1 |
commit: bc6150aed4394093a938536ef2e8ee9c80395749 |
2 |
Author: Mark Wright <gienah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 22 10:26:38 2019 +0000 |
4 |
Commit: Mark Wright <gienah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 22 10:26:38 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc6150ae |
7 |
|
8 |
dev-lang/teyjus: Fix #677904 sandbox issue |
9 |
|
10 |
Closes: https://bugs.gentoo.org/677904 |
11 |
Package-Manager: Portage-2.3.71, Repoman-2.3.17 |
12 |
Signed-off-by: Mark Wright <gienah <AT> gentoo.org> |
13 |
|
14 |
dev-lang/teyjus/Manifest | 1 - |
15 |
...ixes-arity-for-pervasive-modulo-operation.patch | 28 ++++++++++++ |
16 |
...ing-literals-from-proper-character-groups.patch | 45 +++++++++++++++++++ |
17 |
...3-Removing-deprecated-function-String.set.patch | 51 ++++++++++++++++++++++ |
18 |
.../{teyjus-2.0.2.ebuild => teyjus-2.1-r1.ebuild} | 35 +++++++-------- |
19 |
5 files changed, 139 insertions(+), 21 deletions(-) |
20 |
|
21 |
diff --git a/dev-lang/teyjus/Manifest b/dev-lang/teyjus/Manifest |
22 |
index 17912760ca1..4f5eeec88c8 100644 |
23 |
--- a/dev-lang/teyjus/Manifest |
24 |
+++ b/dev-lang/teyjus/Manifest |
25 |
@@ -1,2 +1 @@ |
26 |
DIST teyjus-2.1.tar.gz 723763 BLAKE2B ab6a98c2d2291620b586ab0b419a214b0f7c0b27aad444324e5a417c1a0b27382e2d5c622f798ea88cab77853bca3305ec37904c50a7304ace20237afb993b91 SHA512 1f71d19502f4f4da00f635d2c3d4e141403182d65f039e0d43660edf84c5fcd900e7225ac92dc5bdbe0c8379c4e2ce6e27879af504fcfafddf2695a0c8a13379 |
27 |
-DIST teyjus-source-2.0-b2.tar.gz 465815 BLAKE2B 29d8cc2626144a77551a4cb47631a3b55d6edc33b3bf957c2b732144ce9566adb8d472b7ac423168605dcbabab507a4a3cd05b465b02fa0bbc3967a57183fc7c SHA512 071a25cd5341f7562f07dcaae1f87c35eb394ddab94a5160826c7fb2d9a51efea909b41947205503ebcc58df04388baf9eaf9f5a614186701940da29db1c1b29 |
28 |
|
29 |
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p001-Fixes-arity-for-pervasive-modulo-operation.patch b/dev-lang/teyjus/files/teyjus-2.1-p001-Fixes-arity-for-pervasive-modulo-operation.patch |
30 |
new file mode 100644 |
31 |
index 00000000000..0eb366f7c84 |
32 |
--- /dev/null |
33 |
+++ b/dev-lang/teyjus/files/teyjus-2.1-p001-Fixes-arity-for-pervasive-modulo-operation.patch |
34 |
@@ -0,0 +1,28 @@ |
35 |
+commit 4e53477a6685b515363f7123dbeeece4f60f103a |
36 |
+Author: Fabien Renaud <fafounet@×××××.com> |
37 |
+Date: Sun Aug 9 21:15:16 2015 +0200 |
38 |
+ |
39 |
+ Fixes arity for pervasive modulo operation |
40 |
+ |
41 |
+diff --git a/source/tables_gen/pervasives/pervasives.in b/source/tables_gen/pervasives/pervasives.in |
42 |
+index 2a332da..fcac330 100644 |
43 |
+--- a/source/tables_gen/pervasives/pervasives.in |
44 |
++++ b/source/tables_gen/pervasives/pervasives.in |
45 |
+@@ -91,8 +91,6 @@ |
46 |
+ TYPE 7 int -> int |
47 |
+ /* unary minus on integers */ |
48 |
+ 56 %i~ intuminus 0 0 0 TRUE FALSE MAX PREFIX NOCODE - |
49 |
+- /* modulus */ |
50 |
+- 61 mod mod 0 0 0 TRUE TRUE 160 INFIXL NOCODE |
51 |
+ /* integer abs */ |
52 |
+ 63 %iabs iabs 0 0 0 TRUE TRUE 0 NOFIXITY NOCODE abs |
53 |
+ ;; |
54 |
+@@ -107,6 +105,8 @@ |
55 |
+ 59 %i* intmult 0 0 0 TRUE FALSE 160 INFIXL NOCODE * |
56 |
+ /* integer division */ |
57 |
+ 60 div intdiv 0 0 0 TRUE FALSE 160 INFIXL NOCODE |
58 |
++ /* modulus */ |
59 |
++ 61 mod mod 0 0 0 TRUE TRUE 160 INFIXL NOCODE |
60 |
+ ;; |
61 |
+ |
62 |
+ /* int -> int -> o */ |
63 |
|
64 |
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p002-Add-string-literals-from-proper-character-groups.patch b/dev-lang/teyjus/files/teyjus-2.1-p002-Add-string-literals-from-proper-character-groups.patch |
65 |
new file mode 100644 |
66 |
index 00000000000..0d5e4acbb91 |
67 |
--- /dev/null |
68 |
+++ b/dev-lang/teyjus/files/teyjus-2.1-p002-Add-string-literals-from-proper-character-groups.patch |
69 |
@@ -0,0 +1,45 @@ |
70 |
+commit 78ba2ba7e42d06e64a7a10915259a4e419aa4ce4 |
71 |
+Merge: 4e53477 bb9ba6a |
72 |
+Author: fafounet <fafounet@×××××.com> |
73 |
+Date: Sat Feb 27 13:10:59 2016 +0100 |
74 |
+ |
75 |
+ Merge pull request #104 from robblanco/string-literals |
76 |
+ |
77 |
+ Add string literals from proper character groups |
78 |
+ |
79 |
+commit bb9ba6a57969c9eeab5841923ca822756860163c |
80 |
+Author: Rob Blanco <roberto.blanco@×××××.fr> |
81 |
+Date: Wed Feb 24 19:01:06 2016 +0100 |
82 |
+ |
83 |
+ Add string literals from proper character groups |
84 |
+ |
85 |
+ Escape prefixes were included in the strings being passed to the |
86 |
+ character composition functions, resulting in incorrect characters |
87 |
+ being generated (in the case of control characters) or exceptions |
88 |
+ being thrown (in octal and hex literals, in combination with the |
89 |
+ OCaml-specific prefixes). |
90 |
+ |
91 |
+diff --git a/source/compiler/lplex.mll b/source/compiler/lplex.mll |
92 |
+index 6cb28cd..6b2576a 100644 |
93 |
+--- a/source/compiler/lplex.mll |
94 |
++++ b/source/compiler/lplex.mll |
95 |
+@@ -215,11 +215,14 @@ and stringstate = parse |
96 |
+ | "\\\"" {addChar '"'; stringstate lexbuf} |
97 |
+ | "\"\"" {addChar '"'; stringstate lexbuf} |
98 |
+ |
99 |
+-| "\\^"['@'-'z'] as text {addControl text; stringstate lexbuf} |
100 |
+-| "\\" OCTAL as text {addOctal text; stringstate lexbuf} |
101 |
+-| "\\" (OCTAL OCTAL OCTAL) as text {addOctal text; stringstate lexbuf} |
102 |
+-| "\\x" HEX as text {addHex text; stringstate lexbuf} |
103 |
+-| "\\x" (HEX HEX) as text {addHex text; stringstate lexbuf} |
104 |
++| "\\^" (['@'-'z'] as text) {addControl (String.make 1 text); |
105 |
++ stringstate lexbuf} |
106 |
++| "\\" (OCTAL as text) {addOctal (String.make 1 text); |
107 |
++ stringstate lexbuf} |
108 |
++| "\\" (OCTAL OCTAL OCTAL as text) {addOctal text; stringstate lexbuf} |
109 |
++| "\\x" (HEX as text) {addHex (String.make 1 text); |
110 |
++ stringstate lexbuf} |
111 |
++| "\\x" (HEX HEX as text) {addHex text; stringstate lexbuf} |
112 |
+ |
113 |
+ | "\\x" _ {Errormsg.error lexbuf.lex_curr_p |
114 |
+ "Illegal hex character specification"; |
115 |
|
116 |
diff --git a/dev-lang/teyjus/files/teyjus-2.1-p003-Removing-deprecated-function-String.set.patch b/dev-lang/teyjus/files/teyjus-2.1-p003-Removing-deprecated-function-String.set.patch |
117 |
new file mode 100644 |
118 |
index 00000000000..a6724a9093a |
119 |
--- /dev/null |
120 |
+++ b/dev-lang/teyjus/files/teyjus-2.1-p003-Removing-deprecated-function-String.set.patch |
121 |
@@ -0,0 +1,51 @@ |
122 |
+commit 38772fa56ed7edef88e71df8a69eea4f341968ed |
123 |
+Author: Giselle Reis <giselle.mnr@×××××.com> |
124 |
+Date: Fri Jul 26 15:28:03 2019 +0300 |
125 |
+ |
126 |
+ Removing deprecated function String.set |
127 |
+ |
128 |
+ Teyjus will not build with a typecheck error |
129 |
+ because String.set takes bytes, not a string. This |
130 |
+ commit fixes this issue. |
131 |
+ String.set is deprecated, so Bytes.set is used |
132 |
+ instead. |
133 |
+ |
134 |
+diff --git a/source/compiler/bytecode.ml b/source/compiler/bytecode.ml |
135 |
+index 957c276..655ddab 100644 |
136 |
+--- a/source/compiler/bytecode.ml |
137 |
++++ b/source/compiler/bytecode.ml |
138 |
+@@ -248,28 +248,28 @@ let readWord () = readNBytes (getInChannel ()) (getWordSize ()) |
139 |
+ let readString () = |
140 |
+ let input = getInChannel () in |
141 |
+ let length = readNBytes input 4 in |
142 |
+- let myString = String.make length ' ' in |
143 |
++ let myString = Bytes.make length ' ' in |
144 |
+ let rec readStringAux index = |
145 |
+ if (index = length) then () |
146 |
+ else |
147 |
+- (String.set myString index (input_char input); |
148 |
++ (Bytes.set myString index (input_char input); |
149 |
+ readStringAux (index + 1)) |
150 |
+ in |
151 |
+ readStringAux 0; |
152 |
+- myString |
153 |
++ Bytes.to_string myString |
154 |
+ |
155 |
+ let readLongString () = |
156 |
+ let input = getInChannel() in |
157 |
+ let length = readNBytes input 4 in |
158 |
+- let myString = String.make length ' ' in |
159 |
++ let myString = Bytes.make length ' ' in |
160 |
+ let rec readStringAux index = |
161 |
+ if (index = length) then () |
162 |
+ else |
163 |
+- (String.set myString index (input_char input); |
164 |
++ (Bytes.set myString index (input_char input); |
165 |
+ readStringAux (index + 1)) |
166 |
+ in |
167 |
+ readStringAux 0; |
168 |
+- myString |
169 |
++ Bytes.to_string myString |
170 |
+ |
171 |
+ (* skip n bytes *) |
172 |
+ let skipNBytes numberBytes = |
173 |
|
174 |
diff --git a/dev-lang/teyjus/teyjus-2.0.2.ebuild b/dev-lang/teyjus/teyjus-2.1-r1.ebuild |
175 |
similarity index 74% |
176 |
rename from dev-lang/teyjus/teyjus-2.0.2.ebuild |
177 |
rename to dev-lang/teyjus/teyjus-2.1-r1.ebuild |
178 |
index 41a6ffe77a0..4a0f0073b3e 100644 |
179 |
--- a/dev-lang/teyjus/teyjus-2.0.2.ebuild |
180 |
+++ b/dev-lang/teyjus/teyjus-2.1-r1.ebuild |
181 |
@@ -1,16 +1,13 @@ |
182 |
-# Copyright 1999-2017 Gentoo Foundation |
183 |
+# Copyright 1999-2019 Gentoo Authors |
184 |
# Distributed under the terms of the GNU General Public License v2 |
185 |
|
186 |
-EAPI="6" |
187 |
+EAPI="7" |
188 |
|
189 |
-inherit elisp-common multilib versionator |
190 |
- |
191 |
-MY_PN="${PN}-source" |
192 |
-MY_P=$(version_format_string '${MY_PN}-$1.$2-b$3') |
193 |
+inherit elisp-common multilib |
194 |
|
195 |
DESCRIPTION="Higher-order logic programming language Lambda Prolog" |
196 |
HOMEPAGE="http://teyjus.cs.umn.edu/" |
197 |
-SRC_URI="https://teyjus.googlecode.com/files/${MY_P}.tar.gz" |
198 |
+SRC_URI="https://github.com/teyjus/teyjus/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
199 |
|
200 |
SLOT="0/${PV}" |
201 |
KEYWORDS="~amd64 ~x86" |
202 |
@@ -22,15 +19,18 @@ RDEPEND=">=sys-devel/binutils-2.17:* |
203 |
>=dev-lang/ocaml-3.10[ocamlopt?] |
204 |
emacs? ( virtual/emacs )" |
205 |
DEPEND="${RDEPEND} |
206 |
+ app-text/dos2unix |
207 |
dev-util/omake" |
208 |
|
209 |
-S=${WORKDIR}/${PN} |
210 |
- |
211 |
SITEFILE=50${PN}-gentoo.el |
212 |
|
213 |
+PATCHES=( "${FILESDIR}/${P}-p001-Fixes-arity-for-pervasive-modulo-operation.patch" |
214 |
+ "${FILESDIR}/${P}-p002-Add-string-literals-from-proper-character-groups.patch" |
215 |
+ "${FILESDIR}/${P}-p003-Removing-deprecated-function-String.set.patch") |
216 |
+ |
217 |
src_prepare() { |
218 |
+ find . -type f -exec dos2unix {} \; |
219 |
default |
220 |
- eapply "${FILESDIR}/${PN}-2.0.2-flags.patch" |
221 |
local cflags="" |
222 |
for i in ${CFLAGS} |
223 |
do |
224 |
@@ -41,9 +41,8 @@ src_prepare() { |
225 |
do |
226 |
lflags="${lflags} -cclib ${i}" |
227 |
done |
228 |
- sed -e "s@CFLAGS +=@CFLAGS += ${CFLAGS}@" \ |
229 |
- -e "s@LDFLAGS +=@LDFLAGS += ${LDFLAGS}@" \ |
230 |
- -e "s@OCAMLFLAGS +=@OCAMLFLAGS +=${cflags}${lflags}@" \ |
231 |
+ sed -e "s@\(OCAMLFLAGS= -w -A\)@\1 ${cflags}${lflags}@" \ |
232 |
+ -e "s@\(CFLAGS +=\) -g@\1 ${CFLAGS}\nLDFLAGS += ${LDFLAGS}@" \ |
233 |
-i "${S}/source/OMakefile" \ |
234 |
|| die "Could not set flags in ${S}/teyjus/source/OMakefile" |
235 |
if has_version ">=dev-lang/ocaml-4.03.0"; then |
236 |
@@ -60,12 +59,8 @@ src_prepare() { |
237 |
} |
238 |
|
239 |
src_compile() { |
240 |
- addpredict "/usr/$(get_libdir)/omake/Pervasives.omc" |
241 |
- addpredict "/usr/$(get_libdir)/omake/build/C.omc" |
242 |
- addpredict "/usr/$(get_libdir)/omake/build/Common.omc" |
243 |
- addpredict "/usr/$(get_libdir)/omake/configure/Configure.omc" |
244 |
- addpredict "/usr/$(get_libdir)/omake/build/OCaml.omc" |
245 |
- omake --verbose all || die "omake all failed" |
246 |
+ export HOME="${T}" |
247 |
+ omake --verbose --force-dotomake all || die "omake all failed" |
248 |
if use emacs ; then |
249 |
pushd "${S}/emacs" || die "Could change directory to emacs" |
250 |
elisp-compile *.el || die "emacs elisp compile failed" |
251 |
@@ -86,7 +81,7 @@ src_install() { |
252 |
newbin source/tjdis.opt tjdis |
253 |
newbin source/tjlink.opt tjlink |
254 |
newbin source/tjsim.opt tjsim |
255 |
- dodoc README |
256 |
+ dodoc README.md QUICKSTART |
257 |
if use emacs ; then |
258 |
elisp-install ${PN} emacs/*.{el,elc} |
259 |
cp "${FILESDIR}"/${SITEFILE} "${S}" |