Last active
December 31, 2023 17:25
-
-
Save infinisil/51fc70942e39416db540024b22f5a364 to your computer and use it in GitHub Desktop.
LookingGrimm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
system ? builtins.currentSystem, | |
pkgs ? | |
import (fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs/tarball/cfc3698c31b1fb9cdcf10f36c9643460264d0ca8"; | |
sha256 = "1xn1k48w678hjkrx434n995i68jwkxrwpncyjzrmfz0i9p2y7igh"; | |
}) { | |
config = {}; | |
overlays = []; | |
inherit system; | |
}, | |
}: | |
with pkgs; | |
stdenv.mkDerivation { | |
name = "LookingGrimm"; | |
src = requireFile { | |
name = "LookingGrimm-Linux-x64.zip"; | |
url = "https://goat-productions.itch.io/lookinggrimm"; | |
sha256 = "08swi6gp87q0pbs6f9dpz2zkyq7amgjkjljszd491q08nhr88m19"; | |
}; | |
nativeBuildInputs = [ | |
unzip | |
autoPatchelfHook | |
makeWrapper | |
]; | |
postInstall = '' | |
mkdir -p $out/bin | |
cp -r . $out/libexec | |
''; | |
# https://github.com/actions/runner/issues/918#issuecomment-774140470 | |
dontStrip = true; | |
appendRunpaths = lib.makeLibraryPath [ | |
libGL | |
pulseaudio | |
xorg.libXrandr | |
]; | |
buildInputs = [ | |
stdenv.cc.cc | |
curl | |
lttng-ust | |
]; | |
preFixup = '' | |
# Not an executable by default | |
chmod +x $out/libexec/LookingGrimm | |
# Seems to want an older liblttng-ust version | |
patchelf --replace-needed liblttng-ust.so.{0,1} $out/libexec/libcoreclrtraceptprovider.so | |
''; | |
postFixup = '' | |
# https://stackoverflow.com/a/64370938 | |
# And the binary expects the working directory to be where it is itself | |
makeWrapper $out/{libexec,bin}/LookingGrimm \ | |
--set DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1 \ | |
--run "cd $out/libexec" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nix-build
to build, thenresult/bin/LookinGrimm
to run