-
-
Save worldofpeace/d02bcda1ab44bb37e438335a46579232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/pkgs/applications/networking/instant-messengers/wire-desktop/default.nix b/pkgs/applications/networking/instant-messengers/wire-desktop/default.nix | |
index a08952fffce..08b7d6dd583 100644 | |
--- a/pkgs/applications/networking/instant-messengers/wire-desktop/default.nix | |
+++ b/pkgs/applications/networking/instant-messengers/wire-desktop/default.nix | |
@@ -1,74 +1,90 @@ | |
-{ stdenv, fetchurl, | |
+{ stdenv, fetchurl, makeDesktopItem | |
- makeDesktopItem, | |
- alsaLib, at-spi2-atk, atk, cairo, cups, dbus, dpkg, expat, fontconfig, | |
- freetype, gdk_pixbuf, glib, gtk3, hunspell, libX11, libXScrnSaver, | |
- libXcomposite, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr, | |
- libXrender, libXtst, libnotify, libuuid, nspr, nss, pango, pciutils, | |
- pulseaudio, udev, xdg_utils, xorg, | |
+, alsaLib, at-spi2-atk, atk, cairo, cups, dbus, dpkg, expat, fontconfig | |
+, freetype, gdk_pixbuf, glib, gtk3, hunspell, libX11, libXScrnSaver | |
+, libXcomposite, libXcursor, libXdamage, libXext, libXfixes, libXi, libXrandr | |
+, libXrender, libXtst, libnotify, libuuid, nspr, nss, pango, pciutils | |
+, pulseaudio, udev, xdg_utils, xorg | |
- cpio | |
+, cpio | |
}: | |
let | |
- linux = | |
- let | |
- rpath = stdenv.lib.makeLibraryPath [ | |
- alsaLib at-spi2-atk atk cairo cups dbus expat fontconfig freetype | |
- gdk_pixbuf glib gtk3 hunspell libX11 libXScrnSaver libXcomposite | |
- libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender | |
- libXtst libnotify libuuid nspr nss pango pciutils pulseaudio | |
- stdenv.cc.cc udev xdg_utils xorg.libxcb | |
- ]; | |
- in rec { | |
- version = "3.9.2895"; | |
- | |
- src = fetchurl { | |
- url = "https://wire-app.wire.com/linux/debian/pool/main/" | |
- + "Wire-${version}_amd64.deb"; | |
- sha256 = "0wrn95m64j4b7ym44h9zawq13kg4m12aixlyyzp56bfyczmjq4a5"; | |
- }; | |
- | |
- desktopItem = makeDesktopItem { | |
- name = "wire-desktop"; | |
- exec = "wire-desktop %U"; | |
- icon = "wire-desktop"; | |
- comment = "Secure messenger for everyone"; | |
- desktopName = "Wire Desktop"; | |
- genericName = "Secure messenger"; | |
- categories = "Network;InstantMessaging;Chat;VideoConference"; | |
- }; | |
- | |
- dontBuild = true; | |
- dontPatchELF = true; | |
- dontConfigure = true; | |
- | |
- nativeBuildInputs = [ dpkg ]; | |
- unpackPhase = "dpkg-deb -x $src ."; | |
- installPhase = '' | |
- mkdir -p "$out" | |
- cp -R "opt" "$out" | |
- cp -R "usr/share" "$out/share" | |
- chmod -R g-w "$out" | |
- # Patch wire-desktop | |
- patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
- --set-rpath "${rpath}:$out/opt/Wire" \ | |
- "$out/opt/Wire/wire-desktop" | |
- # Symlink to bin | |
- mkdir -p "$out/bin" | |
- ln -s "$out/opt/Wire/wire-desktop" "$out/bin/wire-desktop" | |
- # Desktop file | |
- mkdir -p "$out/share/applications" | |
- cp "${desktopItem}/share/applications/"* "$out/share/applications" | |
- ''; | |
+ | |
+ inherit (stdenv.hostPlatform) system; | |
+ | |
+ version = { | |
+ "x86_64-linux" = "3.9.2895"; | |
+ "x86_64-darwin" = "3.9.2943"; | |
+ }.${system}; | |
+ | |
+ sha256 = { | |
+ "x86_64-linux" = "0wrn95m64j4b7ym44h9zawq13kg4m12aixlyyzp56bfyczmjq4a5"; | |
+ "x86_64-darwin" = "1y1bzsjmjrj518q29xfx6gg1nhdbaz7y5hzaqrp241az6plp090k"; | |
+ }.${system}; | |
+ | |
+ linux = rec { | |
+ inherit version; | |
+ | |
+ src = fetchurl { | |
+ url = "https://wire-app.wire.com/linux/debian/pool/main/" | |
+ + "Wire-${version}_amd64.deb"; | |
+ inherit sha256; | |
+ }; | |
+ | |
+ desktopItem = makeDesktopItem { | |
+ name = "wire-desktop"; | |
+ exec = "wire-desktop %U"; | |
+ icon = "wire-desktop"; | |
+ comment = "Secure messenger for everyone"; | |
+ desktopName = "Wire Desktop"; | |
+ genericName = "Secure messenger"; | |
+ categories = "Network;InstantMessaging;Chat;VideoConference"; | |
}; | |
+ | |
+ dontBuild = true; | |
+ dontPatchELF = true; | |
+ dontConfigure = true; | |
+ | |
+ nativeBuildInputs = [ dpkg ]; | |
+ rpath = stdenv.lib.makeLibraryPath [ | |
+ alsaLib at-spi2-atk atk cairo cups dbus expat fontconfig freetype | |
+ gdk_pixbuf glib gtk3 hunspell libX11 libXScrnSaver libXcomposite | |
+ libXcursor libXdamage libXext libXfixes libXi libXrandr libXrender | |
+ libXtst libnotify libuuid nspr nss pango pciutils pulseaudio | |
+ stdenv.cc.cc udev xdg_utils xorg.libxcb | |
+ ]; | |
+ | |
+ unpackPhase = "dpkg-deb -x $src ."; | |
+ | |
+ installPhase = '' | |
+ mkdir -p "$out" | |
+ cp -R "opt" "$out" | |
+ cp -R "usr/share" "$out/share" | |
+ chmod -R g-w "$out" | |
+ | |
+ # Patch wire-desktop | |
+ patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ | |
+ --set-rpath "${rpath}:$out/opt/Wire" \ | |
+ "$out/opt/Wire/wire-desktop" | |
+ | |
+ # Symlink to bin | |
+ mkdir -p "$out/bin" | |
+ ln -s "$out/opt/Wire/wire-desktop" "$out/bin/wire-desktop" | |
+ | |
+ # Desktop file | |
+ mkdir -p "$out/share/applications" | |
+ cp "${desktopItem}/share/applications/"* "$out/share/applications" | |
+ ''; | |
+ }; | |
+ | |
darwin = rec { | |
- version = "3.9.2943"; | |
+ inherit version; | |
src = fetchurl { | |
url = "https://github.com/wireapp/wire-desktop/releases/download/" | |
- + "macos%2F${version}/Wire.pkg"; | |
- sha256 = "1y1bzsjmjrj518q29xfx6gg1nhdbaz7y5hzaqrp241az6plp090k"; | |
+ + "macos%2F${version}/Wire.pkg"; | |
+ inherit sha256; | |
}; | |
buildInputs = [ cpio ]; | |
@@ -88,6 +104,7 @@ let | |
cp -r Wire.app $out/Applications | |
''; | |
}; | |
+ | |
in stdenv.mkDerivation ({ | |
pname = "wire-desktop"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment