diff --git a/pkgs/applications/misc/whalebird/default.nix b/pkgs/applications/misc/whalebird/default.nix index 472f7ad42a50..36868690d81d 100644 --- a/pkgs/applications/misc/whalebird/default.nix +++ b/pkgs/applications/misc/whalebird/default.nix @@ -1,22 +1,24 @@ -{ lib, stdenv, fetchurl, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, electron -, nodePackages, alsa-lib, gtk3, libdbusmenu, libxshmfence, mesa, nss }: +{ lib, stdenv, fetchurl +, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, gnugrep, nodePackages +, electron, python3, alsa-lib, gtk3, libdbusmenu, libxshmfence, mesa, nss +}: stdenv.mkDerivation rec { pname = "whalebird"; - version = "4.7.4"; + version = "5.0.7"; src = let - downloads = "https://github.com/h3poteto/whalebird-desktop/releases/download/${version}"; + downloads = "https://github.com/h3poteto/whalebird-desktop/releases/download/v${version}"; in if stdenv.system == "x86_64-linux" then fetchurl { url = downloads + "/Whalebird-${version}-linux-x64.tar.bz2"; - sha256 = "sha256-jRtlnKlrh6If9wy3FqVBtctQO3rZJRwceUWAPmieT4A="; + hash = "sha256-eufP038REwF2VwAxxI8R0S3fE8oJ+SX/CES5ozuut2w="; } else if stdenv.system == "aarch64-linux" then fetchurl { url = downloads + "/Whalebird-${version}-linux-arm64.tar.bz2"; - sha256 = "sha256-gWCBH2zfhJdJ3XUAxvZ0+gBHye5uYCUgX1BDEoaruxY="; + hash = "sha256-U0xVTUUm6wsRxYc1w4vfNtVE6o8dNzXTSi+IX4mgDEE="; } else throw "Whalebird is not supported for ${stdenv.system}"; @@ -25,6 +27,7 @@ stdenv.mkDerivation rec { autoPatchelfHook makeWrapper copyDesktopItems + gnugrep nodePackages.asar ]; @@ -52,9 +55,16 @@ stdenv.mkDerivation rec { runHook preBuild # Necessary steps to find the tray icon + # For aarch64-linux, we need to overwrite this symlink first as it points to + # /usr/bin/python3 + if [ "${stdenv.system}" = "aarch64-linux" ] + then ln -sf ${python3}/bin/python3 \ + opt/Whalebird/resources/app.asar.unpacked/node_modules/better-sqlite3/build/node_gyp_bins/python3 + fi asar extract opt/Whalebird/resources/app.asar "$TMP/work" - substituteInPlace $TMP/work/dist/electron/main.js \ - --replace "qt,\"tray_icon.png\"" "\"$out/opt/Whalebird/resources/build/icons/tray_icon.png\"" + substituteInPlace "$TMP/work/dist/electron/main.js" \ + --replace "$(grep -oE '.{2},"tray_icon.png"' "$TMP/work/dist/electron/main.js")" \ + "\"$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 @@ -83,8 +93,8 @@ stdenv.mkDerivation rec { description = "Electron based Mastodon, Pleroma and Misskey client for Windows, Mac and Linux"; homepage = "https://whalebird.social"; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.mit; - maintainers = with maintainers; [ wolfangaukang colinsane ]; + license = licenses.gpl3Only; + maintainers = with maintainers; [ wolfangaukang colinsane weathercold ]; platforms = [ "x86_64-linux" "aarch64-linux" ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bbd930189032..28dc8228e491 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -35360,7 +35360,7 @@ with pkgs; wgnord = callPackage ../applications/networking/wgnord/default.nix { }; whalebird = callPackage ../applications/misc/whalebird { - electron = electron_19; + electron = electron_21; }; windowlab = callPackage ../applications/window-managers/windowlab { };