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

python-bitcoinlib: init at 0.9.0 #32948

Merged
merged 1 commit into from Dec 23, 2017
Merged

python-bitcoinlib: init at 0.9.0 #32948

merged 1 commit into from Dec 23, 2017

Conversation

jb55
Copy link
Contributor

@jb55 jb55 commented Dec 21, 2017

Motivation for this change

This adds the python-bitcoinlib library to nixpkgs

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 if library works
  • Fits CONTRIBUTING.md.

@jb55 jb55 requested a review from FRidh as a code owner December 21, 2017 19:44
sha256 = "1s1jm2nid7ab7yiwlp1n2v3was9i4q76xmm07wvzpd2zvn5zb91z";
};

propagatedBuildInputs = [ openssl ];
Copy link
Member

Choose a reason for hiding this comment

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

Why is this propagated?

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 get this error if I don't do this: OSError: libeay32: cannot open shared object file: No such file or directory ¯_(ツ)_/¯

@FRidh
Copy link
Member

FRidh commented Dec 21, 2017

How did you test the expression?

@jb55
Copy link
Contributor Author

jb55 commented Dec 21, 2017

@FRidh:

nix-shell --pure -p python3Packages.bitcoinlib --run 'python3 -c "import bitcoin.rpc"'

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Better use the following to test

nix-shell -p  'python3.withPackages(ps: with ps; [ bitcoinlib ])' -I nixpkgs=. --run 'python3 -c "import bitcoin.rpc"'

Or even better:

$(nix-build -E 'with import ./. {}; python3.withPackages(ps: with ps; [ bitcoinlib ])')/bin/python3 -c "import bitcoin.rpc"

The issue with testing with nix-shell is that it adds build-time dependencies. That's why it could find openssl.

You will need to patch the following line to hardcode a path to that library.
https://github.com/petertodd/python-bitcoinlib/blob/5e150ac4a50791e6293752ceef8647b9bb3273c0/bitcoin/core/key.py#L33

@jb55
Copy link
Contributor Author

jb55 commented Dec 22, 2017

@FRidh thanks for your help! What do you think about 37bf17a1d3188008dbc943ac450b9b01b8c8b15e ?

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Looks good.

sha256 = "1s1jm2nid7ab7yiwlp1n2v3was9i4q76xmm07wvzpd2zvn5zb91z";
};

patchPhase = ''
Copy link
Member

Choose a reason for hiding this comment

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

postPatch is preferred so one can still pass along patches.

Signed-off-by: William Casarin <jb55@jb55.com>, @jb55
@jb55
Copy link
Contributor Author

jb55 commented Dec 22, 2017 via email

@FRidh FRidh merged commit 1b555a6 into NixOS:master Dec 23, 2017
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

3 participants