summaryrefslogtreecommitdiffstats
path: root/ouch-git/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'ouch-git/PKGBUILD')
-rw-r--r--ouch-git/PKGBUILD51
1 files changed, 51 insertions, 0 deletions
diff --git a/ouch-git/PKGBUILD b/ouch-git/PKGBUILD
new file mode 100644
index 0000000..8e036ce
--- /dev/null
+++ b/ouch-git/PKGBUILD
@@ -0,0 +1,51 @@
1# Maintainer: Yigit Sever <yigit at yigitsever dot com>
2
3pkgname=ouch-git
4_pkgname=${pkgname%-git}
5pkgver=r397.abf1d4e
6pkgrel=1
7pkgdesc="Painless compression and decompression in the terminal (git version)"
8arch=('x86_64')
9url="https://github.com/ouch-org/ouch/"
10license=('MIT')
11makedepends=('git' 'cargo')
12provides=(${_pkgname})
13conflicts=(${_pkgname} ${_pkgname}-bin)
14source=("${_pkgname}::git+${url}")
15sha256sums=('SKIP')
16
17pkgver() {
18 cd "$srcdir/${_pkgname}"
19 printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
20}
21
22prepare() {
23 cd "$srcdir/${_pkgname}"
24 cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
25}
26
27build() {
28 cd "$srcdir/${_pkgname}"
29 export RUSTUP_TOOLCHAIN=stable
30 export CARGO_TARGET_DIR=target
31 GEN_COMPLETIONS=1 cargo build --frozen --release --all-features
32}
33
34check() {
35 cd "$srcdir/${_pkgname}"
36 export RUSTUP_TOOLCHAIN=stable
37 cargo test --frozen --all-features
38}
39
40package() {
41 cd "$srcdir/${_pkgname}"
42 install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/${_pkgname}"
43 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"
44
45 cd target/release/build/ouch-*/out/completions
46 sed -i "s/':output -- The resulting file. It's extensions can be used to specify the compression formats:_files'/\":output -- The resulting file. It's extensions can be used to specify the compression formats:_files\"/" _ouch
47
48 install -Dm0644 ${_pkgname}.bash "${pkgdir}/usr/share/bash-completion/completions/${_pkgname}"
49 install -Dm0644 ${_pkgname}.fish "${pkgdir}/usr/share/fish/vendor_completions.d/${_pkgname}.fish"
50 install -Dm0644 _${_pkgname} "${pkgdir}/usr/share/zsh/site-functions/_${_pkgname}"
51}