1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash --pure --keep GITHUB_TOKEN -p nix git curl cacert nix-prefetch-git gzip
4 base_url_suffix
="https://pro-store-packages.uniontech.com/appstore/dists/eagle/appstore/binary-"
5 base_url_appendix
="/Packages.gz"
6 target_package
="com.tencent.wechat"
7 packages_file
="Packages.gz"
10 version
=() # TODO: Currently, there is no version differences between archs. This is reserved for future use.
13 for i
in amd64 arm64 loongarch64
15 current_url
=$base_url_suffix$i$base_url_appendix
16 curl
-A "Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" -v -L -O $current_url
17 current_version
=$
(zgrep -A 20 "Package: $target_package" "$packages_file" |
awk -v pkg
="$target_package" '
20 if ($0 ~ "^Package: "pkg) {
23 if (found && $1 == "Version:") {
29 version
+=("$current_version")
30 sha256sum
=$
(zgrep -A 20 "Package: $target_package" "$packages_file" |
awk -v pkg
="$target_package" '
33 if ($0 ~ "^Package: "pkg) {
36 if (found && $1 == "SHA256:") {
42 url
+=("https://pro-store-packages.uniontech.com/appstore/pool/appstore/c/com.tencent.wechat/com.tencent.wechat_"$version"_"$i".deb")
43 hash+=("$(nix hash to-sri --type sha256 $sha256sum)")
46 cat >sources.nix
<<EOF
47 # Generated by ./update.sh - do not update manually!
48 # Last updated: $(date +%F)
50 version = "${version[0]}";
51 amd64_url = "${url[0]}";
52 arm64_url = "${url[1]}";
53 loongarch64_url = "${url[2]}";
54 amd64_hash = "${hash[0]}";
55 arm64_hash = "${hash[1]}";
56 loongarch64_hash = "${hash[2]}";