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

python3.pkgs.pysdl2: fix build #98300

Merged
merged 1 commit into from Sep 24, 2020
Merged

python3.pkgs.pysdl2: fix build #98300

merged 1 commit into from Sep 24, 2020

Conversation

povik
Copy link
Contributor

@povik povik commented Sep 19, 2020

Update patches after version bump.

I ran examples bundled with the library and they seem to run okay.

ZHF: #97479

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@risicle
Copy link
Contributor

risicle commented Sep 19, 2020

Builds successfully on macos 10.14 & non-nixos linux x86_64. Seems like a slightly better approach than previously.

@pmiddend pmiddend self-assigned this Sep 20, 2020
Comment on lines 23 to 32
substituteInPlace sdl2/dll.py --replace \
"DLL(\"SDL2\")" "DLL('${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}')"
"SDL2-path-from-nix" "${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}"
substituteInPlace sdl2/sdlttf.py --replace \
"DLL(\"SDL2_ttf\")" "DLL('${SDL2_ttf}/lib/libSDL2_ttf${stdenv.hostPlatform.extensions.sharedLibrary}')"
"SDL2_ttf-path-from-nix" "${SDL2_ttf}/lib/libSDL2_ttf${stdenv.hostPlatform.extensions.sharedLibrary}"
substituteInPlace sdl2/sdlimage.py --replace \
"DLL(\"SDL2_image\")" "DLL('${SDL2_image}/lib/libSDL2_image${stdenv.hostPlatform.extensions.sharedLibrary}')"
"SDL2_image-path-from-nix" "${SDL2_image}/lib/libSDL2_image${stdenv.hostPlatform.extensions.sharedLibrary}"
substituteInPlace sdl2/sdlgfx.py --replace \
"DLL(\"SDL2_gfx\")" "DLL('${SDL2_gfx}/lib/libSDL2_gfx${stdenv.hostPlatform.extensions.sharedLibrary}')"
"SDL2_gfx-path-from-nix" "${SDL2_gfx}/lib/libSDL2_gfx${stdenv.hostPlatform.extensions.sharedLibrary}"
substituteInPlace sdl2/sdlmixer.py --replace \
"DLL(\"SDL2_mixer\")" "DLL('${SDL2_mixer}/lib/libSDL2_mixer${stdenv.hostPlatform.extensions.sharedLibrary}')"
"SDL2_mixer-path-from-nix" "${SDL2_mixer}/lib/libSDL2_mixer${stdenv.hostPlatform.extensions.sharedLibrary}"
Copy link
Contributor

Choose a reason for hiding this comment

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

we have a substitueAll utility that's usually meant for this type of large substitution

example:
06960ac

Copy link
Contributor

Choose a reason for hiding this comment

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

however, i forgot to post this review like 3 days ago. I think what you have works though

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 see, that makes for cleaner code. Take a look at the updated commit.

Update patches after version bump.
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

LGTM

Result of nixpkgs-review pr 98300 1

6 packages built:
  • python27Packages.pysdl2
  • python27Packages.pytmx
  • python37Packages.pysdl2
  • python37Packages.pytmx
  • python38Packages.pysdl2
  • python38Packages.pytmx

@jonringer jonringer merged commit d82e165 into NixOS:master Sep 24, 2020
@povik povik mentioned this pull request Sep 24, 2020
10 tasks
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