summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4a5a46a347115e36745e1c76b5d15feb2607efb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Maintainer: Flaviu Tamas <me@flaviutamas.com>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Felix Golatofski <contact@xdfr.de>

# Upstream tests have multiple issues including race conditions, using external
# binaries, differing results based on unrelated system directories, etc.
# See https://github.com/nushell/nushell/issues/7951
# See https://github.com/nushell/nushell/issues/8404
BUILDENV+=(!check)

_pkgname=nushell
pkgname=$_pkgname-git
pkgver=0.76.0.r134.gc7583ec
pkgrel=1
pkgdesc='A new type of shell'
arch=('x86_64' 'i686' 'armv6h' 'armv7h')
url='https://www.nushell.sh'
_url="https://github.com/$_pkgname/$_pkgname"
license=('MIT')
depends=('openssl' 'libxcb' 'curl' 'bzip2')
makedepends=('git' 'cargo')
conflicts=("$_pkgname")
provides=("$_pkgname=$pkgver")
options=('!lto')
install=nushell.install
source=("${pkgname%-git}::git+$_url.git")
sha256sums=('SKIP')

prepare() {
	cd "${pkgname%-git}"
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

pkgver() {
	cd "${pkgname%-git}"
	git describe --long --abbrev=7 --tags HEAD |
		sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
	cd "${pkgname%-git}"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --release --frozen --workspace --features=extra,dataframe
}

check() {
	cd "${pkgname%-git}"
	export RUSTUP_TOOLCHAIN=stable
	cargo test --frozen --workspace --features=extra,dataframe
}

package() {
	cd "${pkgname%-git}"
	find target/release \
		-maxdepth 1 \
		-executable \
		-type f \
		-name "nu*" \
		-exec install -Dm0755 -t "$pkgdir/usr/bin/" {} +
	install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}