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

termite: Add support for macOS #43415

Merged
merged 1 commit into from Jul 13, 2018
Merged

Conversation

Enzime
Copy link
Member

@Enzime Enzime commented Jul 12, 2018

Replace fetchgit with fetchFromGitHub now that it supports fetching
submodules. Remove unnecessary postPatch to add <math.h> as termite
already includes . Add a patch to include <errno.h> and remove
the --as-needed flag from ld on macOS.

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.

@dtzWill
Copy link
Member

dtzWill commented Jul 12, 2018

@GrahamcOfBorg build termite

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: termite

Partial log (click to expand)

gzipping man pages under /nix/store/iq7a2jcsjr6li2h8jqiy3nnl4r9n687v-termite-13/share/man/
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/iq7a2jcsjr6li2h8jqiy3nnl4r9n687v-termite-13/bin
patching script interpreter paths in /nix/store/iq7a2jcsjr6li2h8jqiy3nnl4r9n687v-termite-13
checking for references to /build in /nix/store/iq7a2jcsjr6li2h8jqiy3nnl4r9n687v-termite-13...
shrinking RPATHs of ELF executables and libraries in /nix/store/lyb2fjin82an69z890a8c0fb7w2xj6q2-termite-13-terminfo
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/lyb2fjin82an69z890a8c0fb7w2xj6q2-termite-13-terminfo
checking for references to /build in /nix/store/lyb2fjin82an69z890a8c0fb7w2xj6q2-termite-13-terminfo...
/nix/store/iq7a2jcsjr6li2h8jqiy3nnl4r9n687v-termite-13

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: termite

Partial log (click to expand)

gzipping man pages under /nix/store/17l6q4ck09ilr2gkdjs8m3sl8nx76ldv-termite-13/share/man/
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/17l6q4ck09ilr2gkdjs8m3sl8nx76ldv-termite-13/bin
patching script interpreter paths in /nix/store/17l6q4ck09ilr2gkdjs8m3sl8nx76ldv-termite-13
checking for references to /build in /nix/store/17l6q4ck09ilr2gkdjs8m3sl8nx76ldv-termite-13...
shrinking RPATHs of ELF executables and libraries in /nix/store/mmzqcwqdsw2vhw2y3w4qwaananvqvqwi-termite-13-terminfo
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/mmzqcwqdsw2vhw2y3w4qwaananvqvqwi-termite-13-terminfo
checking for references to /build in /nix/store/mmzqcwqdsw2vhw2y3w4qwaananvqvqwi-termite-13-terminfo...
/nix/store/17l6q4ck09ilr2gkdjs8m3sl8nx76ldv-termite-13

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: termite

Partial log (click to expand)

glibPreFixupPhase
post-installation fixup
Wrapping program /nix/store/i62ahhmb8a7j9pymak90k7qicw1fgnzs-termite-13/bin/termite
gzipping man pages under /nix/store/i62ahhmb8a7j9pymak90k7qicw1fgnzs-termite-13/share/man/
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/i62ahhmb8a7j9pymak90k7qicw1fgnzs-termite-13/bin
patching script interpreter paths in /nix/store/i62ahhmb8a7j9pymak90k7qicw1fgnzs-termite-13
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/2n5k1lqw99k41lbr5zri871m3cgjl7gh-termite-13-terminfo
/nix/store/i62ahhmb8a7j9pymak90k7qicw1fgnzs-termite-13


postPatch = "sed '1i#include <math.h>' -i termite.cc";
patches = [ ./url_regexp_trailing.patch
] ++ lib.optional stdenv.isDarwin ./fix_macos.patch;
Copy link
Member

Choose a reason for hiding this comment

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

This makes the addition of the <errno.h> header conditional on using Darwin, please preserve the existing behavior :).

(I suppose either split up the patch or keep the sed line from before and use it unconditionally like we do now?)

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, in my tree I've had a copy of the math.h sed that adds errno.h-- I guess that didn't make it upstream?

Well my apologies about that, but would you be so kind as to add it unconditionally anyway? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in my new commit :)

Replace fetchgit with fetchFromGitHub now that it supports fetching
submodules. Remove unnecessary postPatch to add <math.h> as termite
already includes <cmath>. Add a patch to include <errno.h> on all
platforms and remove the --as-needed flag from ld on macOS.
@xeji
Copy link
Contributor

xeji commented Jul 13, 2018

@GrahamcOfBorg build termite

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: termite

Partial log (click to expand)

glibPreFixupPhase
post-installation fixup
Wrapping program /nix/store/29k45b79lh00bzdaw7zzhbi6mljpn2gv-termite-13/bin/termite
gzipping man pages under /nix/store/29k45b79lh00bzdaw7zzhbi6mljpn2gv-termite-13/share/man/
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/29k45b79lh00bzdaw7zzhbi6mljpn2gv-termite-13/bin
patching script interpreter paths in /nix/store/29k45b79lh00bzdaw7zzhbi6mljpn2gv-termite-13
strip is /nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/8r8gxin2smmcg581vki5wir81xdxcvks-termite-13-terminfo
/nix/store/29k45b79lh00bzdaw7zzhbi6mljpn2gv-termite-13

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: termite

Partial log (click to expand)

gzipping man pages under /nix/store/m4ny8qdwpg4a760fdyp73drgvf8gs94n-termite-13/share/man/
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/m4ny8qdwpg4a760fdyp73drgvf8gs94n-termite-13/bin
patching script interpreter paths in /nix/store/m4ny8qdwpg4a760fdyp73drgvf8gs94n-termite-13
checking for references to /build in /nix/store/m4ny8qdwpg4a760fdyp73drgvf8gs94n-termite-13...
shrinking RPATHs of ELF executables and libraries in /nix/store/azmdj2zgy5k15yvly8rm6dns1brafrvv-termite-13-terminfo
strip is /nix/store/0pjsgkxz0rp5baycq5sp2s72lrr5q9sg-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/azmdj2zgy5k15yvly8rm6dns1brafrvv-termite-13-terminfo
checking for references to /build in /nix/store/azmdj2zgy5k15yvly8rm6dns1brafrvv-termite-13-terminfo...
/nix/store/m4ny8qdwpg4a760fdyp73drgvf8gs94n-termite-13

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: termite

Partial log (click to expand)

gzipping man pages under /nix/store/lsqi3p5qp000xka0ppw3hiziqgsskc05-termite-13/share/man/
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/lsqi3p5qp000xka0ppw3hiziqgsskc05-termite-13/bin
patching script interpreter paths in /nix/store/lsqi3p5qp000xka0ppw3hiziqgsskc05-termite-13
checking for references to /build in /nix/store/lsqi3p5qp000xka0ppw3hiziqgsskc05-termite-13...
shrinking RPATHs of ELF executables and libraries in /nix/store/zy25fihv5jzfdmwy3p1ap0gfdvjkbvqd-termite-13-terminfo
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/zy25fihv5jzfdmwy3p1ap0gfdvjkbvqd-termite-13-terminfo
checking for references to /build in /nix/store/zy25fihv5jzfdmwy3p1ap0gfdvjkbvqd-termite-13-terminfo...
/nix/store/lsqi3p5qp000xka0ppw3hiziqgsskc05-termite-13

@xeji xeji merged commit d73fac6 into NixOS:master Jul 13, 2018
@Ma27
Copy link
Member

Ma27 commented Jul 14, 2018

regarding the errno header patch: is this actually Nix related? Otherwise we should file a patch upstream right?

@Enzime
Copy link
Member Author

Enzime commented Jul 14, 2018

@Ma27 I believe it's macOS related, I will file an upstream patch later and if it gets merged I'll remove the patch from Nixpkgs.

@Enzime Enzime deleted the patch/termite-on-darwin branch July 14, 2018 09:00
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

5 participants