diff options
author | gilcu3 | 2022-09-30 11:16:44 +0200 |
---|---|---|
committer | gilcu3 | 2022-09-30 11:16:44 +0200 |
commit | e64e58f0ddd7b26b7dbbfc63e677e1c4a854d511 (patch) | |
tree | 9a86dae78046db84f0c03b36caa8b929abddb8e2 | |
parent | 348a7b550788ac234377262ec1355cf364d2ac5b (diff) | |
download | aur-e64e58f0ddd7b26b7dbbfc63e677e1c4a854d511.tar.gz |
improved the build process, building with current go using a workaround
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 84 | ||||
-rw-r--r-- | client.conf (renamed from psiphon.conf) | 0 | ||||
-rw-r--r-- | make.bash.patch | 46 | ||||
-rw-r--r-- | psiphon-client.service | 12 | ||||
-rw-r--r-- | psiphon.install | 7 | ||||
-rw-r--r-- | psiphon.service | 11 |
7 files changed, 60 insertions, 126 deletions
@@ -1,26 +1,22 @@ pkgbase = psiphon-tunnel-core-git pkgdesc = Psiphon Tunnelling Proxy - pkgver = 2.0.27.r3653.6826fe87 - pkgrel = 1 + pkgver = 2.0.27.r3656.3b2cfbca + pkgrel = 2 epoch = 3 url = https://github.com/Psiphon-Labs/psiphon-tunnel-core + install = psiphon.install + arch = i686 arch = x86_64 license = GPL3 - makedepends = go-pie - makedepends = perl - makedepends = git - depends = glibc - backup = etc/psiphon.conf - backup = usr/lib/systemd/user/psiphon.service + makedepends = go + conflicts = psiphon-console-client + backup = etc/psiphon/client.conf + backup = usr/lib/systemd/user/psiphon-client.service source = git+https://github.com/Psiphon-Labs/psiphon-tunnel-core.git - source = psiphon.conf - source = psiphon.service - source = make.bash.patch - source = https://storage.googleapis.com/golang/go1.17.13.linux-amd64.tar.gz + source = client.conf + source = psiphon-client.service sha256sums = SKIP sha256sums = c2c414831ad29bdeecd00313c473fbaa448f4750e70df1c10e863870bde179aa - sha256sums = d0227e69cac62480951e9c83747d43fccd7bdd18224652428ab20369b84173aa - sha256sums = 681e9b7e8f32061028061a80c9663f11e2e8d396478c7067706e5ae3db121dc2 - sha256sums = 4cdd2bc664724dc7db94ad51b503512c5ae7220951cac568120f64f8e94399fc + sha256sums = 6711a12112a594ba70bbae51c66ee23302e08c54c4e059c92b67adba9451c037 pkgname = psiphon-tunnel-core-git @@ -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" } diff --git a/psiphon.conf b/client.conf index 7def21ab248d..7def21ab248d 100644 --- a/psiphon.conf +++ b/client.conf diff --git a/make.bash.patch b/make.bash.patch deleted file mode 100644 index c60099207f01..000000000000 --- a/make.bash.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/ConsoleClient/make.bash b/ConsoleClient/make.bash -index 5bcc9fd7..2ab3d7f9 100755 ---- a/ConsoleClient/make.bash -+++ b/ConsoleClient/make.bash -@@ -87,25 +87,6 @@ build_for_windows () { - build_for_linux () { - prepare_build linux - -- echo "...Building linux-i686" -- # TODO: is "CFLAGS=-m32" required? -- CFLAGS=-m32 GOOS=linux GOARCH=386 go build -v -x -ldflags "$LDFLAGS" -tags "${BUILD_TAGS}" -o bin/linux/${EXE_BASENAME}-i686 -- RETVAL=$? -- if [ $RETVAL != 0 ]; then -- echo ".....gox failed, exiting" -- exit $RETVAL -- fi -- unset RETVAL -- -- echo "....UPX packaging output" -- goupx --best bin/linux/${EXE_BASENAME}-i686 -- RETVAL=$? -- if [ $RETVAL != 0 ]; then -- echo ".....goupx failed, exiting" -- exit $RETVAL -- fi -- unset RETVAL -- - echo "...Building linux-x86_64" - GOOS=linux GOARCH=amd64 go build -v -x -ldflags "$LDFLAGS" -tags "${BUILD_TAGS}" -o bin/linux/${EXE_BASENAME}-x86_64 - RETVAL=$? -@@ -114,15 +95,6 @@ build_for_linux () { - exit $RETVAL - fi - unset RETVAL -- -- echo "....UPX packaging output" -- goupx --best bin/linux/${EXE_BASENAME}-x86_64 -- RETVAL=$? -- if [ $RETVAL != 0 ]; then -- echo ".....goupx failed, exiting" -- exit $RETVAL -- fi -- unset RETVAL - } - - build_for_osx () { diff --git a/psiphon-client.service b/psiphon-client.service new file mode 100644 index 000000000000..cf7460f124bd --- /dev/null +++ b/psiphon-client.service @@ -0,0 +1,12 @@ +[Unit] +Description=Psiphon Proxy Client Service +After=network-online.target +Wants=network-online.target + +[Service] +WorkingDirectory=%E/psiphon/ +ExecStart=/usr/bin/psiphon-console-client -config client.config -formatNotices +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/psiphon.install b/psiphon.install new file mode 100644 index 000000000000..79ceac9d8592 --- /dev/null +++ b/psiphon.install @@ -0,0 +1,7 @@ +post_install() { + echo + echo "You need to provide you own configuration file." + echo "The configuration directory is /etc/psiphon/ (for system service) and \$XDG_CONFIG_HOME/psiphon/ (for user service)." + echo "See the repository's README for how to use: https://github.com/Psiphon-Labs/psiphon-tunnel-core" + echo +} diff --git a/psiphon.service b/psiphon.service deleted file mode 100644 index 15ce0c6fdc39..000000000000 --- a/psiphon.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Psiphon Tunnelling Proxy -After=network-online.target -Wants=network-online.target - -[Service] -ExecStart=/usr/bin/psiphon-tunnel-core --config /etc/psiphon.conf -formatNotices -ExecStop= /usr/bin/killall psiphon-tunnel- - -[Install] -WantedBy=multi-user.target |