Gentoo Archives: gentoo-commits

From: Alfredo Tupone <tupone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ada/gnatcoll/, dev-ada/gnatcoll/files/
Date: Sat, 14 Sep 2019 17:10:34
Message-Id: 1568481016.16a5784a51534af0453811caa81181309aa4bf81.tupone@gentoo
1 commit: 16a5784a51534af0453811caa81181309aa4bf81
2 Author: Tupone Alfredo <tupone <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 14 17:10:16 2019 +0000
4 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 14 17:10:16 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16a5784a
7
8 dev-ada/gnatcoll: simplify using ada eclass
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
12
13 .../gnatcoll/files/gnatcoll-2017-r1-gentoo.patch | 186 +++++++++++++++++++++
14 dev-ada/gnatcoll/gnatcoll-2017-r1.ebuild | 129 ++++++++++++++
15 2 files changed, 315 insertions(+)
16
17 diff --git a/dev-ada/gnatcoll/files/gnatcoll-2017-r1-gentoo.patch b/dev-ada/gnatcoll/files/gnatcoll-2017-r1-gentoo.patch
18 new file mode 100644
19 index 00000000000..b8b92e4b737
20 --- /dev/null
21 +++ b/dev-ada/gnatcoll/files/gnatcoll-2017-r1-gentoo.patch
22 @@ -0,0 +1,186 @@
23 +--- a/Makefile 2017-01-20 19:39:07.131398270 +0100
24 ++++ b/Makefile 2017-01-20 19:42:30.088728844 +0100
25 +@@ -43,18 +43,18 @@
26 +
27 + # Build either type of library. The argument (%) is the type of library to build
28 +
29 +-GPRBLD_OPTS=-p -m -j${PROCESSORS} -XLIBRARY_TYPE=$(@F) -XGnatcoll_Build=${Gnatcoll_Build} -XXMLADA_BUILD=$(@F)
30 ++GPRBLD_OPTS=-p -m -j${PROCESSORS} -XGPR_BUILD=$(@F) -XLIBRARY_TYPE=$(@F) -XGnatcoll_Build=${Gnatcoll_Build} -XXMLADA_BUILD=$(@F)
31 +
32 + build_library_type/%: generate_sources
33 + @${RM} src/gnatcoll-atomic.adb
34 +
35 + @echo "====== Building $(@F) libraries ======"
36 +- ${GPRBUILD} ${GPRBLD_OPTS} -Pgnatcoll_full
37 ++ ${GPRBUILD} ${GPRBLD_OPTS} -Pgnatcoll_full -v -cargs ${ADAFLAGS}
38 +
39 + @# Need to build libgnatcoll_gtk separately, because its project files
40 + @# requires gtkada.gpr, which might not exist on the machine.
41 + ifeq (${WITH_GTK},yes)
42 +- ${GPRBUILD} ${GPRBLD_OPTS} -Psrc/gnatcoll_gtk
43 ++ ${GPRBUILD} ${GPRBLD_OPTS} -Psrc/gnatcoll_gtk -v -cargs ${ADAFLAGS}
44 + endif
45 +
46 + build_tools/%: build_library_type/%
47 +@@ -63,13 +63,14 @@
48 + @# They are not build as part of the above because only the Main from
49 + @# gnatcoll_full.gpr are build. We could use aggregate projects to
50 + @# speed things up.
51 +- ${GPRBUILD} ${GPRBLD_OPTS} -q -Psrc/gnatcoll_tools
52 ++ ${GPRBUILD} ${GPRBLD_OPTS} -q -Psrc/gnatcoll_tools -v -cargs ${ADAFLAGS}
53 +
54 + #######################################################################
55 + # install
56 +
57 + GPRINST_OPTS=-p -f --prefix=${prefix} --install-name=gnatcoll \
58 + --exec-subdir=${bindir} --project-subdir=lib/gnat -XXMLADA_BUILD=$(@F) \
59 ++ -XGPR_BUILD=$(@F) \
60 + --build-var=LIBRARY_TYPE --build-name=$(@F) -XLIBRARY_TYPE=$(@F)
61 +
62 + install-clean:
63 +--- a/gnatcoll_shared.gpr.in 2017-01-20 19:50:03.222808656 +0100
64 ++++ b/gnatcoll_shared.gpr.in 2017-01-20 19:50:28.200399274 +0100
65 +@@ -13,7 +13,7 @@
66 +
67 + type Yes_No is ("yes", "no");
68 + Gtk : Yes_No := External ("GTK", "@WITH_GTK@");
69 +- Python : Yes_No := External ("PYTHON", "@WITH_PYTHON@");
70 ++ Python : Yes_No := "@WITH_PYTHON@";
71 + Syslog : Yes_No := External ("SYSLOG", "@WITH_SYSLOG@");
72 + Postgres : Yes_No := External ("POSTGRES", "@WITH_POSTGRES@");
73 + type Sqlite_Inclusion is ("yes", "no", "embedded");
74 +--- a/testsuite/json/__init__.py 2017-04-24 17:52:34.158513249 +0200
75 ++++ b/testsuite/json/__init__.py 2017-04-24 17:52:52.636207017 +0200
76 +@@ -21,7 +21,7 @@
77 + @requires_not_aix # Storage_Error on that machine
78 + @chdir("MB28-001")
79 + def test_MB28_001(self):
80 +- self.runexec(["python", "make_json.py"])
81 ++ self.runexec(["python2.7", "make_json.py"])
82 + self.gprbuild()
83 + self.runexec("json_stack_test", "test.out")
84 +
85 +--- a/testsuite/projects/__init__.py 2017-04-24 19:10:30.465246199 +0200
86 ++++ b/testsuite/projects/__init__.py 2017-04-24 19:10:42.768035080 +0200
87 +@@ -105,25 +105,6 @@
88 + self.gprbuild("default.gpr")
89 + self.runexec("main", "")
90 +
91 +- @support.requires_not_windows
92 +- @chdir("N918-040")
93 +- def test_bareboard(self):
94 +- self.create_fake_bb_compiler('install', 'arm-eabi', '6.1.0w', '3.4.6')
95 +-
96 +- # Make sure auto.cgpr is not deleted on exit
97 +- try:
98 +- os.unlink('auto.cgpr')
99 +- except:
100 +- pass
101 +- self.gprbuild('main_prj', switches=['--autoconf=auto.cgpr'])
102 +- m = re.search('for Target use "(.*?)"', open('auto.cgpr').read())
103 +- target = m.group(1)
104 +-
105 +- def customFilter(actual):
106 +- return actual.replace(target, "<native>")
107 +-
108 +- self.runexec(['sh', 'test.sh'], 'test.out', customFilter=customFilter)
109 +-
110 + @chdir("NB12-045")
111 + def test_NB12_045(self):
112 + # Test registering attribute in unknown package
113 +--- a/src/tools/gnatcoll_db2ada.adb 2017-04-24 21:36:09.193973179 +0200
114 ++++ b/src/tools/gnatcoll_db2ada.adb 2017-04-24 21:36:16.029858932 +0200
115 +@@ -211,7 +211,7 @@
116 +
117 + declare
118 + Output : constant String := Get_Command_Output
119 +- (Command => "python",
120 ++ (Command => "python2.7",
121 + Arguments => Args,
122 + Input => "",
123 + Status => Status'Access,
124 +--- a/src/gnatcoll-projects.ads 2017-11-25 14:50:06.919939453 +0100
125 ++++ b/src/gnatcoll-projects.ads 2017-11-25 14:50:38.932387204 +0100
126 +@@ -1917,7 +1917,8 @@
127 + Predefined_Source_Files : GNATCOLL.VFS.File_Array_Access;
128 + -- The list of source files in Predefined_Source_Path
129 +
130 +- Default_Gnatls : GNAT.Strings.String_Access := new String'("gnatls");
131 ++ Default_Gnatls : GNAT.Strings.String_Access :=
132 ++ new String'("@GNATLS@");
133 + -- The default gnatls command to run.
134 +
135 + Xrefs_Subdir : GNAT.Strings.String_Access;
136 +--- a/src/tools/gnatinspect.adb 2017-11-25 14:52:47.282170250 +0100
137 ++++ b/src/tools/gnatinspect.adb 2017-11-25 14:52:57.691990254 +0100
138 +@@ -642,7 +642,7 @@
139 + GNAT_Version : GNAT.Strings.String_Access;
140 + begin
141 + Env.Set_Path_From_Gnatls
142 +- (Gnatls => "gnatls",
143 ++ (Gnatls => "@GNATLS@",
144 + GNAT_Version => GNAT_Version,
145 + Errors => Local_On_Error'Unrestricted_Access);
146 + Free (GNAT_Version);
147 +--- a/src/gnatcoll-projects.adb 2018-11-14 18:47:27.760365233 +0100
148 ++++ b/src/gnatcoll-projects.adb 2018-11-14 19:10:43.961337201 +0100
149 +@@ -3273,9 +3273,9 @@
150 + Status : out Status_Type;
151 + Result : out GNATCOLL.VFS.File_Array_Access)
152 + is
153 +- Mains_Str_List : String_List_Access;
154 ++ Mains_Str_List : String_Vectors.Vector;
155 + Closure_Status : GPR.Util.Status_Type;
156 +- Closures_List : String_List_Access;
157 ++ Closures_List : String_Vectors.Vector;
158 + begin
159 + Trace (Me, "Get_Closures");
160 +
161 +@@ -3287,25 +3287,18 @@
162 + return;
163 + end if;
164 +
165 +- Mains_Str_List := new String_List (Mains'First .. Mains'Last);
166 + for I in Mains'Range loop
167 +- Mains_Str_List (I) := new String'(Mains (I).Display_Base_Name);
168 ++ Mains_Str_List.Append (Mains (I).Display_Base_Name);
169 + end loop;
170 +
171 + GPR.Util.Get_Closures
172 + (Project.Get_View, Project.Tree_View,
173 +- Mains => Mains_Str_List.all,
174 ++ Mains => Mains_Str_List,
175 + All_Projects => All_Projects,
176 + Include_Externally_Built => Include_Externally_Built,
177 + Status => Closure_Status,
178 + Result => Closures_List);
179 +
180 +- -- Freeing temporary list of mains.
181 +- for I in Mains_Str_List'Range loop
182 +- Free (Mains_Str_List (I));
183 +- end loop;
184 +- Free (Mains_Str_List);
185 +-
186 + case Closure_Status is
187 + when Success =>
188 + Status := Success;
189 +@@ -3321,17 +3314,10 @@
190 + end case;
191 +
192 + if Closure_Status in Success | Incomplete_Closure then
193 +- for I in Closures_List'Range loop
194 +- Append (Result, Create (+Closures_List (I).all));
195 ++ for Closure of Closures_List loop
196 ++ Append (Result, Create (+Closure));
197 + end loop;
198 + end if;
199 +-
200 +- -- Freeing temporary list of closures.
201 +- for I in Closures_List'Range loop
202 +- Free (Closures_List (I));
203 +- end loop;
204 +- Free (Closures_List);
205 +-
206 + end Get_Closures;
207 +
208 + ----------------
209
210 diff --git a/dev-ada/gnatcoll/gnatcoll-2017-r1.ebuild b/dev-ada/gnatcoll/gnatcoll-2017-r1.ebuild
211 new file mode 100644
212 index 00000000000..ae3680e4ccc
213 --- /dev/null
214 +++ b/dev-ada/gnatcoll/gnatcoll-2017-r1.ebuild
215 @@ -0,0 +1,129 @@
216 +# Copyright 1999-2019 Gentoo Authors
217 +# Distributed under the terms of the GNU General Public License v2
218 +
219 +EAPI=7
220 +PYTHON_COMPAT=( python2_7 )
221 +ADA_COMPAT=( gnat_201{6,7} )
222 +inherit ada multilib multiprocessing autotools python-single-r1
223 +
224 +MYP=${PN}-gpl-${PV}
225 +
226 +DESCRIPTION="GNAT Component Collection"
227 +HOMEPAGE="http://libre.adacore.com"
228 +SRC_URI="http://mirrors.cdn.adacore.com/art/591c45e2c7a447af2deed016
229 + -> ${MYP}-src.tar.gz"
230 +
231 +LICENSE="GPL-3"
232 +SLOT="0"
233 +KEYWORDS="~amd64 ~x86"
234 +IUSE="gmp gtk iconv postgres pygobject projects readline
235 + +shared sqlite static-libs syslog tools"
236 +
237 +RDEPEND="${ADA_DEPS}
238 + ${PYTHON_DEPS}
239 + gmp? ( dev-libs/gmp:* )
240 + gtk? (
241 + dev-ada/gtkada[${ADA_USEDEP},shared?,static-libs?]
242 + dev-libs/atk
243 + dev-libs/glib
244 + x11-libs/cairo
245 + x11-libs/gdk-pixbuf
246 + x11-libs/gtk+:3
247 + x11-libs/pango
248 + )
249 + pygobject? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
250 + postgres? ( dev-db/postgresql:* )
251 + sqlite? ( dev-db/sqlite )
252 + projects? (
253 + >=dev-ada/libgpr-2018[${ADA_USEDEP},shared?,static-libs?]
254 + dev-ada/xmlada[shared?,static-libs?]
255 + )
256 + !dev-ada/gnatcoll-core
257 + !dev-ada/gnatcoll-bindings
258 + !dev-ada/gnatcoll-db"
259 +DEPEND="${RDEPEND}
260 + dev-ada/gprbuild[${ADA_USEDEP}]"
261 +
262 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
263 + tools? ( static-libs )
264 + pygobject? ( gtk )
265 + ${ADA_REQUIRED_USE}"
266 +
267 +S="${WORKDIR}"/${MYP}-src
268 +
269 +PATCHES=( "${FILESDIR}"/${P}-r1-gentoo.patch )
270 +
271 +src_prepare() {
272 + default
273 + mv configure.{in,ac} || die
274 + sed -i \
275 + -e "s:@GNATLS@:${GNATLS}:g" \
276 + src/gnatcoll-projects.ads \
277 + src/tools/gnatinspect.adb \
278 + || die
279 + eautoreconf
280 +}
281 +
282 +src_configure() {
283 + if use sqlite; then
284 + myConf="--with-sqlite=$(get_libdir)"
285 + else
286 + myConf="--without-sqlite"
287 + fi
288 + if use gtk ; then
289 + myConf="$myConf --with-gtk=3.0"
290 + else
291 + myConf="$myConf --with-gtk=no"
292 + fi
293 + econf \
294 + --with-python \
295 + $(use_with gmp) \
296 + $(use_with iconv) \
297 + $(use_with postgres postgresql) \
298 + $(use_enable projects) \
299 + $(use_enable pygobject) \
300 + $(use_enable readline gpl) \
301 + $(use_enable readline) \
302 + $(use_enable syslog) \
303 + --with-python-exec=${EPYTHON} \
304 + --enable-shared-python \
305 + --disable-pygtk \
306 + $myConf
307 +}
308 +
309 +src_compile() {
310 + if use shared; then
311 + emake PROCESSORS=$(makeopts_jobs) build_library_type/relocatable
312 + fi
313 + if use static-libs; then
314 + emake PROCESSORS=$(makeopts_jobs) build_library_type/static
315 + fi
316 + if use tools; then
317 + emake PROCESSORS=$(makeopts_jobs) build_tools/static
318 + fi
319 + python_fix_shebang .
320 +}
321 +
322 +src_install() {
323 + if use shared; then
324 + emake prefix="${D}usr" install_library_type/relocatable
325 + fi
326 + if use static-libs; then
327 + emake prefix="${D}usr" install_library_type/static
328 + fi
329 + if use tools; then
330 + emake prefix="${D}usr" install_tools/static
331 + fi
332 + emake prefix="${D}usr" install_gps_plugin
333 + einstalldocs
334 +}
335 +
336 +src_test() {
337 + # The test suite is in
338 + # To run you need to have the ada compiler available as gcc
339 + # Even in this case there are still some problems
340 + # Going into the testsuite directory and running
341 + # ./run.py -v -v
342 + # run here (having enabled most USE flags)
343 + true
344 +}