diff options
author | Alexander F Rødseth | 2016-10-14 12:43:34 +0200 |
---|---|---|
committer | Alexander F Rødseth | 2016-10-14 12:43:34 +0200 |
commit | 4b3c693a24b44ca55b7398171c72a0cc20938e27 (patch) | |
tree | bb9fbfcb3051411d803bc4277d3b0bfa12d1668e | |
parent | 1d25be1ea86718552ddc997e06d7f162909e51fa (diff) | |
download | aur-4b3c693a24b44ca55b7398171c72a0cc20938e27.tar.gz |
Use a more involved build process
-rw-r--r-- | .SRCINFO | 1 | ||||
-rw-r--r-- | PKGBUILD | 41 |
2 files changed, 38 insertions, 4 deletions
@@ -14,6 +14,7 @@ pkgbase = algernon optdepends = mariadb: For using the MariaDB/MySQL database backend optdepends = postgresql: For using the PostgreSQL database backend backup = etc/algernon/serverconf.lua + backup = usr/lib/systemd/system/algernon.service source = git://github.com/xyproto/algernon#tag=1.2.1 md5sums = SKIP @@ -16,21 +16,54 @@ backup=('etc/algernon/serverconf.lua' source=("git://github.com/xyproto/algernon#tag=$pkgver") md5sums=('SKIP') install='algernon.install' +_gourl=github.com/xyproto/algernon prepare() { - cd "$pkgname" + export GOROOT=/usr/lib/go + msg2 "Prepare build enviroment" + rm -rf build + mkdir -p build/go + cd build/go + + for f in "$GOROOT/"*; do + ln -s "$f" + done + + rm pkg + mkdir pkg + cd pkg + + for f in "$GOROOT/pkg/"*; do + ln -s "$f" + done + + export GOROOT="$srcdir/build/go" + export GOPATH="$srcdir/build" + + export DESTPATH="$GOPATH/src/$_gourl" + mkdir -p "$DESTPATH" + + rm -rf $DESTPATH + mv "$srcdir/$pkgname" "$(dirname $DESTPATH)" + + # Glide + msg2 "Download dependencies with Glide" + cd "$GOPATH/src/$_gourl" + glide update glide install } build() { - cd "$pkgname" + cd "$GOPATH/src/$_gourl" - go build + msg2 "Build application" + go fix + go build -x } package() { - cd "$pkgname" + cd "$GOPATH/src/$_gourl" install -Dm755 algernon "$pkgdir/usr/bin/algernon" install -Dm644 system/algernon.service "$pkgdir/usr/lib/systemd/system/algernon.service" |