diff options
author | Francesco Minnocci | 2021-07-20 15:18:51 +0200 |
---|---|---|
committer | Francesco Minnocci | 2021-07-20 15:18:51 +0200 |
commit | 71fc1839e30c0e7865f7120ae1b016e14c3c17c1 (patch) | |
tree | c100e37749981df895718e7bc865d641ebc51c2d /PKGBUILD | |
download | aur-soryu-git.tar.gz |
Initial upload
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..85aef0f640a6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Francesco Minnocci <ascoli dot minnocci at gmail dot com> + +pkgname=soryu-git +_pkgname=soryu +pkgver=r8.e371d90 +pkgrel=1 +license=('Unlicense') +pkgdesc='Glitch an image in the terminal' +makedepends=("git" "go") +conflicts=('soryu') +provides=('soryu') +arch=("x86_64") +_gourl='github.com/enjuus/soryu' +url="https://${_gourl}" +source=("${_pkgname}::git+${url}.git") +sha256sums=('SKIP') + + +pkgver() { + cd "$srcdir/${_pkgname}" + + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + # prevent creation of a `go` directory in one's home. + # this directory cannot be removed with even `rm -rf` unless one becomes root + # or changes the write permissions. + export GOPATH="${srcdir}/gopath" + go clean -modcache +} + +build() { + cd "${srcdir}/${_pkgname}" + + export CGO_LDFLAGS="${LDFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -modcacherw -mod=vendor" + go mod vendor + go build -o $_pkgname . + + go clean -modcache +} + +package() { + cd "${srcdir}/${_pkgname}" + + install -Dm755 -t "${pkgdir}/usr/bin" $_pkgname +} +# vim:set ts=2 sw=2 et: |