slack: add prince213 to maintainers, clean up, 4.45.64 -> 4.45.69 (#438246)

authored by Gaétan Lepage and committed by GitHub c9ac135b fb38f865

+274 -254
+30
pkgs/by-name/sl/slack/darwin.nix
··· 1 + { 2 + pname, 3 + version, 4 + src, 5 + passthru, 6 + meta, 7 + 8 + stdenvNoCC, 9 + undmg, 10 + }: 11 + stdenvNoCC.mkDerivation { 12 + inherit 13 + pname 14 + version 15 + src 16 + passthru 17 + meta 18 + ; 19 + 20 + nativeBuildInputs = [ undmg ]; 21 + 22 + sourceRoot = "."; 23 + 24 + installPhase = '' 25 + runHook preInstall 26 + mkdir -p $out/Applications 27 + cp -a Slack.app $out/Applications 28 + runHook postInstall 29 + ''; 30 + }
+154
pkgs/by-name/sl/slack/linux.nix
··· 1 + { 2 + pname, 3 + version, 4 + src, 5 + passthru, 6 + meta, 7 + 8 + lib, 9 + stdenv, 10 + dpkg, 11 + makeWrapper, 12 + asar, 13 + alsa-lib, 14 + at-spi2-atk, 15 + at-spi2-core, 16 + atk, 17 + cairo, 18 + cups, 19 + curl, 20 + dbus, 21 + expat, 22 + fontconfig, 23 + freetype, 24 + gdk-pixbuf, 25 + glib, 26 + gtk3, 27 + libGL, 28 + libappindicator-gtk3, 29 + libdrm, 30 + libnotify, 31 + libpulseaudio, 32 + libuuid, 33 + libxcb, 34 + libxkbcommon, 35 + libgbm, 36 + nspr, 37 + nss, 38 + pango, 39 + pipewire, 40 + systemd, 41 + wayland, 42 + xdg-utils, 43 + xorg, 44 + }: 45 + stdenv.mkDerivation rec { 46 + inherit 47 + pname 48 + version 49 + src 50 + passthru 51 + meta 52 + ; 53 + 54 + rpath = 55 + lib.makeLibraryPath [ 56 + alsa-lib 57 + at-spi2-atk 58 + at-spi2-core 59 + atk 60 + cairo 61 + cups 62 + curl 63 + dbus 64 + expat 65 + fontconfig 66 + freetype 67 + gdk-pixbuf 68 + glib 69 + gtk3 70 + libGL 71 + libappindicator-gtk3 72 + libdrm 73 + libnotify 74 + libpulseaudio 75 + libuuid 76 + libxcb 77 + libxkbcommon 78 + libgbm 79 + nspr 80 + nss 81 + pango 82 + pipewire 83 + stdenv.cc.cc 84 + systemd 85 + wayland 86 + xorg.libX11 87 + xorg.libXScrnSaver 88 + xorg.libXcomposite 89 + xorg.libXcursor 90 + xorg.libXdamage 91 + xorg.libXext 92 + xorg.libXfixes 93 + xorg.libXi 94 + xorg.libXrandr 95 + xorg.libXrender 96 + xorg.libXtst 97 + xorg.libxkbfile 98 + xorg.libxshmfence 99 + ] 100 + + ":${lib.getLib stdenv.cc.cc}/lib64"; 101 + 102 + buildInputs = [ 103 + gtk3 # needed for GSETTINGS_SCHEMAS_PATH 104 + ]; 105 + 106 + nativeBuildInputs = [ 107 + dpkg 108 + makeWrapper 109 + asar 110 + ]; 111 + 112 + dontUnpack = true; 113 + dontBuild = true; 114 + dontPatchELF = true; 115 + 116 + installPhase = '' 117 + runHook preInstall 118 + 119 + # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here 120 + dpkg --fsys-tarfile $src | tar --extract 121 + rm -rf usr/share/lintian 122 + 123 + mkdir -p $out 124 + mv usr/* $out 125 + 126 + # Otherwise it looks "suspicious" 127 + chmod -R g-w $out 128 + 129 + for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do 130 + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true 131 + patchelf --set-rpath ${rpath}:$out/lib/slack $file || true 132 + done 133 + 134 + # Replace the broken bin/slack symlink with a startup wrapper. 135 + # Make xdg-open overrideable at runtime. 136 + rm $out/bin/slack 137 + makeWrapper $out/lib/slack/slack $out/bin/slack \ 138 + --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \ 139 + --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ 140 + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" 141 + 142 + # Fix the desktop link 143 + substituteInPlace $out/share/applications/slack.desktop \ 144 + --replace /usr/bin/ $out/bin/ \ 145 + --replace /usr/share/pixmaps/slack.png slack \ 146 + --replace bin/slack "bin/slack -s" 147 + 148 + # Prevent Un-blacklist pipewire integration to enable screen sharing on wayland. 149 + # https://github.com/flathub/com.slack.Slack/issues/101#issuecomment-1807073763 150 + sed -i -e 's/,"WebRTCPipeWireCapturer"/,"LebRTCPipeWireCapturer"/' $out/lib/slack/resources/app.asar 151 + 152 + runHook postInstall 153 + ''; 154 + }
+17 -217
pkgs/by-name/sl/slack/package.nix
··· 1 1 { 2 - lib, 3 - stdenv, 2 + callPackage, 4 3 fetchurl, 5 - dpkg, 6 - undmg, 7 - makeWrapper, 8 - asar, 9 - alsa-lib, 10 - at-spi2-atk, 11 - at-spi2-core, 12 - atk, 13 - cairo, 14 - cups, 15 - curl, 16 - dbus, 17 - expat, 18 - fontconfig, 19 - freetype, 20 - gdk-pixbuf, 21 - glib, 22 - gtk3, 23 - libGL, 24 - libappindicator-gtk3, 25 - libdrm, 26 - libnotify, 27 - libpulseaudio, 28 - libuuid, 29 - libxcb, 30 - libxkbcommon, 31 - libxshmfence, 32 - libgbm, 33 - nspr, 34 - nss, 35 - pango, 36 - pipewire, 37 - systemd, 38 - wayland, 39 - xdg-utils, 40 - xorg, 4 + lib, 5 + stdenvNoCC, 41 6 }: 42 7 43 8 let 44 - inherit (stdenv.hostPlatform) system; 45 - throwSystem = throw "slack does not support system: ${system}"; 9 + inherit (stdenvNoCC.hostPlatform) system; 10 + sources = import ./sources.nix { inherit fetchurl; }; 46 11 47 12 pname = "slack"; 48 13 49 - x86_64-darwin-version = "4.45.64"; 50 - x86_64-darwin-sha256 = "0skhh16lc0czxd5ifkqy39hibk4ydlfhn41zdif3hl0sd4vcqbvb"; 51 - 52 - x86_64-linux-version = "4.45.64"; 53 - x86_64-linux-sha256 = "7c6af86ab1d5778aec930d4e7d77b9f9948a83a87e8458e821d6f9e8dfed180f"; 54 - 55 - aarch64-darwin-version = "4.45.64"; 56 - aarch64-darwin-sha256 = "136crd17ybaznp680qb2rl0c8cllkkv21ymf3dck2jhkqbp7v2kj"; 14 + passthru = { 15 + updateScript = ./update.sh; 16 + }; 57 17 58 - version = 59 - { 60 - x86_64-darwin = x86_64-darwin-version; 61 - x86_64-linux = x86_64-linux-version; 62 - aarch64-darwin = aarch64-darwin-version; 63 - } 64 - .${system} or throwSystem; 65 - 66 - src = 67 - let 68 - base = "https://downloads.slack-edge.com"; 69 - in 70 - { 71 - x86_64-darwin = fetchurl { 72 - url = "${base}/desktop-releases/mac/universal/${version}/Slack-${version}-macOS.dmg"; 73 - sha256 = x86_64-darwin-sha256; 74 - }; 75 - x86_64-linux = fetchurl { 76 - url = "${base}/desktop-releases/linux/x64/${version}/slack-desktop-${version}-amd64.deb"; 77 - sha256 = x86_64-linux-sha256; 78 - }; 79 - aarch64-darwin = fetchurl { 80 - url = "${base}/desktop-releases/mac/arm64/${version}/Slack-${version}-macOS.dmg"; 81 - sha256 = aarch64-darwin-sha256; 82 - }; 83 - } 84 - .${system} or throwSystem; 85 - 86 - meta = with lib; { 18 + meta = { 87 19 description = "Desktop client for Slack"; 88 20 homepage = "https://slack.com"; 89 21 changelog = "https://slack.com/release-notes"; 90 - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 91 - license = licenses.unfree; 92 - maintainers = with maintainers; [ 22 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 23 + license = lib.licenses.unfree; 24 + maintainers = with lib.maintainers; [ 93 25 mmahut 26 + prince213 94 27 teutat3s 95 28 ]; 96 29 platforms = [ ··· 100 33 ]; 101 34 mainProgram = "slack"; 102 35 }; 103 - 104 - linux = stdenv.mkDerivation rec { 105 - inherit 106 - pname 107 - version 108 - src 109 - meta 110 - ; 111 - 112 - passthru.updateScript = ./update.sh; 113 - 114 - rpath = 115 - lib.makeLibraryPath [ 116 - alsa-lib 117 - at-spi2-atk 118 - at-spi2-core 119 - atk 120 - cairo 121 - cups 122 - curl 123 - dbus 124 - expat 125 - fontconfig 126 - freetype 127 - gdk-pixbuf 128 - glib 129 - gtk3 130 - libGL 131 - libappindicator-gtk3 132 - libdrm 133 - libnotify 134 - libpulseaudio 135 - libuuid 136 - libxcb 137 - libxkbcommon 138 - libgbm 139 - nspr 140 - nss 141 - pango 142 - pipewire 143 - stdenv.cc.cc 144 - systemd 145 - wayland 146 - xorg.libX11 147 - xorg.libXScrnSaver 148 - xorg.libXcomposite 149 - xorg.libXcursor 150 - xorg.libXdamage 151 - xorg.libXext 152 - xorg.libXfixes 153 - xorg.libXi 154 - xorg.libXrandr 155 - xorg.libXrender 156 - xorg.libXtst 157 - xorg.libxkbfile 158 - xorg.libxshmfence 159 - ] 160 - + ":${lib.getLib stdenv.cc.cc}/lib64"; 161 - 162 - buildInputs = [ 163 - gtk3 # needed for GSETTINGS_SCHEMAS_PATH 164 - ]; 165 - 166 - nativeBuildInputs = [ 167 - dpkg 168 - makeWrapper 169 - asar 170 - ]; 171 - 172 - dontUnpack = true; 173 - dontBuild = true; 174 - dontPatchELF = true; 175 - 176 - installPhase = '' 177 - runHook preInstall 178 - 179 - # The deb file contains a setuid binary, so 'dpkg -x' doesn't work here 180 - dpkg --fsys-tarfile $src | tar --extract 181 - rm -rf usr/share/lintian 182 - 183 - mkdir -p $out 184 - mv usr/* $out 185 - 186 - # Otherwise it looks "suspicious" 187 - chmod -R g-w $out 188 - 189 - for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do 190 - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true 191 - patchelf --set-rpath ${rpath}:$out/lib/slack $file || true 192 - done 193 - 194 - # Replace the broken bin/slack symlink with a startup wrapper. 195 - # Make xdg-open overrideable at runtime. 196 - rm $out/bin/slack 197 - makeWrapper $out/lib/slack/slack $out/bin/slack \ 198 - --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \ 199 - --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ 200 - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}}" 201 - 202 - # Fix the desktop link 203 - substituteInPlace $out/share/applications/slack.desktop \ 204 - --replace /usr/bin/ $out/bin/ \ 205 - --replace /usr/share/pixmaps/slack.png slack \ 206 - --replace bin/slack "bin/slack -s" 207 - '' 208 - + lib.optionalString stdenv.hostPlatform.isLinux '' 209 - # Prevent Un-blacklist pipewire integration to enable screen sharing on wayland. 210 - # https://github.com/flathub/com.slack.Slack/issues/101#issuecomment-1807073763 211 - sed -i -e 's/,"WebRTCPipeWireCapturer"/,"LebRTCPipeWireCapturer"/' $out/lib/slack/resources/app.asar 212 - '' 213 - + '' 214 - runHook postInstall 215 - ''; 216 - }; 217 - 218 - darwin = stdenv.mkDerivation { 219 - inherit 220 - pname 221 - version 222 - src 223 - meta 224 - ; 225 - 226 - passthru.updateScript = ./update.sh; 227 - 228 - nativeBuildInputs = [ undmg ]; 229 - 230 - sourceRoot = "Slack.app"; 231 - 232 - installPhase = '' 233 - runHook preInstall 234 - mkdir -p $out/Applications/Slack.app 235 - cp -R . $out/Applications/Slack.app 236 - runHook postInstall 237 - ''; 238 - }; 239 36 in 240 - if stdenv.hostPlatform.isDarwin then darwin else linux 37 + callPackage (if stdenvNoCC.hostPlatform.isDarwin then ./darwin.nix else ./linux.nix) { 38 + inherit pname passthru meta; 39 + inherit (sources.${system} or (throw "Unsupported system: ${system}")) version src; 40 + }
+26
pkgs/by-name/sl/slack/sources.nix
··· 1 + # Generated by ./update.sh - do not update manually! 2 + # Last updated: 2025-08-29 3 + { fetchurl }: 4 + { 5 + aarch64-darwin = { 6 + version = "4.45.69"; 7 + src = fetchurl { 8 + url = "https://downloads.slack-edge.com/desktop-releases/mac/arm64/4.45.69/Slack-4.45.69-macOS.dmg"; 9 + hash = "sha256-MaPwj0niehwNYiSl8GdzKSF1mezKtIFiAmZzBWbwq9A="; 10 + }; 11 + }; 12 + x86_64-darwin = { 13 + version = "4.45.69"; 14 + src = fetchurl { 15 + url = "https://downloads.slack-edge.com/desktop-releases/mac/x64/4.45.69/Slack-4.45.69-macOS.dmg"; 16 + hash = "sha256-iO5hGzYYmrHoTznw++AEhGjTKiTngzA9/ho+oFGXVeI="; 17 + }; 18 + }; 19 + x86_64-linux = { 20 + version = "4.45.69"; 21 + src = fetchurl { 22 + url = "https://downloads.slack-edge.com/desktop-releases/linux/x64/4.45.69/slack-desktop-4.45.69-amd64.deb"; 23 + hash = "sha256-CwM8oEyRBkE5FSBO5rl4ygRuLtaRefVVZpAEHKxXKcw="; 24 + }; 25 + }; 26 + }
+47 -37
pkgs/by-name/sl/slack/update.sh
··· 1 1 #!/usr/bin/env nix-shell 2 - #! nix-shell -i bash -p curl gnused 2 + #! nix-shell -i bash --pure -p cacert curl jq nix 3 3 4 - set -eou pipefail 4 + set -euo pipefail 5 5 6 - latest_linux_data="$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=x64&variant=deb')" 7 - latest_mac_data="$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=universal&variant=dmg')" 8 - latest_mac_arm_data="$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=arm64&variant=dmg')" 6 + cd $(readlink -e $(dirname "${BASH_SOURCE[0]}")) 9 7 10 - latest_linux_version="$(echo ${latest_linux_data} | jq -rc '.version')" 11 - latest_mac_version="$(echo ${latest_mac_data} | jq -rc '.version')" 12 - latest_mac_arm_version="$(echo ${latest_mac_arm_data} | jq -rc '.version')" 8 + aarch64_darwin_data=$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=arm64&variant=dmg') 9 + x86_64_darwin_data=$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=x64&variant=dmg') 10 + x86_64_linux_data=$(curl -s 'https://slack.com/api/desktop.latestRelease?arch=x64&variant=deb') 13 11 14 - nixpkgs="$(git rev-parse --show-toplevel)" 15 - slack_nix="$nixpkgs/pkgs/by-name/sl/slack/package.nix" 16 - nixpkgs_linux_version=$(cat "$slack_nix" | sed -n 's/.*x86_64-linux-version = \"\([0-9\.]\+\)\";.*/\1/p') 17 - nixpkgs_mac_version=$(cat "$slack_nix" | sed -n 's/.*x86_64-darwin-version = \"\([0-9\.]\+\)\";.*/\1/p') 18 - nixpkgs_mac_arm_version=$(cat "$slack_nix" | sed -n 's/.*aarch64-darwin-version = \"\([0-9\.]\+\)\";.*/\1/p') 12 + aarch64_darwin_version=$(jq -r .version <<< "$aarch64_darwin_data") 13 + x86_64_darwin_version=$(jq -r .version <<< "$x86_64_darwin_data") 14 + x86_64_linux_version=$(jq -r .version <<< "$x86_64_linux_data") 19 15 20 - if [[ "$nixpkgs_linux_version" == "$latest_linux_version" && \ 21 - "$nixpkgs_mac_version" == "$latest_mac_version" && \ 22 - "$nixpkgs_mac_arm_version" == "$latest_mac_version" ]]; then 23 - echo "nixpkgs versions are all up to date!" 24 - exit 0 25 - fi 16 + aarch64_darwin_url=$(jq -r .download_url <<< "$aarch64_darwin_data") 17 + x86_64_darwin_url=$(jq -r .download_url <<< "$x86_64_darwin_data") 18 + x86_64_linux_url=$(jq -r .download_url <<< "$x86_64_linux_data") 26 19 27 - linux_url="$(echo ${latest_linux_data} | jq -rc '.download_url')" 28 - mac_url="$(echo ${latest_mac_data} | jq -rc '.download_url')" 29 - mac_arm_url="$(echo ${latest_mac_arm_data} | jq -rc '.download_url')" 30 - linux_sha256=$(nix-prefetch-url ${linux_url}) 31 - mac_sha256=$(nix-prefetch-url ${mac_url}) 32 - mac_arm_sha256=$(nix-prefetch-url ${mac_arm_url}) 20 + aarch64_darwin_hash=$(nix-prefetch-url "$aarch64_darwin_url") 21 + x86_64_darwin_hash=$(nix-prefetch-url "$x86_64_darwin_url") 22 + x86_64_linux_hash=$(nix-prefetch-url "$x86_64_linux_url") 33 23 34 - sed -i "s/x86_64-linux-version = \".*\"/x86_64-linux-version = \"${latest_linux_version}\"/" "$slack_nix" 35 - sed -i "s/x86_64-darwin-version = \".*\"/x86_64-darwin-version = \"${latest_mac_version}\"/" "$slack_nix" 36 - sed -i "s/aarch64-darwin-version = \".*\"/aarch64-darwin-version = \"${latest_mac_version}\"/" "$slack_nix" 37 - sed -i "s/x86_64-linux-sha256 = \".*\"/x86_64-linux-sha256 = \"${linux_sha256}\"/" "$slack_nix" 38 - sed -i "s/x86_64-darwin-sha256 = \".*\"/x86_64-darwin-sha256 = \"${mac_sha256}\"/" "$slack_nix" 39 - sed -i "s/aarch64-darwin-sha256 = \".*\"/aarch64-darwin-sha256 = \"${mac_arm_sha256}\"/" "$slack_nix" 24 + # use friendlier hashes 40 25 41 - if ! nix-build -A slack "$nixpkgs" --arg config '{ allowUnfree = true; }'; then 42 - echo "The updated slack failed to build." 43 - exit 1 44 - fi 26 + aarch64_darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$aarch64_darwin_hash") 27 + x86_64_darwin_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$x86_64_darwin_hash") 28 + x86_64_linux_hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$x86_64_linux_hash") 45 29 46 - echo "Successfully updated" 47 - echo "slack: $nixpkgs_linux_version -> $latest_linux_version" 30 + cat >sources.nix <<EOF 31 + # Generated by ./update.sh - do not update manually! 32 + # Last updated: $(date +%F) 33 + { fetchurl }: 34 + { 35 + aarch64-darwin = { 36 + version = "$aarch64_darwin_version"; 37 + src = fetchurl { 38 + url = "$aarch64_darwin_url"; 39 + hash = "$aarch64_darwin_hash"; 40 + }; 41 + }; 42 + x86_64-darwin = { 43 + version = "$x86_64_darwin_version"; 44 + src = fetchurl { 45 + url = "$x86_64_darwin_url"; 46 + hash = "$x86_64_darwin_hash"; 47 + }; 48 + }; 49 + x86_64-linux = { 50 + version = "$x86_64_linux_version"; 51 + src = fetchurl { 52 + url = "$x86_64_linux_url"; 53 + hash = "$x86_64_linux_hash"; 54 + }; 55 + }; 56 + } 57 + EOF