-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
vengi-tools: fix build on darwin #399609
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
Merged
Merged
vengi-tools: fix build on darwin #399609
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,9 +27,6 @@ | |
| SDL2, | ||
| SDL2_mixer, | ||
| wayland-protocols, | ||
| Carbon, | ||
| CoreServices, | ||
| OpenCL, | ||
|
|
||
| callPackage, | ||
| nixosTests, | ||
|
|
@@ -46,6 +43,15 @@ stdenv.mkDerivation (finalAttrs: { | |
| hash = "sha256-8rGnW+VtqNJYqUqQDp0yOVIQd7w+cq7PIpqqIQPhkbE="; | ||
| }; | ||
|
|
||
| prePatch = lib.optionalString stdenv.hostPlatform.isDarwin '' | ||
| # Disable code signing on macOS | ||
| substituteInPlace cmake/macros.cmake --replace-fail "codesign" "true" | ||
| substituteInPlace cmake/system/apple.cmake --replace-fail "if(APPLE)" "if(false)" | ||
|
|
||
| # calls otool -L on /usr/lib/libSystem.B.dylib and fails because it doesn't exist | ||
| substituteInPlace cmake/applebundle.cmake --replace-fail 'fixup_bundle("''${TARGET_BUNDLE_DIR}" "" "")' "" | ||
|
Comment on lines
+51
to
+52
Member
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. This is a CMake bug we can hopefully fix for 25.11, but other packages are already working around it, so this seems fine. |
||
| ''; | ||
|
|
||
| nativeBuildInputs = [ | ||
| cmake | ||
| pkg-config | ||
|
|
@@ -73,33 +79,36 @@ stdenv.mkDerivation (finalAttrs: { | |
| SDL2_mixer | ||
| ] | ||
| ++ lib.optional stdenv.hostPlatform.isLinux wayland-protocols | ||
| ++ lib.optionals stdenv.hostPlatform.isDarwin [ | ||
| Carbon | ||
| CoreServices | ||
| OpenCL | ||
| ] | ||
| ++ lib.optional (!stdenv.hostPlatform.isDarwin) opencl-headers; | ||
|
|
||
| cmakeFlags = lib.optional stdenv.hostPlatform.isDarwin "-DCORESERVICES_LIB=${CoreServices}"; | ||
|
|
||
| # error: "The plain signature for target_link_libraries has already been used" | ||
| doCheck = false; | ||
|
|
||
| checkInputs = [ | ||
| gtest | ||
| ]; | ||
|
|
||
| # Set the data directory for each executable. We cannot set it at build time | ||
| # with the PKGDATADIR cmake variable because each executable needs a specific | ||
| # one. | ||
| # This is not needed on darwin, since on that platform data files are saved | ||
| # in *.app/Contents/Resources/ too, and are picked up automatically. | ||
| postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' | ||
| for prog in $out/bin/*; do | ||
| wrapProgram "$prog" \ | ||
| --set CORE_PATH $out/share/$(basename "$prog")/ | ||
| done | ||
| ''; | ||
| postInstall = | ||
| if stdenv.hostPlatform.isDarwin then | ||
| '' | ||
| mkdir -p $out/Applications | ||
| mv $out/*.app $out/Applications/ | ||
|
|
||
| mkdir -p $out/bin | ||
| ln -s $out/Applications/vengi-voxconvert.app/Contents/MacOS/vengi-voxconvert $out/bin/vengi-voxconvert | ||
| '' | ||
| else | ||
| # Set the data directory for each executable. We cannot set it at build time | ||
| # with the PKGDATADIR cmake variable because each executable needs a specific | ||
| # one. | ||
| # This is not needed on darwin, since on that platform data files are saved | ||
| # in *.app/Contents/Resources/ too, and are picked up automatically. | ||
| '' | ||
| for prog in $out/bin/*; do | ||
| wrapProgram "$prog" \ | ||
| --set CORE_PATH $out/share/$(basename "$prog")/ | ||
| done | ||
| ''; | ||
|
|
||
| passthru.tests = { | ||
| voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix { }; | ||
|
|
@@ -124,6 +133,5 @@ stdenv.mkDerivation (finalAttrs: { | |
| ]; | ||
| maintainers = with maintainers; [ fgaz ]; | ||
| platforms = platforms.all; | ||
| broken = stdenv.hostPlatform.isDarwin; | ||
| }; | ||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, adding
sigtoolto thenativeBuildInputsmay suffice.