Skip to content

Commit

Permalink
Merge pull request #258429 from FliegendeWurst/wavebox-117.18-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin authored Nov 7, 2023
2 parents c1cfba5 + 93d7c04 commit a3987f5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 22 deletions.
50 changes: 28 additions & 22 deletions pkgs/applications/networking/instant-messengers/wavebox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, gtk3
, gtk4
, libnotify
, copyDesktopItems
, makeDesktopItem
, makeWrapper
, mesa
Expand All @@ -17,32 +18,21 @@
, xorg
}:

let
version = "10.114.26-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 = "1yk664zgahjg6n98n3kc9avcay0nqwcyq8wq231p7kvd79zazk0r";
url = "https://download.wavebox.app/stable/linux/tar/Wavebox_${version}.tar.gz";
sha256 = "sha256-TxMl8pdycCMY6NFi5MSLZg0p/+KmuAPQOm370bPMm/0=";
};

# don't remove runtime deps
dontPatchELF = true;
# 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
Expand All @@ -62,21 +52,37 @@ 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 = ''
makeWrapper $out/opt/wavebox/wavebox-launcher $out/bin/wavebox \
--prefix PATH : ${xdg-utils}/bin
'';

passthru.updateScript = ./update.sh;

meta = with lib; {
description = "Wavebox messaging application";
homepage = "https://wavebox.io";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env nix-shell
#!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"]')
nix-update wavebox --version "$version"

0 comments on commit a3987f5

Please sign in to comment.