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

tldr: add support for darwin #44384

Merged
merged 2 commits into from Aug 3, 2018
Merged

tldr: add support for darwin #44384

merged 2 commits into from Aug 3, 2018

Conversation

carlosdagos
Copy link
Member

Motivation for this change

Adds darwin support for tldr. Also fixes warning due to git being missing.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@@ -11,9 +11,14 @@ stdenv.mkDerivation rec {
sha256 = "10ylpiqc06p0qpma72vwksd7hd107s0vlx9c6s9rz4vc3i274lb6";
};

buildInputs = [ curl clang libzip ];
buildInputs = [ git curl clang libzip ];
Copy link
Member

Choose a reason for hiding this comment

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

Git should be left out. It is just used for getting the tag which won't work here because fetchFromGitHub leaves out the .git directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the pointer 😄

nativeBuildInputs = [ pkgconfig ];

preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile --replace "gcc" "$CC"
Copy link
Member

Choose a reason for hiding this comment

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

I think you can also do makeFlags = [ "CC=$CC" ];

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried and can't get it work using makeFlags :/ Thanks!

@carlosdagos
Copy link
Member Author

Thanks for the review @matthewbauer. See new commit. Cheers

@Mic92
Copy link
Member

Mic92 commented Aug 3, 2018

@GrahamcOfBorg build tldr

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tldr

Partial log (click to expand)

install man/tldr.1 /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0/share/man/man1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0
shrinking /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0/bin/tldr
gzipping man pages under /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0/share/man/
strip is /nix/store/zrs21zqcchgyabjf4xfimncdq16njizc-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0/bin
patching script interpreter paths in /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0
checking for references to /build in /nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0...
/nix/store/i30gjdljvb7hl6ylq6bca27swphlmsj1-tldr-1.3.0

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: tldr

Partial log (click to expand)

install -d /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/bin
install ./tldr /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/bin
install -d /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/share/man/man1
install man/tldr.1 /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/share/man/man1
post-installation fixup
gzipping man pages under /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/share/man/
strip is /nix/store/qfxcr8c4fg7lkybrny9n2sb77bmippdx-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0/bin
patching script interpreter paths in /nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0
/nix/store/fxbj7mpbl9d38wsyp1h27jgdk5zjkz2z-tldr-1.3.0

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tldr

Partial log (click to expand)

install man/tldr.1 /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0/share/man/man1
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0
shrinking /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0/bin/tldr
gzipping man pages under /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0/share/man/
strip is /nix/store/1hi76hr87bd1y1q1qjk0lv8nmcjip1c8-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0/bin
patching script interpreter paths in /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0
checking for references to /build in /nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0...
/nix/store/xva8vy991ycbmyh0av5sr5skgvlg1zm0-tldr-1.3.0

@Mic92 Mic92 merged commit 3633a2b into NixOS:master Aug 3, 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