New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#104970: Update and rename perl.xml to perl.md #105175
Conversation
I have deliberately not updated the index.xml, because I expect that the PR will be rejected. But I am interested in the review comments to improve it before actually merging it. |
I think you should update the index it makes it easier to test it. |
|
doc/languages-frameworks/perl.md
Outdated
``` | ||
to take the Perl installation from the `PATH` environment variable, or invoke Perl directly with: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
```ShellSession |
Please use ShellSession for these ones.
doc/languages-frameworks/perl.md
Outdated
@@ -0,0 +1,181 @@ | |||
# Perl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Perl | |
# Perl {#sec-language-perl} |
We don't want to break anchor links.
doc/languages-frameworks/perl.md
Outdated
|
||
## Packaging Perl programs | ||
|
||
Nixpkgs provides a function *buildPerlPackage*, a generic package builder function for any Perl package that has a standard *Makefile.PL*. It’s implemented in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nixpkgs provides a function *buildPerlPackage*, a generic package builder function for any Perl package that has a standard *Makefile.PL*. It’s implemented in | |
Nixpkgs provides a function `buildPerlPackage`, a generic package builder function for any Perl package that has a standard `Makefile.PL`. It’s implemented in |
I think it's more idiomatic in Markdown to use literals instead of emphasis for this kind of thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the indentation looks weird.
doc/languages-frameworks/perl.md
Outdated
Perl packages from CPAN are defined in | ||
[pkgs/top-level/perl-packages.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/perl-packages.nix) rather than `pkgs/all-packages.nix`. Most Perl packages are so straight-forward to build that they are defined here directly, rather than having a separate function for each package called from `perl-packages.nix`. However, more complicated packages should be put in a separate file, typically in `pkgs/development/perl-modules`. Here is an example of the former: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
```nix |
Bunch of places need this change.
I have updated the files (index.xml & perl.section.md) but I don't know what to do next. |
No, your changes got reflected in this one. I'll take a look in a bit, thanks! |
I hadn't seen the "Commit suggestion" button before. That's so much quicker! |
} | ||
``` | ||
|
||
Dependencies on other Perl packages can be specified in the ´buildInputs´ and ´propagatedBuildInputs´ attributes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow backticks got turned to forward ticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's weird, no idea how that happened. Fixed multiple occurrences.
So what does ´buildPerlPackage´ do? It does the following: | ||
|
||
1. In the configure phase, it calls `perl Makefile.PL` to generate a Makefile. You can set the variable `makeMakerFlags` to pass flags to `Makefile.PL` | ||
2. It adds the contents of the <envar>PERL5LIB</envar> environment variable to `#! .../bin/perl` line of Perl scripts as `-I<replaceable>dir</replaceable>` flags. This ensures that a script can find its dependencies. (This can cause this shebang line to become too long for Darwin to handle; see the note below.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaceables have not been replaced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed and . Multiple instances.
This will remove the `-I` flags from the shebang line, rewrite them in the `use lib` form, and put them on the next line instead. | ||
This function can be given any number of Perl scripts as arguments; it will modify them in-place. | ||
|
||
## Generation from CPAN {#ssec-generation-from-CPAN} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section and the one below previously belonged under “Packaging Perl programs”. Is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it was not intentional. When looking at the XML source it's difficult to keep track of this kind of detail. It's fixed by increasing the section level from '##' to '###'. Hope that's supported.
I'll fix it coming weekend. |
This happens when the script expects Perl to be installed at `/usr/bin/perl`, which is not the case when using Perl from nixpkgs. | ||
You can fix the script by changing the first line to: | ||
|
||
```ShellSession |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a perl
snippet.
|
||
If you are always using the script in places where `nix-shell` is available, you can embed the `nix-shell` invocation in the shebang like this: | ||
|
||
```ShellSession |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
|
||
## Packaging Perl programs {#ssec-perl-packaging} | ||
|
||
Nixpkgs provides a function `buildPerlPackage`, a generic package builder function for any Perl package that has a standard `Makefile.PL`. It’s implemented in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the lines split frequently? Try using the formatter from #105243
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware that there is a formatter. I will try it out next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtolnar I am unable to squash my commits. Trying to follow the instructions here https://medium.com/@mittalyashu/how-to-squash-commits-in-a-github-pull-request-97b36576eacb leads to a tremendous amount of merge conflicts by commits that I didn't make... Please advise.
"Auto-merging pkgs/top-level/all-packages.nix
CONFLICT (content): Merge conflict in pkgs/top-level/all-packages.nix
error: could not apply a64d7d8... Revert "Revert "texinfo: revert to version 6.5 on Darwin""
"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For squashing, I would suggest rebasing onto the parent commit of your first commit instead of master
. That way you will have less commits to worry about.
git rebase -i c7a82285f6c63816b66e78fa1b66fb2bfbe67f8f^
But note that you will need to rebase onto master
anyway, to resolve the conflict in index.xml
.
Also, could you please squash the changes? |
Thanks. I have rebased it since another merge conflict sneaked in and will merge this after the CI finishes, |
Motivation for this change
Addresses #104970, conversion of Docbook language-support for Perl to CommonMark.
@ryantm
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)