mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-31 14:22:14 +01:00
50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
# Contributor: Anon <danilagdn.2004@gmail.com>
|
|
# Maintainer: Anon <danilagdn.2004@gmail.com>
|
|
pkgname=sing-box
|
|
pkgver=1.6.0
|
|
pkgrel=0
|
|
pkgdesc="The universal proxy platform."
|
|
url="https://sing-box.sagernet.org/"
|
|
arch="all"
|
|
license="GPL-3.0-or-later with name use or association addition"
|
|
makedepends="go"
|
|
subpackages="$pkgname-openrc $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion"
|
|
options="!check"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/SagerNet/sing-box/archive/v$pkgver.tar.gz
|
|
$pkgname.initd"
|
|
_tags=with_gvisor,with_quic,with_wireguard,with_utls,with_reality_server,with_clash_api,with_ech
|
|
|
|
build() {
|
|
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
|
|
|
|
install -d completions
|
|
go run ./cmd/sing-box completion bash > completions/bash
|
|
go run ./cmd/sing-box completion fish > completions/fish
|
|
go run ./cmd/sing-box completion zsh > completions/zsh
|
|
}
|
|
|
|
|
|
package() {
|
|
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 -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
|
|
|
|
install -Dm644 completions/bash "$pkgdir/usr/share/bash-completion/completions/$pkgname.bash"
|
|
install -Dm644 completions/fish "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
|
|
install -Dm644 completions/zsh "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
|
|
|
|
}
|
|
|
|
sha512sums="
|
|
d3cf7ec748985176c0b414338678736d31a30b146a6d764af8273379b62ce092e66d6be01e6fcf610878274729f0d301b579f1373fbe7e1c9401df0f61868618 sing-box-1.6.0.tar.gz
|
|
b90e16319d2d2827886219e8f420954060c6e003a88f523595da5f04fe0530f95c3fae89f60dec452a87804f479164dd29b57f1329b928cc3d641fd7ef174284 sing-box.initd
|
|
"
|