blob: 8a7fd548c9a5a943b677d12920537ec6892cf410 (
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
64
65
66
67
68
69
|
# Maintainer: Caleb Maclennan <caleb@alerque.com>
pkgname=teamtype-git
_pkgname=${pkgname%-git}
pkgver=0.9.2.r0.ge05a267
pkgrel=2
pkgdesc='Peer-to-peer, editor-agnostic collaborative editing of local text files'
arch=(x86_64)
url="https://github.com/$_pkgname/$_pkgname"
license=(AGPL-3.0-only)
depends=(glibc # libc.so libm.so
libgcc libgcc_s.so
libgit2 libgit2.so
zlib)
makedepends=(cargo
git)
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname")
replaces=(ethersync-git)
source=("git+$url.git")
sha256sums=('SKIP')
pkgver() {
cd "${pkgname%-git}"
git describe --long --abbrev=7 --tags --match="v*" |
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
_srcenv() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
export CARGO_HOME="$srcdir"
export CARGO_PROFILE_RELEASE_DEBUG=2
export CARGO_PROFILE_RELEASE_STRIP=false
export CARGO_PROFILE_RELEASE_LTO=true
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_OPT_LEVEL=3
CFLAGS+=' -ffat-lto-objects'
export LIBGIT2_NO_VENDOR=1
}
prepare() {
_srcenv
cargo fetch --locked --target host-tuple
}
build() {
_srcenv
cargo build --frozen --release
}
check() {
_srcenv
cargo test --frozen -p $_pkgname
}
package() {
cd "$_pkgname/target"
install -Dm755 -t "$pkgdir/usr/bin/" "release/$_pkgname"
pushd completions
install -Dm0644 -t "$pkgdir/usr/share/bash-completion/completions/" "$_pkgname.bash"
install -Dm0644 -t "$pkgdir/usr/share/elvish/lib/" "$_pkgname.elv"
install -Dm0644 -t "$pkgdir/usr/share/fish/vendor_completions.d/" "$_pkgname.fish"
# install -Dm0644 -t "$pkgdir/usr/share/nushell/vendor/autoload/" "$_pkgname.nu"
install -Dm0644 -t "$pkgdir/usr/share/zsh/site-functions/" "_$_pkgname"
pushd ../manpages
install -Dm0644 -t "$pkgdir/usr/share/man/man1/" $_pkgname*.1
}
|