From ab1dd67e728006fe199b6cd2bd1b659a25f61c25 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 24 Jun 2024 16:52:06 +0100 Subject: [PATCH] digitalalovestory-bin: link missing libraries & excise steam-run --- pkgs/digitalalovestory-bin/default.nix | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/pkgs/digitalalovestory-bin/default.nix b/pkgs/digitalalovestory-bin/default.nix index 3908319..d8bbe83 100644 --- a/pkgs/digitalalovestory-bin/default.nix +++ b/pkgs/digitalalovestory-bin/default.nix @@ -1,16 +1,13 @@ { stdenv , lib , fetchzip -, steam-run -# , zlib -# , autoPatchelfHook +, zlib +, autoPatchelfHook +, xorg +, libpulseaudio +, alsa-lib }: -# TODO: Shouldn't need the whole steam-run FHS env. -# Adding autoPatchelfHook and zlib lets it build and run, -# but pygame errors out with "error: No available video device". -# It may be more practical to just create a version built from source. - stdenv.mkDerivation rec { pname = "digitalalovestory-bin"; version = "1.1"; @@ -20,13 +17,22 @@ stdenv.mkDerivation rec { sha256 = "+7KcZ8dKts1AoKWNfHMKIt+w2fBFIAcnkuAtzSw49xk="; }; - # nativeBuildInputs = [ - # autoPatchelfHook - # ]; + nativeBuildInputs = [ + autoPatchelfHook + ]; buildInputs = [ - steam-run - # zlib + zlib + ]; + + appendRunpaths = [ + "${xorg.libX11}/lib" + "${xorg.libXext}/lib" + "${xorg.libXrender}/lib" + "${xorg.libXrandr}/lib" + "${xorg.libXcursor}/lib" + "${libpulseaudio}/lib" + "${alsa-lib}/lib" ]; sourceRoot = "."; @@ -47,9 +53,6 @@ stdenv.mkDerivation rec { sed -i "s#dir=.*#dir=$out/opt/Digital-linux-x86#g" $out/opt/Digital-linux-x86/Digital.sh sed -i 's/base=.*/base=Digital.sh/g' $out/opt/Digital-linux-x86/Digital.sh - # wrap in steam-run - sed -i 's#exec#exec "${steam-run}/bin/steam-run"#g' $out/opt/Digital-linux-x86/Digital.sh - # link entrypoint to bin directory mkdir -p $out/bin ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital