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

ledger: enable python command #39919

Merged
merged 1 commit into from May 5, 2018
Merged

Conversation

pmiddend
Copy link
Contributor

@pmiddend pmiddend commented May 3, 2018

Motivation for this change

ledger in nixpkgs currently uses python (it’s in buildInputs), but the
ledger python command isn’t available until you turn it on via a cmake
flag.

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.

@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" ];
cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DUSE_PYTHON=true" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we turn this into a package option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sadly, I wouldn't know how.

Copy link
Contributor

Choose a reason for hiding this comment

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

You'd add a parameter to the input of the function which is true by default: {... usePython ? true ... }:

then you'd check it in the cmakeFlags like this: (if usePython then "-DUSE_PYTHON=true" else ""); or you'd use (lib.optionalString usePython "-DUSE_PYTHON=true").

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, easy enough. I'll update the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

ledger in nixpkgs currently uses python (it’s in buildInputs), but the
ledger python command isn’t available until you turn it on via a cmake
flag.
@matthewbauer
Copy link
Member

@GrahamcOfBorg build ledger

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ledger

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1
shrinking /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/lib/libledger.so.3
shrinking /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/lib/python2.7/site-packages/ledger.so
shrinking /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/bin/ledger
gzipping man pages under /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/share/man/
strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/lib  /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1/bin
patching script interpreter paths in /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1
checking for references to /build in /nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1...
/nix/store/bhiymwilri6a3jpgmyifw13fhm6ah0p7-ledger-3.1.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: ledger

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1
shrinking /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/bin/ledger
shrinking /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/lib/python2.7/site-packages/ledger.so
shrinking /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/lib/libledger.so.3
gzipping man pages under /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/share/man/
strip is /nix/store/gp7fylxwn18b7pl2c18ks89hsiaxyfvf-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/lib  /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1/bin
patching script interpreter paths in /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1
checking for references to /build in /nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1...
/nix/store/m32x7p59jqmjl1zpzzprfic2ycb7awj8-ledger-3.1.1

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ledger

Partial log (click to expand)

'/nix/store/6a9ry0hmysbb0xgplpwrhlpfh636ibkd-source/lisp/ledger-state.el' -> '/nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/share/emacs/site-lisp/ledger-state.el'
'/nix/store/6a9ry0hmysbb0xgplpwrhlpfh636ibkd-source/lisp/ledger-test.el' -> '/nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/share/emacs/site-lisp/ledger-test.el'
'/nix/store/6a9ry0hmysbb0xgplpwrhlpfh636ibkd-source/lisp/ledger-texi.el' -> '/nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/share/emacs/site-lisp/ledger-texi.el'
'/nix/store/6a9ry0hmysbb0xgplpwrhlpfh636ibkd-source/lisp/ledger-xact.el' -> '/nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/share/emacs/site-lisp/ledger-xact.el'
post-installation fixup
gzipping man pages under /nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/share/man/
strip is /nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/lib  /nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1/bin
patching script interpreter paths in /nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1
/nix/store/81094jaib021s69xp1viyk340klnmiw9-ledger-3.1.1

@matthewbauer matthewbauer merged commit 005d803 into NixOS:master May 5, 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