diff options
author | Laith Bahodi | 2023-07-16 17:07:13 -0400 |
---|---|---|
committer | Laith Bahodi | 2023-07-16 17:07:13 -0400 |
commit | dab4c3f807d2e5ebf65d26a0a22b296e9c7ab372 (patch) | |
tree | 1f15f7f7f0c75b615011cb211c87569385cf20e6 | |
download | aur-dab4c3f807d2e5ebf65d26a0a22b296e9c7ab372.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 56 |
2 files changed, 72 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e22143efee83 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = xshot-git + pkgdesc = XS Screenshot Tool for X11 + pkgver = r12.b84afb1 + pkgrel = 1 + url = https://github.com/hydrobeam/xshot + arch = x86_64 + license = MIT + makedepends = git + depends = libxcb + depends = libx11 + provides = xshot + conflicts = xshot + source = xshot-git::git+https://github.com/hydrobeam/xshot.git + sha256sums = SKIP + +pkgname = xshot-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9d48c8eb8b8c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,56 @@ +# Maintainer: aquabeam <laithbahodi@gmail.com> + +pkgname=xshot-git +pkgver=r12.b84afb1 +pkgrel=1 +pkgdesc='XS Screenshot Tool for X11' +arch=('x86_64') +url=https://github.com/hydrobeam/xshot +license=('MIT') +depends=('libxcb' 'libx11') +makedepends=('git') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=("$pkgname::git+$url.git") +sha256sums=(SKIP) + +# If there are no tags then use number of revisions since beginning of the history: +pkgver() { + cd "$pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" +} + +prepare() { + cargo fetch --locked --manifest-path=$pkgname/Cargo.toml --target="$CARCH-unknown-linux-gnu" +} + +build() { + cd "$pkgname" + export RUSTUP_TOOLCHAIN=stable + cargo build --release --locked + + find target -name xshot.fish | xargs dirname > out_dir +} + +check() { + cd "$pkgname" + export RUSTUP_TOOLCHAIN=stable + cargo test --release --locked +} + +package() { + cd "$pkgname" + + local OUT_DIR=$(<out_dir) + + install -Dm755 "target/release/xshot" "$pkgdir/usr/bin/xshot" + + install -Dm644 "$OUT_DIR/_xshot" "$pkgdir/usr/share/zsh/site-functions/_xshot" + install -Dm644 "$OUT_DIR"/xshot.bash "$pkgdir/usr/share/bash-completion/completions/xshot" + install -Dm644 "$OUT_DIR"/xshot.fish "$pkgdir/usr/share/fish/vendor_completions.d/xshot.fish" + install -Dm644 "$OUT_DIR"/xshot.1 "$pkgdir/usr/share/man/man1/xshot.1" + + install -Dm644 "README.md" "$pkgdir/usr/share/doc/${pkgname}/README.md" + install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" +} + |