qq: 3.2.17-2025.5.21 -> 3.2.18-2025.6.16 and init darwin at 6.9.75-2025.6.16 (#417506)

This commit is contained in:
Aleksana 2025-06-21 21:06:58 +08:00 committed by GitHub
commit 1c86961dab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 193 additions and 111 deletions

View File

@ -20,6 +20,7 @@
xorg,
systemd,
stdenv,
undmg,
vips,
at-spi2-core,
autoPatchelfHook,
@ -29,107 +30,130 @@
}:
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}");
in
stdenv.mkDerivation {
sources = import ./sources.nix { inherit fetchurl; };
source =
sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
pname = "qq";
version = sources.version;
inherit 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;
inherit (source) version src;
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 ];
maintainers = with lib.maintainers; [
fee1-dead
bot-wxt1221
fee1-dead
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
'';
}

View File

@ -1,9 +1,30 @@
# Generated by ./update.sh - do not update manually!
# Last updated: 2025-05-30
# 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
{
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-darwin = any-darwin;
x86_64-darwin = any-darwin;
aarch64-linux = {
version = "3.2.18-2025.6.16";
src = fetchurl {
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.18-2025.6.16";
src = fetchurl {
url = "https://dldir1v6.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.18_250616_amd64_01.deb";
hash = "sha256-7/c1PwlcWogXO229e7f1gYWktCT+hpyQI1+22TkvzLQ=";
};
};
}

View File

@ -5,27 +5,64 @@ 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")
# darwin
version=$(jq -r .version <<< "$payload")-$(jq -r .updateDate <<< "$payload")
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")
amd64_hash=$(nix-prefetch-url $amd64_url)
arm64_hash=$(nix-prefetch-url $arm64_url)
darwin_url=$(jq -r .downloadUrl <<< "$darwin_payload")
darwin_hash=$(nix-prefetch-url $darwin_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")
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.*(?=";)')
linux_payload=$(curl "$linux_url" | grep -oP "var params= \K\{.*\}(?=;)")
linux_version=$(jq -r .version <<< "$linux_payload")-$(jq -r .updateDate <<< "$linux_payload")
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
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 <<EOF
# Generated by ./update.sh - do not update manually!
# Last updated: $(date +%F)
{ fetchurl }:
let
any-darwin = {
version = "$darwin_version";
src = fetchurl {
url = "$darwin_url";
hash = "$darwin_hash";
};
};
in
{
version = "$version";
amd64_url = "$amd64_url";
arm64_url = "$arm64_url";
arm64_hash = "$arm64_hash";
amd64_hash = "$amd64_hash";
aarch64-darwin = any-darwin;
x86_64-darwin = any-darwin;
aarch64-linux = {
version = "$linux_version";
src = fetchurl {
url = "$linux_aarch64_url";
hash = "$linux_aarch64_hash";
};
};
x86_64-linux = {
version = "$linux_version";
src = fetchurl {
url = "$linux_x86_64_url";
hash = "$linux_x86_64_hash";
};
};
}
EOF