Skip to content

Commit

Permalink
dev-ada/gnatcoll: Add version 2017
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.6, Repoman-2.3.1
  • Loading branch information
atupone committed Jun 24, 2017
1 parent 9bae7ef commit c522884
Show file tree
Hide file tree
Showing 3 changed files with 354 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-ada/gnatcoll/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST gnatcoll-gpl-2016-src.tar.gz 5687584 SHA256 8cc7cc01db548447a78e3d6d35a35867514beb625009abbcd3be124c1e259b3b SHA512 8cf06e7c5d58d3b159855534791e7969882e04856ba9d03982a63dcfc630f5b5910c6cad57fec9b00c3d04008b0cb0a1fb238e349766348fa4548868238ede8a WHIRLPOOL d37c12bb6242d92104e89b7c1d9a9cd94d802137ee32faa58687700a822db69e2739372376d12032228843c2a5356f8085d6072715b8bc1bda411039d20b55f5
DIST gnatcoll-gpl-2017-src.tar.gz 5785988 SHA256 66168ee795a67dde3b8a8d0fe6663a776d1bdf50091e6cdd47f3837d89afd434 SHA512 e8b7f2c00816597f33496168bf8928841a2037e517908810761849e23633b2c229d47e4bfaa808e5a619da52bc165f17b8aefa5dee39ecf1a6773b3b1db80363 WHIRLPOOL a0fbda792b282ecb184057efa98332f0b790c9412ba6fec541fbcb8c57cab48f64df6ff81017c283e599cda858d668f5f8fcf5b7bd771c23f34a84a6d16f4c79
224 changes: 224 additions & 0 deletions dev-ada/gnatcoll/files/gnatcoll-2017-gentoo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
--- gnatcoll-gpl-2016-src/Makefile.old 2017-01-20 19:39:07.131398270 +0100
+++ gnatcoll-gpl-2016-src/Makefile 2017-01-20 19:42:30.088728844 +0100
@@ -49,12 +49,12 @@
@${RM} src/gnatcoll-atomic.adb

@echo "====== Building $(@F) libraries ======"
- ${GPRBUILD} ${GPRBLD_OPTS} -Pgnatcoll_full
+ ${GPRBUILD} ${GPRBLD_OPTS} -Pgnatcoll_full -cargs ${ADAFLAGS}

@# Need to build libgnatcoll_gtk separately, because its project files
@# requires gtkada.gpr, which might not exist on the machine.
ifeq (${WITH_GTK},yes)
- ${GPRBUILD} ${GPRBLD_OPTS} -Psrc/gnatcoll_gtk
+ ${GPRBUILD} ${GPRBLD_OPTS} -Psrc/gnatcoll_gtk -cargs ${ADAFLAGS}
endif

build_tools/%: build_library_type/%
@@ -63,7 +63,7 @@
@# They are not build as part of the above because only the Main from
@# gnatcoll_full.gpr are build. We could use aggregate projects to
@# speed things up.
- ${GPRBUILD} ${GPRBLD_OPTS} -q -Psrc/gnatcoll_tools
+ ${GPRBUILD} ${GPRBLD_OPTS} -q -Psrc/gnatcoll_tools -cargs ${ADAFLAGS}

#######################################################################
# install
--- gnatcoll-gpl-2015-src/src/gnatcoll_iconv.gpr.old 2017-01-07 08:58:01.361112843 +0100
+++ gnatcoll-gpl-2015-src/src/gnatcoll_iconv.gpr 2017-01-07 08:58:23.653687385 +0100
@@ -26,6 +26,7 @@

package Compiler is
for Switches ("Ada") use GnatColl_Shared.Compiler'Switches ("Ada");
+ for Driver ("C") use External ("GCC", "gcc");
for Switches ("C") use GnatColl_Shared.Compiler'Switches ("C")
& GnatColl_Shared.Iconv_Include;
end Compiler;
--- gnatcoll-gpl-2015-src/src/gnatcoll_sqlite.gpr.old 2017-01-07 09:00:17.146448202 +0100
+++ gnatcoll-gpl-2015-src/src/gnatcoll_sqlite.gpr 2017-01-07 09:00:44.884885281 +0100
@@ -60,8 +60,9 @@

-- force full optimization for sqlite, we do not debug it
-- in any case.
"-O3") & Gnatcoll_Shared.Sqlite_Switches;
end case;
+ for Driver ("C") use External ("GCC", "gcc");
end Compiler;

package Linker is
--- gnatcoll-gpl-2015-src/src/gnatcoll_postgres.gpr.old 2017-01-07 09:05:09.177756146 +0100
+++ gnatcoll-gpl-2015-src/src/gnatcoll_postgres.gpr 2017-01-07 09:05:34.282279733 +0100
@@ -38,6 +38,7 @@
for Switches ("C") use
GnatColl_Shared.Compiler'Switches ("C");
end case;
+ for Driver ("C") use External ("GCC", "gcc");
end Compiler;

package Linker is
--- gnatcoll-gpl-2016-src/gnatcoll_shared.gpr.in.old 2017-01-20 19:50:03.222808656 +0100
+++ gnatcoll-gpl-2016-src/gnatcoll_shared.gpr.in 2017-01-20 19:50:28.200399274 +0100
@@ -13,7 +13,7 @@

type Yes_No is ("yes", "no");
Gtk : Yes_No := External ("GTK", "@WITH_GTK@");
- Python : Yes_No := External ("PYTHON", "@WITH_PYTHON@");
+ Python : Yes_No := "@WITH_PYTHON@";
Syslog : Yes_No := External ("SYSLOG", "@WITH_SYSLOG@");
Postgres : Yes_No := External ("POSTGRES", "@WITH_POSTGRES@");
type Sqlite_Inclusion is ("yes", "no", "embedded");
--- gnatcoll-gpl-2016-src/src/gnatcoll__libgpr.gpr.old 2017-02-04 15:56:11.685079607 +0100
+++ gnatcoll-gpl-2016-src/src/gnatcoll__libgpr.gpr 2017-02-04 15:57:00.383221978 +0100
@@ -49,6 +49,8 @@
package Builder renames GnatColl_Shared.Builder;

package Compiler is
+ for Driver ("C") use External ("GCC", "gcc");
+
for Switches ("Ada") use GnatColl_Shared.Compiler'Switches ("Ada");
for Switches ("C") use GnatColl_Shared.Compiler'Switches ("C");
for Switches ("sinfo.adb") use Compiler'Switches ("Ada") & ("-gnatg");
--- gnatcoll-gpl-2016-src/src/gnatcoll__nogpr.gpr.old 2017-02-04 15:58:41.008450044 +0100
+++ gnatcoll-gpl-2016-src/src/gnatcoll__nogpr.gpr 2017-02-04 15:59:02.815066080 +0100
@@ -64,6 +64,7 @@
for Switches ("Ada") use GnatColl_Shared.Compiler'Switches ("Ada");
for Switches ("C") use GnatColl_Shared.Compiler'Switches ("C");
for Switches ("sinfo.adb") use Compiler'Switches ("Ada") & ("-gnatg");
+ for Driver ("C") use External ("GCC", "gcc");

case GnatColl_Shared.Atomics is
when "intrinsic" =>
--- gnatcoll-gpl-2016-src/aclocal.m4.old 2017-04-06 08:25:14.796699365 +0200
+++ gnatcoll-gpl-2016-src/aclocal.m4 2017-04-06 08:25:36.622318016 +0200
@@ -45,7 +45,7 @@
cat > conftest.ada <<EOF
[$3]
EOF
- if AC_TRY_COMMAND([gnatchop -q conftest.ada && $1 $2 >/dev/null 2>conftest.out])
+ if AC_TRY_COMMAND([${GNATCHOP} -q conftest.ada && $1 $2 >/dev/null 2>conftest.out])
then
: Success
$4
@@ -68,7 +68,7 @@
AC_DEFUN(AM_HAS_INTRINSIC_SYNC_COUNTERS,
[
AC_MSG_CHECKING([whether platform supports atomic inc/dec])
- AM_TRY_ADA([gnatmake], [check.adb],
+ AM_TRY_ADA([${GNATMAKE}], [check.adb],
[
with Interfaces; use Interfaces;
procedure Check is
--- gnatcoll-gpl-2016-src/testsuite/json/__init__.py.old 2017-04-24 17:52:34.158513249 +0200
+++ gnatcoll-gpl-2016-src/testsuite/json/__init__.py 2017-04-24 17:52:52.636207017 +0200
@@ -21,7 +21,7 @@
@requires_not_aix # Storage_Error on that machine
@chdir("MB28-001")
def test_MB28_001(self):
- self.runexec(["python", "make_json.py"])
+ self.runexec(["python2.7", "make_json.py"])
self.gprbuild()
self.runexec("json_stack_test", "test.out")

--- gnatcoll-gpl-2016-src/testsuite/projects/aggregate_create/c1/c.gpr.old 2017-04-24 18:00:21.652975475 +0200
+++ gnatcoll-gpl-2016-src/testsuite/projects/aggregate_create/c1/c.gpr 2017-04-24 18:01:23.035983670 +0200
@@ -15,5 +15,6 @@
for Default_Switches ("ada") use
("-g", "-gnatQ", "-O1", "-gnatf", "-gnato", "-gnatwa.Xe", "-gnaty");
+ for Driver ("c") use External ("GCC", "gcc");
end Compiler;

end c;
--- gnatcoll-gpl-2016-src/testsuite/projects/aggregate_create/c2/c.gpr.old 2017-04-24 18:01:28.394896928 +0200
+++ gnatcoll-gpl-2016-src/testsuite/projects/aggregate_create/c2/c.gpr 2017-04-24 18:01:44.343638682 +0200
@@ -15,5 +15,6 @@
for Default_Switches ("ada") use
("-g", "-gnatQ", "-O1", "-gnatf", "-gnato", "-gnatwa.Xe", "-gnaty");
+ for Driver ("C") use External ("GCC", "gcc");
end Compiler;

end c;
--- gnatcoll-gpl-2016-src/testsuite/projects/__init__.py.old 2017-04-24 19:10:30.465246199 +0200
+++ gnatcoll-gpl-2016-src/testsuite/projects/__init__.py 2017-04-24 19:10:42.768035080 +0200
@@ -105,25 +105,6 @@
self.gprbuild("default.gpr")
self.runexec("main", "")

- @support.requires_not_windows
- @chdir("N918-040")
- def test_bareboard(self):
- self.create_fake_bb_compiler('install', 'arm-eabi', '6.1.0w', '3.4.6')
-
- # Make sure auto.cgpr is not deleted on exit
- try:
- os.unlink('auto.cgpr')
- except:
- pass
- self.gprbuild('main_prj', switches=['--autoconf=auto.cgpr'])
- m = re.search('for Target use "(.*?)"', open('auto.cgpr').read())
- target = m.group(1)
-
- def customFilter(actual):
- return actual.replace(target, "<native>")
-
- self.runexec(['sh', 'test.sh'], 'test.out', customFilter=customFilter)
-
@chdir("NB12-045")
def test_NB12_045(self):
# Test registering attribute in unknown package
--- gnatcoll-gpl-2016-src/testsuite/xref/tabs/default.gpr.old 2017-04-24 20:01:55.535913959 +0200
+++ gnatcoll-gpl-2016-src/testsuite/xref/tabs/default.gpr 2017-04-24 20:02:51.740950192 +0200
@@ -1,3 +1,6 @@
project Default is
for Languages use ("Ada", "C");
+ package Compiler is
+ for Driver ("C") use External ("GCC", "gcc");
+ end Compiler;
end Default;
--- gnatcoll-gpl-2016-src/testsuite/xref/doc1/dummy.gpr.old 2017-04-24 20:04:12.012574064 +0200
+++ gnatcoll-gpl-2016-src/testsuite/xref/doc1/dummy.gpr 2017-04-24 20:04:54.025853974 +0200
@@ -6,4 +6,7 @@
for Body_Suffix ("c++") use ".cc";
end Naming;

+ package Compiler is
+ for Driver ("C") use External ("GCC", "gcc");
+ end Compiler;
end Dummy;
--- gnatcoll-gpl-2016-src/src/tools/gnatcoll_db2ada.adb.old 2017-04-24 21:36:09.193973179 +0200
+++ gnatcoll-gpl-2016-src/src/tools/gnatcoll_db2ada.adb 2017-04-24 21:36:16.029858932 +0200
@@ -211,7 +211,7 @@

declare
Output : constant String := Get_Command_Output
- (Command => "python",
+ (Command => "python2.7",
Arguments => Args,
Input => "",
Status => Status'Access,
--- gnatcoll-gpl-2017-src/src/gnatcoll_python.gpr.old 2017-06-24 18:06:19.702063079 +0200
+++ gnatcoll-gpl-2017-src/src/gnatcoll_python.gpr 2017-06-24 18:05:04.276103652 +0200
@@ -60,6 +60,7 @@

for Switches ("C") use
- ("-g", "-O2") & GnatColl_Shared.Python_Cflags;
+ ("-g", "-O2", "-fPIC") & GnatColl_Shared.Python_Cflags;
+ for Driver ("C") use External ("GCC", "gcc");
end Compiler;

package Linker is
--- gnatcoll-gpl-2017-src/src/gnatcoll_gtk.gpr.old 2017-06-24 18:37:22.164631219 +0200
+++ gnatcoll-gpl-2017-src/src/gnatcoll_gtk.gpr 2017-06-24 18:37:55.763186201 +0200
@@ -71,11 +71,12 @@
for Switches ("Ada") use GnatColl_Shared.Compiler'Switches ("Ada");

for Switches ("C") use
- ("-g", "-O2")
+ ("-g", "-O2", "-fPIC")
& GnatColl_Shared.Python_Cflags
& GnatColl_Shared.Pygtk_Include
& GnatColl_Shared.PyGobject_Include
& Gtk_Include;
+ for Driver ("C") use External ("GCC", "gcc");
end Compiler;

package Linker is
129 changes: 129 additions & 0 deletions dev-ada/gnatcoll/gnatcoll-2017.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit multilib multiprocessing autotools python-single-r1

MYP=${PN}-gpl-${PV}

DESCRIPTION="GNAT Component Collection"
HOMEPAGE="http://libre.adacore.com"
SRC_URI="http://mirrors.cdn.adacore.com/art/591c45e2c7a447af2deed016
-> ${MYP}-src.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="gmp gtk iconv postgresql pygobject projects readline +shared sqlite
static syslog"

RDEPEND="dev-lang/gnat-gpl:*
${PYTHON_DEPS}
gmp? ( dev-libs/gmp:* )
gtk? (
dev-ada/gtkada
dev-libs/atk
dev-libs/glib
x11-libs/cairo
x11-libs/gdk-pixbuf
x11-libs/gtk+:3
x11-libs/pango
)
pygobject? ( dev-python/pygobject:3[${PYTHON_USEDEP}] )
postgresql? ( dev-db/postgresql:* )
sqlite? ( dev-db/sqlite )
projects? (
>=dev-ada/gprbuild-2017[static?,shared?]
)"
DEPEND="${RDEPEND}
dev-ada/gprbuild"

REQUIRED_USE="${PYTHON_REQUIRED_USE}
pygobject? ( gtk )"

S="${WORKDIR}"/${MYP}-src

PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )

pkg_setup() {
GCC=${ADA:-$(tc-getCC)}
GNATMAKE="${GCC/gcc/gnatmake}"
GNATCHOP="${GCC/gcc/gnatchop}"
if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
eerror "You need a gcc compiler that provides the Ada Compiler:"
eerror "1) use gcc-config to select the right compiler or"
eerror "2) set ADA=gcc-4.9.4 in make.conf"
die "ada compiler not available"
fi
python-single-r1_pkg_setup
}

src_prepare() {
default
mv configure.{in,ac} || die
eautoreconf
}

src_configure() {
if use sqlite; then
myConf="--with-sqlite=$(get_libdir)"
else
myConf="--without-sqlite"
fi
if use gtk ; then
myConf="$myConf --with-gtk=3.0"
else
myConf="$myConf --with-gtk=no"
fi
econf \
GNATCHOP="${GNATCHOP}" \
GNATMAKE="${GNATMAKE}" \
--with-python \
$(use_with gmp) \
$(use_with iconv) \
$(use_with postgresql) \
$(use_enable projects) \
$(use_enable pygobject) \
$(use_enable readline gpl) \
$(use_enable readline) \
$(use_enable syslog) \
--with-python-exec=${EPYTHON} \
--enable-shared-python \
--disable-pygtk \
CC=${GCC} \
$myConf
}

src_compile() {
if use shared; then
emake PROCESSORS=$(makeopts_jobs) GPRBUILD_OPTIONS=-v GCC=${GCC} \
build_library_type/relocatable
fi
if use static; then
emake PROCESSORS=$(makeopts_jobs) GPRBUILD_OPTIONS=-v GCC=${GCC} \
build_library_type/static
fi
python_fix_shebang .
}

src_install() {
if use shared; then
emake prefix="${D}usr" install_library_type/relocatable
fi
if use static; then
emake prefix="${D}usr" install_library_type/static
fi
emake prefix="${D}usr" install_gps_plugin
einstalldocs
}

src_test() {
# The test suite is in
# To run you need to have the ada compiler available as gcc
# Even in this case there are still some problem
# Going into the testsuite directory and running
# ./run.py -v -v
# run here (having enabled most USE flags)
true
}

0 comments on commit c522884

Please sign in to comment.