From 2e92942bd137f5a1811fef64a1094bfa59ca98b4 Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Tue, 17 Jun 2025 18:17:35 +0800 Subject: [PATCH 1/4] qq: add prince213 to maintainers --- pkgs/by-name/qq/qq/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/qq/qq/package.nix b/pkgs/by-name/qq/qq/package.nix index b5cf57432e8b..715aba6b6668 100644 --- a/pkgs/by-name/qq/qq/package.nix +++ b/pkgs/by-name/qq/qq/package.nix @@ -128,8 +128,9 @@ stdenv.mkDerivation { license = lib.licenses.unfree; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; maintainers = with lib.maintainers; [ - fee1-dead bot-wxt1221 + fee1-dead + prince213 ]; }; } From 0119a82552b1236b85ee84ede2f85c6ed68898b6 Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Tue, 17 Jun 2025 18:31:32 +0800 Subject: [PATCH 2/4] qq: refactor update script --- pkgs/by-name/qq/qq/package.nix | 20 +++++------------ pkgs/by-name/qq/qq/sources.nix | 20 ++++++++++++----- pkgs/by-name/qq/qq/update.sh | 39 ++++++++++++++++++++++------------ 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/pkgs/by-name/qq/qq/package.nix b/pkgs/by-name/qq/qq/package.nix index 715aba6b6668..9728db8584d3 100644 --- a/pkgs/by-name/qq/qq/package.nix +++ b/pkgs/by-name/qq/qq/package.nix @@ -29,24 +29,14 @@ }: let - sources = import ./sources.nix; - srcs = { - x86_64-linux = fetchurl { - url = sources.amd64_url; - hash = sources.amd64_hash; - }; - aarch64-linux = fetchurl { - url = sources.arm64_url; - hash = sources.arm64_hash; - }; - }; - src = - srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + sources = import ./sources.nix { inherit fetchurl; }; + source = + sources.${stdenv.hostPlatform.system} + or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); in stdenv.mkDerivation { pname = "qq"; - version = sources.version; - inherit src; + inherit (source) version src; nativeBuildInputs = [ autoPatchelfHook diff --git a/pkgs/by-name/qq/qq/sources.nix b/pkgs/by-name/qq/qq/sources.nix index 0070dfbc8d4e..c408746b915e 100644 --- a/pkgs/by-name/qq/qq/sources.nix +++ b/pkgs/by-name/qq/qq/sources.nix @@ -1,9 +1,19 @@ # Generated by ./update.sh - do not update manually! # Last updated: 2025-05-30 +{ fetchurl }: { - version = "3.2.17-2025.5.21"; - amd64_url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_amd64_01.deb"; - arm64_url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_arm64_01.deb"; - arm64_hash = "sha256-PdZ9yHyyx55Y6J59ZsjDsXhXHyNkk1JBS9K0i0vuX/Q="; - amd64_hash = "sha256-BG6Qz+hquexSa5QCwWx6vucb4TS0dUQ6UYKB/zkkI1g="; + aarch64-linux = { + version = "3.2.17-2025.5.21"; + src = fetchurl { + url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_arm64_01.deb"; + hash = "sha256-PdZ9yHyyx55Y6J59ZsjDsXhXHyNkk1JBS9K0i0vuX/Q="; + }; + }; + x86_64-linux = { + version = "3.2.17-2025.5.21"; + src = fetchurl { + url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_amd64_01.deb"; + hash = "sha256-BG6Qz+hquexSa5QCwWx6vucb4TS0dUQ6UYKB/zkkI1g="; + }; + }; } diff --git a/pkgs/by-name/qq/qq/update.sh b/pkgs/by-name/qq/qq/update.sh index 0784b89dc622..12304716f632 100755 --- a/pkgs/by-name/qq/qq/update.sh +++ b/pkgs/by-name/qq/qq/update.sh @@ -5,27 +5,40 @@ set -euo pipefail cd $(readlink -e $(dirname "${BASH_SOURCE[0]}")) -payload=$(curl https://im.qq.com/rainbow/linuxQQDownload | grep -oP "var params= \K\{.*\}(?=;)") -amd64_url=$(jq -r .x64DownloadUrl.deb <<< "$payload") -arm64_url=$(jq -r .armDownloadUrl.deb <<< "$payload") +# linux -version=$(jq -r .version <<< "$payload")-$(jq -r .updateDate <<< "$payload") +linux_url=$(curl -s https://im.qq.com/linuxqq/index.shtml | grep -oP 'var rainbowConfigUrl = "\K.*(?=";)') +linux_payload=$(curl "$linux_url" | grep -oP "var params= \K\{.*\}(?=;)") +linux_version=$(jq -r .version <<< "$linux_payload")-$(jq -r .updateDate <<< "$linux_payload") -amd64_hash=$(nix-prefetch-url $amd64_url) -arm64_hash=$(nix-prefetch-url $arm64_url) +linux_aarch64_url=$(jq -r .armDownloadUrl.deb <<< "$linux_payload") +linux_x86_64_url=$(jq -r .x64DownloadUrl.deb <<< "$linux_payload") + +linux_aarch64_hash=$(nix-prefetch-url $linux_aarch64_url) +linux_x86_64_hash=$(nix-prefetch-url $linux_x86_64_url) # use friendlier hashes -amd64_hash=$(nix hash convert --to sri --hash-algo sha256 "$amd64_hash") -arm64_hash=$(nix hash convert --to sri --hash-algo sha256 "$arm64_hash") +linux_aarch64_hash=$(nix hash convert --to sri --hash-algo sha256 "$linux_aarch64_hash") +linux_x86_64_hash=$(nix hash convert --to sri --hash-algo sha256 "$linux_x86_64_hash") cat >sources.nix < Date: Tue, 17 Jun 2025 18:34:37 +0800 Subject: [PATCH 3/4] qq: 3.2.17-2025.5.21 -> 3.2.18-2025.6.16 --- pkgs/by-name/qq/qq/sources.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/qq/qq/sources.nix b/pkgs/by-name/qq/qq/sources.nix index c408746b915e..43684d278684 100644 --- a/pkgs/by-name/qq/qq/sources.nix +++ b/pkgs/by-name/qq/qq/sources.nix @@ -1,19 +1,19 @@ # Generated by ./update.sh - do not update manually! -# Last updated: 2025-05-30 +# Last updated: 2025-06-17 { fetchurl }: { aarch64-linux = { - version = "3.2.17-2025.5.21"; + version = "3.2.18-2025.6.16"; src = fetchurl { - url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_arm64_01.deb"; - hash = "sha256-PdZ9yHyyx55Y6J59ZsjDsXhXHyNkk1JBS9K0i0vuX/Q="; + url = "https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.18_250616_arm64_01.deb"; + hash = "sha256-wwZC+hyyrmmjhlk4hdJTnf5WkRxjit6smUmD4jPKbM0="; }; }; x86_64-linux = { - version = "3.2.17-2025.5.21"; + version = "3.2.18-2025.6.16"; src = fetchurl { - url = "https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.17_250521_amd64_01.deb"; - hash = "sha256-BG6Qz+hquexSa5QCwWx6vucb4TS0dUQ6UYKB/zkkI1g="; + url = "https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.18_250616_amd64_01.deb"; + hash = "sha256-7/c1PwlcWogXO229e7f1gYWktCT+hpyQI1+22TkvzLQ="; }; }; } From 78d1e97dc817ed9240150ba0a839de221bbd6953 Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Tue, 17 Jun 2025 18:53:53 +0800 Subject: [PATCH 4/4] qq: init darwin at 6.9.75-2025.6.16 --- pkgs/by-name/qq/qq/package.nix | 185 +++++++++++++++++++-------------- pkgs/by-name/qq/qq/sources.nix | 11 ++ pkgs/by-name/qq/qq/update.sh | 24 +++++ 3 files changed, 144 insertions(+), 76 deletions(-) diff --git a/pkgs/by-name/qq/qq/package.nix b/pkgs/by-name/qq/qq/package.nix index 9728db8584d3..fb48240150e5 100644 --- a/pkgs/by-name/qq/qq/package.nix +++ b/pkgs/by-name/qq/qq/package.nix @@ -20,6 +20,7 @@ xorg, systemd, stdenv, + undmg, vips, at-spi2-core, autoPatchelfHook, @@ -33,87 +34,19 @@ let source = sources.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); -in -stdenv.mkDerivation { pname = "qq"; inherit (source) version src; - - nativeBuildInputs = [ - autoPatchelfHook - makeShellWrapper - wrapGAppsHook3 - dpkg - ]; - - buildInputs = [ - alsa-lib - at-spi2-core - cups - glib - gtk3 - libdrm - libpulseaudio - libgcrypt - libkrb5 - libgbm - nss - vips - xorg.libXdamage - ]; - - dontWrapGApps = true; - - runtimeDependencies = map lib.getLib [ - systemd - libkrb5 - ]; - - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - cp -r opt $out/opt - cp -r usr/share $out/share - substituteInPlace $out/share/applications/qq.desktop \ - --replace-fail "/opt/QQ/qq" "$out/bin/qq" \ - --replace-fail "/usr/share" "$out/share" - makeShellWrapper $out/opt/QQ/qq $out/bin/qq \ - --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \ - --prefix LD_PRELOAD : "${lib.makeLibraryPath [ libssh2 ]}/libssh2.so.1" \ - --prefix LD_LIBRARY_PATH : "${ - lib.makeLibraryPath [ - libGL - libuuid - ] - }" \ - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ - --add-flags ${lib.escapeShellArg commandLineArgs} \ - "''${gappsWrapperArgs[@]}" - - # Remove bundled libraries - rm -r $out/opt/QQ/resources/app/sharp-lib - - # https://aur.archlinux.org/cgit/aur.git/commit/?h=linuxqq&id=f7644776ee62fa20e5eb30d0b1ba832513c77793 - rm -r $out/opt/QQ/resources/app/libssh2.so.1 - - # https://github.com/microcai/gentoo-zh/commit/06ad5e702327adfe5604c276635ae8a373f7d29e - ln -s ${libayatana-appindicator}/lib/libayatana-appindicator3.so \ - $out/opt/QQ/libappindicator3.so - - ln -s ${libnotify}/lib/libnotify.so \ - $out/opt/QQ/libnotify.so - - runHook postInstall - ''; - - passthru.updateScript = ./update.sh; - + passthru = { + updateScript = ./update.sh; + }; meta = { - homepage = "https://im.qq.com/linuxqq/"; + homepage = "https://im.qq.com/index/"; description = "Messaging app"; platforms = [ - "x86_64-linux" + "aarch64-darwin" "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" ]; license = lib.licenses.unfree; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; @@ -123,4 +56,104 @@ stdenv.mkDerivation { prince213 ]; }; -} +in +if stdenv.hostPlatform.isDarwin then + stdenv.mkDerivation { + inherit + pname + version + src + passthru + meta + ; + + nativeBuildInputs = [ undmg ]; + sourceRoot = "."; + + installPhase = '' + runHook preInstall + + mkdir -p $out/Applications + cp -a QQ.app $out/Applications + + runHook postInstall + ''; + } +else + stdenv.mkDerivation { + inherit + pname + version + src + passthru + meta + ; + + nativeBuildInputs = [ + autoPatchelfHook + makeShellWrapper + wrapGAppsHook3 + dpkg + ]; + + buildInputs = [ + alsa-lib + at-spi2-core + cups + glib + gtk3 + libdrm + libpulseaudio + libgcrypt + libkrb5 + libgbm + nss + vips + xorg.libXdamage + ]; + + dontWrapGApps = true; + + runtimeDependencies = map lib.getLib [ + systemd + libkrb5 + ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp -r opt $out/opt + cp -r usr/share $out/share + substituteInPlace $out/share/applications/qq.desktop \ + --replace-fail "/opt/QQ/qq" "$out/bin/qq" \ + --replace-fail "/usr/share" "$out/share" + makeShellWrapper $out/opt/QQ/qq $out/bin/qq \ + --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \ + --prefix LD_PRELOAD : "${lib.makeLibraryPath [ libssh2 ]}/libssh2.so.1" \ + --prefix LD_LIBRARY_PATH : "${ + lib.makeLibraryPath [ + libGL + libuuid + ] + }" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \ + --add-flags ${lib.escapeShellArg commandLineArgs} \ + "''${gappsWrapperArgs[@]}" + + # Remove bundled libraries + rm -r $out/opt/QQ/resources/app/sharp-lib + + # https://aur.archlinux.org/cgit/aur.git/commit/?h=linuxqq&id=f7644776ee62fa20e5eb30d0b1ba832513c77793 + rm -r $out/opt/QQ/resources/app/libssh2.so.1 + + # https://github.com/microcai/gentoo-zh/commit/06ad5e702327adfe5604c276635ae8a373f7d29e + ln -s ${libayatana-appindicator}/lib/libayatana-appindicator3.so \ + $out/opt/QQ/libappindicator3.so + + ln -s ${libnotify}/lib/libnotify.so \ + $out/opt/QQ/libnotify.so + + runHook postInstall + ''; + } diff --git a/pkgs/by-name/qq/qq/sources.nix b/pkgs/by-name/qq/qq/sources.nix index 43684d278684..6b16cd97f70c 100644 --- a/pkgs/by-name/qq/qq/sources.nix +++ b/pkgs/by-name/qq/qq/sources.nix @@ -1,7 +1,18 @@ # Generated by ./update.sh - do not update manually! # Last updated: 2025-06-17 { fetchurl }: +let + any-darwin = { + version = "6.9.75-2025.6.16"; + src = fetchurl { + url = "https://dldir1v6.qq.com/qqfile/qq/QQNT/Mac/QQ_6.9.75_250616_01.dmg"; + hash = "sha256-MS2WGrAuBGlbzzxfUlcixoD1snchEaLu4Ecvt84Hdfo="; + }; + }; +in { + aarch64-darwin = any-darwin; + x86_64-darwin = any-darwin; aarch64-linux = { version = "3.2.18-2025.6.16"; src = fetchurl { diff --git a/pkgs/by-name/qq/qq/update.sh b/pkgs/by-name/qq/qq/update.sh index 12304716f632..e281dbf08b72 100755 --- a/pkgs/by-name/qq/qq/update.sh +++ b/pkgs/by-name/qq/qq/update.sh @@ -5,6 +5,19 @@ set -euo pipefail cd $(readlink -e $(dirname "${BASH_SOURCE[0]}")) +# darwin + +darwin_url=$(curl -s https://im.qq.com/macqq/index.shtml | grep -oP 'var rainbowConfigUrl = "\K.*(?=";)') +darwin_payload=$(curl "$darwin_url" | grep -oP "var params= \K\{.*\}(?=;)") +darwin_version=$(jq -r .version <<< "$darwin_payload" | awk -F\ '{print $1}')-$(jq -r .updateDate <<< "$darwin_payload") + +darwin_url=$(jq -r .downloadUrl <<< "$darwin_payload") + +darwin_hash=$(nix-prefetch-url $darwin_url) + +# use friendlier hashes +darwin_hash=$(nix hash convert --to sri --hash-algo sha256 "$darwin_hash") + # linux linux_url=$(curl -s https://im.qq.com/linuxqq/index.shtml | grep -oP 'var rainbowConfigUrl = "\K.*(?=";)') @@ -25,7 +38,18 @@ cat >sources.nix <