summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a0366031b4c725aeb123bff6d99b88cf761662d6 (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgbase=xet
pkgname=(git-xet xetcmd xetmnt)
pkgver=0.14.4
pkgrel=1
pkgdesc='CLI tools for working with XetHub'
arch=(x86_64)
url=https://xethub.com
_url='https://github.com/xetdata/xet-core'
license=(BSD)
depends=(gcc-libs
         glibc
         openssl
         zlib libz.so)
makedepends=(cargo
             protobuf
             openssl)
_archive="xet-core-$pkgver"
options=(!lto)
source=("$_url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('0afd5a912e2beaf10429bf1f216c0a76db3dc385a05ec4d406d146bde7a230a4')

prepare() {
	cd "$_archive"
	# Upstream lockfile not synced
	pushd rust;   cargo update; popd
	pushd rust;   cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"; popd
	pushd gitxet; cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"; popd
	# pushd libxet; cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"; popd
}

build() {
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	CFLAGS+=' -ffat-lto-objects'
	cd "$_archive"
	pushd rust; cargo build --frozen --release; popd
	pushd gitxet; cargo build --frozen --release; popd
	# pushd libxet; cargo build --frozen --release; popd
}

_package() {
	cd "$_archive/$1"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" ../LICENSE
}

package_git-xet() {
	_package gitxet
}

package_xetcmd() {
	_package rust
}

package_xetmnt() {
	depends+=(git-xet)
	_package gitxet
}