feat: use patches

This commit is contained in:
Oskar Manhart
2024-09-09 11:09:42 +02:00
parent 7d5cce374c
commit 28e958e600
5 changed files with 127 additions and 22 deletions

View File

@@ -0,0 +1,11 @@
--- a/WinAppsLauncher.sh
+++ b/WinAppsLauncher.sh
@@ -19,7 +19,7 @@ declare -rx EC_WIN_NOT_SPEC=6
declare -rx EC_NO_WIN_FOUND=7
# Paths
-declare -rx ICONS_PATH="./Icons"
+declare -rx ICONS_PATH="@out@/Icons"
declare -rx APPDATA_PATH="${HOME}/.local/share/winapps"
declare -rx CONFIG_PATH="${HOME}/.config/winapps"
declare -rx CONFIG_FILE="${CONFIG_PATH}/winapps.conf"

View File

@@ -29,16 +29,18 @@ stdenv.mkDerivation rec {
(callPackage ../winapps { })
];
patches = [ ./WinAppsLauncher.diff ];
postPatch = ''
substituteAllInPlace WinAppsLauncher.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r ./Icons $out/Icons
sed -E -i \
-e "$(printf "%s$out%s" 's|^declare -rx ICONS_PATH="./Icons"|declare -rx ICONS_PATH="' '/Icons"|')" \
WinAppsLauncher.sh
install -m755 -D WinAppsLauncher.sh $out/bin/winapps-launcher
install -Dm444 -T Icons/AppIcon.svg $out/share/pixmaps/winapps.svg