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.pysdl2: init at 0.9.6 #36506

Merged
merged 1 commit into from May 21, 2018
Merged

Conversation

pmiddend
Copy link
Contributor

@pmiddend pmiddend commented Mar 8, 2018

Motivation for this change

We have SDL2, but no Python support!

Things done

I commented out the whole find_package magic that Python (and PySDL2) does and replaced it by the hard-coded library paths. I hope that's nixpkgs policy.

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

@pmiddend pmiddend requested a review from FRidh as a code owner March 8, 2018 09:43
@ryantm
Copy link
Member

ryantm commented Mar 8, 2018

@GrahamcOfBorg eval

@pmiddend
Copy link
Contributor Author

Is anything wrong, preventing this from being merged?


buildPythonPackage rec {
pname = "PySDL2";
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

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

The name attribute is added by buildPython* and should therefore be removed.

# sandboxed. Disable for now.
doCheck = false;

src = 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

patches = [ ./PySDL2-dll.patch ];
postPatch = ''
substituteInPlace sdl2/dll.py --replace \
"DLL(\"SDL2\")" "DLL('${SDL2}/lib/libSDL2.so')"
Copy link
Member

Choose a reason for hiding this comment

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

stdenv.hostPlatform.extensions.sharedLibrary instead of .so.

@pmiddend
Copy link
Contributor Author

Thanks for the review, should be fixed now.

@pmiddend
Copy link
Contributor Author

Any issues remaining?

};

# deliberately not in propagated build inputs; the user can decide
# which library he/she wants to include.
Copy link
Member

Choose a reason for hiding this comment

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

they

'';

meta = {
description = "PySDL2 is a wrapper around the SDL2 library and as such similar to the discontinued PySDL project. In contrast to PySDL, it has no licensing restrictions, nor does it rely on C code, but uses ctypes instead.";
Copy link
Member

Choose a reason for hiding this comment

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

@FRidh
Copy link
Member

FRidh commented Mar 30, 2018

@GrahamcOfBorg build pythonPackages.pysdl2 python3Packages.pysdl2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: pythonPackages.pysdl2, python3Packages.pysdl2

Partial log (click to expand)

patching script interpreter paths in /nix/store/nqjdy445f7fpz91750bzsh4ffi6x6mfi-python2.7-PySDL2-0.9.6
checking for references to /build in /nix/store/nqjdy445f7fpz91750bzsh4ffi6x6mfi-python2.7-PySDL2-0.9.6...
Successfully installed PySDL2-0.9.6
/build/PySDL2-0.9.6
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/4fvnlf82pf7gf41wvimnkz5km39lviyi-python3.6-PySDL2-0.9.6
strip is /nix/store/fzcs0fn6bb04m82frhlb78nc03ny3w55-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/4fvnlf82pf7gf41wvimnkz5km39lviyi-python3.6-PySDL2-0.9.6/lib
patching script interpreter paths in /nix/store/4fvnlf82pf7gf41wvimnkz5km39lviyi-python3.6-PySDL2-0.9.6
checking for references to /build in /nix/store/4fvnlf82pf7gf41wvimnkz5km39lviyi-python3.6-PySDL2-0.9.6...

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: pythonPackages.pysdl2, python3Packages.pysdl2

Partial log (click to expand)

Successfully installed PySDL2-0.9.6
/build/PySDL2-0.9.6
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/kdz82mfr60nnwv8m2cp8j7f0wrlk01iz-python3.6-PySDL2-0.9.6
strip is /nix/store/3zq400fri5dv7d30lpxlqm2v9y1iis6j-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/kdz82mfr60nnwv8m2cp8j7f0wrlk01iz-python3.6-PySDL2-0.9.6/lib
patching script interpreter paths in /nix/store/kdz82mfr60nnwv8m2cp8j7f0wrlk01iz-python3.6-PySDL2-0.9.6
checking for references to /build in /nix/store/kdz82mfr60nnwv8m2cp8j7f0wrlk01iz-python3.6-PySDL2-0.9.6...
/nix/store/2wcv5y3xzg0vz9033d46b7qla70nwybb-python2.7-PySDL2-0.9.6
/nix/store/kdz82mfr60nnwv8m2cp8j7f0wrlk01iz-python3.6-PySDL2-0.9.6

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: pythonPackages.pysdl2, python3Packages.pysdl2

Partial log (click to expand)

/private/tmp/nix-build-python3.6-PySDL2-0.9.6.drv-0/PySDL2-0.9.6
post-installation fixup
strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/7qfp3y16axj0mfqw1bmvpscl6ls9xg9b-python2.7-PySDL2-0.9.6/lib
strip is /nix/store/0fzpxnsanc02i4jsb1yhchjp4p62b2n3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/zcbdqw1m9xzhrj140j2n9b9w71qp4asn-python3.6-PySDL2-0.9.6/lib
patching script interpreter paths in /nix/store/7qfp3y16axj0mfqw1bmvpscl6ls9xg9b-python2.7-PySDL2-0.9.6
patching script interpreter paths in /nix/store/zcbdqw1m9xzhrj140j2n9b9w71qp4asn-python3.6-PySDL2-0.9.6
/nix/store/7qfp3y16axj0mfqw1bmvpscl6ls9xg9b-python2.7-PySDL2-0.9.6
/nix/store/zcbdqw1m9xzhrj140j2n9b9w71qp4asn-python3.6-PySDL2-0.9.6

@pmiddend
Copy link
Contributor Author

Anything else?

@pmiddend
Copy link
Contributor Author

I've fixed the conflicts. Any chance of this being merged?

@Mic92 Mic92 merged commit fc1ccb3 into NixOS:master May 21, 2018
@pmiddend pmiddend deleted the pysdl2-init branch May 21, 2018 17:02
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