diff options
author | haawda | 2018-08-31 18:35:10 +0200 |
---|---|---|
committer | haawda | 2018-08-31 18:35:10 +0200 |
commit | f03956796ffd41966c9e7ab5aa24027b11429551 (patch) | |
tree | fd49d09aac8e2bd1a47cdf98bc2b0154b82992a9 | |
parent | 6e85b964f63883996280a869243e9fbbc1c7d15c (diff) | |
download | aur-f03956796ffd41966c9e7ab5aa24027b11429551.tar.gz |
simplify PKGBUILD
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 68 |
2 files changed, 11 insertions, 63 deletions
@@ -1,15 +1,15 @@ pkgbase = slit pkgdesc = A modern PAGER for viewing logs, get more than most in less time. Written in Go pkgver = 1.2.0 - pkgrel = 1 + pkgrel = 2 url = https://github.com/tigrawap/slit arch = x86_64 arch = i686 license = MIT - makedepends = go + makedepends = go-pie makedepends = git + depends = glibc options = !strip - options = !emptydirs source = git+https://github.com/tigrawap/slit#commit=f1d770e md5sums = SKIP @@ -2,13 +2,14 @@ pkgname=slit pkgver=1.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="A modern PAGER for viewing logs, get more than most in less time. Written in Go" arch=('x86_64' 'i686') url="https://github.com/tigrawap/slit" license=('MIT') -makedepends=('go' 'git') -options=('!strip' '!emptydirs') +depends=('glibc') +makedepends=('go-pie' 'git') +options=('!strip') source=("git+https://github.com/tigrawap/slit#commit=f1d770e") md5sums=('SKIP') _gourl=github.com/tigrawap/slit @@ -19,64 +20,11 @@ pkgver() { } build() { - export GOROOT=/usr/lib/go - export GOFLAGS='-gcflags "all=-trimpath=${GOPATH}" -asmflags "all=-trimpath=${GOPATH}"' - [[ -d build ]] && 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 - - platform=`for f in "$GOROOT/pkg/"*; do echo \`basename $f\`; done|grep linux` - - rm -f "$platform" - mkdir "$platform" - cd "$platform" - - for f in "$GOROOT/pkg/$platform/"*.h; do - ln -s "$f" - done - - export GOROOT="$srcdir/build/go" - export GOPATH="$srcdir/build" - - go get -fix "$_gourl" - - # Prepare executable - if [ -d "$srcdir/build/src" ]; then - cd "$srcdir/build/src/$_gourl" - go build -o "$srcdir/build/$pkgname" - else - echo 'Old sources for a previous version of this package are already present!' - echo 'Build in a chroot or uninstall the previous version.' - return 1 - fi + cd "$pkgname" + go build $_gourl/cmd/slit } package() { - export GOROOT="$GOPATH" - - # Package license (if available) - for f in LICENSE COPYING; do - if [ -e "$srcdir/build/src/$_gourl/$f" ]; then - install -Dm644 "$srcdir/build/src/$_gourl/$f" \ - "$pkgdir/usr/share/licenses/$pkgname/$f" - fi - done - - # Package executables - if [ -e "$srcdir/build/$pkgname" ]; then - install -Dm755 "$srcdir/build/$pkgname" \ - "$pkgdir/usr/bin/$pkgname" - fi + install -Dm644 "$srcdir"/$pkgname/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + install -Dm755 "$srcdir"/$pkgname/$pkgname "$pkgdir"/usr/bin/$pkgname } |