From 76d13bcc5e1e1726b402a2c01702bcffc0fb1724 Mon Sep 17 00:00:00 2001 From: emaryn Date: Wed, 28 May 2025 19:26:55 +0800 Subject: [PATCH] opencsg: fix --- pkgs/development/libraries/opencsg/default.nix | 16 +++++----------- .../libraries/opencsg/opencsgexample.patch | 8 ++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 pkgs/development/libraries/opencsg/opencsgexample.patch diff --git a/pkgs/development/libraries/opencsg/default.nix b/pkgs/development/libraries/opencsg/default.nix index 160398456550..6b885033d2e0 100644 --- a/pkgs/development/libraries/opencsg/default.nix +++ b/pkgs/development/libraries/opencsg/default.nix @@ -22,6 +22,8 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-r8wASontO8R4qeS6ObIPPVibJOI+J1tzg/kaWQ1NV8U="; }; + patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./opencsgexample.patch ]; + nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = @@ -37,17 +39,9 @@ stdenv.mkDerivation (finalAttrs: { doCheck = false; - postInstall = - '' - install -D ../copying.txt "$out/share/doc/opencsg/copying.txt" - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - mkdir -p $out/Applications - mv $out/bin/*.app $out/Applications - rmdir $out/bin || true - ''; - - dontWrapQtApps = true; + postInstall = '' + install -D ../copying.txt "$out/share/doc/opencsg/copying.txt" + ''; postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' app=$out/Applications/opencsgexample.app/Contents/MacOS/opencsgexample diff --git a/pkgs/development/libraries/opencsg/opencsgexample.patch b/pkgs/development/libraries/opencsg/opencsgexample.patch new file mode 100644 index 000000000000..c6b9ead494bb --- /dev/null +++ b/pkgs/development/libraries/opencsg/opencsgexample.patch @@ -0,0 +1,8 @@ +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -19,4 +19,5 @@ + + install(TARGETS opencsgexample + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/Applications + )