Skip to content

Instantly share code, notes, and snippets.

@infinisil
Last active December 31, 2023 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infinisil/51fc70942e39416db540024b22f5a364 to your computer and use it in GitHub Desktop.
Save infinisil/51fc70942e39416db540024b22f5a364 to your computer and use it in GitHub Desktop.
LookingGrimm
{
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"
'';
}
@infinisil
Copy link
Author

nix-build to build, then result/bin/LookinGrimm to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment