summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6e2844f99502df5efc2d831df59d9378abf6e90f (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
95
96
97
# Maintainer: Manuel Wiesinger <m {you know what belongs here} mmap {and here} at>
# Contributor: Omar Sandoval <osandov at osandov dot com>
# Contributor: Roger Zanoni <rogerzanoni@gmail.com>
# Contributor: Sylvain Henry <hsyl20@gmail.com>
# Contributor: Marti Raudsepp <marti@juffo.org>
# Contributor: Dan McGee <dpmcgee@gmail.com>
# Contributor: LeCrayonVert <sunrider@laposte.net>
# Contributor: Lukas Fleischer <archlinux@cryptocrack.de>
# Contributor: Vladimir Kirillov <proger@wilab.org.ua>

pkgname=coccinelle
pkgver=1.3.0
pkgrel=1
pkgdesc="C source code matching and transformation engine"
arch=('x86_64')
url="https://coccinelle.lip6.fr"
license=('GPL-2.0-or-later')
makedepends=(
    'ocaml'
    'ocaml-findlib'
    'ocaml-num'
    'ocaml-pcre'
    'ocaml-stdcompat'
)
depends=(
    'glibc'
    'pcre'
    'python'
    'zstd'
)
checkdepends=(
    'ocaml'
)
optdepends=(
    'ocaml: OCaml scripting feature'
    'ocaml-findlib: OCaml scripting feature'
)
source=(
    "$pkgname-$pkgver.tar.gz::https://github.com/coccinelle/${pkgname}/archive/${pkgver}.tar.gz"
    "0001-fix-bash-completion.patch"
)
b2sums=('f5aa1dfb138a2b9e306fb712294481dcd84042fc0c0f05711be83892b0d567134694ef8e7aad3762fb7d775ec2b02bfc7984b34bbe901b4566811fbaab9ffc5d'
        'be6b5bf866c14a5f0e95bd11472563292a37331d2a81b2e52f65bac6a635c5a48293de6bbabe63e9b63e7fb3fefc4083229bcf961b07c53f13796d8dc061f290')
options=('!strip')

prepare() {
    cd "$pkgname-$pkgver"
    patch -p1 < ../0001-fix-bash-completion.patch
}

build() {
    cd "$pkgname-$pkgver"

    ./autogen

    ./configure \
	--enable-ocaml \
	--enable-opt \
	--enable-pcre \
	--enable-pcre-syntax \
	--enable-python \
	--enable-stdcompat \
	\
	--prefix=/usr \
	--docdir=/usr/share/doc \
	--libdir=/usr/lib/ocaml \
	--mandir=/usr/share/man \
    # TODO, no package yet
    #  --enable-pyml \

    make
}

check() {
    cd "$pkgname-$pkgver"

    # make check is interactive, so do it manually

    ./spatch.opt --testall --no-update-score-file

    cd cpptests
    ../scripts/cpptests.sh
}

package() {
    cd "$pkgname-$pkgver"

    make DESTDIR="$pkgdir/" MANDIR="/usr/share/man" install

    strip \
	$pkgdir/usr/bin/spatch \
	$pkgdir/usr/bin/spgen \
	$pkgdir/usr/bin/spatch \
	$pkgdir/usr/bin/spgen \
	$pkgdir/usr/lib/ocaml/coccinelle/dllpyml_stubs.so \
	$pkgdir/usr/lib/ocaml/coccinelle/dllpyml_stubs.so
}