summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorgilcu32022-09-30 11:16:44 +0200
committergilcu32022-09-30 11:16:44 +0200
commite64e58f0ddd7b26b7dbbfc63e677e1c4a854d511 (patch)
tree9a86dae78046db84f0c03b36caa8b929abddb8e2 /PKGBUILD
parent348a7b550788ac234377262ec1355cf364d2ac5b (diff)
downloadaur-e64e58f0ddd7b26b7dbbfc63e677e1c4a854d511.tar.gz
improved the build process, building with current go using a workaround
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD84
1 files changed, 30 insertions, 54 deletions
diff --git a/PKGBUILD b/PKGBUILD
index dcc591c9d9ac..4ac54f11e550 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,46 +2,30 @@
# Maintainer: Modelmat <modelmat@outlook.com.au>
# Comaintainer: gilcu3 <gilcu3 [at] gmail [dot] com>
-# Usage:
-# This package provides a configuration file in /etc/psiphon.conf
-# as well as systemd user service, `psiphon.service`. The service
-# will crash (probably a bug) as the `DataStoreDirectory` option
-# is empty.
-#
-# However, if it is not set it will store temporary files in the
-# current working directory, which will fail for a user-service
-# (does not have write permissions for its directory). Hence, it
-# it advised that you set it to a writeable directory.
-#
-# If it is necessary to have per-user configuration files, it is
-# advised to create them in `~/.config/systemd/user/` to override
-# the system-wide user service.
-#
-# This application also installs `/usr/bin/psiphon-tunnel-core`.
-
_pkgname=psiphon-tunnel-core
pkgname="$_pkgname-git"
-GOVERSION=go1.17.13
-pkgver=2.0.27.r3653.6826fe87
-pkgrel=1
+pkgver=2.0.27.r3656.3b2cfbca
+pkgrel=2
epoch=3
pkgdesc='Psiphon Tunnelling Proxy'
-arch=($CARCH)
+arch=('i686' 'x86_64')
url="https://github.com/Psiphon-Labs/psiphon-tunnel-core"
license=('GPL3')
-makedepends=('go-pie' 'perl' 'git')
-depends=('glibc')
+makedepends=('go')
+conflicts=('psiphon-console-client')
source=("git+$url.git"
- "psiphon.conf"
- "psiphon.service"
- "make.bash.patch"
- "https://storage.googleapis.com/golang/${GOVERSION}.linux-amd64.tar.gz")
-backup=('etc/psiphon.conf' 'usr/lib/systemd/user/psiphon.service')
+ "client.conf"
+ "psiphon-client.service"
+ )
+install=psiphon.install
+backup=('etc/psiphon/client.conf' 'usr/lib/systemd/user/psiphon-client.service')
sha256sums=('SKIP'
'c2c414831ad29bdeecd00313c473fbaa448f4750e70df1c10e863870bde179aa'
- 'd0227e69cac62480951e9c83747d43fccd7bdd18224652428ab20369b84173aa'
- '681e9b7e8f32061028061a80c9663f11e2e8d396478c7067706e5ae3db121dc2'
- '4cdd2bc664724dc7db94ad51b503512c5ae7220951cac568120f64f8e94399fc')
+ '6711a12112a594ba70bbae51c66ee23302e08c54c4e059c92b67adba9451c037'
+ )
+
+
+
pkgver() {
cd $_pkgname
@@ -51,34 +35,26 @@ pkgver() {
printf "%s.r%s.%s" "$TAG" "$REVISION" "$COMMIT"
}
-prepare(){
- cd "$srcdir/${_pkgname}"
- patch --strip=1 --input=../make.bash.patch
-}
+export GO111MODULE=off
+export CGO_CPPFLAGS="$CPPFLAGS"
+export CGO_CFLAGS="$CFLAGS"
+export CGO_CXXFLAGS="$CXXFLAGS"
+export CGO_LDFLAGS="$LDFLAGS"
+export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+console_binary=psiphon-console-client
-# This follows the docker file in https://github.com/Psiphon-Labs/psiphon-tunnel-core/blob/master/ConsoleClient/Dockerfile
build() {
- cw=$(pwd)
- export GOPATH=$cw/home/go
- mkdir -p $GOPATH
- export GOROOT=$cw/go
- mkdir -p $GOROOT
- export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
- export CGO_ENABLED=1
-
- go get -u github.com/pwaller/goupx
-
+ export GOPATH=$srcdir/go
mkdir -p "${GOPATH}/src/github.com/Psiphon-Labs"
- ln -sf "../../../../../$_pkgname/" "${GOPATH}/src/github.com/Psiphon-Labs/psiphon-tunnel-core"
+ rm -rf "${GOPATH}/src/github.com/Psiphon-Labs/${_pkgname}"
+ ln -srf "$srcdir/${_pkgname}/" "${GOPATH}/src/github.com/Psiphon-Labs/${_pkgname}"
- cd "$_pkgname/ConsoleClient"
- ./make.bash linux
-
+ # Modified to disable quic disabled (it is not compatible with current go version 1.19)
+ go build -tags "PSIPHON_DISABLE_QUIC" -o bin/$console_binary "github.com/Psiphon-Labs/$_pkgname/ConsoleClient"
}
package() {
- cd $_pkgname/ConsoleClient/
- install -Dm755 "bin/linux/$_pkgname-x86_64" "$pkgdir/usr/bin/$_pkgname"
- install -Dm644 "$srcdir/psiphon.conf" "$pkgdir/etc/psiphon.conf"
- install -Dm644 "$srcdir/psiphon.service" "$pkgdir/usr/lib/systemd/user/psiphon.service"
+ install -Dm755 "$srcdir/bin/$console_binary" "$pkgdir/usr/bin/$console_binary"
+ install -Dm644 "$srcdir/client.conf" "$pkgdir/etc/psiphon/client.conf"
+ install -Dm644 "$srcdir/psiphon-client.service" "$pkgdir/usr/lib/systemd/user/psiphon-client.service"
}