* [gentoo-commits] repo/gentoo:master commit in: dev-libs/tre/files/, dev-libs/tre/
@ 2017-03-18 7:33 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2017-03-18 7:33 UTC (permalink / raw
To: gentoo-commits
commit: 0f3e9cea7260add9bdb7c4cd326d6e6f5f890f90
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 16 19:32:23 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Mar 18 07:33:29 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f3e9cea
dev-libs/tre: Drop old (distutils.eclass)
dev-libs/tre/files/0.8.0-python.patch | 39 ---------------
dev-libs/tre/tre-0.8.0.ebuild | 89 -----------------------------------
2 files changed, 128 deletions(-)
diff --git a/dev-libs/tre/files/0.8.0-python.patch b/dev-libs/tre/files/0.8.0-python.patch
deleted file mode 100644
index f290e0bf578..00000000000
--- a/dev-libs/tre/files/0.8.0-python.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/python/setup.py b/python/setup.py
-index b420a4c..b1bca6b 100644
---- a/python/setup.py
-+++ b/python/setup.py
-@@ -10,7 +10,8 @@ import shutil
-
- version = "0.8.0"
- data_files = []
--include_dirs = ["../lib"]
-+include_dirs = ["lib"]
-+library_dirs = ["lib/.libs"]
- libraries = ["tre"]
-
- if sys.platform == "win32":
-@@ -28,9 +29,10 @@ setup(name = "tre",
- url = "http://laurikari.net/tre/",
- data_files = data_files,
- ext_modules = [Extension("tre",
-- sources = ["tre-python.c"],
-+ sources = ["python/tre-python.c"],
- define_macros = [("HAVE_CONFIG_H", None)],
- include_dirs = include_dirs,
-+ library_dirs = library_dirs,
- libraries = libraries
- ),
- ],
-diff --git a/python/tre-python.c b/python/tre-python.c
-index bbb24ed..2e35e3a 100644
---- a/python/tre-python.c
-+++ b/python/tre-python.c
-@@ -13,7 +13,7 @@
- #include "Python.h"
- #include "structmember.h"
-
--#include <tre/tre.h>
-+#include <tre.h>
-
- #define TRE_MODULE "tre"
-
diff --git a/dev-libs/tre/tre-0.8.0.ebuild b/dev-libs/tre/tre-0.8.0.ebuild
deleted file mode 100644
index b528d390dc6..00000000000
--- a/dev-libs/tre/tre-0.8.0.ebuild
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=3
-
-PYTHON_DEPEND="2"
-SUPPORT_PYTHON_ABIS="1"
-RESTRICT_PYTHON_ABIS="3.* *-jython"
-
-inherit distutils eutils
-
-DESCRIPTION="Lightweight, robust, and efficient POSIX compliant regexp matching library"
-HOMEPAGE="http://laurikari.net/tre/ https://github.com/laurikari/tre/"
-SRC_URI="http://laurikari.net/tre/${P}.tar.bz2"
-
-LICENSE="BSD-2"
-SLOT="0"
-KEYWORDS="alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-solaris"
-IUSE="nls python static-libs"
-
-RDEPEND="
- !app-misc/glimpse
- !app-text/agrep"
-DEPEND="${RDEPEND}
- virtual/pkgconfig
- nls? ( sys-devel/gettext )"
-
-DISTUTILS_SETUP_FILES=("python/setup.py")
-
-pkg_setup() {
- use python && python_pkg_setup
-}
-
-src_prepare() {
- epatch \
- "${FILESDIR}"/${PV}-python.patch \
- "${FILESDIR}"/${PV}-pkgcfg.patch
-}
-
-src_configure() {
- econf \
- --disable-dependency-tracking \
- --enable-agrep \
- --enable-system-abi \
- $(use_enable nls) \
- $(use_enable static-libs static)
-}
-
-src_compile() {
- emake || die
- use python && distutils_src_compile
-}
-
-src_test() {
- if $(locale -a | grep -iq en_US.iso88591); then
- emake -j1 \
- check || die
- else
- ewarn "If you like to run the test,"
- ewarn "please make sure en_US.ISO-8859-1 is installed."
- die "en_US.ISO-8859-1 locale is missing"
- fi
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die
-
- local exe_ext=
- [[ ${CHOST} = *mingw32* ]] && exe_ext=.exe
- mv "${ED}"/usr/bin/agrep{,-tre}${exe_ext} || die
-
- dodoc AUTHORS ChangeLog NEWS README THANKS TODO || die
- dohtml doc/*.{css,html} || die
- use python && distutils_src_install
-}
-
-pkg_postinst() {
- echo
- ewarn "app-misc/glimpse, app-text/agrep and this package all provide agrep."
- ewarn "If this causes any unforeseen incompatibilities please file a bug"
- ewarn "on https://bugs.gentoo.org."
- echo
-
- use python && distutils_pkg_postinst
-}
-
-pkg_postrm() {
- use python && distutils_pkg_postrm
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/tre/files/, dev-libs/tre/
@ 2022-03-21 22:07 Patrice Clement
0 siblings, 0 replies; 3+ messages in thread
From: Patrice Clement @ 2022-03-21 22:07 UTC (permalink / raw
To: gentoo-commits
commit: 93098055bb06d347ab414c6ff4f948c7ee9ea367
Author: Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Tue Mar 15 13:06:07 2022 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Mon Mar 21 22:06:07 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93098055
dev-libs/tre: add 0.8.0_p20210321
Closes: https://bugs.gentoo.org/296813
Closes: https://github.com/gentoo/gentoo/pull/24577
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
dev-libs/tre/Manifest | 1 +
dev-libs/tre/files/0.8.0-CVE-2016-8559.patch | 7 -
dev-libs/tre/files/0.8.0-pkgcfg.patch | 2 -
dev-libs/tre/files/tre-chicken.patch | 20 +++
dev-libs/tre/files/tre-issue37.patch | 11 ++
dev-libs/tre/files/tre-issue50.patch | 11 ++
dev-libs/tre/files/tre-issue55-part1.patch | 28 ++++
dev-libs/tre/files/tre-issue55-part2.patch | 11 ++
dev-libs/tre/files/tre-python3.patch | 191 +++++++++++++++++++++++++++
dev-libs/tre/files/tre-tests.patch | 10 ++
dev-libs/tre/metadata.xml | 5 +
dev-libs/tre/tre-0.8.0_p20210321.ebuild | 112 ++++++++++++++++
12 files changed, 400 insertions(+), 9 deletions(-)
diff --git a/dev-libs/tre/Manifest b/dev-libs/tre/Manifest
index 84c1c6408081..92f10ffb9446 100644
--- a/dev-libs/tre/Manifest
+++ b/dev-libs/tre/Manifest
@@ -1 +1,2 @@
DIST tre-0.8.0.tar.bz2 380714 BLAKE2B b2af6e805e9e19fd69debf2f881ddfb591317f69db4e29a04e1899eb69100b8ac7744f86fa438530509ca2ee8aa1d346d416c6391f13247cd9398f4c59c2ed85 SHA512 db7465993e0d25eee8e52f974427b8a040234cf0f017769eb94ee88bc6261821336aad7f762bfa82db7e2212d8449bc221592586f061c528a59a550773cbc263
+DIST tre-0.8.0_p20210321.tar.gz 146294 BLAKE2B d740bd0e99f50f5e4d8105f5260e43a81b6af9857a21e386e437ab8d48a9e0de23eae03e96cf6b9f4d2d37f72d0fa73ef7343086271ea80f166bdba3f04475a9 SHA512 950c81f681970fc737cfdd6815445f05a018fc742b964cea3ce19f0249c677dd715ece4ff8e543fa9f3fd23b503eafa00aea00dbae063af9bc7e08dc1bc33aed
diff --git a/dev-libs/tre/files/0.8.0-CVE-2016-8559.patch b/dev-libs/tre/files/0.8.0-CVE-2016-8559.patch
index 39ceae016446..923dbfbf3a2a 100644
--- a/dev-libs/tre/files/0.8.0-CVE-2016-8559.patch
+++ b/dev-libs/tre/files/0.8.0-CVE-2016-8559.patch
@@ -12,13 +12,6 @@ type, size_t, rather than int.
also improve comments, use calloc in place of malloc+memset, and
remove bogus casts.
----
- src/regex/regexec.c | 23 ++++++++++++++++++-----
- 1 file changed, 18 insertions(+), 5 deletions(-)
-
-Note: patch was modified to apply to tre, parts were taken from
-https://github.com/laurikari/tre/issues/37
-
--- a/lib/tre-match-parallel.c
+++ b/lib/tre-match-parallel.c
@@ -59,6 +59,7 @@
diff --git a/dev-libs/tre/files/0.8.0-pkgcfg.patch b/dev-libs/tre/files/0.8.0-pkgcfg.patch
index 82f803504282..7952619c9616 100644
--- a/dev-libs/tre/files/0.8.0-pkgcfg.patch
+++ b/dev-libs/tre/files/0.8.0-pkgcfg.patch
@@ -1,8 +1,6 @@
tre.pc.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
-diff --git a/tre.pc.in b/tre.pc.in
-index fdc45fa..b8d0676 100644
--- a/tre.pc.in
+++ b/tre.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
diff --git a/dev-libs/tre/files/tre-chicken.patch b/dev-libs/tre/files/tre-chicken.patch
new file mode 100644
index 000000000000..6047f9ae80d3
--- /dev/null
+++ b/dev-libs/tre/files/tre-chicken.patch
@@ -0,0 +1,20 @@
+--- a/python/setup.py
++++ b/python/setup.py
+@@ -10,7 +10,8 @@ import shutil
+
+ version = "0.8.0"
+ data_files = []
+-include_dirs = ["../lib"]
++include_dirs = ["../include"]
++library_dirs = ["../lib/.libs"]
+ libraries = ["tre"]
+
+ if sys.platform == "win32":
+@@ -31,6 +32,7 @@ setup(name = "tre",
+ sources = ["tre-python.c"],
+ define_macros = [("HAVE_CONFIG_H", None)],
+ include_dirs = include_dirs,
++ library_dirs = library_dirs,
+ libraries = libraries
+ ),
+ ],
diff --git a/dev-libs/tre/files/tre-issue37.patch b/dev-libs/tre/files/tre-issue37.patch
new file mode 100644
index 000000000000..43b0cded7d26
--- /dev/null
+++ b/dev-libs/tre/files/tre-issue37.patch
@@ -0,0 +1,11 @@
+--- a/lib/tre-parse.c
++++ b/lib/tre-parse.c
+@@ -1480,6 +1480,8 @@ tre_parse(tre_parse_ctx_t *ctx)
+ ctx->re++;
+ while (ctx->re_end - ctx->re >= 0)
+ {
++ if (i == sizeof(tmp))
++ return REG_EBRACE;
+ if (ctx->re[0] == CHAR_RBRACE)
+ break;
+ if (tre_isxdigit(ctx->re[0]))
diff --git a/dev-libs/tre/files/tre-issue50.patch b/dev-libs/tre/files/tre-issue50.patch
new file mode 100644
index 000000000000..f233953ce28f
--- /dev/null
+++ b/dev-libs/tre/files/tre-issue50.patch
@@ -0,0 +1,11 @@
+--- a/lib/tre-parse.c
++++ b/lib/tre-parse.c
+@@ -1341,7 +1341,7 @@ tre_parse(tre_parse_ctx_t *ctx)
+
+ case CHAR_RPAREN: /* end of current subexpression */
+ if ((ctx->cflags & REG_EXTENDED && depth > 0)
+- || (ctx->re > ctx->re_start
++ || (!(ctx->cflags & REG_EXTENDED) && ctx->re > ctx->re_start
+ && *(ctx->re - 1) == CHAR_BACKSLASH))
+ {
+ DPRINT(("tre_parse: empty: '%.*" STRF "'\n",
diff --git a/dev-libs/tre/files/tre-issue55-part1.patch b/dev-libs/tre/files/tre-issue55-part1.patch
new file mode 100644
index 000000000000..8e12cf683030
--- /dev/null
+++ b/dev-libs/tre/files/tre-issue55-part1.patch
@@ -0,0 +1,28 @@
+--- a/lib/tre-parse.c
++++ b/lib/tre-parse.c
+@@ -582,16 +582,23 @@
+ tre_parse_int(const tre_char_t **regex, const tre_char_t *regex_end)
+ {
+ int num = -1;
++ int overflow = 0;
+ const tre_char_t *r = *regex;
+ while (r < regex_end && *r >= L'0' && *r <= L'9')
+ {
+ if (num < 0)
+ num = 0;
+- num = num * 10 + *r - L'0';
++ if (num <= (INT_MAX - 9) / 10) {
++ num = num * 10 + *r - L'0';
++ } else {
++ /* This digit could cause an integer overflow. We do not return
++ * directly; instead, consume all remaining digits. */
++ overflow = 1;
++ }
+ r++;
+ }
+ *regex = r;
+- return num;
++ return overflow ? -1 : num;
+ }
+
+
diff --git a/dev-libs/tre/files/tre-issue55-part2.patch b/dev-libs/tre/files/tre-issue55-part2.patch
new file mode 100644
index 000000000000..b28a7a5f4901
--- /dev/null
+++ b/dev-libs/tre/files/tre-issue55-part2.patch
@@ -0,0 +1,11 @@
+--- a/lib/tre-parse.c
++++ b/lib/tre-parse.c
+@@ -641,7 +641,7 @@ tre_parse_bound(tre_parse_ctx_t *ctx, tre_ast_node_t **result)
+ }
+
+ /* Check that the repeat counts are sane. */
+- if ((max >= 0 && min > max) || max > RE_DUP_MAX)
++ if ((max >= 0 && min > max) || max > RE_DUP_MAX || min > RE_DUP_MAX)
+ return REG_BADBR;
+
+
diff --git a/dev-libs/tre/files/tre-python3.patch b/dev-libs/tre/files/tre-python3.patch
new file mode 100644
index 000000000000..b3068519e1dd
--- /dev/null
+++ b/dev-libs/tre/files/tre-python3.patch
@@ -0,0 +1,191 @@
+--- a/python/example.py
++++ b/python/example.py
+@@ -1,7 +1,7 @@
+ import tre
+
+ fz = tre.Fuzzyness(maxerr = 3)
+-print fz
++print (fz)
+
+ pt = tre.compile("Don(ald( Ervin)?)? Knuth", tre.EXTENDED)
+ data = """
+@@ -16,5 +16,5 @@ typefaces.
+ m = pt.search(data, fz)
+
+ if m:
+- print m.groups()
+- print m[0]
++ print (m.groups())
++ print (m[0])
+--- a/python/tre-python.c
++++ b/python/tre-python.c
+@@ -86,9 +86,9 @@ TreFuzzyness_repr(PyObject *obj)
+ TreFuzzynessObject *self = (TreFuzzynessObject*)obj;
+ PyObject *o;
+
+- o = PyString_FromFormat("%s(delcost=%d,inscost=%d,maxcost=%d,subcost=%d,"
++ o = PyUnicode_FromFormat("%s(delcost=%d,inscost=%d,maxcost=%d,subcost=%d,"
+ "maxdel=%d,maxerr=%d,maxins=%d,maxsub=%d)",
+- self->ob_type->tp_name, self->ap.cost_del,
++ Py_TYPE(self)->tp_name, self->ap.cost_del,
+ self->ap.cost_ins, self->ap.max_cost,
+ self->ap.cost_subst, self->ap.max_del,
+ self->ap.max_err, self->ap.max_ins,
+@@ -118,8 +118,7 @@ static PyMemberDef TreFuzzyness_members[
+ };
+
+ static PyTypeObject TreFuzzynessType = {
+- PyObject_HEAD_INIT(NULL)
+- 0, /* ob_size */
++ PyVarObject_HEAD_INIT(NULL, 0)
+ TRE_MODULE ".Fuzzyness", /* tp_name */
+ sizeof(TreFuzzynessObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+@@ -193,7 +192,7 @@ PyTreMatch_groups(TreMatchObject *self,
+ }
+
+ static PyObject *
+-PyTreMatch_groupi(PyObject *obj, int gn)
++PyTreMatch_groupi(PyObject *obj, Py_ssize_t gn)
+ {
+ TreMatchObject *self = (TreMatchObject*)obj;
+ PyObject *result;
+@@ -220,7 +219,7 @@ PyTreMatch_group(TreMatchObject *self, P
+ PyObject *result;
+ long gn;
+
+- gn = PyInt_AsLong(grpno);
++ gn = PyLong_AsLong(grpno);
+
+ if (PyErr_Occurred())
+ return NULL;
+@@ -277,8 +276,7 @@ static PySequenceMethods TreMatch_as_seq
+ };
+
+ static PyTypeObject TreMatchType = {
+- PyObject_HEAD_INIT(NULL)
+- 0, /* ob_size */
++ PyVarObject_HEAD_INIT(NULL, 0)
+ TRE_MODULE ".Match", /* tp_name */
+ sizeof(TreMatchObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+@@ -380,8 +378,8 @@ PyTrePattern_search(TrePatternObject *se
+ }
+ else
+ {
+- targ = PyString_AsString(pstring);
+- tlen = PyString_Size(pstring);
++ targ = PyBytes_AsString(pstring);
++ tlen = PyBytes_Size(pstring);
+
+ rc = tre_reganexec(&self->rgx, targ, tlen, &mo->am, fz->ap, eflags);
+ }
+@@ -433,8 +431,7 @@ PyTrePattern_dealloc(TrePatternObject *s
+ }
+
+ static PyTypeObject TrePatternType = {
+- PyObject_HEAD_INIT(NULL)
+- 0, /* ob_size */
++ PyVarObject_HEAD_INIT(NULL, 0)
+ TRE_MODULE ".Pattern", /* tp_name */
+ sizeof(TrePatternObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+@@ -467,7 +464,7 @@ static PyTypeObject TrePatternType = {
+ };
+
+ static TrePatternObject *
+-newTrePatternObject()
++newTrePatternObject(void)
+ {
+ TrePatternObject *self;
+
+@@ -482,7 +479,7 @@ static PyObject *
+ PyTre_ncompile(PyObject *self, PyObject *args)
+ {
+ TrePatternObject *rv;
+- PyUnicodeObject *upattern = NULL;
++ PyObject *upattern = NULL;
+ char *pattern = NULL;
+ int pattlen;
+ int cflags = 0;
+@@ -537,9 +534,8 @@ static PyMethodDef tre_methods[] = {
+ { NULL, NULL }
+ };
+
+-static char *tre_doc =
+-"Python module for TRE library\n\nModule exports "
+-"the only function: compile";
++
++#define tre_doc "Python module for TRE library\n\nModule exports the only function: compile"
+
+ static struct _tre_flags {
+ char *name;
+@@ -556,40 +552,57 @@ static struct _tre_flags {
+ { NULL, 0 }
+ };
+
++
++static struct PyModuleDef moduledef = {
++ PyModuleDef_HEAD_INIT,
++ TRE_MODULE ".Module", /* m_name */
++ tre_doc, /* m_doc */
++ -1, /* m_size */
++ tre_methods, /* m_methods */
++ NULL, /* m_reload */
++ NULL, /* m_traverse */
++ NULL, /* m_clear */
++ NULL, /* m_free */
++};
++
++
+ PyMODINIT_FUNC
+-inittre(void)
++PyInit_tre(void)
+ {
+ PyObject *m;
+ struct _tre_flags *fp;
+
+ if (PyType_Ready(&TreFuzzynessType) < 0)
+- return;
++ return NULL;
+ if (PyType_Ready(&TreMatchType) < 0)
+- return;
++ return NULL;
+ if (PyType_Ready(&TrePatternType) < 0)
+- return;
++ return NULL;
+
+ /* Create the module and add the functions */
+- m = Py_InitModule3(TRE_MODULE, tre_methods, tre_doc);
++
++ m = PyModule_Create (&moduledef);
++
+ if (m == NULL)
+- return;
++ return NULL;
+
+ Py_INCREF(&TreFuzzynessType);
+ if (PyModule_AddObject(m, "Fuzzyness", (PyObject*)&TreFuzzynessType) < 0)
+- return;
++ return NULL;
+ Py_INCREF(&TreMatchType);
+ if (PyModule_AddObject(m, "Match", (PyObject*)&TreMatchType) < 0)
+- return;
++ return NULL;
+ Py_INCREF(&TrePatternType);
+ if (PyModule_AddObject(m, "Pattern", (PyObject*)&TrePatternType) < 0)
+- return;
++ return NULL;
+ ErrorObject = PyErr_NewException(TRE_MODULE ".Error", NULL, NULL);
+ Py_INCREF(ErrorObject);
+ if (PyModule_AddObject(m, "Error", ErrorObject) < 0)
+- return;
++ return NULL;
+
+ /* Insert the flags */
+ for (fp = tre_flags; fp->name != NULL; fp++)
+ if (PyModule_AddIntConstant(m, fp->name, fp->val) < 0)
+- return;
++ return NULL;
++ return m;
+ }
diff --git a/dev-libs/tre/files/tre-tests.patch b/dev-libs/tre/files/tre-tests.patch
new file mode 100644
index 000000000000..c39ff9fb268d
--- /dev/null
+++ b/dev-libs/tre/files/tre-tests.patch
@@ -0,0 +1,10 @@
+--- tre-0.7.6/tests/agrep/run-tests.sh.tests
++++ tre-0.7.6/tests/agrep/run-tests.sh
+@@ -2,6 +2,7 @@
+
+ set -e
+
++export LD_LIBRARY_PATH=$top_builddir/lib/.libs
+ agrep="$top_builddir/src/agrep"
+
+ echo "$builddir $top_builddir $srcdir"
diff --git a/dev-libs/tre/metadata.xml b/dev-libs/tre/metadata.xml
index 4d02215649f9..f77edd54bfa6 100644
--- a/dev-libs/tre/metadata.xml
+++ b/dev-libs/tre/metadata.xml
@@ -8,4 +8,9 @@
<upstream>
<remote-id type="github">laurikari/tre</remote-id>
</upstream>
+ <use>
+ <flag name="agrep">Build agrep tool</flag>
+ <flag name="alloca">Enable if you want TRE to use alloca() instead of malloc() when allocating memory needed for regexec operations</flag>
+ <flag name="approx">Enable the approximate matching functionality</flag>
+ </use>
</pkgmetadata>
diff --git a/dev-libs/tre/tre-0.8.0_p20210321.ebuild b/dev-libs/tre/tre-0.8.0_p20210321.ebuild
new file mode 100644
index 000000000000..15ab1ee38acf
--- /dev/null
+++ b/dev-libs/tre/tre-0.8.0_p20210321.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+COMMIT="6092368aabdd0dbb0fbceb2766a37b98e0ff6911"
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
+
+inherit autotools distutils-r1
+
+DESCRIPTION="Lightweight, robust, and efficient POSIX compliant regexp matching library"
+HOMEPAGE="
+ https://laurikari.net/tre/
+ https://github.com/laurikari/tre
+"
+SRC_URI="https://github.com/laurikari/tre/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="+agrep +alloca +approx debug nls profile python"
+
+RDEPEND="
+ agrep? (
+ !app-text/agrep
+ !dev-ruby/amatch
+ !app-misc/glimpse
+ )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="
+ ${RDEPEND}
+ nls? ( sys-devel/gettext )
+"
+BDEPEND="virtual/pkgconfig"
+
+REQUIRED_USE="
+ agrep? ( approx )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+PATCHES=(
+ "${FILESDIR}/0.8.0-pkgcfg.patch"
+ "${FILESDIR}/0.8.0-CVE-2016-8559.patch"
+ "${FILESDIR}/${PN}-chicken.patch"
+ "${FILESDIR}/${PN}-issue37.patch"
+ "${FILESDIR}/${PN}-issue50.patch"
+ "${FILESDIR}/${PN}-issue55-part1.patch"
+ "${FILESDIR}/${PN}-issue55-part2.patch"
+ "${FILESDIR}/${PN}-python3.patch"
+ "${FILESDIR}/${PN}-tests.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --disable-static
+ --disable-system-abi
+ --enable-multibyte
+ --enable-wchar
+ $(use_enable agrep)
+ $(use_enable approx)
+ $(use_enable debug)
+ $(use_enable nls)
+ $(use_enable profile)
+ $(use_with alloca)
+ )
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ if locale -a | grep -iq en_US.iso88591; then
+ emake -j1 check
+ else
+ ewarn "If you like to run the test,"
+ ewarn "please make sure en_US.ISO-8859-1 is installed."
+ die "en_US.ISO-8859-1 locale is missing"
+ fi
+}
+
+src_compile() {
+ default
+ if use python; then
+ pushd "python" || die
+ python_foreach_impl distutils-r1_python_compile
+ popd || die
+ fi
+}
+
+src_install() {
+ local HTML_DOCS=( doc/*.{css,html} )
+
+ default
+ use python && python_foreach_impl python_install
+}
+
+pkg_postinst() {
+ ewarn "app-misc/glimpse, app-text/agrep and this package all provide agrep."
+ ewarn "If this causes any unforeseen incompatibilities please file a bug"
+ ewarn "on https://bugs.gentoo.org."
+}
+
+python_install() {
+ pushd "python" || die
+ distutils-r1_python_install
+ popd || die
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/tre/files/, dev-libs/tre/
@ 2024-08-16 2:25 Sam James
0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-08-16 2:25 UTC (permalink / raw
To: gentoo-commits
commit: ad45f6c5cbdc1c79899a1e092aafaebd1641f841
Author: Kostadin Shishmanov <kocelfc <AT> tutanota <DOT> com>
AuthorDate: Sun Jun 2 15:35:44 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 16 02:25:10 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad45f6c5
dev-libs/tre: fix building with gcc 14, remove nonexistent blockers
Patch is a part of https://github.com/laurikari/tre/pull/49
Remove blockers for app-text/agrep and app-misc/glimpse that are no
longer in the tree.
Closes: https://bugs.gentoo.org/932740
Signed-off-by: Kostadin Shishmanov <kocelfc <AT> tutanota.com>
Closes: https://github.com/gentoo/gentoo/pull/36980
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-libs/tre/files/tre-c99.patch | 23 ++++++
dev-libs/tre/tre-0.8.0_p20210321-r4.ebuild | 108 +++++++++++++++++++++++++++++
2 files changed, 131 insertions(+)
diff --git a/dev-libs/tre/files/tre-c99.patch b/dev-libs/tre/files/tre-c99.patch
new file mode 100644
index 000000000000..75375139f6c8
--- /dev/null
+++ b/dev-libs/tre/files/tre-c99.patch
@@ -0,0 +1,23 @@
+https://github.com/laurikari/tre/pull/49/commits/9c049c8c50a50a4f101aa45dd34bd138af7ed3cf
+https://bugs.gentoo.org/932740
+
+--- a/python/tre-python.c
++++ b/python/tre-python.c
+@@ -365,7 +365,7 @@ PyTrePattern_search(TrePatternObject *self, PyObject *args)
+
+ if (PyUnicode_Check(pstring))
+ {
+- Py_ssize_t len = PyUnicode_GetSize(pstring);
++ Py_ssize_t len = PyUnicode_GET_LENGTH(pstring);
+ wchar_t *buf = calloc(sizeof(wchar_t), len);
+ if(!buf)
+ {
+@@ -502,7 +502,7 @@ PyTre_ncompile(PyObject *self, PyObject *args)
+
+ if (upattern != NULL)
+ {
+- Py_ssize_t len = PyUnicode_GetSize(upattern);
++ Py_ssize_t len = PyUnicode_GET_LENGTH(upattern);
+ wchar_t *buf = calloc(sizeof(wchar_t), len);
+ if(!buf)
+ {
diff --git a/dev-libs/tre/tre-0.8.0_p20210321-r4.ebuild b/dev-libs/tre/tre-0.8.0_p20210321-r4.ebuild
new file mode 100644
index 000000000000..fa489c2c58fb
--- /dev/null
+++ b/dev-libs/tre/tre-0.8.0_p20210321-r4.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+COMMIT="6092368aabdd0dbb0fbceb2766a37b98e0ff6911"
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+DISTUTILS_EXT=1
+DISTUTILS_OPTIONAL=1
+
+inherit autotools distutils-r1
+
+DESCRIPTION="Lightweight, robust, and efficient POSIX compliant regexp matching library"
+HOMEPAGE="
+ https://laurikari.net/tre/
+ https://github.com/laurikari/tre
+"
+SRC_URI="https://github.com/laurikari/tre/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${COMMIT}"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos"
+IUSE="+agrep +alloca +approx debug nls profile python"
+
+RDEPEND="
+ agrep? (
+ !dev-ruby/amatch
+ )
+ python? ( ${PYTHON_DEPS} )
+"
+DEPEND="
+ ${RDEPEND}
+ nls? ( sys-devel/gettext )
+"
+BDEPEND="
+ python? ( ${DISTUTILS_DEPS} )
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+REQUIRED_USE="
+ agrep? ( approx )
+ python? ( ${PYTHON_REQUIRED_USE} )
+"
+
+PATCHES=(
+ "${FILESDIR}/0.8.0-pkgcfg.patch"
+ "${FILESDIR}/0.8.0-CVE-2016-8559.patch"
+ "${FILESDIR}/${PN}-chicken.patch"
+ "${FILESDIR}/${PN}-issue37.patch"
+ "${FILESDIR}/${PN}-issue50.patch"
+ "${FILESDIR}/${PN}-issue55-part1.patch"
+ "${FILESDIR}/${PN}-issue55-part2.patch"
+ "${FILESDIR}/${PN}-python3.patch"
+ "${FILESDIR}/${PN}-tests.patch"
+ "${FILESDIR}/${PN}-c99.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myconf=(
+ --disable-static
+ --disable-system-abi
+ --enable-multibyte
+ --enable-wchar
+ $(use_enable agrep)
+ $(use_enable approx)
+ $(use_enable debug)
+ $(use_enable nls)
+ $(use_enable profile)
+ $(use_with alloca)
+ )
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ if locale -a | grep -iq en_US.iso88591; then
+ emake -j1 check
+ else
+ ewarn "If you like to run the test,"
+ ewarn "please make sure en_US.ISO-8859-1 is installed."
+ die "en_US.ISO-8859-1 locale is missing"
+ fi
+}
+
+src_compile() {
+ default
+
+ if use python; then
+ cd python || die
+ distutils-r1_src_compile
+ fi
+}
+
+src_install() {
+ local HTML_DOCS=( doc/*.{css,html} )
+
+ default
+
+ use python && distutils-r1_src_install
+
+ find "${ED}" -type f -name '*.la' -delete || die
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-16 2:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16 2:25 [gentoo-commits] repo/gentoo:master commit in: dev-libs/tre/files/, dev-libs/tre/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2022-03-21 22:07 Patrice Clement
2017-03-18 7:33 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox