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

pythonPackages.libnacl: init at 1.5.0 #24020

Merged
merged 2 commits into from Mar 19, 2017
Merged

Conversation

xvapx
Copy link
Contributor

@xvapx xvapx commented Mar 18, 2017

Motivation for this change

To add libnacl to pythonPackages.
This is needed to upgrade tribler to 7.0.0-beta (still working on it) and might be useful for other packages.

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
    • Linux
  • 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.

It might need another substitution in postPatch to work in macOS, i have no way to test it, but the current substitution affects linux only.

@mention-bot
Copy link

@xvapx, thanks for your PR! By analyzing the history of the files in this pull request, we identified @FRidh to be a potential reviewer.

name = "libnacl-${version}";
version = "1.5.0";

src = pkgs.fetchurl {
Copy link
Member

Choose a reason for hiding this comment

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

fetchPypi

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, it will be included in next push.


propagatedBuildInputs = with self; [ pkgs.libsodium ];

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

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, it will be included in next push.

@@ -13867,6 +13867,30 @@ in {
clblas = pkgs.clblas-cuda;
};

libnacl = buildPythonPackage rec {
Copy link
Member

Choose a reason for hiding this comment

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

move expression to pkgs/development/python-modules/libnacl/default.nix

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, it will be included in next push.
There is now only libnacl = callPackage ../development/python-modules/libnacl/default.nix { }; in python-packages.nix

patchPhase = ''
substituteInPlace "./libnacl/__init__.py" --replace "ctypes.cdll.LoadLibrary('libsodium.so')" "ctypes.cdll.LoadLibrary('${pkgs.libsodium}/lib/libsodium.so')"
'';
#doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

are the tests running and are they found?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems they are not found, there is no error but it says Ran 0 tests in 0.000s. Any tip on how to proceed?

'';
#doCheck = false;

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

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

are you going to maintain this package?

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'm pretty inexperienced, but i am willing to do it if it's ok.

Copy link
Member

Choose a reason for hiding this comment

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

in this case please add yourself as a maintainer to this package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done.

@FRidh
Copy link
Member

FRidh commented Mar 18, 2017

It might need another substitution in patchPhase to work in macOS, i have no way to test it, but the current substitution affects linux only.

No problem, darwin users can propose a fix.

description = "Python bindings for libsodium based on ctypes";
homepage = "https://pypi.python.org/pypi/libnacl";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.unix;
Copy link
Member

Choose a reason for hiding this comment

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

For the meantime, I would limit platforms to linux, if mac os x probably does not work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, done.

@Mic92 Mic92 merged commit 8490317 into NixOS:master Mar 19, 2017
@Mic92
Copy link
Member

Mic92 commented Mar 19, 2017

I also added the tests of this project

@xvapx
Copy link
Contributor Author

xvapx commented Mar 20, 2017

Wow, thanks a lot, your changes have taught me some things.

@xvapx xvapx deleted the add/libnacl-1.5.0 branch March 20, 2017 20:23
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