From 742317931e285035ffa43ba97de15949935f494c Mon Sep 17 00:00:00 2001 From: nat Date: Tue, 12 Dec 2023 21:28:08 +0100 Subject: [PATCH 1/2] lunar-client: cleaner packaging --- pkgs/by-name/lu/lunar-client/package.nix | 31 +++++++++++------------- pkgs/by-name/lu/lunar-client/update.sh | 4 +-- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/pkgs/by-name/lu/lunar-client/package.nix b/pkgs/by-name/lu/lunar-client/package.nix index 4dcfbb76e0b0..3b584762b77a 100644 --- a/pkgs/by-name/lu/lunar-client/package.nix +++ b/pkgs/by-name/lu/lunar-client/package.nix @@ -4,7 +4,7 @@ , makeWrapper }: -let +appimageTools.wrapType2 rec { pname = "lunar-client"; version = "3.1.3"; @@ -13,22 +13,19 @@ let hash = "sha512-VV6UH0mEv+bABljDKZUOZXBjM1Whf2uacUQI8AnyLDBYI7pH0fkdjsBfjhQhFL0p8nHOwPAQflA+8vRFLH/uZw=="; }; - appimageContents = appimageTools.extract { inherit pname version src; }; -in -appimageTools.wrapType2 rec { - inherit pname version src; - - extraInstallCommands = '' - mv $out/bin/{${pname}-${version},${pname}} - source "${makeWrapper}/nix-support/setup-hook" - wrapProgram $out/bin/${pname} \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" - install -Dm444 ${appimageContents}/launcher.desktop $out/share/applications/lunar-client.desktop - install -Dm444 ${appimageContents}/launcher.png $out/share/pixmaps/lunar-client.png - substituteInPlace $out/share/applications/lunar-client.desktop \ - --replace 'Exec=AppRun --no-sandbox %U' 'Exec=lunar-client' \ - --replace 'Icon=launcher' 'Icon=lunar-client' - ''; + extraInstallCommands = + let contents = appimageTools.extract { inherit pname version src; }; + in '' + mv $out/bin/{lunar-client-*,lunar-client} + source "${makeWrapper}/nix-support/setup-hook" + wrapProgram $out/bin/lunar-client \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" + install -Dm444 ${contents}/launcher.desktop $out/share/applications/lunar-client.desktop + install -Dm444 ${contents}/launcher.png $out/share/pixmaps/lunar-client.png + substituteInPlace $out/share/applications/lunar-client.desktop \ + --replace 'Exec=AppRun --no-sandbox %U' 'Exec=lunar-client' \ + --replace 'Icon=launcher' 'Icon=lunar-client' + ''; passthru.updateScript = ./update.sh; diff --git a/pkgs/by-name/lu/lunar-client/update.sh b/pkgs/by-name/lu/lunar-client/update.sh index aa0adbff2b29..d3c4529fcd01 100755 --- a/pkgs/by-name/lu/lunar-client/update.sh +++ b/pkgs/by-name/lu/lunar-client/update.sh @@ -6,7 +6,7 @@ target="$(dirname "$(readlink -f "$0")")/package.nix" host="https://launcherupdates.lunarclientcdn.com" metadata=$(curl "$host/latest-linux.yml") version=$(echo "$metadata" | yq .version -r) -sha512=$(echo "$metadata" | yq .sha512 -r) +hash=$(echo "$metadata" | yq .sha512 -r) sed -i "s@version = .*;@version = \"$version\";@g" "$target" -sed -i "s@hash.* = .*;@hash = \"sha512-$sha512\";@g" "$target" +sed -i "s@hash.* = .*;@hash = \"sha512-$hash\";@g" "$target" From bc809761f5d071de2a1364ac80631e3612021b03 Mon Sep 17 00:00:00 2001 From: nat Date: Mon, 1 Jan 2024 22:31:52 +0100 Subject: [PATCH 2/2] lunar-client: 3.1.3 -> 3.2.1 --- pkgs/by-name/lu/lunar-client/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/lu/lunar-client/package.nix b/pkgs/by-name/lu/lunar-client/package.nix index 3b584762b77a..c01e74dd9a80 100644 --- a/pkgs/by-name/lu/lunar-client/package.nix +++ b/pkgs/by-name/lu/lunar-client/package.nix @@ -6,11 +6,11 @@ appimageTools.wrapType2 rec { pname = "lunar-client"; - version = "3.1.3"; + version = "3.2.1"; src = fetchurl { url = "https://launcherupdates.lunarclientcdn.com/Lunar%20Client-${version}.AppImage"; - hash = "sha512-VV6UH0mEv+bABljDKZUOZXBjM1Whf2uacUQI8AnyLDBYI7pH0fkdjsBfjhQhFL0p8nHOwPAQflA+8vRFLH/uZw=="; + hash = "sha512-ZW+SFIZ5+xxgesaZ7ZQbUnv7H5U92SZdfAU7GhJR1H0mhkrIb5Go6GWrIXaWYZLrmOlD98LSLihYi7SemJp+Yg=="; }; extraInstallCommands =