blob: 28befcb3487618f9ff1640f0b1fcf158bb7a2bd7 (
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# Maintainer:
_pkgname="cvise"
pkgname="$_pkgname-git"
pkgver=2.12.0.r172.gfbbe8fc
pkgrel=1
pkgdesc="Super-parallel Python port of the C-Reduce"
url="https://github.com/marxin/cvise"
license=('NCSA')
arch=('x86_64')
depends=(
'clang'
'flex'
'python-chardet'
'python-jsonschema'
'python-msgspec' # AUR
'python-pebble' # AUR
'python-psutil'
'python-zstandard'
'tree-sitter-cli'
'unifdef'
)
makedepends=(
'cmake'
'git'
'llvm'
'ninja'
'python'
)
checkdepends=(
'python-pytest'
'python-pytest-mock'
'python-pytest-subprocess'
)
optdepends=('colordiff')
provides=("$_pkgname")
conflicts=("$_pkgname")
_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')
pkgver() (
cd "$_pkgsrc"
local _tmp _tag _version _revision _hash
_tmp=$(git tag | grep -Ev '[A-Za-z][A-Za-z]' | sed -E 's&([^0-9]*)(\S+)$&\2 \1\2&' | sort -rV | head -1)
_version=$(cut -f1 -d' ' <<< ${_tmp:?})
_tag=$(cut -f2 -d' ' <<< ${_tmp:?})
_revision=$(git rev-list --count --cherry-pick "$_tag"...HEAD)
_commit=$(git rev-parse --short=7 HEAD)
printf '%s.r%s.g%s' "${_version:?}" "${_revision:?}" "${_commit:?}"
)
build() {
local _cmake_options=(
-B build
-S "$_pkgsrc"
-G Ninja
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX='/usr'
-DCMAKE_INSTALL_LIBEXECDIR='lib'
-Wno-dev
)
cmake "${_cmake_options[@]}"
cmake --build build
}
check() {
ctest --test-dir build --rerun-failed --output-on-failure
}
package() {
DESTDIR="$pkgdir" cmake --install build
install -Dm644 "$_pkgsrc/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"
# remove tests
rm -rf "$pkgdir/usr/share/cvise/tests"
# specify python version to prevent untracked pyc files
local _pyver_major _pyver_minor
_pyver_major=$(python -c 'import sys; print(sys.version_info.major)')
_pyver_minor=$(python -c 'import sys; print(sys.version_info.minor)')
eval "depends+=(
'python>=${_pyver_major}.${_pyver_minor}'
'python<${_pyver_major}.$((_pyver_minor + 1))'
)"
# generate pyc files
python -m compileall -f -p / -s "$pkgdir" "$pkgdir/"
}
|