Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 117 lines 2.8 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchzip, 6 autoPatchelfHook, 7 copyDesktopItems, 8 makeDesktopItem, 9 nss, 10 cairo, 11 xorg, 12 libxkbcommon, 13 alsa-lib, 14 at-spi2-core, 15 libgbm, 16 pango, 17 libdrm, 18 vivaldi-ffmpeg-codecs, 19 gtk3, 20 libGL, 21 libglvnd, 22 systemd, 23 nix-update-script, 24}: 25 26stdenv.mkDerivation (finalAttrs: { 27 pname = "nextcloud-talk-desktop"; 28 version = "1.2.5"; 29 30 # Building from source would require building also building Server and Talk components 31 # See https://github.com/nextcloud/talk-desktop?tab=readme-ov-file#%EF%B8%8F-prerequisites 32 src = fetchzip { 33 url = "https://github.com/nextcloud-releases/talk-desktop/releases/download/v${finalAttrs.version}/Nextcloud.Talk-linux-x64.zip"; 34 hash = "sha256-Jozdyxd02LocmbRrR2pB7EtIRIjd988JtDhlCNbumks="; 35 stripRoot = false; 36 }; 37 38 icon = fetchurl { 39 url = "https://raw.githubusercontent.com/nextcloud/talk-desktop/refs/tags/v1.0.0/img/icons/icon.png"; 40 hash = "sha256-DteSSuxIs0ukIJrvUO/3Mrh5F2GG5UAVvGRZUuZonkg="; 41 }; 42 43 nativeBuildInputs = [ 44 autoPatchelfHook 45 copyDesktopItems 46 ]; 47 48 buildInputs = [ 49 nss 50 cairo 51 alsa-lib 52 at-spi2-core 53 pango 54 libdrm 55 libxkbcommon 56 gtk3 57 vivaldi-ffmpeg-codecs 58 libgbm 59 libGL 60 libglvnd 61 ] 62 ++ (with xorg; [ 63 libX11 64 libXcomposite 65 libXdamage 66 libXrandr 67 libXfixes 68 libXcursor 69 ]); 70 71 # Required to launch the application and proceed past the zygote_linux fork() process 72 # Fixes `Zygote could not fork` 73 runtimeDependencies = [ systemd ]; 74 75 desktopItems = [ 76 (makeDesktopItem { 77 type = "Application"; 78 name = "nextcloud-talk-desktop"; 79 desktopName = "Nextcloud Talk"; 80 comment = finalAttrs.meta.description; 81 exec = finalAttrs.meta.mainProgram; 82 icon = "nextcloud-talk-desktop"; 83 categories = [ "Chat" ]; 84 }) 85 ]; 86 87 preInstall = '' 88 mkdir -p $out/bin 89 mkdir -p $out/opt 90 91 cp -r $src/* $out/opt/ 92 ''; 93 94 installPhase = '' 95 runHook preInstall 96 97 # Link the application in $out/bin away from contents of `preInstall` 98 ln -s "$out/opt/Nextcloud Talk-linux-x64/Nextcloud Talk" $out/bin/nextcloud-talk-desktop 99 mkdir -p $out/share/icons/hicolor/512x512/apps 100 cp $icon $out/share/icons/hicolor/512x512/apps/nextcloud-talk-desktop.png 101 102 runHook postInstall 103 ''; 104 105 passthru.updateScript = nix-update-script { }; 106 107 meta = { 108 description = "Nextcloud Talk Desktop Client"; 109 homepage = "https://github.com/nextcloud/talk-desktop"; 110 changelog = "https://github.com/nextcloud/talk-desktop/blob/${finalAttrs.version}/CHANGELOG.md"; 111 license = lib.licenses.agpl3Only; 112 maintainers = with lib.maintainers; [ kashw2 ]; 113 mainProgram = "nextcloud-talk-desktop"; 114 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; 115 platforms = [ "x86_64-linux" ]; 116 }; 117})