Skip to content

Instantly share code, notes, and snippets.

@markus1189
Last active December 11, 2023 13:54
Show Gist options
  • Save markus1189/3fd4d5ec4317a9a56a330ac32e583964 to your computer and use it in GitHub Desktop.
Save markus1189/3fd4d5ec4317a9a56a330ac32e583964 to your computer and use it in GitHub Desktop.
HumbleBundle DoorKickers NixOS
# Nix file for DoorKickers
#
# - make sure 'DoorKickers.tar.gz' is in the same dir
# - run:
# $ nix-build -E 'with import <nixpkgs> { }; callPackage_i686 ./default.nix { }'
{lib, openal, glibc, libGL, libX11, libogg, xorg, makeWrapper, stdenv }:
stdenv.mkDerivation {
name = "DoorKickers";
src = ./DoorKickers.tar.gz;
buildInputs = [ makeWrapper ];
libPath = lib.makeLibraryPath [
glibc
libX11
libGL
libogg
openal
stdenv.cc.cc
xorg.libXxf86vm
];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mkdir -p "$out/opt"
cp -r data "$out/opt/"
cp -r mods "$out/opt/"
cp -r DoorKickers "$out/opt/"
cp -r linux_libs "$out/lib"
cp -r linux_libs "$out/opt/"
chmod +x "$out/opt/DoorKickers"
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
--set-rpath "$libPath:$out/lib" \
"$out/opt/DoorKickers"
for i in $out/lib/lib*; do
patchelf --set-rpath "$libPath:$out/lib" "$i"
done
mkdir "$out/bin"
wrapProgram "$out/opt/DoorKickers" --run "cd $out/opt/"
ln -s "$out/opt/DoorKickers" "$out/bin/DoorKickers"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment