summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorBrett Cornwall2021-03-02 23:06:17 -0800
committerBrett Cornwall2021-03-02 23:06:17 -0800
commitd3ba03c12466ec6947e38532cb1408cb0907ef72 (patch)
tree64cb292496d529ef939fb8da5bbfe7719973191f /PKGBUILD
parentba8f1c9289f5d81b00139ee55f44849e2b66cfb6 (diff)
downloadaur-d3ba03c12466ec6947e38532cb1408cb0907ef72.tar.gz
Revert back to pre-docker building
This reverts the following: - ba8f1c9289f5d81b00139ee55f44849e2b66cfb6 - 59aebefd23192677bfa7af116d58174e2bbabeb7 - fb7ee02303ce81c2c90f1117818775b2d987611c - 1044560efe55f965b7a8ab8fbb18f90a37013f61 - 474068bfd7df4751399597731f715ca2a9566288
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD67
1 files changed, 33 insertions, 34 deletions
diff --git a/PKGBUILD b/PKGBUILD
index a7f221d1ac9a..d790e9544e7e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,23 +19,21 @@
_pkgname=psiphon-tunnel-core
pkgname="$_pkgname-git"
-pkgver=2.0.14.r3354.08f530bd
-pkgrel=3
+pkgver=2.0.10.r3020.a9bed696
+pkgrel=1
pkgdesc='Psiphon Tunnelling Proxy'
arch=('x86_64')
url="https://github.com/Psiphon-Labs/psiphon-tunnel-core"
license=('GPL')
-makedepends=('go-pie' 'perl' 'docker' 'git')
+makedepends=('go-pie' 'perl')
depends=('glibc')
source=("git+$url.git"
"psiphon.conf"
- "psiphon.service"
- "Dockerfile.patch")
+ "psiphon.service")
backup=('etc/psiphon.conf' 'usr/lib/systemd/user/psiphon.service')
md5sums=('SKIP'
'c1ec9a446e89495501b8375d2682aa49'
- 'a6d6b01633a39325abbdb3597c50a4cc'
- '2a2474d64b2c4de819976b5f6bfa5c0f')
+ 'a6d6b01633a39325abbdb3597c50a4cc')
pkgver() {
cd $_pkgname
@@ -45,39 +43,40 @@ pkgver() {
printf "%s.r%s.%s" "$TAG" "$REVISION" "$COMMIT"
}
-prepare(){
- if ! groups ${USER} | grep &>/dev/null '\bdocker\b'; then
- >&2 echo "The user ${USER} does not belong to the docker group. Please add it."
- exit 1
- fi
-
- if ! systemctl is-active docker | grep &>/dev/null '\bactive\b'; then
- >&2 echo "Docker service is not started. Please start it."
- exit 1
- fi
- patch --forward --strip=1 --input="Dockerfile.patch"
-}
-
build() {
cd "$_pkgname/ConsoleClient"
- docker build --no-cache=true -t psiclient \
- --build-arg USER_ID=$(id -u) \
- --build-arg GROUP_ID=$(id -g) \
- --build-arg USERNAME=$USER .
- docker images
- cd .. && \
- docker run \
- --rm \
- -v $PWD:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
- psiclient \
- /bin/bash -c './make.bash linux 64' \
- ; cd -
+ # This errors but seems to fix building
+ go get || true
+
+ # Copied from the README file
+ BUILDDATE=$(date --iso-8601=seconds)
+ BUILDREPO=$(git config --get remote.origin.url)
+ BUILDREV=$(git rev-parse --short HEAD)
+ GOVERSION=$(go version | perl -ne '/go version (.*?) / && print $1')
+ DEPENDENCIES=$(echo -n "{" && go list -f '{{range $dep := .Deps}}{{printf "%s\n" $dep}}{{end}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | xargs -I pkg bash -c 'cd $GOPATH/src/pkg && echo -n "\"pkg\":\"$(git rev-parse --short HEAD)\","' | sed 's/,$/}/')
+
+ LDFLAGS="\
+-X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildDate=$BUILDDATE \
+-X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildRepo=$BUILDREPO \
+-X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.buildRev=$BUILDREV \
+-X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.goVersion=$GOVERSION \
+-X github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/buildinfo.dependencies=$DEPENDENCIES \
+-s -w
+"
+
+ # TODO: Figure out how to do the stripping?
+ # https://wiki.archlinux.org/index.php/Go_package_guidelines#Flags_and_build_options
+
+ go build \
+ -trimpath \
+ -ldflags "$LDFLAGS" \
+ -o $_pkgname .
}
package() {
- cd "$_pkgname/ConsoleClient/bin/linux/"
- install -Dm755 ${_pkgname}-x86_64 "$pkgdir"/usr/bin/$_pkgname
+ cd "$_pkgname/ConsoleClient"
+ install -Dm755 $_pkgname "$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"
}