1 |
commit: 60324f1ab1eac2a18f7af728cdccefea8f0331ad |
2 |
Author: Tupone Alfredo <tupone <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 14 20:53:02 2017 +0000 |
4 |
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 14 20:53:51 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60324f1a |
7 |
|
8 |
dev-python/quex: Adding quex - Lexican Analyzer Generator |
9 |
|
10 |
Package-Manager: Portage-2.3.13, Repoman-2.3.3 |
11 |
|
12 |
dev-python/quex/Manifest | 1 + |
13 |
dev-python/quex/files/quex-0.65.4-gentoo.patch | 43 +++++++++++++++++++++++++ |
14 |
dev-python/quex/metadata.xml | 24 ++++++++++++++ |
15 |
dev-python/quex/quex-0.65.4.ebuild | 44 ++++++++++++++++++++++++++ |
16 |
4 files changed, 112 insertions(+) |
17 |
|
18 |
diff --git a/dev-python/quex/Manifest b/dev-python/quex/Manifest |
19 |
new file mode 100644 |
20 |
index 00000000000..28b6c4074ed |
21 |
--- /dev/null |
22 |
+++ b/dev-python/quex/Manifest |
23 |
@@ -0,0 +1 @@ |
24 |
+DIST quex-0.65.4.tar.gz 2202154 BLAKE2B 6b273998c9641aeee458291245a4fb956b5fe9b66d8c42f0c1d9b360a4d171c830a1d487bcbab9ccea49d10b7532ed488ce66dc165f31cce9521f97c5a4575f4 SHA512 0b11d7e5c5165674626fbbe7f54853656c579c63b78bd2fef2f5a9b316171dc647812d9a37df4e7c49c05de11a307b6425089f4ab281affb6c03a9cf09e2a035 |
25 |
|
26 |
diff --git a/dev-python/quex/files/quex-0.65.4-gentoo.patch b/dev-python/quex/files/quex-0.65.4-gentoo.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..cbe161a18e1 |
29 |
--- /dev/null |
30 |
+++ b/dev-python/quex/files/quex-0.65.4-gentoo.patch |
31 |
@@ -0,0 +1,43 @@ |
32 |
+--- quex-0.65.4/quex-exe.py.old 2017-12-13 21:42:48.633280478 +0100 |
33 |
++++ quex-0.65.4/quex-exe.py 2017-12-13 21:43:02.066040530 +0100 |
34 |
+@@ -40,11 +40,6 @@ |
35 |
+ print("error: Please, use Python versions 2.x.") |
36 |
+ sys.exit(-1) |
37 |
+ |
38 |
+-if os.environ.has_key("QUEX_PATH") == False: |
39 |
+- print("Environment variable QUEX_PATH has not been defined.") |
40 |
+-else: |
41 |
+- sys.path.insert(0, os.environ["QUEX_PATH"]) |
42 |
+- |
43 |
+ try: |
44 |
+ exception_checker.do_on_import(sys.argv) |
45 |
+ import quex.DEFINITIONS |
46 |
+--- quex-0.65.4/quex/DEFINITIONS.py.old 2017-12-13 21:48:52.887765325 +0100 |
47 |
++++ quex-0.65.4/quex/DEFINITIONS.py 2017-12-13 21:52:29.805877359 +0100 |
48 |
+@@ -23,7 +23,7 @@ |
49 |
+ QUEX_VERSION = '0.65.4' |
50 |
+ |
51 |
+ try: |
52 |
+- QUEX_INSTALLATION_DIR = os.environ["QUEX_PATH"] |
53 |
++ QUEX_INSTALLATION_DIR = "@PYTHON_SITEDIR@" |
54 |
+ # Note, that windows can also deal with backslashes. |
55 |
+ QUEX_INSTALLATION_DIR = QUEX_INSTALLATION_DIR.replace("\\", "/") |
56 |
+ except: |
57 |
+@@ -49,15 +49,14 @@ |
58 |
+ sys.exit(-1) # sys.exit(-1) is acceptable |
59 |
+ |
60 |
+ QUEX_PATH = QUEX_INSTALLATION_DIR |
61 |
+-QUEX_CODEC_DB_PATH = QUEX_PATH + "/quex/engine/codec_db/database" |
62 |
++QUEX_CODEC_DB_PATH = "/usr/share/quex/database" |
63 |
+ |
64 |
+-sys.path.insert(0, QUEX_INSTALLATION_DIR) |
65 |
+ |
66 |
+ def check(): |
67 |
+ global QUEX_INSTALLATION_DIR |
68 |
+ |
69 |
+ # -- Try to acces the file 'quex-exe.py' in order to verify |
70 |
+- if os.access(QUEX_INSTALLATION_DIR + "/quex-exe.py", os.F_OK) == False: |
71 |
++ if False: |
72 |
+ print "error: Environment variable 'QUEX_PATH' does not point to" |
73 |
+ print "error: a valid installation directory of quex." |
74 |
+ print "error: current setting of 'QUEX_PATH':" |
75 |
|
76 |
diff --git a/dev-python/quex/metadata.xml b/dev-python/quex/metadata.xml |
77 |
new file mode 100644 |
78 |
index 00000000000..7500e5f0c48 |
79 |
--- /dev/null |
80 |
+++ b/dev-python/quex/metadata.xml |
81 |
@@ -0,0 +1,24 @@ |
82 |
+<?xml version="1.0" encoding="UTF-8"?> |
83 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
84 |
+<pkgmetadata> |
85 |
+ <maintainer type="project"> |
86 |
+ <email>python@g.o</email> |
87 |
+ </maintainer> |
88 |
+ <maintainer type="person"> |
89 |
+ <email>tupone@g.o</email> |
90 |
+ <name>Tupone Alfredo</name> |
91 |
+ </maintainer> |
92 |
+ <longdescription lang="en"> |
93 |
+ It is: |
94 |
+ a tool to generate lexical analyzers. A lexical analyzer is a program |
95 |
+ that transforms a stream of characters into a stream of |
96 |
+ 'atomic chunks of meaning', so called tokens. |
97 |
+ |
98 |
+ It does: |
99 |
+ generate directly coded lexical analyzers, rather than table based |
100 |
+ engines. |
101 |
+ respond to queries on Unicode properties and regular expressions on the |
102 |
+ command line. |
103 |
+ generate state transition graphs of the generated engines. |
104 |
+ </longdescription> |
105 |
+</pkgmetadata> |
106 |
|
107 |
diff --git a/dev-python/quex/quex-0.65.4.ebuild b/dev-python/quex/quex-0.65.4.ebuild |
108 |
new file mode 100644 |
109 |
index 00000000000..0bf833a6419 |
110 |
--- /dev/null |
111 |
+++ b/dev-python/quex/quex-0.65.4.ebuild |
112 |
@@ -0,0 +1,44 @@ |
113 |
+# Copyright 1999-2017 Gentoo Foundation |
114 |
+# Distributed under the terms of the GNU General Public License v2 |
115 |
+ |
116 |
+EAPI=6 |
117 |
+ |
118 |
+PYTHON_COMPAT=( python2_7 ) |
119 |
+ |
120 |
+inherit python-single-r1 |
121 |
+ |
122 |
+DESCRIPTION="Mode Oriented Directly Coded Lexical Analyser Generator" |
123 |
+HOMEPAGE="http://quex.sourceforge.net/" |
124 |
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
125 |
+ |
126 |
+LICENSE="LGPL-2.1" |
127 |
+SLOT="0" |
128 |
+KEYWORDS="~amd64 ~x86" |
129 |
+IUSE="" |
130 |
+ |
131 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
132 |
+ |
133 |
+DEPEND="${PYTHON_DEPS}" |
134 |
+RDEPEND="${DEPEND}" |
135 |
+ |
136 |
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch ) |
137 |
+ |
138 |
+src_prepare() { |
139 |
+ default |
140 |
+ sed -i \ |
141 |
+ -e "s:@PYTHON_SITEDIR@:$(python_get_sitedir):g" \ |
142 |
+ quex/DEFINITIONS.py || die |
143 |
+ mv quex/engine/codec_db/database . || die |
144 |
+} |
145 |
+ |
146 |
+src_install() { |
147 |
+ default |
148 |
+ insinto /usr/share/quex |
149 |
+ doins -r database |
150 |
+ dosym $(python_get_sitedir)/quex/code_base /usr/include/quex/code_base |
151 |
+ |
152 |
+ python_domodule quex |
153 |
+ python_newexe quex-exe.py quex |
154 |
+ doman manpage/quex.1 |
155 |
+ dodoc -r demo |
156 |
+} |