commit:     361ee9dd497b8f13f9f36d0f4c96a99df17f09fa
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 23 17:20:12 2026 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Mon Feb 23 17:20:23 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=361ee9dd

dev-util/coccinelle: add 1.3.1

Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-util/coccinelle/Manifest                |   1 +
 dev-util/coccinelle/coccinelle-1.3.1.ebuild | 136 ++++++++++++++++++++++++++++
 2 files changed, 137 insertions(+)

diff --git a/dev-util/coccinelle/Manifest b/dev-util/coccinelle/Manifest
index 85f4f384e5fc..eb1a49b36d34 100644
--- a/dev-util/coccinelle/Manifest
+++ b/dev-util/coccinelle/Manifest
@@ -1,2 +1,3 @@
 DIST coccinelle-1.1.1.tar.bz2 2118055 BLAKE2B 
7efb0c86432c88daa1bce2710acdf2f62b6210c69245b4896ea8c5e39a0b28c538d94deae6ed1544e0ced66b2baa6edf8670f5e02dad40c2d1f5562326ce23e3
 SHA512 
fcb83203c91dae18122cf95f7db931d2e1576559b74a7a1c664c795437904acdffa005a8b9e732c1d99c8f0ab1c5f529d143eafe79c6397d28c4879848afca45
 DIST coccinelle-1.3.0.tar.bz2 2187014 BLAKE2B 
a56a85ead694cea26c142ebdf2e7e917bee5310758aeac3a9442b3a99bc52687325ec550362e29a6b922744ea08f76e64fdd65b0da5ffb8baa6713bb66b95d61
 SHA512 
ba04af40958a39997f01332c01533bf7889a506ce00e95ddbd5d5499cf62c228a1c30642536d2a46da8c58a70a781adc52c9421bbf9410bd3d41a599ce2375d9
+DIST coccinelle-1.3.1.tar.bz2 2304644 BLAKE2B 
44be7765cc25b147d0e01392270cc28b140282f646fdd737ab967cb2f7895f4a0fc83129f4bbdbdaea1bb102d61cc10e9988d419cc973f51dad9bd060ab037c8
 SHA512 
924aea43b4e927b6a1d0775e064b697abeeb4de0dd1dec8885ccdf1494d65336802a78d281f8e9179db625a8857d10e6585a28570e6f563273c2f31736083715

diff --git a/dev-util/coccinelle/coccinelle-1.3.1.ebuild 
b/dev-util/coccinelle/coccinelle-1.3.1.ebuild
new file mode 100644
index 000000000000..9af5e290dcc3
--- /dev/null
+++ b/dev-util/coccinelle/coccinelle-1.3.1.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..14} )
+inherit autotools bash-completion-r1 elisp-common python-single-r1
+
+DESCRIPTION="Program matching and transformation engine"
+HOMEPAGE="https://coccinelle.gitlabpages.inria.fr/website/ 
https://gitlab.inria.fr/coccinelle/coccinelle";
+SRC_URI="https://gitlab.inria.fr/coccinelle/coccinelle/-/archive/${PV}/${P}.tar.bz2";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc emacs +ocamlopt pcre python test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+# Test failures need investigation
+RESTRICT="strip !test? ( test ) test"
+
+RDEPEND="
+       dev-lang/ocaml:=[ocamlopt?]
+       dev-ml/sexplib:=[ocamlopt(+)?]
+       dev-ml/menhir:=[ocamlopt?]
+       dev-ml/camlp4:=[ocamlopt?]
+       dev-ml/parmap:=[ocamlopt?]
+       dev-ml/findlib:=[ocamlopt?]
+       dev-ml/stdcompat:=
+       emacs? ( >=app-editors/emacs-23.1:* )
+       pcre? (
+               dev-libs/libpcre
+               dev-ml/pcre-ocaml:=[ocamlopt?]
+       )
+       python? ( ${PYTHON_DEPS} )
+"
+DEPEND="${RDEPEND}"
+# dev-texlive/texlive-fontsextra contains 'ifsym.sty'
+BDEPEND="
+       virtual/pkgconfig
+       doc? (
+               dev-texlive/texlive-latexextra
+               dev-texlive/texlive-fontsextra
+               virtual/latex-base
+               dev-tex/hevea
+       )
+"
+
+DOCS=( authors.txt bugs.txt changes.txt credits.txt readme.txt )
+PATCHES=(
+       "${FILESDIR}"/${P}-bash-completion.patch
+       "${FILESDIR}"/${PN}-1.3.0-find-xxdate.patch
+       "${FILESDIR}"/${P}-shuffle.patch
+)
+SITEFILE=50coccinelle-gentoo.el
+
+pkg_setup() {
+       use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+       default
+
+       eautoreconf
+
+       if use python ; then
+               # Fix python install location
+               sed -e "s:\$(LIBDIR)/python:$(python_get_sitedir):" \
+                       -i Makefile || die
+       fi
+}
+
+src_configure() {
+       local myeconfargs=(
+               --enable-ocaml
+               --with-bash-completion="$(get_bashcompdir)"
+               --with-python="${EPYTHON}"
+
+               $(use_enable python)
+               $(use_enable pcre)
+               $(use_enable pcre pcre-syntax)
+               $(use_enable ocamlopt opt)
+       )
+
+       CONFIG_SHELL="${BROOT}"/bin/bash econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+       export TARGET_SPATCH=$(usev !ocamlopt 'byte-only')
+
+       emake VERBOSE=yes -j1 $(usex ocamlopt 'all.opt' 'all-dev')
+
+       if use doc ; then
+               VARTEXFONTS="${T}"/fonts emake VERBOSE=yes docs
+       fi
+
+       if use emacs ; then
+               elisp-compile editors/emacs/cocci.el || die
+       fi
+}
+
+src_test() {
+       # TODO: See Fedora's method?
+       # 
https://src.fedoraproject.org/rpms/coccinelle/blob/rawhide/f/coccinelle.spec#_231
+       emake VERBOSE=yes check $(usev python pycocci-check)
+}
+
+src_install() {
+       emake DESTDIR="${D}" PREFIX="${EPREFIX}" VERBOSE=yes -j1 install
+
+       if use python ; then
+               python_optimize
+       else
+               rm -rf "${ED}/usr/$(get_libdir)/${PN}/python" || die
+       fi
+
+       if use emacs ; then
+               elisp-install ${PN} editors/emacs/*
+               elisp-site-file-install "${FILESDIR}"/${SITEFILE}
+       fi
+
+       einstalldocs
+       use doc && dodoc docs/manual/*.pdf
+
+       newdoc editors/vim/README README-vim
+       rm editors/vim/README || die
+       insinto /usr/share/vim/vimfiles
+       doins -r editors/vim/*
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

Reply via email to