Last active
December 11, 2023 13:54
-
-
Save markus1189/3fd4d5ec4317a9a56a330ac32e583964 to your computer and use it in GitHub Desktop.
HumbleBundle DoorKickers NixOS
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
# 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