Skip to content

Instantly share code, notes, and snippets.

@markus1189
Last active February 6, 2018 06:28
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 markus1189/91daef51b0eb6c588f6d7b645da5e3bd to your computer and use it in GitHub Desktop.
Save markus1189/91daef51b0eb6c588f6d7b645da5e3bd to your computer and use it in GitHub Desktop.
DesktopDungeons on Nix(OS)
# Nix build file for Desktop Dungeons
# nix-build --argstr savesDir ~/DDSaves DesktopDungeons.nix
{ pkgs ? import <nixpkgs> { system = "i686-linux";}
, savesDir
}: with pkgs;
assert lib.pathExists savesDir;
stdenv.mkDerivation rec {
name = "desktop-dungeons";
version = "1.57";
buildInputs = [
mesa_glu
binutils
xorg.libX11
xorg.libXcursor
stdenv.cc.cc
glib
gdk_pixbuf
gtk2
alsaLib
libpulseaudio
];
phases = [ "unpackPhase" "installPhase" ];
ldPath = stdenv.lib.makeLibraryPath buildInputs;
src = ./Desktop_Dungeons_EE_Linux_1_57.tar.gz;
installPhase = ''
mkdir -p $out
patchelf --set-rpath "${ldPath}" DesktopDungeons_Data/Plugins/x86/ScreenSelector.so
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
--set-rpath "$out/DesktopDungeons_Data/Plugins/x86:${ldPath}" \
DesktopDungeons.x86
rm Install.sh DesktopDungeons.sh
mv * $out/
echo "Linking ${savesDir} to hold savegame files"
ln -s ${savesDir} $out/DesktopDungeons_Data/Saves
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment