From 89e37ba6333c7bb32e153e73577f34433e7b1bf4 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 7 Feb 2021 23:17:51 +0000 Subject: [PATCH] nix/pkgs: enigma: init --- nix/pkgs/default.nix | 1 + nix/pkgs/enigma.nix | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 nix/pkgs/enigma.nix diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index d5c57ef556..45d130a85b 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -23,5 +23,6 @@ django-tailwind = pkgs.python3Packages.callPackage ./django-tailwind.nix {}; windows = import ./windows args; hp-rom = import ./hp-rom.nix args; + enigma = import ./enigma.nix args; } // (import ./heptapod-runner.nix args) // (import ./lightspeed args) diff --git a/nix/pkgs/enigma.nix b/nix/pkgs/enigma.nix new file mode 100644 index 0000000000..062631dce7 --- /dev/null +++ b/nix/pkgs/enigma.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +let + inherit (pkgs) stdenv fetchurl jdk wrapGAppsHook makeWrapper gtk3; +in +stdenv.mkDerivation rec { + pname = "enigma"; + version = "0.23.0"; + + src = fetchurl { + url = "https://maven.fabricmc.net/cuchaz/enigma-swing/${version}/enigma-swing-${version}-all.jar"; + sha256 = "sha256:003y7zjdig5ngjkpzpminp55k3mzv7g2csjp5sfhn26gvm7bnr23"; + }; + + buildInputs = [ + gtk3 + ]; + nativeBuildInputs = [ + makeWrapper + wrapGAppsHook + ]; + + dontUnpack = true; + buildPhase = "true"; + installPhase = '' + mkdir -p $out/bin $out/share + cp $src $out/share/enigma-swing-all.jar + makeWrapper ${jdk}/bin/java $out/bin/enigma --add-flags "-jar $out/share/enigma-swing-all.jar" + ''; +}