about summary refs log tree commit diff
path: root/pkgs/applications/graphics/pikopixel
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2020-12-06 22:42:40 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2020-12-06 22:44:48 +0100
commitae16a68336da531f3104a0c0bc93cc729e56276d (patch)
treec2839d6207d6ed905db853e23eb9f53f4f95b59c /pkgs/applications/graphics/pikopixel
parent357ef10f544766af3347a7534a0c244e7603292f (diff)
pikopixel: init at 1.0-b9e
Diffstat (limited to 'pkgs/applications/graphics/pikopixel')
-rw-r--r--pkgs/applications/graphics/pikopixel/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/pikopixel/default.nix b/pkgs/applications/graphics/pikopixel/default.nix
new file mode 100644
index 0000000000000..a20a0a2db61bb
--- /dev/null
+++ b/pkgs/applications/graphics/pikopixel/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, fetchurl
+, gnustep
+, gcc
+, llvmPackages_9
+}:
+
+let
+  # Earlier llvm than 9 segfaults
+  gnustep' = gnustep.override { llvmPackages = llvmPackages_9; };
+
+in gnustep'.gsmakeDerivation rec {
+  pname = "pikopixel";
+  version = "1.0-b9e";
+
+  src = fetchurl {
+    url = "http://twilightedge.com/downloads/PikoPixel.Sources.${version}.tar.gz";
+    sha256 = "1gmgb5ch7s6fwvg85l6pl6fsx0maqwd8yvg7sz3r9lj32g2pz5wn";
+  };
+
+  sourceRoot = "PikoPixel.Sources.${version}/PikoPixel";
+
+  buildInputs = [
+    gnustep'.base
+    gnustep'.gui
+    gnustep'.back
+  ];
+
+  # Fix the Exec and Icon paths in the .desktop file, and save the file in the
+  # correct place.
+  # postInstall gets redefined in gnustep.make's builder.sh, so we use preFixup
+  preFixup = ''
+    mkdir -p $out/share/applications
+    sed \
+      -e "s@^Exec=.*\$@Exec=$out/bin/PikoPixel %F@" \
+      -e "s@^Icon=.*/local@Icon=$out@" \
+      PikoPixel.app/Resources/PikoPixel.desktop > $out/share/applications/PikoPixel.desktop
+  '';
+
+  meta = with lib; {
+    description = "Application for drawing and editing pixel-art images";
+    homepage = "http://twilightedge.com/mac/pikopixel/";
+    downloadPage = "http://twilightedge.com/mac/pikopixel/";
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ fgaz ];
+    platforms = platforms.all;
+  };
+}