-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
perfect_dark: un-vendor gzip; refactor derivation builder; add updateScript #440718
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,13 @@ | |
| lib, | ||
| stdenv, | ||
| fetchFromGitHub, | ||
| SDL2, | ||
| sdl2-compat, | ||
| cmake, | ||
| libGL, | ||
| pkg-config, | ||
| python3, | ||
| zlib, | ||
| unstableGitUpdater, | ||
| romID ? "ntsc-final", | ||
| }: | ||
| let | ||
|
|
@@ -27,14 +28,20 @@ stdenv.mkDerivation (finalAttrs: { | |
| owner = "fgsfdsfgs"; | ||
| repo = "perfect_dark"; | ||
| rev = "bb4fcffeb5dc382fce4c609897a2e82590d7d709"; | ||
| hash = "sha256-XLmAjwEzz4fPpHuk3IBmhhDfiuudwMTnYgVe6Wcfdsg="; | ||
| hash = "sha256-naWE+oWgvrd4CSoBm6W4em60baTWn4uSnKbWh8WKPDM="; | ||
|
|
||
| postFetch = '' | ||
| pushd $out | ||
| rm tools/gzip | ||
| rm -r tools/mkrom | ||
| popd | ||
| ''; | ||
SigmaSquadron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| enableParallelBuilding = true; | ||
|
|
||
| # Fails to build if not set: | ||
| hardeningDisable = [ "format" ]; | ||
| hardeningEnable = [ "pie" ]; | ||
|
|
||
| cmakeFlags = [ | ||
| (lib.cmakeFeature "ROMID" romID) | ||
|
|
@@ -47,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { | |
| ]; | ||
|
|
||
| buildInputs = [ | ||
| SDL2 | ||
| sdl2-compat | ||
| libGL | ||
| zlib | ||
| ]; | ||
|
|
@@ -72,7 +79,7 @@ stdenv.mkDerivation (finalAttrs: { | |
| ''; | ||
|
|
||
| preConfigure = '' | ||
| patchShebangs --build . | ||
| patchShebangs --build tools/assetmgr | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why specify this path? doesn't this makes the process less robust to future changes?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We generally should only patch files which need to be patched. I'd rather the build fail because of an unpatched file that we can review and add than have a new patched file execute without us knowing when updating.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I can drop this change if it's really not worth it, we can see what @SigmaSquadron says.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think in this particular case, it's safe to assume that any script is either part of the build process (and will need the patching) or will not be used at runtime (because we install only one binary in In any case, it's not important.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with @normalcea here. It's best if we have absolute control over which files in the source are executable. |
||
| ''; | ||
|
|
||
| installPhase = '' | ||
|
|
@@ -91,6 +98,10 @@ stdenv.mkDerivation (finalAttrs: { | |
| runHook postInstall | ||
| ''; | ||
|
|
||
| passthru = { | ||
| updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; | ||
| }; | ||
|
|
||
| meta = { | ||
| description = "Modern cross-platform port of Perfect Dark"; | ||
| longDescription = '' | ||
|
|
@@ -114,8 +125,6 @@ stdenv.mkDerivation (finalAttrs: { | |
| license = with lib.licenses; [ | ||
| # perfect_dark, khrplatform.h, port/fast3d | ||
| mit | ||
| # Vendored source code and binaries of 'gzip'. | ||
| gpl3Plus | ||
| # Derivative work of "Perfect Dark" © 2000 Rare Ltd. | ||
| unfree | ||
| ]; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.