summaryrefslogtreecommitdiff
path: root/dev-ada/gprbuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-ada/gprbuild
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-ada/gprbuild')
-rw-r--r--dev-ada/gprbuild/Manifest11
-rw-r--r--dev-ada/gprbuild/files/gprbuild-2016-gentoo.patch235
-rw-r--r--dev-ada/gprbuild/files/gprbuild-2016.xml94
-rw-r--r--dev-ada/gprbuild/files/gprbuild-2017-gentoo.patch42
-rw-r--r--dev-ada/gprbuild/files/gprbuild-2017.xml85
-rw-r--r--dev-ada/gprbuild/gprbuild-2016.ebuild100
-rw-r--r--dev-ada/gprbuild/gprbuild-2017.ebuild108
-rw-r--r--dev-ada/gprbuild/metadata.xml25
8 files changed, 700 insertions, 0 deletions
diff --git a/dev-ada/gprbuild/Manifest b/dev-ada/gprbuild/Manifest
new file mode 100644
index 000000000000..5d43c523123c
--- /dev/null
+++ b/dev-ada/gprbuild/Manifest
@@ -0,0 +1,11 @@
+AUX gprbuild-2016-gentoo.patch 8822 SHA256 c7edfa33c5ca2dec9730911164f2faf1c8bb70d128ea7055189e9a9956b779d6 SHA512 25e5819bd6763ccf85c24eb492d5d871b2ca6f807132f6a52d90abb9a60f9c70e31d1c988bd972ba842ed2b11dce31a53bff5c6e0254489a742381fbc42a3f43 WHIRLPOOL 000c6df1d7afe023d12b70d4081172916b3d74eabb7dd34e199c6f4a56272ad399ac2ddf058f8c7ae60efc2496dd85b77bb8668268bd642bc34423b4dacd5c79
+AUX gprbuild-2016.xml 4083 SHA256 6c7030e461260862e6de77dbfc9e3f9d8f951b0e8abb4dd31bda4119d47e3a4c SHA512 f6416039c980e7482f8fd45690a68cf190101ebf408bc253332d8a9557ede8d3da5af004fe7f6f2f416e74b6411232c2e17744d20e36cbe50a51d5b21b816b79 WHIRLPOOL f7994e95f9f4f7691026cb355c86eebd4db966de8f4738b42435f73f14c239653f11195c4d4f24eac8400936f7aebe7e1845fac2834fefea02327d5600996e7d
+AUX gprbuild-2017-gentoo.patch 1730 SHA256 f21a2731be486f0c70f10e48e3b4182d8eca8801efa00d8bf6cdc9961b36995b SHA512 452be15b98253266eb6564833df69478c507ce4d5f1ccd191909046b159c5e9fcc8d4b565d9fcffc757b54ec69eb695c4690f9944cd3ae60861afcded2178fb7 WHIRLPOOL 2d8dbcf21bd94c7c58b7387eae4231b4cb13467de645267b04bd2ec1706cf4fe5f362b47a24bf69dafe958eb711edd99fdc07094dac7ae0468d03717dc9d3ba8
+AUX gprbuild-2017.xml 3844 SHA256 fe319a46c96c1c15281e9d75a1e41048fe4ab798f8c4620b3663b6a8446d3d6e SHA512 13ba2efec9fa9fa0023d052163e186e9ccad1e8c80acff972568323b7e614dd9953f7c2a8f3a5d2f95eaee17072b1c50a2da5c3c2daafa81f5d2ab17fb95bf89 WHIRLPOOL fba1b030959fb1f8d18ea5ea05e982c26349fd972c01afb519421cbc1d562816ee0542e8d4525934e4866e362ca88fb11aa5d5c3c6d7948bb84169dc5bc38f26
+DIST gprbuild-gpl-2016-src.tar.gz 2142261 SHA256 d51659454bc0aaf1a9a9f1d05aab469a1f3d900065a4542123d3a59ab067275d SHA512 6b9e00248aaee90f3c00e7ce442c2b551b8532ec4d94a4471858d117feb27e91fd6d218995d4b71ee3f1f0677e9547d562fc2cda9ba80c3f6eb8d840ed56eb7e WHIRLPOOL 2afb9d3188f9498cf9cf9a6605081e27a843a15e4c4d5541616b8818757c6f8d458e8d6fbe97bcfc0607ac98d58ec2e4830d17aefd26458b3adcf1489a646945
+DIST gprbuild-gpl-2017-src.tar.gz 2454957 SHA256 0d0a48b8744e4f7230a85008d8213b583459046395704e8ab8c5cabedbf7c616 SHA512 12f3682d64ce0718de4940c1e71a4380b20021805d88543842dbf3b5ce5d518c23a6b2d868565579baf81efa1d8cf05c7778253162f0df5d7adc0eb1865c9f88 WHIRLPOOL 905b3a6d64a7f8a6970586b5d1c010badcc24c42e4b406ed7508e0470920b86d0992e80dc2326b10a314cb27519944f5199a7f0d75e72dae8fb096180c22a781
+DIST xmlada-gpl-2016-src.tar.gz 1440671 SHA256 ea64d8da2c5fb01a257fc5bf474b8d4ec40b01dc15b320b9fe260ff2db668ba4 SHA512 d1d7c3d91731394235aed4b80c91b1babe30d5f184282fae8087ee556318475e3923ed628b805693fc89a4d9bb219b0fb0937bc5024a742226da0245d36ed652 WHIRLPOOL b6ebb927d801394ad0b62d9538142c420ab33627582059466d4f64b12c3a45b1b5b489019aef715a59101370220a78507fe03d97c9e67233dfcc4f3aad1f16d7
+DIST xmlada-gpl-2017-src.tar.gz 1578393 SHA256 9b103157eb3ecd697b597ad4e60f56f39028bc2d6ea513d2dce8a3b0e65ac54b SHA512 371f6adc01550a4bb13204ec0404dc1165438db595f4346813e5a23a155de74c857c40c55adde173919c2fe35b3b91d78b235c9718ee86bc848e62ddfd7fa2b4 WHIRLPOOL 4b2da3fb799f8def6eb6383a9483258340368cc80e96e8ffab207c3c8849c1279a80cf68ca47c8a20ce91c084041bdfa95128a14321454055534d804272ef4dd
+EBUILD gprbuild-2016.ebuild 2506 SHA256 2d71f4bf08204d2350f92bc550e9fd89411ea133cab1cb36efc07a27f82b5ec1 SHA512 4334181f60b48a90f03795eccff460a658c1268a2d3576e0d68894adaf042f6f107d905cac4534958f837b5d60f46fc606aca1243b72a3c2b4491d9f95c44799 WHIRLPOOL 972c304f064a025bc8f347b2c3437da21e8dc51bac5c34878ff50cc7561260beb1db212273e7fac61eb67a53a6fb37bff405dbdcda0f27688806e866e599f45c
+EBUILD gprbuild-2017.ebuild 2993 SHA256 104f406b22eb36289f3168ffa21bbfe6f9569ea90a40c221154456aae3606f35 SHA512 6b31d85097144a6cfcb990ad4153ba090802c0c5cb31b52355c0efc2570bd7f425dcd9da5b5b583584d3995daeecbbacee0bf7f2ed3cd404d219d57013bbabf0 WHIRLPOOL 26eef355a8ba2e4dda92bcdc49e9f8c4701a21514171b8438471d483aa7696f65fe73422e44dd422ac6e98c24ef88775126350dcf7eabb663271b5975735cb96
+MISC metadata.xml 1157 SHA256 99e5595d4691fa5124ba42e93e8c8443396161d34854a27cc2943daf7bceb6d8 SHA512 47a7793368b83f9f9101df74a87214ae6615c163a6ffbb24644b102b427ca8559f39f16075b6b5048b8dade368f540f2b8e9b19b376905996b0915c74faff580 WHIRLPOOL b785a432b02183ec7d8ad88675d41ab35147bee3b6fc5892800bce680d346e8335b877c3bdf037642da7e42ff0cee043450c6af33380d429255368ef6b1db390
diff --git a/dev-ada/gprbuild/files/gprbuild-2016-gentoo.patch b/dev-ada/gprbuild/files/gprbuild-2016-gentoo.patch
new file mode 100644
index 000000000000..94973bfceac7
--- /dev/null
+++ b/dev-ada/gprbuild/files/gprbuild-2016-gentoo.patch
@@ -0,0 +1,235 @@
+diff -Naur gprbuild-gpl-2016-src.old/src/gprbuild-main.adb gprbuild-gpl-2016-src/src/gprbuild-main.adb
+--- gprbuild-gpl-2016-src.old/src/gprbuild-main.adb 2017-03-28 09:12:24.205058242 +0200
++++ gprbuild-gpl-2016-src/src/gprbuild-main.adb 2017-03-28 09:21:20.495344963 +0200
+@@ -52,7 +52,8 @@
+ with GPR.Tempdir; use GPR.Tempdir;
+ with GPR.Tree; use GPR.Tree;
+ with GPR.Util; use GPR.Util;
++with Gprbuild.Sigint_Intercepted;
+
+ procedure Gprbuild.Main is
+
+ use Stamps;
+@@ -124,11 +124,6 @@
+ pragma Import (C, Install_Int_Handler, "__gnat_install_int_handler");
+ -- Called by Gnatmake to install the SIGINT handler below
+
+- procedure Sigint_Intercepted;
+- pragma Convention (C, Sigint_Intercepted);
+- -- Called when the program is interrupted by Ctrl-C to delete the
+- -- temporary mapping files and configuration pragmas files.
+-
+ No_Object_Check_Switch : constant String := "--no-object-check";
+ Direct_Import_Only_Switch : constant String := "--direct-import-only";
+ Indirect_Imports_Switch : constant String := "--indirect-imports";
+@@ -1616,22 +1611,6 @@
+ end if;
+ end Scan_Arg;
+
+- ------------------------
+- -- Sigint_Intercepted --
+- ------------------------
+-
+- procedure Sigint_Intercepted is
+- begin
+- Put_Line ("*** Interrupted ***");
+- Delete_All_Temp_Files (Project_Tree.Shared);
+-
+- if Distributed_Mode then
+- Compilation.Slave.Unregister_Remote_Slaves (From_Signal => True);
+- end if;
+-
+- OS_Exit (1);
+- end Sigint_Intercepted;
+-
+ ----------------
+ -- Initialize --
+ ----------------
+@@ -2293,7 +2272,7 @@
+
+ -- And install Ctrl-C handler
+
+- Install_Int_Handler (Sigint_Intercepted'Unrestricted_Access);
++ Install_Int_Handler (Gprbuild.Sigint_Intercepted'Unrestricted_Access);
+
+ -- Check command line arguments. These will be overridden when looking
+ -- for the configuration file
+diff -Naur gprbuild-gpl-2016-src.old/src/gprbuild-sigint_intercepted.adb gprbuild-gpl-2016-src/src/gprbuild-sigint_intercepted.adb
+--- gprbuild-gpl-2016-src.old/src/gprbuild-sigint_intercepted.adb 1970-01-01 01:00:00.000000000 +0100
++++ gprbuild-gpl-2016-src/src/gprbuild-sigint_intercepted.adb 2017-03-28 09:20:00.661792854 +0200
+@@ -0,0 +1,20 @@
++------------------------
++-- Sigint_Intercepted --
++------------------------
++
++with Ada.Text_IO; use Ada.Text_IO;
++with Gpr_Util; use Gpr_Util;
++with Gprbuild.Compile;
++with Gprbuild.Compilation.Slave;
++
++procedure Gprbuild.Sigint_Intercepted is
++begin
++ Put_Line ("*** Interrupted ***");
++ Delete_All_Temp_Files (Project_Tree.Shared);
++
++ if Distributed_Mode then
++ Compilation.Slave.Unregister_Remote_Slaves (From_Signal => True);
++ end if;
++
++ OS_Exit (1);
++end Gprbuild.Sigint_Intercepted;
+diff -Naur gprbuild-gpl-2016-src.old/src/gprbuild-sigint_intercepted.ads gprbuild-gpl-2016-src/src/gprbuild-sigint_intercepted.ads
+--- gprbuild-gpl-2016-src.old/src/gprbuild-sigint_intercepted.ads 1970-01-01 01:00:00.000000000 +0100
++++ gprbuild-gpl-2016-src/src/gprbuild-sigint_intercepted.ads 2017-03-28 09:15:35.275616543 +0200
+@@ -0,0 +1,4 @@
++procedure Gprbuild.Sigint_Intercepted;
++pragma Convention (C, Sigint_Intercepted);
++-- Called when the program is interrupted by Ctrl-C to delete the
++-- temporary mapping files and configuration pragmas files.
+diff -Naur gprbuild-gpl-2016-src.old/src/gprinstall-main.adb gprbuild-gpl-2016-src/src/gprinstall-main.adb
+--- gprbuild-gpl-2016-src.old/src/gprinstall-main.adb 2017-03-28 09:12:24.205058242 +0200
++++ gprbuild-gpl-2016-src/src/gprinstall-main.adb 2017-03-28 09:25:36.515709886 +0200
+@@ -42,6 +42,7 @@
+ with Gprinstall.DB;
+ with Gprinstall.Install;
+ with Gprinstall.Uninstall;
++with Gprinstall.Sigint_Intercepted;
+
+ procedure Gprinstall.Main is
+
+@@ -94,11 +94,6 @@
+ pragma Import (C, Install_Int_Handler, "__gnat_install_int_handler");
+ -- Called by Gnatmake to install the SIGINT handler below
+
+- procedure Sigint_Intercepted;
+- pragma Convention (C, Sigint_Intercepted);
+- -- Called when the program is interrupted by Ctrl-C to delete the
+- -- temporary mapping files and configuration pragmas files.
+-
+ ---------------
+ -- Copyright --
+ ---------------
+@@ -514,17 +509,6 @@
+ end if;
+ end Scan_Arg;
+
+- ------------------------
+- -- Sigint_Intercepted --
+- ------------------------
+-
+- procedure Sigint_Intercepted is
+- begin
+- Put_Line ("*** Interrupted ***");
+- Delete_All_Temp_Files (Project_Tree.Shared);
+- OS_Exit (1);
+- end Sigint_Intercepted;
+-
+ ----------------
+ -- Initialize --
+ ----------------
+@@ -862,7 +846,7 @@
+
+ -- And install Ctrl-C handler
+
+- Install_Int_Handler (Sigint_Intercepted'Unrestricted_Access);
++ Install_Int_Handler (Gprinstall.Sigint_Intercepted'Unrestricted_Access);
+
+ -- Check command line arguments. These will be overridden when looking
+ -- for the configuration file
+diff -Naur gprbuild-gpl-2016-src.old/src/gprinstall-sigint_intercepted.adb gprbuild-gpl-2016-src/src/gprinstall-sigint_intercepted.adb
+--- gprbuild-gpl-2016-src.old/src/gprinstall-sigint_intercepted.adb 1970-01-01 01:00:00.000000000 +0100
++++ gprbuild-gpl-2016-src/src/gprinstall-sigint_intercepted.adb 2017-03-28 09:24:50.307545617 +0200
+@@ -0,0 +1,12 @@
++------------------------
++-- Sigint_Intercepted --
++------------------------
++
++with Ada.Text_IO; use Ada.Text_IO;
++
++procedure Gprinstall.Sigint_Intercepted is
++begin
++ Put_Line ("*** Interrupted ***");
++ Delete_All_Temp_Files (Project_Tree.Shared);
++ OS_Exit (1);
++end Gprinstall.Sigint_Intercepted;
+diff -Naur gprbuild-gpl-2016-src.old/src/gprinstall-sigint_intercepted.ads gprbuild-gpl-2016-src/src/gprinstall-sigint_intercepted.ads
+--- gprbuild-gpl-2016-src.old/src/gprinstall-sigint_intercepted.ads 1970-01-01 01:00:00.000000000 +0100
++++ gprbuild-gpl-2016-src/src/gprinstall-sigint_intercepted.ads 2017-03-28 09:22:18.462294461 +0200
+@@ -0,0 +1,4 @@
++procedure Gprinstall.Sigint_Intercepted;
++pragma Convention (C, Sigint_Intercepted);
++-- Called when the program is interrupted by Ctrl-C to delete the
++-- temporary mapping files and configuration pragmas files.
+--- gprbuild-gpl-2016-src/Makefile.in.old 2017-01-19 19:52:41.242907252 +0100
++++ gprbuild-gpl-2016-src/Makefile.in 2017-01-19 19:54:45.822646333 +0100
+@@ -25,12 +25,12 @@
+ host=@host@
+ target=@target@
+ build=@build@
+-prefix=@prefix@
++prefix=$(DESTDIR)@prefix@
+ srcdir=@srcdir@
+ objdir=@objdir@
+ exec_prefix=@exec_prefix@
+ datarootdir=@datarootdir@
+-datadir=@datadir@
++datadir=$(DESTDIR)@datadir@
+ bindir=@bindir@
+ libdir=@libdir@
+ libexecdir=@libexecdir@
+@@ -66,7 +66,7 @@
+ .PHONY: all distall gprbuild gprconfig gprclean gprinstall gprname gprls
+
+ all:
+- $(GPRBUILD_BUILDER)
++ $(GPRBUILD_BUILDER) -cargs:C $(CFLAGS) -cargs:Ada $(ADAFLAGS)
+
+ distall: all install install.dist
+
+@@ -173,13 +173,13 @@
+ libgpr.build: $(foreach t, $(LIBGPR_TYPES), libgpr.build.$(t))
+
+ libgpr.build.shared:
+- ${BUILDER} -XLIBRARY_TYPE=relocatable -P$(srcdir)/gpr/gpr.gpr
++ ${BUILDER} -XLIBRARY_TYPE=relocatable -P$(srcdir)/gpr/gpr.gpr -cargs:Ada $(ADAFLAGS)
+
+ libgpr.build.static:
+- ${BUILDER} -XLIBRARY_TYPE=static -P$(srcdir)/gpr/gpr.gpr
++ ${BUILDER} -XLIBRARY_TYPE=static -P$(srcdir)/gpr/gpr.gpr -cargs:Ada $(ADAFLAGS)
+
+ libgpr.build.static-pic:
+- ${BUILDER} -XLIBRARY_TYPE=static-pic -P$(srcdir)/gpr/gpr.gpr
++ ${BUILDER} -XLIBRARY_TYPE=static-pic -P$(srcdir)/gpr/gpr.gpr -cargs:Ada $(ADAFLAGS)
+
+ libgpr.install: $(foreach t, $(LIBGPR_TYPES), libgpr.install.$(t))
+
+--- gprbuild-gpl-2015-src/gprbuild.gpr.old 2017-01-11 21:44:59.795997896 +0100
++++ gprbuild-gpl-2015-src/gprbuild.gpr 2017-01-11 21:45:07.971998651 +0100
+@@ -66,6 +66,7 @@
+ for Switches ("gpr*.ad?") use
+ Compiler'Default_Switches ("Ada") & ("-g1");
+ end case;
++ for Driver ("C") use External ("CC", "gcc");
+ end Compiler;
+
+ package Binder is
+ make BUILDER="$(BUILDER)" BUILD="$(BUILD)"
+--- gprbuild-gpl-2016-src/gpr/src/gpr-conf.adb.old 2017-09-12 21:29:25.945747949 +0200
++++ gprbuild-gpl-2016-src/gpr/src/gpr-conf.adb 2017-09-12 21:35:16.299101715 +0200
+@@ -1839,6 +1839,16 @@
+ end;
+ end if;
+
++ Compiler_Root := First_Compiler_Root;
++ while Compiler_Root.Next /= null loop
++ Compiler_Root := Compiler_Root.Next;
++ end loop;
++ Compiler_Root.Next :=
++ new Compiler_Root_Data'
++ (Root => new String'("/usr"),
++ Runtimes => null,
++ Next => null);
++
+ -- Now that the compiler roots are in a correct order, add the
+ -- directories corresponding to these compiler roots in the
+ -- project path.
diff --git a/dev-ada/gprbuild/files/gprbuild-2016.xml b/dev-ada/gprbuild/files/gprbuild-2016.xml
new file mode 100644
index 000000000000..7d321e03b6a1
--- /dev/null
+++ b/dev-ada/gprbuild/files/gprbuild-2016.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" ?>
+<gprconfig>
+ <compiler_description>
+ <name>GNAT-@VER@</name>
+ <executable prefix="1">gnatmake-@VER@</executable>
+ <version>
+ <external>${PREFIX}gnatls-@VER@ -v --version</external>
+ <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
+ </version>
+ <languages>Ada</languages>
+ <variable name="gcc_version">
+ <external>${PREFIX}gcc-@VER@ -v</external>
+ <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
+ </variable>
+ <runtimes default="default,kernel,native">
+ <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
+ <directory group="default" contents="^rts-">\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory>
+ <directory group="2" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory>
+ <directory group="1" >\.\./$TARGET/lib/gnat/(.*)/adalib/</directory>
+ </runtimes>
+ <target>
+ <external>${PREFIX}gcc-@VER@ -dumpmachine</external>
+ <grep regexp="[^\r\n]+"></grep>
+ </target>
+ </compiler_description>
+
+ <configuration>
+ <compilers>
+ <compiler name="GNAT-@VER@" />
+ </compilers>
+ <config>
+ package Naming is
+ for Spec_Suffix ("Ada") use ".ads";
+ for Body_Suffix ("Ada") use ".adb";
+ for Casing use "lowercase";
+ for Dot_Replacement use "-";
+ end Naming;
+
+ package Compiler is
+ for Driver ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc-@VER@";
+ for Language_Kind ("Ada") use "unit_based";
+ for Dependency_Kind ("Ada") use "ALI_File";
+ for Leading_Required_Switches ("Ada") use
+ ("-c", "-x", "ada", "-gnatA")
+ &amp; Compiler'Leading_Required_Switches ("Ada");
+ for Mapping_File_Switches ("Ada") use ("-gnatem=");
+ for Mapping_Spec_Suffix ("Ada") use "%s";
+ for Mapping_Body_Suffix ("Ada") use "%b";
+ for Config_File_Switches ("Ada") use ("-gnatec=");
+ for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE";
+ for Multi_Unit_Switches ("Ada") use ("-gnateI");
+ for Multi_Unit_Object_Separator ("Ada") use "~";
+ for Config_Body_File_Name ("Ada") use
+ "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");";
+ for Config_Spec_File_Name ("Ada") use
+ "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");";
+ for Config_Body_File_Name_Index ("Ada") use
+ "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);";
+ for Config_Spec_File_Name_Index ("Ada") use
+ "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);";
+ for Config_Body_File_Name_Pattern ("Ada") use
+ "pragma Source_File_Name_Project " &amp;
+ " (Body_File_Name => ""*%b""," &amp;
+ " Casing => %c," &amp;
+ " Dot_Replacement => ""%d"");";
+ for Config_Spec_File_Name_Pattern ("Ada") use
+ "pragma Source_File_Name_Project " &amp;
+ " (Spec_File_Name => ""*%s""," &amp;
+ " Casing => %c," &amp;
+ " Dot_Replacement => ""%d"");";
+ for Config_File_Unique ("Ada") use "False";
+ for PIC_Option ("Ada") use ("-fPIC");
+ end Compiler;
+
+ package Binder is
+ for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE";
+ for Driver ("Ada") use
+ "${GPRCONFIG_PREFIX}libexec/gprbuild/gprbind";
+ for Switches ("Ada") use ("--gnatbind_path=gnatbind-@VER@");
+ end Binder;
+
+ package Clean is
+ for Source_Artifact_Extensions ("Ada")
+ use (".dg", ".rep", ".stdout", ".stderr");
+ for Object_Artifact_Extensions ("Ada") use (".s", ".ci", ".gcno");
+ end Clean;
+
+ for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
+ for Runtime_Library_Dir ("Ada") use "${RUNTIME_DIR(ada)}/adalib/";
+ for Runtime_Source_Dirs ("Ada") use ("${RUNTIME_DIR(ada)}/adainclude/");
+ for Library_Encapsulated_Supported use "true";
+ </config>
+ </configuration>
+</gprconfig>
diff --git a/dev-ada/gprbuild/files/gprbuild-2017-gentoo.patch b/dev-ada/gprbuild/files/gprbuild-2017-gentoo.patch
new file mode 100644
index 000000000000..c784920eaf3b
--- /dev/null
+++ b/dev-ada/gprbuild/files/gprbuild-2017-gentoo.patch
@@ -0,0 +1,42 @@
+--- gprbuild-2017/gpr/gpr.gpr.old 2017-05-27 20:59:07.061135892 +0200
++++ gprbuild-2017/gpr/gpr.gpr 2017-05-27 20:59:38.022638398 +0200
+@@ -67,6 +67,7 @@
+ for Switches ("gpr*.ad?") use
+ Compiler'Default_Switches ("Ada") & ("-g1");
+ end case;
++ for Driver ("C") use External ("CC", "gcc");
+ end Compiler;
+
+ end GPR;
+--- gprbuild-17.0/src/gprbuild-post_compile.adb.old 2017-05-18 14:17:06.114797015 +0200
++++ gprbuild-17.0/src/gprbuild-post_compile.adb 2017-05-18 14:18:55.466956852 +0200
+@@ -4744,7 +4744,9 @@
+ No_Create => Proj.Is_Aggregated);
+ end if;
+
+- Shared_Libs := not Is_Static (Proj.Proj);
++ if not Is_Static (Proj.Proj) then
++ Shared_Libs := True;
++ end if;
+
+ end if;
+ end if;
+--- gprbuild-gpl-2016-src/gpr/src/gpr-conf.adb.old 2017-09-12 21:29:25.945747949 +0200
++++ gprbuild-gpl-2016-src/gpr/src/gpr-conf.adb 2017-09-12 21:35:16.299101715 +0200
+@@ -1839,6 +1839,16 @@
+ end;
+ end if;
+
++ Compiler_Root := First_Compiler_Root;
++ while Compiler_Root.Next /= null loop
++ Compiler_Root := Compiler_Root.Next;
++ end loop;
++ Compiler_Root.Next :=
++ new Compiler_Root_Data'
++ (Root => new String'("/usr"),
++ Runtimes => null,
++ Next => null);
++
+ -- Now that the compiler roots are in a correct order, add the
+ -- directories corresponding to these compiler roots in the
+ -- project path.
diff --git a/dev-ada/gprbuild/files/gprbuild-2017.xml b/dev-ada/gprbuild/files/gprbuild-2017.xml
new file mode 100644
index 000000000000..9e1e47b512ef
--- /dev/null
+++ b/dev-ada/gprbuild/files/gprbuild-2017.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" ?>
+<gprconfig>
+ <compiler_description>
+ <name>GNAT-@VER@</name>
+ <executable prefix="1">gnatls-@VER@</executable>
+ <version>
+ <external>${PREFIX}gnatls-@VER@ -v --version</external>
+ <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
+ </version>
+ <languages>Ada</languages>
+ <variable name="gcc_version">
+ <external>${PREFIX}gcc-@VER@ -v</external>
+ <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
+ </variable>
+ <runtimes default="default,kernel,native">
+ <directory group="default" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/adalib/</directory>
+ <directory group="default" contents="^rts-">\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/ada_object_path</directory>
+ <directory group="2" >\.\./lib/gcc(-lib)?/$TARGET/$gcc_version/rts-(.*)/adalib/</directory>
+ <directory group="1" >\.\./$TARGET/lib/gnat/(.*)/adalib/</directory>
+ </runtimes>
+ <target>
+ <external>${PREFIX}gcc-@VER@ -dumpmachine</external>
+ <grep regexp="[^\r\n]+"></grep>
+ </target>
+ </compiler_description>
+
+ <configuration>
+ <compilers>
+ <compiler name="GNAT-@VER@" />
+ </compilers>
+ <config>
+ package Compiler is
+ for Driver ("Ada") use "${PATH(ada)}${PREFIX(ada)}gcc-@VER@";
+ for Language_Kind ("Ada") use "unit_based";
+ for Dependency_Kind ("Ada") use "ALI_File";
+ for Leading_Required_Switches ("Ada") use
+ ("-c", "-x", "ada", "-gnatA")
+ &amp; Compiler'Leading_Required_Switches ("Ada");
+ for Mapping_File_Switches ("Ada") use ("-gnatem=");
+ for Mapping_Spec_Suffix ("Ada") use "%s";
+ for Mapping_Body_Suffix ("Ada") use "%b";
+ for Config_File_Switches ("Ada") use ("-gnatec=");
+ for Include_Path_File ("Ada") use "ADA_PRJ_INCLUDE_FILE";
+ for Multi_Unit_Switches ("Ada") use ("-gnateI");
+ for Multi_Unit_Object_Separator ("Ada") use "~";
+ for Config_Body_File_Name ("Ada") use
+ "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"");";
+ for Config_Spec_File_Name ("Ada") use
+ "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"");";
+ for Config_Body_File_Name_Index ("Ada") use
+ "pragma Source_File_Name_Project (%u, Body_File_Name => ""%f"", Index => %i);";
+ for Config_Spec_File_Name_Index ("Ada") use
+ "pragma Source_File_Name_Project (%u, Spec_File_Name => ""%f"", Index => %i);";
+ for Config_Body_File_Name_Pattern ("Ada") use
+ "pragma Source_File_Name_Project " &amp;
+ " (Body_File_Name => ""*%b""," &amp;
+ " Casing => %c," &amp;
+ " Dot_Replacement => ""%d"");";
+ for Config_Spec_File_Name_Pattern ("Ada") use
+ "pragma Source_File_Name_Project " &amp;
+ " (Spec_File_Name => ""*%s""," &amp;
+ " Casing => %c," &amp;
+ " Dot_Replacement => ""%d"");";
+ for Config_File_Unique ("Ada") use "False";
+ for PIC_Option ("Ada") use ("-fPIC");
+ for Leading_Required_Switches ("Ada") use
+ Compiler'Leading_Required_Switches ("Ada") &amp; ("--RTS=${RUNTIME_DIR(ada)}");
+ end Compiler;
+
+ package Binder is
+ for Objects_Path_File ("Ada") use "ADA_PRJ_OBJECTS_FILE";
+ for Driver ("Ada") use
+ "${GPRCONFIG_PREFIX}libexec/gprbuild/gprbind";
+ for Switches ("Ada") use ("--gnatbind_path=gnatbind-@VER@");
+ for Required_Switches ("Ada") use
+ Binder'Required_Switches ("Ada") &amp; ("--RTS=${RUNTIME_DIR(ada)}");
+ end Binder;
+
+ for Toolchain_Version ("Ada") use "GNAT ${VERSION(ada)}";
+
+for Runtime_Dir ("Ada") use "${RUNTIME_DIR(ada)}";
+ for Library_Encapsulated_Supported use "true";
+ </config>
+ </configuration>
+</gprconfig>
diff --git a/dev-ada/gprbuild/gprbuild-2016.ebuild b/dev-ada/gprbuild/gprbuild-2016.ebuild
new file mode 100644
index 000000000000..60d1b029292a
--- /dev/null
+++ b/dev-ada/gprbuild/gprbuild-2016.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs multiprocessing
+
+MYP=${PN}-gpl-${PV}
+
+DESCRIPTION="Multi-Language Management"
+HOMEPAGE="http://libre.adacore.com/"
+SRC_URI="
+ http://mirrors.cdn.adacore.com/art/57399662c7a447658e0affa8
+ -> ${MYP}-src.tar.gz
+ bootstrap? (
+ http://mirrors.cdn.adacore.com/art/57399978c7a447658e0affc0
+ -> xmlada-gpl-${PV}-src.tar.gz )"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="bootstrap gnat_2016 gnat_2017 +shared static static-pic"
+
+DEPEND="!bootstrap? ( dev-ada/xmlada[static,gnat_2016=,gnat_2017=] )
+ gnat_2016? ( dev-lang/gnat-gpl:4.9.4 )
+ gnat_2017? ( dev-lang/gnat-gpl:6.3.0 )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${MYP}-src
+
+REQUIRED_USE="bootstrap? ( !shared !static !static-pic )
+ ^^ ( gnat_2016 gnat_2017 )"
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_prepare() {
+ if use gnat_2016; then
+ GCC_PV=4.9.4
+ else
+ GCC_PV=6.3.0
+ fi
+ sed -e "s:@VER@:${GCC_PV}:g" "${FILESDIR}"/${P}.xml > gnat-${GCC_PV}.xml
+ default
+}
+
+src_configure() {
+ if ! use bootstrap ; then
+ default
+ fi
+}
+
+bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls"
+lib_progs="gprlib gprbind"
+
+src_compile() {
+ GCC=${CHOST}-gcc-${GCC_PV}
+ if use bootstrap; then
+ GNATMAKE=${CHOST}-gnatmake-${GCC_PV}
+ local xmlada_src="../xmlada-gpl-${PV}-src"
+ incflags="-Isrc -Igpr/src -I${xmlada_src}/sax -I${xmlada_src}/dom \
+ -I${xmlada_src}/schema -I${xmlada_src}/unicode \
+ -I${xmlada_src}/input_sources"
+ ${GCC} -c ${CFLAGS} src/gpr_imports.c -o gpr_imports.o || die
+ for bin in ${bin_progs}; do
+ ${GNATMAKE} -j$(makeopts_jobs) ${incflags} $ADAFLAGS ${bin}-main \
+ -o ${bin} -largs gpr_imports.o || die
+ done
+ for lib in $lib_progs; do
+ ${GNATMAKE} -j$(makeopts_jobs) ${incflags} ${lib} $ADAFLAGS \
+ -largs gpr_imports.o || die
+ done
+ else
+ emake PROCESSORS=$(makeopts_jobs) all
+ for kind in shared static static-pic; do
+ if use ${kind}; then
+ emake PROCESSORS=$(makeopts_jobs) libgpr.build.${kind}
+ fi
+ done
+ fi
+}
+
+src_install() {
+ if use bootstrap; then
+ dobin ${bin_progs}
+ exeinto /usr/libexec/gprbuild
+ doexe ${lib_progs}
+ insinto /usr/share/gprconfig
+ doins share/gprconfig/*
+ insinto /usr/share/gpr
+ doins share/_default.gpr
+ else
+ default
+ for kind in shared static static-pic; do
+ if use ${kind}; then
+ emake DESTDIR="${D}" libgpr.install.${kind}
+ fi
+ done
+ fi
+ insinto /usr/share/gprconfig
+ doins gnat-${GCC_PV}.xml
+ einstalldocs
+}
diff --git a/dev-ada/gprbuild/gprbuild-2017.ebuild b/dev-ada/gprbuild/gprbuild-2017.ebuild
new file mode 100644
index 000000000000..a6101175e17e
--- /dev/null
+++ b/dev-ada/gprbuild/gprbuild-2017.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs multiprocessing
+
+MYP=${PN}-gpl-${PV}
+
+DESCRIPTION="Multi-Language Management"
+HOMEPAGE="http://libre.adacore.com/"
+SRC_URI="
+ http://mirrors.cdn.adacore.com/art/591c45e2c7a447af2deecff7
+ -> ${MYP}-src.tar.gz
+ bootstrap? (
+ http://mirrors.cdn.adacore.com/art/591aeb88c7a4473fcbb154f8
+ -> xmlada-gpl-${PV}-src.tar.gz )"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="bootstrap gnat_2016 gnat_2017 +shared static static-pic"
+
+DEPEND="!bootstrap? ( dev-ada/xmlada[static,gnat_2016=,gnat_2017=] )
+ gnat_2016? ( dev-lang/gnat-gpl:4.9.4 )
+ gnat_2017? ( dev-lang/gnat-gpl:6.3.0 )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"/${MYP}-src
+
+REQUIRED_USE="bootstrap? ( !shared !static !static-pic )
+ ^^ ( gnat_2016 gnat_2017 )"
+PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
+
+src_prepare() {
+ if use gnat_2016; then
+ GCC_PV=4.9.4
+ else
+ GCC_PV=6.3.0
+ fi
+ sed -e "s:@VER@:${GCC_PV}:g" "${FILESDIR}"/${P}.xml > gnat-${GCC_PV}.xml
+ default
+}
+
+src_configure() {
+ emake prefix="${D}"usr setup
+}
+
+bin_progs="gprbuild gprconfig gprclean gprinstall gprname gprls"
+lib_progs="gprlib gprbind"
+
+src_compile() {
+ GCC=${CHOST}-gcc-${GCC_PV}
+ if use bootstrap; then
+ GNATMAKE=${CHOST}-gnatmake-${GCC_PV}
+ local xmlada_src="../xmlada-gpl-${PV}-src"
+ incflags="-Isrc -Igpr/src -I${xmlada_src}/sax -I${xmlada_src}/dom \
+ -I${xmlada_src}/schema -I${xmlada_src}/unicode \
+ -I${xmlada_src}/input_sources"
+ ${GCC} -c ${CFLAGS} gpr/src/gpr_imports.c -o gpr_imports.o || die
+ for bin in ${bin_progs}; do
+ ${GNATMAKE} -j$(makeopts_jobs) ${incflags} $ADAFLAGS ${bin}-main \
+ -o ${bin} -largs gpr_imports.o || die
+ done
+ for lib in $lib_progs; do
+ ${GNATMAKE} -j$(makeopts_jobs) ${incflags} ${lib} $ADAFLAGS \
+ -largs gpr_imports.o || die
+ done
+ else
+ gprbuild -p -m -j$(makeopts_jobs) -XBUILD=production -v \
+ gprbuild.gpr -XLIBRARY_TYPE=static -XXMLADA_BUILD=static \
+ -cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS} || die
+ if use shared; then
+ gprbuild -p -m -j$(makeopts_jobs) -XBUILD=production -v \
+ -XLIBRARY_TYPE=relocatable -XXMLADA_BUILD=relocatable \
+ gpr/gpr.gpr -cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS} || die
+ fi
+ for kind in static static-pic; do
+ if use ${kind}; then
+ gprbuild -p -m -j$(makeopts_jobs) -XBUILD=production -v \
+ -XLIBRARY_TYPE=${kind} -XXMLADA_BUILD=${kind} gpr/gpr.gpr \
+ -cargs:C ${CFLAGS} -cargs:Ada ${ADAFLAGS} || die
+ fi
+ done
+ fi
+}
+
+src_install() {
+ if use bootstrap; then
+ dobin ${bin_progs}
+ exeinto /usr/libexec/gprbuild
+ doexe ${lib_progs}
+ insinto /usr/share/gprconfig
+ doins share/gprconfig/*
+ insinto /usr/share/gpr
+ doins share/_default.gpr
+ else
+ default
+ for kind in shared static static-pic; do
+ if use ${kind}; then
+ emake DESTDIR="${D}" libgpr.install.${kind}
+ fi
+ done
+ rm "${D}"usr/doinstall || die
+ fi
+ insinto /usr/share/gprconfig
+ doins gnat-${GCC_PV}.xml
+ einstalldocs
+}
diff --git a/dev-ada/gprbuild/metadata.xml b/dev-ada/gprbuild/metadata.xml
new file mode 100644
index 000000000000..4cf88165a988
--- /dev/null
+++ b/dev-ada/gprbuild/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tupone@gentoo.org</email>
+ <name>Tupone Alfredo</name>
+ </maintainer>
+ <use>
+ <flag name="gnat_2016">Compile with dev-lang/gnat-gpl-2016</flag>
+ <flag name="gnat_2017">Compile with dev-lang/gnat-gpl-2017</flag>
+ <flag name="shared">Build shared library</flag>
+ <flag name="static">Build static library</flag>
+ <flag name="static-pic">Build static library with pic code</flag>
+ </use>
+ <longdescription lang="en">
+ GPRbuild is an advanced software tool designed to help automate the
+ construction of multi-language systems. It removes complexity from
+ multi-language development by allowing developers to quickly and easily
+ compile and link software written in a combination of languages
+ including Ada, Assembler, C, C++, and Fortran. Easily extendable by
+ users to cover new toolchains and languages it is primarily aimed at
+ projects of all sizes organized into subsystems and libraries and is
+ particularly well-suited for compiled languages.
+ </longdescription>
+</pkgmetadata>