Skip to content
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

acme.sh: init at 2.7.8 #38856

Merged
merged 2 commits into from Apr 12, 2018
Merged

acme.sh: init at 2.7.8 #38856

merged 2 commits into from Apr 12, 2018

Conversation

yorickvP
Copy link
Contributor

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

installPhase = ''
mkdir -p $out $out/bin $out/lib
cp -R $src/* $_
ln -s $out/lib/acme.sh $out/bin
Copy link
Member

@Mic92 Mic92 Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be wrapped with wrapProgram to have openssl and curl in PATH: https://github.com/Neilpang/acme.sh/blob/master/acme.sh#L31

@@ -414,6 +414,8 @@ with pkgs;

acct = callPackage ../tools/system/acct { };

acme_sh = callPackage ../tools/admin/acme.sh { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acme-sh would be preferable, for the attribute, folder name and package name. See Package Naming in Nixpkgs manual:

Dashes in the package name should be preserved in new variable names, rather than converted to underscores or camel cased — e.g., http-parser instead of http_parser or httpParser. The hyphenated style is preferred in all three package names.

sha256 = "0zm64z7av63xi7yjhljab2i8q1vx4q1mpcmcm58jm6k4babalxrf";
};

phases = [ "installPhase" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #28910.

installPhase = ''
mkdir -p $out $out/bin $out/lib
cp -R $src/* $_
ln -s $out/lib/acme.sh $out/bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if that belongs to lib: share subdirectory seems to be more appropriate. Generally, when upstream is not FHS-compliant, it is usually cleaner to just expose a symlink to executable:

  installPhase = "mkdir -p $out/bin && ln -s $src/acme.sh $_";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you really meant to link from $src here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$src is just a fixed-output derivation, so it shouldn't be garbage collected if there are references to it. In this case, repo mostly contains documentation and the shell script itself. Is there a problem with this approach?

Copy link
Member

@lukateras lukateras Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm mostly worried about clutter and increased risk of collisions when it comes to paths linked to profile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only it requires to pull two derivations instead of one, but maybe that's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean to link from src. The other files are needed and acme.sh needs to be in the same dir (it uses realpath on itself to find the helper libs). I can move it to share.

Copy link
Member

@lukateras lukateras Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also libexec that is not linked by default which also seems appropriate.

@Mic92 Mic92 merged commit 276580f into NixOS:master Apr 12, 2018
@yorickvP yorickvP deleted the acme-sh branch April 12, 2018 21:42
lukateras pushed a commit to serokell/nixpkgs that referenced this pull request May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants