From 602f5579b1d041294b4d623b678a54680a337e0f Mon Sep 17 00:00:00 2001 From: Lilac Date: Sun, 14 May 2023 17:59:54 +0000 Subject: [PATCH] sing-box: auto updated to 1.2.6-1 --- repo/sing-box/PKGBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 repo/sing-box/PKGBUILD diff --git a/repo/sing-box/PKGBUILD b/repo/sing-box/PKGBUILD new file mode 100644 index 0000000..8924442 --- /dev/null +++ b/repo/sing-box/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: everyx + +pkgname=sing-box +pkgver=1.2.6 +pkgrel=1 + +pkgdesc='The universal proxy platform.' +arch=('x86_64' 'i686') +url='https://sing-box.sagernet.org/' +license=('GPL3 with name use or association addition') + +makedepends=('go') + +source=("$pkgname-$pkgver.tar.gz::https://github.com/SagerNet/sing-box/archive/v$pkgver.tar.gz") +sha256sums=('8f7adf55ed9afe6ec0dd8b04ed64dd3a6243578ee779f909dfb3778fa2dbda10') + +conflicts=("$pkgname-git" "$pkgname-beta") +optdepends=('sing-geosite: sing-geosite database' + 'sing-geoip: sing-geoip database') + +backup=("etc/$pkgname/config.json") + +_tags=with_gvisor,with_quic,with_wireguard,with_utls,with_reality_server,with_clash_api +build(){ + cd "$pkgname-$pkgver" + + export CGO_CPPFLAGS="$CPPFLAGS" + export CGO_CFLAGS="$CFLAGS" + export CGO_CXXFLAGS="$CXXFLAGS" + export CGO_LDFLAGS="$LDFLAGS" + + go build \ + -v \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -tags "$_tags" \ + -ldflags " + -X \"github.com/sagernet/sing-box/constant.Version=$pkgver\" + -s -w -buildid= -linkmode=external" \ + ./cmd/sing-box + + sed -i "/^\[Service\]$/a User=$pkgname" release/config/$pkgname*.service + + echo "u $pkgname - \"Sing-box Service\" - -" > "release/config/$pkgname.sysusers" +} + +package() { + cd "$pkgname-$pkgver" + + install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname" + install -Dm755 "$pkgname" -t "$pkgdir/usr/bin" + install -Dm644 "release/config/config.json" -t "$pkgdir/etc/$pkgname" + install -Dm644 "release/config/$pkgname.service" -t "$pkgdir/usr/lib/systemd/system" + install -Dm644 "release/config/$pkgname@.service" -t "$pkgdir/usr/lib/systemd/system" + install -Dm644 "release/config/$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" +}