From 698d6e72262eb33f9f871232680c1aeba570fed7 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Thu, 27 Jun 2024 10:59:55 +0100 Subject: [PATCH] digital-a-love-story: completely replace packaged launcher --- pkgs/digital-a-love-story/default.nix | 12 +++--------- pkgs/digital-a-love-story/launcher.sh | 3 +++ 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 pkgs/digital-a-love-story/launcher.sh diff --git a/pkgs/digital-a-love-story/default.nix b/pkgs/digital-a-love-story/default.nix index 79ebab3..3e8fd9e 100644 --- a/pkgs/digital-a-love-story/default.nix +++ b/pkgs/digital-a-love-story/default.nix @@ -47,16 +47,10 @@ stdenv.mkDerivation rec { mkdir -p $out/opt/Digital-linux-x86 cp -R source/* $out/opt/Digital-linux-x86 - # patch paths in entrypoint - substituteInPlace $out/opt/Digital-linux-x86/Digital.sh \ - --replace '${"\${0%.sh}"}' "$out/opt/Digital-linux-x86/Digital" \ - --replace '`dirname \"$0\"`' "$out/opt/Digital-linux-x86" \ - --replace '`dirname "$0"`' "$out/opt/Digital-linux-x86" \ - --replace '`basename "$0"`' 'Digital.sh' - - # link entrypoint to bin directory + # add launcher mkdir -p $out/bin - ln -s $out/opt/Digital-linux-x86/Digital.sh $out/bin/Digital + substituteAll ${./launcher.sh} $out/bin/Digital + chmod +x $out/bin/Digital # add desktop file mkdir -p $out/share/applications diff --git a/pkgs/digital-a-love-story/launcher.sh b/pkgs/digital-a-love-story/launcher.sh new file mode 100644 index 0000000..9727e6f --- /dev/null +++ b/pkgs/digital-a-love-story/launcher.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "@out@/opt/Digital-linux-x86/lib/python" "-OO" "@out@/opt/Digital-linux-x86/Digital.py" "$@" \ No newline at end of file