diff options
author | xiota | 2024-03-27 13:34:38 +0000 |
---|---|---|
committer | xiota | 2024-03-27 13:34:38 +0000 |
commit | b19f3d885259171094a8e7dcf373da9126959248 (patch) | |
tree | 6a1c564e02227ce4f9e3cecc5a1f61119e5b1ae5 /PKGBUILD | |
parent | 7dcf78db09065c146c38c9468baeab1f0c038692 (diff) | |
download | aur-b19f3d885259171094a8e7dcf373da9126959248.tar.gz |
0.20.4.r4
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 64 |
1 files changed, 45 insertions, 19 deletions
@@ -1,30 +1,56 @@ -# Maintainer: spikecodes <19519553+spikecodes@users.noreply.github.com> -pkgname=xcp-git -_pkgname=${pkgname%-git} -pkgver=r298.5125c3c +# Maintainer: +# Contributor: spikecodes <19519553+spikecodes@users.noreply.github.com> + +_pkgname="xcp" +pkgname="$_pkgname-git" +pkgver=0.20.4.r4.g6356af3 pkgrel=1 -pkgdesc="An extended cp" -arch=('x86_64') +pkgdesc="An extended 'cp'" url="https://github.com/tarka/xcp" -license=("GPL-3.0") -makedepends=("git" "cargo") -provides=(${_pkgname}) -conflicts=(${_pkgname}) -source=("${_pkgname}::git+${url}") -sha256sums=("SKIP") +license=("GPL-3.0-only") +arch=('x86_64') + +makedepends=( + 'git' + 'cargo' +) + +provides=("$_pkgname=${pkgver%%.r*}") +conflicts=("$_pkgname") + +_pkgsrc="$_pkgname" +source=("$_pkgsrc"::"git+$url.git") +sha256sums=('SKIP') pkgver() { - cd "${_pkgname}" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + cd "$_pkgsrc" + git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \ + | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g' +} + +prepare() { + export CARGO_HOME="${CARGO_HOME:-$SRCDEST/cargo-home}" + export RUSTUP_TOOLCHAIN=${RUSTUP_TOOLCHAIN:-stable} + export CARGO_TARGET_DIR=target + + cd "$_pkgsrc" + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } build() { - cd "${_pkgname}" - cargo build --release --locked --all-features --target-dir=target + cd "$_pkgsrc" + cargo build --frozen --release --all-features +} + +check() { + cd "$_pkgsrc" + ./tests/scripts/test-linux.sh } package() { - cd "${_pkgname}" - install -Dm644 COPYING "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE" - install -Dm755 "target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" + cd "$_pkgsrc" + install -Dm755 "$CARGO_TARGET_DIR/release/$_pkgname" -t "$pkgdir/usr/bin/" + install -Dm644 "completions/$_pkgname.bash" "$pkgdir/usr/share/bash-completion/completions/$_pkgname" + install -Dm644 "completions/$_pkgname.fish" "$pkgdir/usr/share/fish/vendor_completions.d/$_pkgname.fish" + install -Dm644 "completions/$_pkgname.zsh" "$pkgdir/usr/share/zsh/site-functions/_$_pkgname" } |