about summary refs log tree commit diff
path: root/pkgs/applications/graphics/qosmic
diff options
context:
space:
mode:
authorNikolay Korotkiy <sikmir@disroot.org>2022-06-16 16:42:32 +0300
committerNikolay Korotkiy <sikmir@disroot.org>2022-06-16 17:53:50 +0300
commite6ef6b680f118cf3140a7ab8544b7f2ce69133e1 (patch)
treeccaa337048c15378a8699fe6e923dcd9260c591b /pkgs/applications/graphics/qosmic
parentf9763428b4d7fe379a5d6b5fa81ca84cec392291 (diff)
qosmic: enable on darwin
Diffstat (limited to 'pkgs/applications/graphics/qosmic')
-rw-r--r--pkgs/applications/graphics/qosmic/default.nix22
1 files changed, 16 insertions, 6 deletions
diff --git a/pkgs/applications/graphics/qosmic/default.nix b/pkgs/applications/graphics/qosmic/default.nix
index 96823441b6e16..9e2248f896de7 100644
--- a/pkgs/applications/graphics/qosmic/default.nix
+++ b/pkgs/applications/graphics/qosmic/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation
+{ stdenv
 , fetchFromGitHub
 , fetchpatch
 , qmake
@@ -13,7 +13,7 @@
 , lib
 }:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "qosmic";
   version = "1.6.0";
 
@@ -42,6 +42,13 @@ mkDerivation rec {
     })
   ];
 
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace qosmic.pro \
+      --replace "/share" "/Applications/qosmic.app/Contents/Resources" \
+      --replace "/qosmic/scripts" "/scripts" \
+      --replace "install_icons install_desktop" ""
+  '';
+
   nativeBuildInputs = [ qmake wrapQtAppsHook pkg-config ];
 
   buildInputs = [
@@ -55,16 +62,19 @@ mkDerivation rec {
 
   qmakeFlags = [
     # Use pkg-config to correctly locate library paths
-    "-config" "link_pkgconfig"
+    "CONFIG+=link_pkgconfig"
   ];
 
+  preInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    mv qosmic.app $out/Applications
+  '';
+
   meta = with lib; {
     description = "A cosmic recursive flame fractal editor";
     homepage = "https://github.com/bitsed/qosmic";
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.raboof ];
-    # It might be possible to make it work on OSX,
-    # but this has not been tested.
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }