about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/inklecate
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-07-23 09:26:00 +0000
committerAlyssa Ross <hi@alyssa.is>2021-07-23 09:26:00 +0000
commitab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d (patch)
tree504b28a058661f6c1cbb7d3f580020e50367ca7f /nixpkgs/pkgs/development/compilers/inklecate
parent55cc63c079f49e81d695a25bc2f5b3902f2bd290 (diff)
parentb09661d41fb93562fd53f31574dbf781b130ac44 (diff)
downloadnixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar.gz
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar.bz2
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar.lz
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar.xz
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.tar.zst
nixlib-ab63e0bb8dcf2b1bf8d4a26ed360af777b8f241d.zip
Merge commit 'b09661d41fb93562fd53f31574dbf781b130ac44'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/inklecate')
-rw-r--r--nixpkgs/pkgs/development/compilers/inklecate/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/inklecate/default.nix b/nixpkgs/pkgs/development/compilers/inklecate/default.nix
new file mode 100644
index 000000000000..6ed01d9bbcf6
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/inklecate/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, unzip, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "inklecate";
+  version = "1.0.0";
+
+  src =
+    if stdenv.isLinux then
+      fetchurl {
+        url    = "https://github.com/inkle/ink/releases/download/v${version}/inklecate_linux.zip";
+        sha256 = "6e17db766222998ba0ae5a5da9857e34896e683b9ec42fad528c3f8bea7398ea";
+        name   = "${pname}-${version}";
+      }
+    else if stdenv.isDarwin then
+      fetchurl {
+        url    = "https://github.com/inkle/ink/releases/download/v${version}/inklecate_mac.zip";
+        sha256 = "b6f4dd1f95c180637ce193dbb5fa6d59aeafe49a2121a05b7822e6cbbaa6931f";
+        name   = "${pname}-${version}";
+      }
+    else throw "Not supported on ${stdenv.hostPlatform.system}.";
+
+  # Work around the "unpacker appears to have produced no directories"
+  # case that happens when the archive doesn't have a subdirectory.
+  setSourceRoot = "sourceRoot=$(pwd)";
+
+  nativeBuildInputs = [ unzip makeWrapper ];
+
+  unpackPhase = ''
+    unzip -qq -j $src -d $pname-$version
+
+    rm $pname-$version/ink-engine-runtime.dll
+    rm $pname-$version/ink_compiler.dll
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin/
+
+    cp $pname-$version/inklecate $out/bin/inklecate
+  '';
+
+
+  meta = with lib; {
+    description     = "Compiler for ink, inkle's scripting language";
+    longDescription = ''
+      Inklecate is a command-line compiler for ink, inkle's open source
+      scripting language for writing interactive narrative
+      '';
+    homepage        = "https://www.inklestudios.com/ink/";
+    downloadPage    = "https://github.com/inkle/ink/releases";
+    license         = licenses.mit;
+    platforms       = platforms.unix;
+    maintainers     = with maintainers; [ shreerammodi ];
+  };
+}