summaryrefslogtreecommitdiff
path: root/pkgs/applications/graphics/vengi-tools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/graphics/vengi-tools/default.nix')
-rw-r--r--pkgs/applications/graphics/vengi-tools/default.nix54
1 files changed, 32 insertions, 22 deletions
diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix
index e0ca7b306f4e..9b6c078fa53d 100644
--- a/pkgs/applications/graphics/vengi-tools/default.nix
+++ b/pkgs/applications/graphics/vengi-tools/default.nix
@@ -20,15 +20,13 @@
libjpeg,
libuuid,
libuv,
+ libX11,
lua5_4,
lzfse,
opencl-headers,
SDL2,
SDL2_mixer,
wayland-protocols,
- Carbon,
- CoreServices,
- OpenCL,
callPackage,
nixosTests,
@@ -45,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}" "" "")' ""
+ '';
+
nativeBuildInputs = [
cmake
pkg-config
@@ -68,18 +75,12 @@ stdenv.mkDerivation (finalAttrs: {
lua5_4
lzfse
SDL2
+ libX11
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;
@@ -87,17 +88,27 @@ stdenv.mkDerivation (finalAttrs: {
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 { };
@@ -122,6 +133,5 @@ stdenv.mkDerivation (finalAttrs: {
];
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
- broken = stdenv.hostPlatform.isDarwin;
};
})