summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 853151b964d6da213c9c117a15f4c2d5c80f6266 (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
# Maintainer: Otreblan <otreblain@gmail.com>

pkgname=worldql-server-git
pkgver=r3.cd18230
pkgrel=1
pkgdesc="The spatial message broker and database for real-time multiplayer experiences."
arch=('x86_64')
url="https://github.com/WorldQL/worldql_server"
license=('GPL3')
groups=()
depends=('zeromq')
makedepends=('cargo' 'git')
checkdepends=()
optdepends=()
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/$pkgname"
	( set -o pipefail
	git describe --tags --long 2>/dev/null | sed 's/^v-//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

prepare() {
	cd "$srcdir/$pkgname"

	# Use system zeromq
	sed -i 's/, features = \["zmq-vendored"\] //' Cargo.toml

	cargo update
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$srcdir/$pkgname"

	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release --features zeromq,websocket
}

package() {
	cd "$srcdir/$pkgname"

	find target/release \
		-maxdepth 1 \
		-executable \
		-type f \
		-exec install -Dm0755 -t "$pkgdir/usr/bin/" {} +
}