From 3643c79786455b03b68eaa426318fe8bf7eb2134 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 5 Jun 2022 20:48:02 -0700 Subject: [PATCH] whalebird: apply PR feedback --- nixpatches/03-whalebird-4.6.0.patch | 11 ++++++++++- nixpatches/05-whalebird-aarch64.patch | 25 +++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/nixpatches/03-whalebird-4.6.0.patch b/nixpatches/03-whalebird-4.6.0.patch index 8c97ed8d..4d087f1e 100644 --- a/nixpatches/03-whalebird-4.6.0.patch +++ b/nixpatches/03-whalebird-4.6.0.patch @@ -1,5 +1,5 @@ diff --git a/pkgs/applications/misc/whalebird/default.nix b/pkgs/applications/misc/whalebird/default.nix -index 9b8a7f0a348..0f60f74c91b 100644 +index 9b8a7f0a348..7170a63ac7f 100644 --- a/pkgs/applications/misc/whalebird/default.nix +++ b/pkgs/applications/misc/whalebird/default.nix @@ -3,11 +3,11 @@ @@ -16,3 +16,12 @@ index 9b8a7f0a348..0f60f74c91b 100644 }; nativeBuildInputs = [ +@@ -31,7 +31,7 @@ stdenv.mkDerivation rec { + # Necessary steps to find the tray icon + asar extract opt/Whalebird/resources/app.asar "$TMP/work" + substituteInPlace $TMP/work/dist/electron/main.js \ +- --replace "jo,\"tray_icon.png\"" "\"$out/opt/Whalebird/resources/build/icons/tray_icon.png\"" ++ --replace "Do,\"tray_icon.png\"" "\"$out/opt/Whalebird/resources/build/icons/tray_icon.png\"" + asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" opt/Whalebird/resources/app.asar + + runHook postBuild diff --git a/nixpatches/05-whalebird-aarch64.patch b/nixpatches/05-whalebird-aarch64.patch index 1d647a8a..7bf86d64 100644 --- a/nixpatches/05-whalebird-aarch64.patch +++ b/nixpatches/05-whalebird-aarch64.patch @@ -1,5 +1,5 @@ diff --git a/pkgs/applications/misc/whalebird/default.nix b/pkgs/applications/misc/whalebird/default.nix -index 7170a63ac7f..16b3e85e1ad 100644 +index 7170a63ac7f..dcd88fb9a8b 100644 --- a/pkgs/applications/misc/whalebird/default.nix +++ b/pkgs/applications/misc/whalebird/default.nix @@ -1,17 +1,35 @@ @@ -12,7 +12,7 @@ index 7170a63ac7f..16b3e85e1ad 100644 + desktopName = "Whalebird"; + genericName = "An Electron based Mastodon client for Windows, Mac and Linux"; + categories = [ "Network" ]; -+ exec = "opt/Whalebird/whalebird"; ++ exec = "@out@/bin/whalebird"; + icon = "whalebird"; + name = "whalebird"; + }; @@ -44,19 +44,22 @@ index 7170a63ac7f..16b3e85e1ad 100644 autoPatchelfHook makeWrapper nodePackages.asar -@@ -22,7 +40,10 @@ stdenv.mkDerivation rec { - dontConfigure = true; +@@ -19,10 +37,11 @@ stdenv.mkDerivation rec { + buildInputs = [ alsa-lib gtk3 libdbusmenu libxshmfence mesa nss ]; + +- dontConfigure = true; +- unpackPhase = '' - dpkg-deb -x ${src} ./ -+ mkdir -p ./opt -+ tar -xf ${src} -C ./opt ++ mkdir -p opt ++ tar -xf ${src} -C opt + # remove the version/target suffix from the untar'd directory -+ mv ./opt/Whalebird-* ./opt/Whalebird ++ mv opt/Whalebird-* opt/Whalebird ''; buildPhase = '' -@@ -41,12 +62,21 @@ stdenv.mkDerivation rec { +@@ -41,12 +60,23 @@ stdenv.mkDerivation rec { runHook preInstall mkdir $out @@ -70,8 +73,10 @@ index 7170a63ac7f..16b3e85e1ad 100644 + done + + # install desktop item -+ mkdir -p "$out/share" -+ ln -s "${desktopItem}/share/applications" "$out/share/applications" ++ mkdir -p "$out/share/applications" ++ substitute "${desktopItem}/share/applications/whalebird.desktop" \ ++ "$out/share/applications/whalebird.desktop" \ ++ --subst-var out - substituteInPlace $out/share/applications/whalebird.desktop \ - --replace '/opt/Whalebird' $out/bin