summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ee1b80a94f2914ca78b27a8e6a0a605ad9737f52 (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
98
99
100
101
102
103
104
105
106
# 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>

_basename=coccinelle
pkgname=$_basename-git
pkgver=1.3.1.r2.g5bf4aac
pkgrel=2
pkgdesc="C source code matching and transformation engine"
arch=('x86_64')
url="https://coccinelle.gitlabpages.inria.fr/website/"
license=('GPL-2.0-or-later')
makedepends=(
    'ocaml'
    'ocaml-findlib'
    'ocaml-menhir'
    'ocaml-num'
    'ocaml-parmap'
    'ocaml-pcre'
    'ocaml-pyml'
    'ocaml-stdcompat'
)
depends=(
    'glibc'
    'pcre'
    'python'
    'zstd'
)
checkdepends=(
    'ocaml'
)
optdepends=(
    'ocaml: OCaml scripting feature'
    'ocaml-findlib: OCaml scripting feature'
    'python-psycopg2: PostgreSQL support for Python bindings'
)
source=("git+https://gitlab.inria.fr/coccinelle/coccinelle.git")
b2sums=('SKIP')
options=('!strip')
provides=($_basename)
conflicts=($_basename)

prepare() {
    cd $_basename
    git clean -dfx
}

pkgver() {
    cd $_basename
    git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd $_basename

    ./autogen

    ./configure \
	--enable-bytes \
	--enable-dynlink \
	--enable-menihr \
	--enable-ocaml \
	--enable-opt \
	--enable-opt \
	--enable-pcre \
	--enable-pcre-syntax \
	--enable-pyml \
	--enable-python \
	--enable-stdcompat \
	--enable-parmap \
	\
	--prefix=/usr \
	--docdir=/usr/share/doc \
	--libdir=/usr/lib/ocaml \
	--mandir=/usr/share/man \
    make
}

check() {
    cd $_basename
    make check
}

package() {
    cd $_basename

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

    # Emacs modes
    install -Dm644 editors/emacs/cocci.el -t $pkgdir/usr/share/emacs/site-lisp
    install -Dm644 editors/emacs/cocci-ediff.el -t $pkgdir/usr/share/emacs/site-lisp

    # vim
    install -Dm644 editors/vim/ftdetect/cocci.vim -t $pkgdir/usr/share/vim/vimfiles/ftdetect
    install -Dm644 editors/vim/syntax/cocci.vim -t $pkgdir/usr/share/vim/vimfiles/syntax

    strip \
	$pkgdir/usr/bin/spatch \
	$pkgdir/usr/bin/spgen
}