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

SDL2: Add withStatic option #88519

Merged

Conversation

@karolchmist
Copy link
Contributor

karolchmist commented May 21, 2020

Motivation for this change

Build of the package devilutionx fails.

The error message:

make[2]: *** No rule to make target '/nix/store/slyxpxxprgdq3x54nanqg7sd3wg1cks7-SDL2-2.0.12/lib/libSDL2main.a', needed by 'devilutionx'.  Stop.

From my limited understanding of the build process, this is due probably to this commit, which stopped moving /libSDL2main.a to $dev folder.

The same commit added a possibility of removing *.la files insteaf of *.a files. It can be done by setting dontDisableStatic flag, but curiously it is not possible to set this flag for SDL2. Or maybe I'm missing something...

This PR adds a new parameter to SDL2: withStatic ? false. It is used to set dontDisableStatic = withStatic;. By default, if not used, it won't change the current behaviour. Setting it to true for the build of devolutionx fixes the build on my machine.

dontDisableStatic = withStatic; exists in other packages, and inspired this solution.

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.

Pinging @cpages, the maintainer, and @nh2, who committed 57908c1

@ofborg ofborg bot requested a review from cpages May 21, 2020
@cpages cpages merged commit 1059cda into NixOS:master Jun 7, 2020
17 checks passed
17 checks passed
editorconfig editorconfig
Details
Evaluation Performance Report Evaluator Performance Report
Details
SDL2, SDL2.passthru.tests on aarch64-linux Success
Details
SDL2, SDL2.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4babef9"; rev="4babef9608d708f5f3b1aea6942f4dd3ef91570f"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@cpages
Copy link
Contributor

cpages commented Jun 7, 2020

Thanks and sorry for the delay

@karolchmist karolchmist mentioned this pull request Jun 8, 2020
4 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.