summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rawlinson2022-10-28 16:34:59 +1300
committerGeorge Rawlinson2022-10-28 16:34:59 +1300
commitc98efcd58775885cf92a2bfc412d7c176398ef2b (patch)
treec35f11e7e7d4cad82a64e171c7257e965784e1c9
parentd6ab10c2776cc3b70c43f6fcb46064cf63e4e3da (diff)
downloadaur-c98efcd58775885cf92a2bfc412d7c176398ef2b.tar.gz
addpkg: vhs 0.1.0-1
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD95
2 files changed, 91 insertions, 29 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6aefc045934b..39d83a651764 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,16 @@
-# Generated by mksrcinfo v8
-# Fri Jan 15 01:54:54 UTC 2016
pkgbase = vhs
- pkgdesc = Video Handler Script (VHS) aka ffmpeg-tui
- pkgver = 2.7.6
- pkgrel = 0
- url = https://github.com/sri-arjuna/vhs
- arch = any
- license = GPL3
- depends = tui
+ pkgdesc = A tool for recording terminal GIFs
+ pkgver = 0.1.0
+ pkgrel = 1
+ url = https://github.com/charmbracelet/vhs
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
depends = ffmpeg
- provides = vhs
- source = https://github.com/sri-arjuna/vhs/archive/master.zip
- md5sums = 17563c056fb4176f72a03c5e17ce5db0
+ depends = ttyd
+ options = !lto
+ source = vhs::git+https://github.com/charmbracelet/vhs#commit=d6bba9f32240f3eef4b063f4742b9af4475cc9b2
+ b2sums = SKIP
pkgname = vhs
-
diff --git a/PKGBUILD b/PKGBUILD
index 212de15e2a4e..2646551e2e5d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,87 @@
-# Maintainer: Simon Arjuna Erat (sea), erat.simon@gmail.com
-# Contributor: Simon Arjuna Erat (sea), erat.simon@gmail.com
+# Maintainer: George Rawlinson <grawlinson@archlinux.org>
pkgname=vhs
-pkgdesc="Video Handler Script (VHS) aka ffmpeg-tui"
-license=('GPL3')
-groups=()
+pkgver=0.1.0
+pkgrel=1
+pkgdesc='A tool for recording terminal GIFs'
+arch=('x86_64')
+url='https://github.com/charmbracelet/vhs'
+license=('MIT')
+depends=('ffmpeg' 'ttyd')
+makedepends=('git' 'go')
+options=('!lto')
+_commit='d6bba9f32240f3eef4b063f4742b9af4475cc9b2'
+source=("$pkgname::git+$url#commit=$_commit")
+b2sums=('SKIP')
-arch=('any')
-pkgver=2.7.6
-pkgrel=0
+pkgver() {
+ cd "$pkgname"
-url="https://github.com/sri-arjuna/vhs"
-source=("https://github.com/sri-arjuna/vhs/archive/master.zip")
-md5sums=('17563c056fb4176f72a03c5e17ce5db0')
+ 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} \
+ -X main.Version=v$pkgver \
+ -X main.CommitSHA=$_commit \
+ -X main.CommitDate=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)" \
+ -o build \
+ .
+
+ # man page
+ ./build/vhs man > build/vhs.1
-provides=('vhs')
-depends=( 'tui' 'ffmpeg' )
+ # completions
+ for shell in bash fish zsh; do
+ ./build/vhs completion "$shell" > "build/$shell-completion"
+ done
+}
+
+check() {
+ cd "$pkgname"
+
+ go test -v ./...
+}
package() {
- cd "${srcdir}/${pkgname}-master"
- ./configure --prefix=/usr --chroot="$pkgdir"
- ./make-install
+ cd "$pkgname"
+
+ # binary
+ install -vDm755 -t "$pkgdir/usr/bin" build/vhs
+
+ # documentation
+ install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
+
+ # man pages
+ install -vDm644 -t "$pkgdir/usr/share/man/man1" build/vhs.1
+
+ # completions
+ install -vDm644 build/bash-completion "$pkgdir/usr/share/bash-completion/completions/vhs"
+ install -vDm644 build/fish-completion "$pkgdir/usr/share/fish/vendor_completions.d/vhs.fish"
+ install -vDm644 build/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_vhs"
+
+ # license
+ install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}