aboutsummaryrefslogtreecommitdiffstats
path: root/testing/coccinelle/APKBUILD
blob: 202a1941d1d6b6f813c5f63c75b401be83e9e4f6 (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
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>

pkgname=coccinelle
pkgver=1.1.1
pkgrel=2
pkgdesc="provides the spatch matching and transformation engine implementing semantic patch language"
url="https://coccinelle.gitlabpages.inria.fr/website/"
makedepends="
	autoconf
	automake
	ocaml
	ocaml-findlib
	ocaml-num
	ocaml-ocamldoc
	"
depends="
	pcre
	python3
	"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	"
# riscv64, loongarch64: ocaml
arch="all !riscv64 !loongarch64"
license="GPL-2.0-only"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/coccinelle/coccinelle/archive/$pkgver.tar.gz

	unit-test-score.bin
	"

build() {
	./autogen
	./configure \
		--prefix=/usr \
		--enable-release=yes \
		--with-python=/usr/bin/python3

	# parallel build broken, but at least coccinelle is relatively small
	make -j 1
}

package() {
	make DESTDIR="$pkgdir" MANDIR="/usr/share/man" install
}

check() {
	# coccinelle runs unit tests and compares results with a score file to
	# track new regressions. We provide it as unit-test-score.bin new to the
	# APKBUILD.
	./spatch.opt \
		--testall \
		--no-update-score-file \
		--expected-score-file "$srcdir"/unit-test-score.bin
}

sha512sums="
f935aef406d3356a8e3d08fa7dacd6dd8d49aeb3f00668b775a63881b8d8a259acbbaa21348cb32a8a1cc5cf13dcf10d7e871de0f7c0abb6e45eac24e892df98  coccinelle-1.1.1.tar.gz
fbd6b52cbea7367f1dc103b9a1d6e7c0bb352952c6cc9436c484c1eb71d0fa605a67c51641be9dc3c72511f8efb78c2d937d4fae1986c3731905df2625c522d5  unit-test-score.bin
"