DeepChirp pushed to branch main at Arch Linux / Packaging / Packages / sing-box


Commits:
642ba59d by DeepChirp at 2026-08-13T14:14:29+08:00
Remove bundled libraries

- - - - -


2 changed files:

- .SRCINFO
- PKGBUILD


Changes:

=====================================
.SRCINFO
=====================================
@@ -13,19 +13,25 @@ pkgbase = sing-box
        makedepends = lld
        makedepends = llvm
        makedepends = ninja
-       depends = glibc>=2.31
+       makedepends = python
+       depends = glibc
+       depends = brotli
+       depends = zstd
+       depends = zlib
        optdepends = sing-geosite-rule-set: GeoSite rule sets
        optdepends = sing-geoip-rule-set: GeoIP rule sets
        backup = etc/sing-box/config.json
        source = 
sing-box-1.13.18.tar.gz::https://github.com/SagerNet/sing-box/archive/v1.13.18.tar.gz
-       source = 
cronet-go::git+https://github.com/SagerNet/cronet-go.git#commit=7e27f60f7f04a1c762b6bb69b4a44d7b24cd7a5d
-       source = 
naiveproxy::git+https://github.com/SagerNet/naiveproxy.git#branch=cronet-go
+       source = 
git+https://github.com/SagerNet/cronet-go.git#commit=7e27f60f7f04a1c762b6bb69b4a44d7b24cd7a5d
+       source = git+https://github.com/SagerNet/naiveproxy.git#branch=cronet-go
        source = 0001-build-use-the-system-toolchain.patch
        source = 0002-build-drop-unknown-clang-flag.patch
+       source = 
https://github.com/chromium/chromium/raw/refs/tags/150.0.7871.63/tools/generate_shim_headers/generate_shim_headers.py
        sha256sums = 
e41ed9d7adecd7597c1d5cc91818366a9538d94b41c244225ac40ac948c643f5
        sha256sums = 
46501331925bc53f58ff5497fe0aa42f7e65ddcbd313b52cfd63755240f48c02
        sha256sums = SKIP
        sha256sums = 
58c83e0ab0587a8bb020d98ee5cd787e32f692041824b2ae6b78812ec912c5a0
        sha256sums = 
b941918a0af49840bd929d16be947cc473b0c8b27a4ceab16da34e9b288a57dd
+       sha256sums = 
b64f3bc06e74955d1027e3720a2ef14b6203722a5e7fe4c777a6b1051b9744dd
 
 pkgname = sing-box


=====================================
PKGBUILD
=====================================
@@ -11,21 +11,31 @@ arch=('x86_64')
 url='https://sing-box.sagernet.org/'
 license=("GPL-3.0-or-later" "LicenseRef-${pkgname}-exception")
 
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/SagerNet/sing-box/archive/v${pkgver}.tar.gz";
-        
"cronet-go::git+https://github.com/SagerNet/cronet-go.git#commit=${_cronet_commit_hash}";
-        
"naiveproxy::git+https://github.com/SagerNet/naiveproxy.git#branch=cronet-go";
+        
"git+https://github.com/SagerNet/cronet-go.git#commit=${_cronet_commit_hash}";
+        "git+https://github.com/SagerNet/naiveproxy.git#branch=cronet-go";
         "0001-build-use-the-system-toolchain.patch"
-        "0002-build-drop-unknown-clang-flag.patch")
+        "0002-build-drop-unknown-clang-flag.patch"
+        
"https://github.com/chromium/chromium/raw/refs/tags/150.0.7871.63/tools/generate_shim_headers/generate_shim_headers.py";)
 sha256sums=('e41ed9d7adecd7597c1d5cc91818366a9538d94b41c244225ac40ac948c643f5'
             '46501331925bc53f58ff5497fe0aa42f7e65ddcbd313b52cfd63755240f48c02'
             'SKIP'
             '58c83e0ab0587a8bb020d98ee5cd787e32f692041824b2ae6b78812ec912c5a0'
-            'b941918a0af49840bd929d16be947cc473b0c8b27a4ceab16da34e9b288a57dd')
-depends=('glibc>=2.31')
-makedepends=('clang' 'git' 'gn' 'go>=1.25' 'lld' 'llvm' 'ninja')
+            'b941918a0af49840bd929d16be947cc473b0c8b27a4ceab16da34e9b288a57dd'
+            'b64f3bc06e74955d1027e3720a2ef14b6203722a5e7fe4c777a6b1051b9744dd')
+depends=('glibc')
+makedepends=('clang' 'git' 'gn' 'go>=1.25' 'lld' 'llvm' 'ninja' 'python')
 optdepends=('sing-geosite-rule-set: GeoSite rule sets'
             'sing-geoip-rule-set: GeoIP rule sets')
 backup=("etc/${pkgname}/config.json")
 
+declare -gA _system_libs=(
+    [brotli]=brotli
+    [zlib]=zlib
+    [zstd]=zstd
+)
+_unwanted_bundled_libs=( "${!_system_libs[@]}" )
+depends+=("${_system_libs[@]}")
+
 prepare() {
     export GOPATH="${srcdir}"
 
@@ -37,6 +47,22 @@ prepare() {
     patch -Np1 -i "${srcdir}/0002-build-drop-unknown-clang-flag.patch" -d 
naiveproxy
     go mod download -modcacherw
 
+    pushd "naiveproxy/src"
+    install -Dm644 "${srcdir}/generate_shim_headers.py" 
"tools/generate_shim_headers/generate_shim_headers.py"
+    sed -i 's/defined(OFFICIAL_BUILD)/defined(NEVER_DEFINED_OFFICIAL_BUILD)/g' 
tools/generate_shim_headers/generate_shim_headers.py
+    local _lib
+    for _lib in "${_unwanted_bundled_libs[@]}"; do
+        find "third_party/$_lib" -type f \
+            \! -path "third_party/$_lib/chromium/*" \
+            \! -path "third_party/$_lib/google/*" \
+            \! -path "third_party/harfbuzz-ng/utils/hb_scoped.h" \
+            \! -regex '.*\.\(gn\|gni\|isolate\)' \
+            -delete
+    done
+    ./build/linux/unbundle/replace_gn_files.py \
+        --system-libraries "${!_system_libs[@]}"
+    popd
+
     cd "${srcdir}/${pkgname}-${pkgver}"
     go mod download -modcacherw
 }



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/sing-box/-/commit/642ba59d16d9575b5a9bca69d3adbc09120c3944

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/sing-box/-/commit/642ba59d16d9575b5a9bca69d3adbc09120c3944
You're receiving this email because of your account on gitlab.archlinux.org. 
Manage all notifications: https://gitlab.archlinux.org/-/profile/notifications 
| Help: https://gitlab.archlinux.org/help


Reply via email to