blob: ddf48911767ff9db31e23f5393a9e901e38b8b2d (
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
|
# Maintainer: Jonne Haß <me@jhass.eu>
# Contributor: Mikkel Kroman <mk@maero.dk>
pkgname=crystal-git
pkgver=1.10.1.r69.gf8fafc386c
pkgrel=1
pkgdesc="The Crystal Programming Language"
arch=('x86_64' 'aarch64')
url="http://crystal-lang.org"
license=('Apache')
depends=('gc' 'pcre2' 'libevent')
makedepends=('git' 'libxml2' 'llvm' 'crystal')
checkdepends=('libyaml' 'libxml2' 'gmp' 'git' 'inetutils')
optdepends=('shards: To make the crystal deps command work'
'libyaml: For YAML support'
'gmp: For BigInt support'
'libxml2: For XML support')
conflicts=('crystal')
provides=('crystal')
source=("git+https://github.com/crystal-lang/crystal.git")
pkgver() {
cd "$srcdir/${pkgname/-git/}"
( set -o pipefail
git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
prepare() {
cd "$srcdir/${pkgname/-git/}"
if [ "$CARCH" = "aarch64" ]; then
export EXPORT_CC="CC=cc" # prevent lld usage, broken on aarch64
fi
}
build() {
cd "$srcdir/${pkgname/-git/}"
make release=1 FLAGS="--no-debug" \
CRYSTAL_PATH="$srcdir/${pkgname/-git/}/src:$srcdir/${pkgname/-git}/lib" \
CRYSTAL_CACHE_DIR="/tmp/crystal"
make docs CRYSTAL_CACHE_DIR="/tmp/crystal"
}
check() {
cd "$srcdir/${pkgname/-git/}"
make -j1 compiler_spec std_spec \
CRYSTAL_PATH="$srcdir/${pkgname/-git/}/src:$srcdir/${pkgname/-git}/lib" \
CRYSTAL_CONFIG_VERSION="$pkgver" \
CRYSTAL_CACHE_DIR="/tmp/crystal"
}
package() {
cd "$srcdir/${pkgname/-git/}"
make install install_docs PREFIX="$pkgdir/usr"
install -Dm644 src/llvm/ext/llvm_ext.o "$pkgdir/usr/share/crystal/src/llvm/ext/llvm_ext.o"
cp -av lib/ "$pkgdir/usr/share/crystal/lib/"
}
sha256sums=('SKIP')
|