dragnpkgs/pkgs/games/outer-wilds-text-adventure/default.nix

62 lines
1.9 KiB
Nix

{
lib,
fetchzip,
stdenvNoCC,
bash,
jdk11,
jogl
}:
let
jdk = jdk11;
joglJarFiles = [
"gluegen-rt-natives-linux-amd64.jar"
"gluegen-rt.jar"
"jogl-all-natives-linux-amd64.jar"
"jogl-all.jar"
"nativewindow-awt.jar"
"nativewindow-natives-linux-amd64.jar"
"nativewindow-os-drm.jar"
"nativewindow-os-x11.jar"
"nativewindow.jar"
];
joglJars = lib.strings.concatMapStringsSep ":" (f: "${jogl}/share/java/${f}") joglJarFiles;
in stdenvNoCC.mkDerivation rec {
pname = "outer-wilds-text-adventure";
version = "1.0";
src = fetchzip {
url = "https://www.mobiusdigitalgames.com/uploads/4/7/3/2/47328935/outerwildstextadventure.application.windows64.zip";
hash = "sha256-DZWjAQmraphpBQEKzMWa327DWA3bc8fiSocHe4hF06k=";
};
propagatedNativeBuildInputs = [ jdk jogl ];
installPhase = ''
mkdir -p $out
cp -r data $out/data
mkdir -p $out/share
cp -r source $out/share
mkdir -p $out/share/doc
cp SomeContextForTheThingYouJustDownloaded.txt $out/share/doc/README.txt
mkdir -p $out/lib
for file in core.jar jl1.0.1.jar jsminim.jar minim.jar mp3spi1.9.5.jar OuterWilds_TextAdventure.jar tritonus_aos.jar tritonus_share.jar; do
cp "lib/$file" $out/lib
done
mkdir -p $out/bin
cat > $out/bin/outer-wilds-text-adventure <<EOF
#!${bash}/bin/bash
cd $out
exec ${jdk}/bin/java -Djna.nosys=true -Djava.library.path=$out/lib -cp "$out/lib/OuterWilds_TextAdventure.jar:$out/lib/core.jar:$out/lib/jl1.0.1.jar:$out/lib/jsminim.jar:$out/lib/minim.jar:$out/lib/mp3spi1.9.5.jar:$out/lib/tritonus_aos.jar:$out/lib/tritonus_share.jar:${joglJars}" OuterWilds_TextAdventure
EOF
chmod +x $out/bin/outer-wilds-text-adventure
'';
meta = with lib; {
description = "Outer Wilds: A Thrilling Graphical Text Adventure";
homepage = "https://www.mobiusdigitalgames.com/outer-wilds-text-adventure.html";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
};
}