commit:     8e08a861062b4f9e123271767574e29133d07359
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 17 09:38:58 2020 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Mon Aug 17 09:38:58 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e08a861

dev-python/quex: fix build for python3.7

Bug: https://bugs.gentoo.org/737374
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 dev-python/quex/files/quex-0.71.0-py37.patch | 11 ++++++
 dev-python/quex/quex-0.71.0-r1.ebuild        | 54 ++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/dev-python/quex/files/quex-0.71.0-py37.patch 
b/dev-python/quex/files/quex-0.71.0-py37.patch
new file mode 100644
index 00000000000..9c2ed48d549
--- /dev/null
+++ b/dev-python/quex/files/quex-0.71.0-py37.patch
@@ -0,0 +1,11 @@
+--- a/quex/input/code/base.py  2020-08-17 11:27:16.948578316 +0200
++++ b/quex/input/code/base.py  2020-08-17 11:27:27.604426654 +0200
+@@ -123,7 +123,7 @@
+     def set_source_reference(self, SourceReference): 
+         self.__source_reference = SourceReference
+ 
+-    @typed(Re=re._pattern_type)
++    @typed(Re=re.Pattern)
+     def contains_string(self, Re):  return self.__check_code(lambda x: 
Re.search(x) is not None)
+     def is_empty(self):             return not self.__check_code(lambda x: 
len(x) != 0)
+     def is_whitespace(self):        return not self.__check_code(lambda x: 
len(x.strip()) != 0)

diff --git a/dev-python/quex/quex-0.71.0-r1.ebuild 
b/dev-python/quex/quex-0.71.0-r1.ebuild
new file mode 100644
index 00000000000..7b55297c7f7
--- /dev/null
+++ b/dev-python/quex/quex-0.71.0-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_7 )
+
+inherit python-single-r1
+
+DESCRIPTION="Mode Oriented Directly Coded Lexical Analyser Generator"
+HOMEPAGE="http://quex.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.zip"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}"
+BDEPEND="${RDEPEND}
+       app-arch/unzip"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gentoo.patch
+       "${FILESDIR}"/${P}-py37.patch
+)
+
+src_prepare() {
+       default
+       sed -i \
+               -e "s:@PYTHON_SITEDIR@:$(python_get_sitedir):g" \
+               quex/DEFINITIONS.py || die
+       mkdir -p engine/codec_db/unicode || die
+       mv quex/engine/codec_db/database engine/codec_db/ || die
+       mv quex/engine/codec_db/unicode/database engine/codec_db/unicode/ || die
+       mv quex/code_base . || die
+}
+
+src_install() {
+       default
+       insinto /usr/share/quex/
+       doins -r engine
+       doins -r code_base
+
+       python_domodule quex
+       python_newscript quex-exe.py quex
+       doman manpage/quex.1
+       dodoc -r demo
+       insinto /etc/profile.d/
+       doins "${FILESDIR}"/quex.sh
+}

Reply via email to