diff options
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 48 |
3 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0e48a7a6ca69 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = page-git + pkgdesc = pager that utilizes nvim terminal buffer + pkgver = v1.8.0.r1.gb67b846 + pkgrel = 1 + url = https://github.com/I60R/page + arch = i686 + arch = x86_64 + license = MIT + makedepends = rust + makedepends = cargo + makedepends = git + depends = neovim + depends = gcc-libs + provides = page + conflicts = page + source = git+https://github.com/I60R/page.git + md5sums = SKIP + +pkgname = page-git + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..aff905f11646 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +* +*/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5eceb2a50b18 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,48 @@ +# Maintainer: 160R@protonmail.com +_pkgname=page +pkgname=${_pkgname}-git +pkgrel=1 +pkgver=v1.8.0.r1.gb67b846 +pkgdesc='pager that utilizes nvim terminal buffer' +arch=('i686' 'x86_64') +url="https://github.com/I60R/page" +license=('MIT') +depends=('neovim' 'gcc-libs') +makedepends=('rust' 'cargo' 'git') +provides=('page') +conflicts=('page') +source=("git+https://github.com/I60R/page.git") +md5sums=('SKIP') + + +pkgver() { + checkout_project_root + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +package() { + checkout_project_root + + cargo build --release + + # Install binaries + install -D -m755 "target/release/page" "$pkgdir/usr/bin/page" + install -D -m755 "target/release/page-term-agent" "$pkgdir/usr/bin/page-term-agent" + + # Find last build directory where completions was generated + completions_dir=$(find "target" -name "shell_completions" -type d -printf "%T+\t%p\n" | sort | awk 'NR==1{print $2}') + + # Install shell completions + install -D -m644 "$completions_dir/_page" "$pkgdir/usr/share/zsh/site-functions/_page" + install -D -m644 "$completions_dir/page.bash" "$pkgdir/usr/share/bash-completion/completions/page" + install -D -m644 "$completions_dir/page.fish" "$pkgdir/usr/share/fish/completions/page.fish" + + # Install MIT license + install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + +# Ensures that current directory is root of repository +checkout_project_root() { + cd "$srcdir" + cd "$_pkgname" > /dev/null 2>&1 || cd .. +} |