wechat-uos: 1.0.0.238 -> 1.0.0.241
This commit is contained in:
parent
48705e5f4d
commit
1d2d850e72
@ -169,23 +169,25 @@ let
|
||||
bzip2
|
||||
];
|
||||
|
||||
sources = import ./sources.nix;
|
||||
|
||||
wechat = stdenvNoCC.mkDerivation
|
||||
rec {
|
||||
pname = "wechat-uos";
|
||||
version = "1.0.0.238";
|
||||
version = sources.version;
|
||||
|
||||
src = {
|
||||
x86_64-linux = fetchurl {
|
||||
url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_${version}_amd64.deb";
|
||||
hash = "sha256-NxAmZ526JaAzAjtAd9xScFnZBuwD6i2wX2/AEqtAyWs=";
|
||||
url = sources.amd64_url;
|
||||
hash = sources.amd64_hash;
|
||||
};
|
||||
aarch64-linux = fetchurl {
|
||||
url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_${version}_arm64.deb";
|
||||
hash = "sha256-3ru6KyBYXiuAlZuWhyyvtQCWbOJhGYzker3FS0788RE=";
|
||||
url = sources.arm64_url;
|
||||
hash = sources.arm64_hash;
|
||||
};
|
||||
loongarch64-linux = fetchurl {
|
||||
url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_${version}_loongarch64.deb";
|
||||
hash = "sha256-iuJeLMKD6v8J8iKw3+cyODN7PZQrLpi9p0//mkI0ujE=";
|
||||
url = sources.loongarch64_url;
|
||||
hash = sources.loongarch64_hash;
|
||||
};
|
||||
}.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported.");
|
||||
|
||||
@ -273,5 +275,7 @@ buildFHSEnv {
|
||||
'';
|
||||
targetPkgs = pkgs: [ wechat-uos-env ];
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
extraOutputsToInstall = [ "usr" "var/lib/uos" "var/uos" "etc" ];
|
||||
}
|
||||
|
11
pkgs/by-name/we/wechat-uos/sources.nix
Normal file
11
pkgs/by-name/we/wechat-uos/sources.nix
Normal file
@ -0,0 +1,11 @@
|
||||
# Generated by ./update.sh - do not update manually!
|
||||
# Last updated: 2024-05-06
|
||||
{
|
||||
version = "1.0.0.241";
|
||||
amd64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_1.0.0.241_amd64.deb";
|
||||
arm64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_1.0.0.241_arm64.deb";
|
||||
loongarch64_url = "https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_1.0.0.241_loongarch64.deb";
|
||||
amd64_hash = "sha256-J2ipc3byBzvVFe+B1k+nsgZo+mwRpBd6LtF/ybAzmKM=";
|
||||
arm64_hash = "sha256-5KA4ekhVdXoin/7VhuMbG8XIlx0w7vHAedZ1fnBOBYo=";
|
||||
loongarch64_hash = "sha256-kMMnb9jjOOtQFivLDu+aQctVMYeFHQ1fNg49AQE4yLk=";
|
||||
}
|
60
pkgs/by-name/we/wechat-uos/update.sh
Normal file
60
pkgs/by-name/we/wechat-uos/update.sh
Normal file
@ -0,0 +1,60 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash --pure --keep GITHUB_TOKEN -p nix git curl cacert nix-prefetch-git gzip
|
||||
|
||||
base_url_suffix="https://pro-store-packages.uniontech.com/appstore/dists/eagle/appstore/binary-"
|
||||
base_url_appendix="/Packages.gz"
|
||||
target_package="com.tencent.wechat"
|
||||
packages_file="Packages.gz"
|
||||
|
||||
url=()
|
||||
version=() # TODO: Currently, there is no version differences between archs. This is reserved for future use.
|
||||
hash=()
|
||||
|
||||
for i in amd64 arm64 loongarch64
|
||||
do
|
||||
current_url=$base_url_suffix$i$base_url_appendix
|
||||
curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" -v -L -O $current_url
|
||||
current_version=$(zgrep -A 20 "Package: $target_package" "$packages_file" | awk -v pkg="$target_package" '
|
||||
BEGIN { found = 0 }
|
||||
{
|
||||
if ($0 ~ "^Package: "pkg) {
|
||||
found = 1;
|
||||
}
|
||||
if (found && $1 == "Version:") {
|
||||
print $2;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
')
|
||||
version+=("$current_version")
|
||||
sha256sum=$(zgrep -A 20 "Package: $target_package" "$packages_file" | awk -v pkg="$target_package" '
|
||||
BEGIN { found = 0 }
|
||||
{
|
||||
if ($0 ~ "^Package: "pkg) {
|
||||
found = 1;
|
||||
}
|
||||
if (found && $1 == "SHA256:") {
|
||||
print $2;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
')
|
||||
url+=("https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_"$version"_"$i".deb")
|
||||
hash+=("$(nix hash to-sri --type sha256 $sha256sum)")
|
||||
done
|
||||
|
||||
cat >sources.nix <<EOF
|
||||
# Generated by ./update.sh - do not update manually!
|
||||
# Last updated: $(date +%F)
|
||||
{
|
||||
version = "${version[0]}";
|
||||
amd64_url = "${url[0]}";
|
||||
arm64_url = "${url[1]}";
|
||||
loongarch64_url = "${url[2]}";
|
||||
amd64_hash = "${hash[0]}";
|
||||
arm64_hash = "${hash[1]}";
|
||||
loongarch64_hash = "${hash[2]}";
|
||||
}
|
||||
EOF
|
||||
|
||||
rm -r Packages.gz
|
Loading…
Reference in New Issue
Block a user