diff options
author | George Rawlinson | 2022-02-19 16:52:03 +0000 |
---|---|---|
committer | George Rawlinson | 2022-02-19 16:52:03 +0000 |
commit | 21c69fa1c88530c4823c6d043c844085f4cf747f (patch) | |
tree | 93dfc0ef6fa04a5df380ab8e972b9c25b8779c74 | |
download | aur-obelisk.tar.gz |
addpkg: obelisk 0.90-1
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 65 |
2 files changed, 80 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ec289bb58173 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = obelisk + pkgdesc = CLI tool for saving web page as single HTML file + pkgver = 0.90 + pkgrel = 1 + url = https://github.com/go-shiori/obelisk + arch = x86_64 + license = MIT + makedepends = git + makedepends = go + depends = glibc + options = !lto + source = obelisk::git+https://github.com/go-shiori/obelisk.git#commit=77069341882e2d45c15af83bec39594ae6e37520 + b2sums = SKIP + +pkgname = obelisk diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..fe5d6535cc6e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,65 @@ +# Maintainer: George Rawlinson <grawlinson@archlinux.org> + +pkgname=obelisk +pkgver=0.90 +pkgrel=1 +pkgdesc="CLI tool for saving web page as single HTML file" +arch=('x86_64') +url="https://github.com/go-shiori/obelisk" +license=('MIT') +depends=('glibc') +makedepends=('git' 'go') +options=('!lto') +_commit='77069341882e2d45c15af83bec39594ae6e37520' # v0.90 (v0.91 is also present on the same commit...) +source=("$pkgname::git+$url.git#commit=$_commit") +b2sums=('SKIP') + +pkgver() { + cd "$pkgname" + + git describe --tags | sed 's/^v//' +} + +prepare() { + cd "$pkgname" + + # create directory for build output + mkdir build + + # download dependencies + go mod download +} + +build() { + cd "$pkgname" + + # set Go flags + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + go build -v \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-linkmode external -extldflags $LDFLAGS" \ + -o build \ + ./cmd/... +} + +check() { + cd "$pkgname" + + go test -v ./... +} + +package() { + cd "$pkgname" + + # binary + install -vDm755 -t "$pkgdir/usr/bin" build/obelisk + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE +} |