about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/wavebox
diff options
context:
space:
mode:
authorFliegendeWurst <2012gdwu+github@posteo.de>2023-10-20 11:09:19 +0200
committerFliegendeWurst <2012gdwu+github@posteo.de>2023-10-20 11:10:53 +0200
commit93d7c04dac8af7cc0b2b28cc0de7a00cb11bbafb (patch)
tree1ef7b07be78a53e022df39648d53e4f54e62b78b /pkgs/applications/networking/instant-messengers/wavebox
parent5fc826a9cc043e7714e1f82e4abb28334517e866 (diff)
wavebox: 10.117.21-2 -> 10.118.5-2
Refactor to remove let.
Use nix-update in update script.
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/wavebox')
-rw-r--r--pkgs/applications/networking/instant-messengers/wavebox/default.nix46
-rwxr-xr-xpkgs/applications/networking/instant-messengers/wavebox/update.sh14
2 files changed, 26 insertions, 34 deletions
diff --git a/pkgs/applications/networking/instant-messengers/wavebox/default.nix b/pkgs/applications/networking/instant-messengers/wavebox/default.nix
index c7fedc51b5825..21a8a4a963030 100644
--- a/pkgs/applications/networking/instant-messengers/wavebox/default.nix
+++ b/pkgs/applications/networking/instant-messengers/wavebox/default.nix
@@ -4,6 +4,7 @@
 , gtk3
 , gtk4
 , libnotify
+, copyDesktopItems
 , makeDesktopItem
 , makeWrapper
 , mesa
@@ -17,26 +18,13 @@
 , xorg
 }:
 
-let
-  version = "10.117.21-2";
-  desktopItem = makeDesktopItem rec {
-    name = "Wavebox";
-    exec = "wavebox";
-    icon = "wavebox";
-    desktopName = name;
-    genericName = name;
-    categories = [ "Network" "WebBrowser" ];
-  };
-
-  tarball = "Wavebox_${version}.tar.gz";
-
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "wavebox";
-  inherit version;
+  version = "10.118.5-2";
+
   src = fetchurl {
-    url = "https://download.wavebox.app/stable/linux/tar/${tarball}";
-    sha256 = "1g2mf3xmcaz3y6vwa65r4ccw71ddqj1cn12p0k1f1xawfl74kc5c";
+    url = "https://download.wavebox.app/stable/linux/tar/Wavebox_${version}.tar.gz";
+    sha256 = "sha256-TxMl8pdycCMY6NFi5MSLZg0p/+KmuAPQOm370bPMm/0=";
   };
 
   # don't remove runtime deps
@@ -44,7 +32,7 @@ stdenv.mkDerivation {
   # ignore optional Qt 6 shim
   autoPatchelfIgnoreMissingDeps = [ "libQt6Widgets.so.6" "libQt6Gui.so.6" "libQt6Core.so.6" ];
 
-  nativeBuildInputs = [ autoPatchelfHook makeWrapper qt5.wrapQtAppsHook ];
+  nativeBuildInputs = [ autoPatchelfHook makeWrapper qt5.wrapQtAppsHook copyDesktopItems ];
 
   buildInputs = with xorg; [
     libXdmcp
@@ -64,14 +52,28 @@ stdenv.mkDerivation {
 
   runtimeDependencies = [ (lib.getLib udev) libnotify gtk4 ];
 
+  desktopItems = [
+    (makeDesktopItem rec {
+      name = "Wavebox";
+      exec = "wavebox";
+      icon = "wavebox";
+      desktopName = name;
+      genericName = name;
+      categories = [ "Network" "WebBrowser" ];
+    })
+  ];
+
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin $out/opt/wavebox
     cp -r * $out/opt/wavebox
 
-    # provide desktop item and icon
-    mkdir -p $out/share/applications $out/share/icons/hicolor/128x128/apps
-    ln -s ${desktopItem}/share/applications/* $out/share/applications
+    # provide icon for desktop item
+    mkdir -p $out/share/icons/hicolor/128x128/apps
     ln -s $out/opt/wavebox/product_logo_128.png $out/share/icons/hicolor/128x128/apps/wavebox.png
+
+    runHook postInstall
   '';
 
   postFixup = ''
diff --git a/pkgs/applications/networking/instant-messengers/wavebox/update.sh b/pkgs/applications/networking/instant-messengers/wavebox/update.sh
index dcf0339e8e3a6..316f8bfbb7ecc 100755
--- a/pkgs/applications/networking/instant-messengers/wavebox/update.sh
+++ b/pkgs/applications/networking/instant-messengers/wavebox/update.sh
@@ -1,15 +1,5 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -i bash -p coreutils curl jq
-set -euo pipefail
-
-cd $(dirname "${BASH_SOURCE[0]}")
-
-setKV () {
-    sed -i "s|$2 = \".*\"|$2 = \"${3:-}\"|" $1
-}
+#!nix-shell -i bash -p nix-update curl jq
 
 version=$(curl "https://download.wavebox.app/stable/linux/latest.json" | jq --raw-output '.["urls"]["tar"] | match("https://download.wavebox.app/stable/linux/tar/Wavebox_(.+).tar.gz").captures[0]["string"]')
-
-sha256_linux64=$(nix-prefetch-url --quiet https://download.wavebox.app/stable/linux/tar/Wavebox_${version}.tar.gz)
-setKV ./default.nix version $version
-setKV ./default.nix sha256 "$sha256_linux64"
+nix-update wavebox --version "$version"