diff options
author | Ulrich Müller <ulm@gentoo.org> | 2015-03-31 16:58:42 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2015-03-31 16:58:42 +0000 |
commit | 37bac0fb2d369e1ee1670df2df1bb5aeea599ddc (patch) | |
tree | eba61bab332516cf3c77cca386465d1ecb9eed4c /app-eselect/eselect-gnat | |
parent | Version bump. (diff) | |
download | historical-37bac0fb2d369e1ee1670df2df1bb5aeea599ddc.tar.gz historical-37bac0fb2d369e1ee1670df2df1bb5aeea599ddc.tar.bz2 historical-37bac0fb2d369e1ee1670df2df1bb5aeea599ddc.zip |
Move package from app-admin to app-eselect category.
Package-Manager: portage-2.2.18/cvs/Linux x86_64
RepoMan-Options: --force
Manifest-Sign-Key: 0x9433907D693FB5B8!
Diffstat (limited to 'app-eselect/eselect-gnat')
-rw-r--r-- | app-eselect/eselect-gnat/ChangeLog | 171 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/Manifest | 28 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild | 32 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild | 35 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild | 35 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild | 35 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/files/gnat-common-1.3-r1.bash | 223 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/files/gnat-common-1.4-r1.bash | 226 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/files/gnat.eselect-1.3 | 207 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/files/gnat.eselect-1.4 | 230 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/files/gnat.eselect-1.5 | 226 | ||||
-rw-r--r-- | app-eselect/eselect-gnat/metadata.xml | 6 |
12 files changed, 1454 insertions, 0 deletions
diff --git a/app-eselect/eselect-gnat/ChangeLog b/app-eselect/eselect-gnat/ChangeLog new file mode 100644 index 000000000000..ffd48357e9a0 --- /dev/null +++ b/app-eselect/eselect-gnat/ChangeLog @@ -0,0 +1,171 @@ +# ChangeLog for app-eselect/eselect-gnat +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/ChangeLog,v 1.1 2015/03/31 16:48:57 ulm Exp $ + + 31 Mar 2015; Ulrich Müller <ulm@gentoo.org> +eselect-gnat-1.3-r1.ebuild, + +eselect-gnat-1.4.ebuild, +eselect-gnat-1.4-r1.ebuild, + +eselect-gnat-1.5.ebuild, +files/gnat.eselect-1.3, + +files/gnat-common-1.3-r1.bash, +files/gnat.eselect-1.4, + +files/gnat-common-1.4-r1.bash, +files/gnat.eselect-1.5, +metadata.xml: + Move package from app-admin to app-eselect category. + + 10 Aug 2014; Patrick Lauer <patrick@gentoo.org> eselect-gnat-1.3-r1.ebuild, + eselect-gnat-1.4-r1.ebuild, eselect-gnat-1.4.ebuild, eselect-gnat-1.5.ebuild: + Fix description for more repoman happy + + 08 Mar 2010; George Shapovalov <george@gentoo.org> + eselect-gnat-1.5.ebuild: + added ~sparc in preparison to enable gnat-gcc on sparc (#301446) + +*eselect-gnat-1.5 (22 Jan 2010) + + 22 Jan 2010; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-1.5, +eselect-gnat-1.5.ebuild: + new version, supporting brief output mode (#292105) + + 16 May 2008; George Shapovalov <george@gentoo.org> + -files/gnat.eselect-1.2, -files/gnat-common-1.2.bash, + -eselect-gnat-1.2.ebuild: + removed old version + +*eselect-gnat-1.4-r1 (16 May 2008) + + 16 May 2008; George Shapovalov <george@gentoo.org> + +files/gnat-common-1.4-r1.bash, +eselect-gnat-1.4-r1.ebuild: + fixed incorrect semicolon in ADA_PROJECT_PATH + +*eselect-gnat-1.4 (14 Apr 2008) + + 14 Apr 2008; George Shapovalov <george@gentoo.org> +files/gnat.eselect-1.4, + +eselect-gnat-1.4.ebuild: + split profile validity check off the get_active_gnat and made the update + action clean unmerged profile + + 04 Mar 2008; Santiago M. Mola <coldwind@gentoo.org> + eselect-gnat-1.3-r1.ebuild: + amd64 stable wrt bug #209265 + + 08 Feb 2008; Tobias Scherbaum <dertobi123@gentoo.org> + eselect-gnat-1.3-r1.ebuild: + ppc stable, bug #209265 + + 07 Feb 2008; George Shapovalov <george@gentoo.org> + -files/gnat.eselect-0.9, -files/gnat.eselect-1.0, + -files/gnat.eselect-1.0-r1, -files/gnat.eselect-1.1, + -files/gnat.eselect-1.1-r1, -files/gnat-common-1.3.bash, + -files/gnat-common.bash, -eselect-gnat-0.9.ebuild, + -eselect-gnat-1.0.ebuild, -eselect-gnat-1.0-r1.ebuild, + -eselect-gnat-1.1.ebuild, -eselect-gnat-1.1-r1.ebuild, + -eselect-gnat-1.3.ebuild: + pulled obsolete versions + + 05 Feb 2008; Christian Faulhammer <opfer@gentoo.org> + eselect-gnat-1.3-r1.ebuild: + stable x86, bug 208997 + +*eselect-gnat-1.3-r1 (29 Dec 2007) + + 29 Dec 2007; George Shapovalov <george@gentoo.org> + +files/gnat-common-1.3-r1.bash, +eselect-gnat-1.3-r1.ebuild: + fixed problem with ADA_PROJECT_PATH when no libs are installed (203628) + +*eselect-gnat-1.3 (26 Dec 2007) + + 26 Dec 2007; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-1.3, +files/gnat-common-1.3.bash, + +eselect-gnat-1.3.ebuild: + new version, implements selection of primary compilers and versioned + virtual/ada processing (see #151343) + + 26 Dec 2007; Harald van Dijk <truedfx@gentoo.org> eselect-gnat-1.2.ebuild: + Fix typo that left gnat-common.bash uninstalled + +*eselect-gnat-1.2 (14 Dec 2007) + + 14 Dec 2007; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-1.2, +files/gnat-common-1.2.bash, + +eselect-gnat-1.2.ebuild: + new version, supports unified libs layout + +*eselect-gnat-1.1-r1 (11 Dec 2007) + + 11 Dec 2007; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-1.1-r1, +eselect-gnat-1.1-r1.ebuild: + replaced env-update with do_action env update, #179880 + +*eselect-gnat-1.1 (19 Sep 2007) + + 19 Sep 2007; <portage-cvs@gentoo.org> +files/gnat.eselect-1.1, + +files/gnat-common.bash, +eselect-gnat-1.1.ebuild: + split off code common with gnat.eclass (##192505 and 167000). + + 07 Sep 2007; George Shapovalov <george@gentoo.org> files/gnat.eselect-0.9, + files/gnat.eselect-1.0, files/gnat.eselect-1.0-r1: + fixed typo in DESCRIPTION + +*eselect-gnat-1.0-r1 (15 Jun 2007) + + 15 Jun 2007; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-1.0-r1, +eselect-gnat-1.0-r1.ebuild: + added LIBDIR/adalib to LDPATH and refactored creation of env file. Now all + the libs should be picked up (fixes some issues with asis) + + 25 May 2007; user account for gentoo cvs access <portage-cvs@gentoo.org> + -files/gnat.eselect-0.7, -files/gnat.eselect-0.8, + -files/gnat.eselect-0.8-r1, -eselect-gnat-0.7.ebuild, + -eselect-gnat-0.8.ebuild, -eselect-gnat-0.8-r1.ebuild: + removed old versions (would not work with the eclasses at present in fact) + +*eselect-gnat-1.0 (25 May 2007) + + 25 May 2007; user account for gentoo cvs access <portage-cvs@gentoo.org> + +files/gnat.eselect-1.0, +eselect-gnat-1.0.ebuild: + new version, forcing env-update upon changes now + +*eselect-gnat-0.9 (26 May 2006) + + 26 May 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.9, +eselect-gnat-0.9.ebuild: + added LDPATH settings for gnat and the libs + + 17 May 2006; George Shapovalov <george@gentoo.org> + -files/gnat.eselect-0.6, -files/gnat.eselect, -eselect-gnat-0.5.ebuild, + -eselect-gnat-0.6.ebuild: + removed stale versions + +*eselect-gnat-0.8-r1 (17 May 2006) + + 17 May 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.8-r1, +eselect-gnat-0.8-r1.ebuild: + a fix to process all the installed libs, not just the 1st one.. (revbump, so + that everybody picks up the right code) + + 12 May 2006; Joseph Jezak <josejx@gentoo.org> eselect-gnat-0.8.ebuild: + Marked ~ppc for bug #133119. + +*eselect-gnat-0.8 (12 May 2006) + + 12 May 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.8, +eselect-gnat-0.8.ebuild: + new version - fixes ROOTPATH + some cosmetic changes + + 02 May 2006; George Shapovalov <george@gentoo.org> files/gnat.eselect-0.7: + small fix to the do_show and do_list methods (so that they actually show libs) + +*eselect-gnat-0.7 (02 May 2006) + + 02 May 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.7, +eselect-gnat-0.7.ebuild: + new version of eselect module, first shot at supporting Ada libs + +*eselect-gnat-0.6 (22 Jan 2006) + + 22 Jan 2006; George Shapovalov <george@gentoo.org> + +files/gnat.eselect-0.6, +eselect-gnat-0.6.ebuild: + new version: moved gnat specs under /usr/share to avoid config_protect + +*eselect-gnat-0.5 (17 Jan 2006) + + 17 Jan 2006; George Shapovalov <george@gentoo.org> +files/gnat.eselect, + +metadata.xml, +eselect-gnat-0.5.ebuild: + initial commit. eselect module for the gnat compilers (#111340) diff --git a/app-eselect/eselect-gnat/Manifest b/app-eselect/eselect-gnat/Manifest new file mode 100644 index 000000000000..4cdd900d1445 --- /dev/null +++ b/app-eselect/eselect-gnat/Manifest @@ -0,0 +1,28 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + +AUX gnat-common-1.3-r1.bash 6851 SHA256 b06cdf0c6d995b14eb3891d2892e4722c29f292d4ba26f19d087a6e34253606f SHA512 8aea2d1c2b36c6ecd5de13205123606d708e0a3e6c22cc8d7f22a6e625f830a8f4f44b35d6bf007a209805d10e0ca1cab893ca31e1a3c05a86492b00f54a6b1d WHIRLPOOL 37388c2145b5040fae3f84fcbe6d83c29a69888fba13a1597dee736e46f7c472fd10570d35aa880a45e9e9b7a22550ad9f1a5e3f40f7e0ab76b7073d8fe12352 +AUX gnat-common-1.4-r1.bash 6807 SHA256 a5bda7a80c5befe2f82e9d9ab39ab33816f0a6137b0a857ea046e7b4f356d7c6 SHA512 5132ca373ec7d0cb3bcbce224ba0a2167ded715a27f36442844ddc55859240070b6a296c0eef035ea4bb4298b335c826c71fbb016b64cf90e44e1eb0790c2075 WHIRLPOOL adcaa8766eac70f0cad53bb6e970783cb59f25b982a5c6fa79937cb062c934922529fbfe841c71ac30ad255a0d82be0012a24f7ac60ddc417fae0de5907a4a7f +AUX gnat.eselect-1.3 5306 SHA256 815baf272c839c3c096605e9520cff3971c11ce811019352ab1b61fc70d65e5d SHA512 a096456e228dcb3157ef983fc5df49503af13e5e524d3aba9ea056604460afff4941286d2e800ba1ac2b329f9ceafe1dc2d5a9a12c4bda4acefc0c1a302092fa WHIRLPOOL 18c03113d320c8e294fd0f1f3ce900e2ceb1e4c810b9a4e1b03d1291bffa3b407333be24a37686e46db181f9136f660045e2a4f3af07df60f63b30d627c22182 +AUX gnat.eselect-1.4 6029 SHA256 170d027796a2a50bff17bd394d05b31bf184ba310f61a589a4a4f7806bde5ca2 SHA512 1d3122459dc3d8f7f63341b23be9cf36219a86a5164463094444b3c40a363bce0abf57041d2c6847c6c0e4f7ec954d71e1474e39a73fb79984d8209d389e09a4 WHIRLPOOL 7cfd49f35097c2c2b178fdadf078868af6b9ba40ea1a8af60caa2063101abc92edbeaa4a10f1e16b0e27412e7cbeae5f5b0f9aba33dd13a2495457857a280e0e +AUX gnat.eselect-1.5 5959 SHA256 44672322df98dd24030a262e3300aadfd7de2335b19c9d958a012d0a4201aec4 SHA512 42c68be4c5744984c475875315ef4a636aa25adba0bedabd8cc98d5daf64031d9e4fc879b047e4ff47ca4a0cbddf2116829b5ce99577ed9112f38859c64b8580 WHIRLPOOL cf0d6750f9bd6e96c628b8b92d28816aeefaae5ba8e509589eda6464b4b182d99ee28e876ddc2e8e9a8a8f6d8143eaf3fb114aa4b63c529170ce70b1b17e86d2 +EBUILD eselect-gnat-1.3-r1.ebuild 788 SHA256 5d30c76500bffce2a248fcf3aa32b3aec367c8001f2b091b791d1daa2ceda48f SHA512 2b0e47bc5bee1b09a4b5ae59cd13680284b2c830d97b78098e086f3ff2c4885151ce7f01602d5005a72aee00d811b5f0718d2f53098db845ea8a54b1427683fe WHIRLPOOL 47abf08ace7a572f530cf4802f9b2c303f21bfd764254b00cb492c4b2f40fe09730d570c77460d8fc3a4ab9b308d3f200b401e72e7b61dc9819a3b909e00a54f +EBUILD eselect-gnat-1.4-r1.ebuild 891 SHA256 1f2bafcb336c572fa160b6073f6cbf16308a9c05bc6d1028f2e848f99e24d62a SHA512 b6a4029a99c52cba42d6d0f6bd7b641ae95bcd3b84fb0de93297dedd7f2b59830b6bd1ff4f91a644f28ee84133161ce414067a2736ff0b697fe5d0f0d567e0f0 WHIRLPOOL b8bc6ea9bb3d18d9236eabaeed37f959cd175be5970121660eef223363449ecd681c24d632498c34194c67d348e999e1df496de511037ffb6d74e148db330288 +EBUILD eselect-gnat-1.4.ebuild 888 SHA256 000745dc045d623f062f3afe83f8181f91526e8b81939bbae0799d5e5be85592 SHA512 ed9c2b7f567b2020ebd3c5ac690245d84838591450178a4fe9ad93b6ffa5956025d03bb7a312b652d267e255f564fc3751336e4178ccda43418d994896778f64 WHIRLPOOL 4de8ca98122e92a24e01b874a8828299f4fad198969ab1af68c460ced66b45c81774a13d05a87d4157d4b475fdfa811d3f6354e1c4a6809d449df0c520a3b1fe +EBUILD eselect-gnat-1.5.ebuild 903 SHA256 d7f9a6d25de710b747e933d217f38b451a873803f5696709be5124eac282b0f0 SHA512 b1d25d85fd48b68cb3df9faf612b17c13f9df410ea4c3ee88f470ffe3fd55babc62fc4cf64bcb3a85ff24328e5f28e21042a5d900b0c4e0bf5fe2877e6f29611 WHIRLPOOL ed324e11fea2e734034231ea4ebf4c431ee2d44194333ceb948879782447e3a5a0696e03077546be5bd8e0ca6450cd0c0e8a85d36840b17387656d13492b5211 +MISC ChangeLog 6507 SHA256 4fbd60988e17ff8454f1b1a0731e5bc1a4fb2198edc7e1f87708dc2710c87bca SHA512 b2be8b12133d4a067d2d3c3f52d379835bdf530dc4a3cd8c303eeca3a59c536d202dcf884f385e1f999b15d2809e96b0fb3bf1b472452cfeded0a868c6fbe6c7 WHIRLPOOL eacdbf17298dbf3aed1dc2b667367fa053f05ea88d7d48b1096e092418478761bacae0b80a91a368cd8e81d957ad533ac433570ac0cae1dafd2c8b580cafd127 +MISC metadata.xml 244 SHA256 c32a1e42a5f85acb0b69af3e2644f98213d48492817c90a82c833927d2881419 SHA512 df60315eb6903f90b81f336d0e744949816c6e521742528693e459454a30e513a0c951f2854b959c2201eca01632cd78df1dc99ef083a31ad641730c0e28043d WHIRLPOOL cb0913fb54f299e199cfe98e636a53ba8c74cb6104547b166b3c50c05126041b6aa2df3cd73c4c3c6be98ca0eb8f174c7b159949962328480b724072fb922854 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2 + +iQGcBAEBCAAGBQJVGs/9AAoJEJQzkH1pP7W4zaQL/2H+W0HCnvA/nFCIPbMQByE2 +3vazRyj2N/Ldiwu5W8PF7ovXpkaWjmHR34ZGjKVkYtf3trAviOcpmBibOj/a5wMa +eydba+RZzQg4BVN4y1+Enx8LzHfe+M5A87Z34nSdHSYUhAG7wGrO7zBfVVsTSeYx +liGZzxebnVhAOqZFbr1z/RM3JsEYe35/aG3HpVcFsshJiBxhmwuYVH/C9Etn5rY6 +hIR58pNMPPTiydJxnmXSn1MZU53QQwiX5+jLIHA2fjZ2JembwPYC1oKa30ucBHQR +Eo9pIET0RynD/JpXE4HyC87L+/lkmPvOG0MK7zpERRXYUDJZLogyub9HUnN5/ByI +MUg+DgKhdMLFTdbbpmYk+mliyQuXlAWt2mNZ2838bt4pKbbJOfbnzzGHH8w1sCMp +AbzTWakfObqghoiee1XgpOChp3V68lQLO78jNBpR0TcKg/JD53EIG2zDOfyrej+d +B36BjFfF/LoSFxwH8sTjqFwYdEXF7TjZ4KMqCfdTww== +=FBOc +-----END PGP SIGNATURE----- diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild new file mode 100644 index 000000000000..84c715bd58c8 --- /dev/null +++ b/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/eselect-gnat-1.3-r1.ebuild,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +inherit eutils + +DESCRIPTION="gnat module for eselect" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" + +IUSE="" +RDEPEND="app-admin/eselect" + +MODULEDIR="/usr/share/eselect/modules" + +# NOTE!! +# This path is duplicated in gnat-eselect module, +# adjust in both locations! +LIBDIR="/usr/share/gnat/lib" + +src_install() { + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}"/gnat.eselect-${PV} gnat.eselect + dodir ${LIBDIR} + insinto ${LIBDIR} + newins "${FILESDIR}"/gnat-common-${PVR}.bash gnat-common.bash +} diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild new file mode 100644 index 000000000000..0d3112eb9ddc --- /dev/null +++ b/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/eselect-gnat-1.4-r1.ebuild,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +inherit eutils + +DESCRIPTION="gnat module for eselect" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" + +IUSE="" +RDEPEND="app-admin/eselect" + +MODULEDIR="/usr/share/eselect/modules" + +# NOTE!! +# This path is duplicated in gnat-eselect module, +# adjust in both locations! +LIBDIR="/usr/share/gnat/lib" + +src_install() { + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}"/gnat.eselect-${PV} gnat.eselect + dodir ${LIBDIR} + insinto ${LIBDIR} + # !ATTN! + # Make sure to adjust version of installed file to a proper one if there is + # a change! + newins "${FILESDIR}"/gnat-common-${PVR}.bash gnat-common.bash +} diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild new file mode 100644 index 000000000000..ca3d5150a660 --- /dev/null +++ b/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/eselect-gnat-1.4.ebuild,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +inherit eutils + +DESCRIPTION="gnat module for eselect" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" + +IUSE="" +RDEPEND="app-admin/eselect" + +MODULEDIR="/usr/share/eselect/modules" + +# NOTE!! +# This path is duplicated in gnat-eselect module, +# adjust in both locations! +LIBDIR="/usr/share/gnat/lib" + +src_install() { + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}"/gnat.eselect-${PV} gnat.eselect + dodir ${LIBDIR} + insinto ${LIBDIR} + # !ATTN! + # Make sure to adjust version of installed file to a proper one if there is + # a change! + newins "${FILESDIR}"/gnat-common-1.3-r1.bash gnat-common.bash +} diff --git a/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild b/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild new file mode 100644 index 000000000000..937853b69242 --- /dev/null +++ b/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/eselect-gnat-1.5.ebuild,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +inherit eutils + +DESCRIPTION="gnat module for eselect" +HOMEPAGE="http://www.gentoo.org" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~sparc" + +IUSE="" +RDEPEND=">=app-admin/eselect-1.2.5" + +MODULEDIR="/usr/share/eselect/modules" + +# NOTE!! +# This path is duplicated in gnat-eselect module, +# adjust in both locations! +LIBDIR="/usr/share/gnat/lib" + +src_install() { + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}"/gnat.eselect-${PV} gnat.eselect + dodir ${LIBDIR} + insinto ${LIBDIR} + # !ATTN! + # Make sure to adjust version of installed file to a proper one if there is + # a change! + newins "${FILESDIR}"/gnat-common-1.4-r1.bash gnat-common.bash +} diff --git a/app-eselect/eselect-gnat/files/gnat-common-1.3-r1.bash b/app-eselect/eselect-gnat/files/gnat-common-1.3-r1.bash new file mode 100644 index 000000000000..5984d835334c --- /dev/null +++ b/app-eselect/eselect-gnat/files/gnat-common-1.3-r1.bash @@ -0,0 +1,223 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/files/gnat-common-1.3-r1.bash,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +# +# Original Author: George Shapovalov <george@gentoo.org> +# Purpose: Contains common vars/locations and functions for use by gnat.eclass, +# gnat.eselect and gnatbuild.eclass. +# +# NOTE!!! +# This code should just define vars (try to limit these!) and simple functions. +# No bash extensions!! +# That is, no portage or eclass constructs are allowed! +# + + + +# ---------------------------------- +# Globals + +# Environmantal stuff (for env update) +SPECSDIR="/usr/share/gnat/eselect" +ENVDIR="/etc/env.d" +MARKER="55gnat-" + +# User configurable settings +SETTINGSDIR="/etc/ada" +PRIMELIST="${SETTINGSDIR}/primary_compilers" + +## Lib install locations +## +## Gnat profile dependent files go under under ${LibTop}/${Gnat_Profile}/${PN} +## and common files go unde SpecsDir, DataDir +#PREFIX=/usr +## Replace %LIBDIR% below with $(get_libdir) in eclasses and ebuilds (top level Ok, inherit multilib) +## or $(profile2libdir ${profile}) in this code, eselect module or anywhere +## outside portage (as profile will be available only during actual execution, this only should +## be done inside corresponding functions). +#AdalibSpecsDir=${PREFIX}/include/ada +#AdalibDataDir=${PREFIX}/share/ada +#AdalibLibTop=${PREFIX}/%LIBDIR%/ada + + +# ------------------------------------ +# Helpers +# + +# get_all_profile_components splits gnat profile and returns pace separated list of its components: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 +# args: +# $1 - the string to split +get_all_profile_components() { + local GnatSLOT=${1##*-} + local remainder=${1%-*} + local GnatPkg=${remainder##*-} + remainder=${remainder%-gnat-*} + echo "${remainder} ${GnatPkg} ${GnatSLOT}" +} + +# similar to above, returns only SLOT component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> 4.1 +# args: +# $1 - the string to extract the slot from +get_gnat_SLOT() { + echo "${1##*-}" +} + +# returns only Pkg component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> gcc +# args: +# $1 - the string to extract the slot from +get_gnat_Pkg() { + local remainder=${1%-*} + echo "${remainder##*-}" +} + +# returns only Arch component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu +# args: +# $1 - the string to extract the slot from +get_gnat_Arch() { + echo ${1%-gnat-*} +} + + + +## ------------------------------------------- +# gnat profile and lib detection functions + + +# create a list of all gnat env.d files +# for now use trivial implementation - store name of active profile in the +# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} +get_env_list() { + for fn in ${ENVDIR}/${MARKER}*; do + echo $(basename ${fn}) + done +} + + + +# find all installed compilers and return a list +find_all_compilers() { + [[ ! -d ${SPECSDIR} ]] && exit + for fn in ${SPECSDIR}/*; do + [[ ! -d ${fn} ]] && echo $(basename ${fn}); + done +} + +# find installed primary compilers and return a list +find_primary_compilers() { + [[ ! -f ${PRIMELIST} ]] && exit + for fn in $(cat ${PRIMELIST}); do + [[ -f ${SPECSDIR}/${fn} ]] && echo ${fn}; + done +} + +# find installed libs and return a list +find_all_libs() { + [[ ! -d ${SPECSDIR} ]] && exit + for fn in ${SPECSDIR}/*; do + [[ -d ${fn} ]] && echo $(basename ${fn}); + done +} + +# find libs that have been built for a given profile +# Arguments: +# $1 - gnat profile for which to detect active libs +find_libs4profile() { + libs=( $(find_all_libs) ) + + for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do + [[ -f ${SPECSDIR}/${libs[$i]}/$1 ]] && echo "${libs[$i]}" + done +} + + + + +## ----------------------- +# main action - central part of do_set and helpers + + +# extracts values of the passed var definition from given spec file +# params: +# $1: spec file (as generated by gnabuild.eclass) +# $2: variable name +get_var_from_spec() { + local var=$(grep -e "^ *$2=" $1|cut -d= -f2) + echo ${var} +} + + +# Cycle through given libs and form a ':' separated list of settings for the given +# var. Returned string starts with ':' if there is any non-empty setting, +# otherwise returns empty string. Repeating settings are omitted, that is +# unique entry is added only first time it is encountered. No need to have some +# common dir listed many times in PATH for example. +# +# params: +# $1 - name of env var to process +# $2 - name of gnat profile +# $3.. - list of libs to check (to avoid its composition every time) +# - the list is expanded to list of args at the point of call +get_lib_var_settings() { + local envVar=$1 + local toset=$2 + #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep + if [[ "none" != ${3} ]]; then + local envString + local specLine + while [[ -n $3 ]]; do + specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) + #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep + if [[ -n ${specLine} ]] && [[ ! ${envString} =~ ${specLine} ]]; then + envString="${envString}:${specLine}" + fi + shift + done + echo "${envString}" + fi +} + + + +# The action! +# Part common for do_set and do_update of gnat.eselect, also used in gnat.eclass +# to set environment during lib build and installation +# +# params: +# $1 - profile to set (toset param inside) +# $2 - envfile + +generate_envFile() { + local toset=$1 + local envfile=$2 + + local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" + local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" + local libs=( $(find_libs4profile ${toset}) ) + #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep + if (( 0 == ${#libs[@]} )); then + libs="none" + fi + + local MyPath="${binpath}:${libexecpath}$(get_lib_var_settings PATH ${toset} ${libs[@]})" + echo "PATH=${MyPath}" > "${envfile}" + echo "ROOTPATH=${MyPath}" >> "${envfile}" + echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath)$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" + echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath)$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" + # the next three use the common base + local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) + echo "LDPATH=${libBase}:${libBase}/adalib$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" + echo "ADA_INCLUDE_PATH=${libBase}/adainclude$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" + echo "ADA_OBJECTS_PATH=${libBase}/adalib$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" + # ADA_PROJECT_PATH may not be set in any of the installed packages, + # we should only create this line if cumulative var is non-empty + My_ProjectPath=$(get_lib_var_settings ADA_PROJECT_PATH ${toset} ${libs[@]}) + if [[ -n ${My_ProjectPath} ]]; then + echo "ADA_PROJECT_PATH=${My_ProjectPath}" >> "${envfile}" + fi +} + diff --git a/app-eselect/eselect-gnat/files/gnat-common-1.4-r1.bash b/app-eselect/eselect-gnat/files/gnat-common-1.4-r1.bash new file mode 100644 index 000000000000..d12b811b81b4 --- /dev/null +++ b/app-eselect/eselect-gnat/files/gnat-common-1.4-r1.bash @@ -0,0 +1,226 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-eselect/eselect-gnat/files/gnat-common-1.4-r1.bash,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +# +# Author: George Shapovalov <george@gentoo.org> +# Purpose: Contains common vars/locations and functions for use by gnat.eclass, +# gnat.eselect and gnatbuild.eclass. +# +# NOTE!!! +# This code should just define vars (try to limit these!) and simple functions. +# No bash extensions!! +# That is, no portage or eclass constructs are allowed! +# + + + +# ---------------------------------- +# Globals + +# Environmantal stuff (for env update) +SPECSDIR="/usr/share/gnat/eselect" +ENVDIR="/etc/env.d" +MARKER="55gnat-" + +# User configurable settings +SETTINGSDIR="/etc/ada" +PRIMELIST="${SETTINGSDIR}/primary_compilers" + +## Lib install locations +## +## Gnat profile dependent files go under under ${LibTop}/${Gnat_Profile}/${PN} +## and common files go unde SpecsDir, DataDir +#PREFIX=/usr +## Replace %LIBDIR% below with $(get_libdir) in eclasses and ebuilds (top level Ok, inherit multilib) +## or $(profile2libdir ${profile}) in this code, eselect module or anywhere +## outside portage (as profile will be available only during actual execution, this only should +## be done inside corresponding functions). +#AdalibSpecsDir=${PREFIX}/include/ada +#AdalibDataDir=${PREFIX}/share/ada +#AdalibLibTop=${PREFIX}/%LIBDIR%/ada + + +# ------------------------------------ +# Helpers +# + +# get_all_profile_components splits gnat profile and returns pace separated list of its components: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu gcc 4.1 +# args: +# $1 - the string to split +get_all_profile_components() { + local GnatSLOT=${1##*-} + local remainder=${1%-*} + local GnatPkg=${remainder##*-} + remainder=${remainder%-gnat-*} + echo "${remainder} ${GnatPkg} ${GnatSLOT}" +} + +# similar to above, returns only SLOT component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> 4.1 +# args: +# $1 - the string to extract the slot from +get_gnat_SLOT() { + echo "${1##*-}" +} + +# returns only Pkg component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> gcc +# args: +# $1 - the string to extract the slot from +get_gnat_Pkg() { + local remainder=${1%-*} + echo "${remainder##*-}" +} + +# returns only Arch component: +# x86_64-pc-linux-gnu-gnat-gcc-4.1 -> x86_64-pc-linux-gnu +# args: +# $1 - the string to extract the slot from +get_gnat_Arch() { + echo ${1%-gnat-*} +} + + + +## ------------------------------------------- +# gnat profile and lib detection functions + + +# create a list of all gnat env.d files +# for now use trivial implementation - store name of active profile in the +# env file name, so it gets called 55gnat-${ARCH}-${PN}-${SLOT} +get_env_list() { + for fn in ${ENVDIR}/${MARKER}*; do + echo $(basename ${fn}) + done +} + + + +# find all installed compilers and return a list +find_all_compilers() { + [[ ! -d ${SPECSDIR} ]] && exit + for fn in ${SPECSDIR}/*; do + [[ ! -d ${fn} ]] && echo $(basename ${fn}); + done +} + +# find installed primary compilers and return a list +find_primary_compilers() { + [[ ! -f ${PRIMELIST} ]] && exit + for fn in $(cat ${PRIMELIST}); do + [[ -f ${SPECSDIR}/${fn} ]] && echo ${fn}; + done +} + +# find installed libs and return a list +find_all_libs() { + [[ ! -d ${SPECSDIR} ]] && exit + for fn in ${SPECSDIR}/*; do + [[ -d ${fn} ]] && echo $(basename ${fn}); + done +} + +# find libs that have been built for a given profile +# Arguments: +# $1 - gnat profile for which to detect active libs +find_libs4profile() { + libs=( $(find_all_libs) ) + + for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do + [[ -f ${SPECSDIR}/${libs[$i]}/$1 ]] && echo "${libs[$i]}" + done +} + + + + +## ----------------------- +# main action - central part of do_set and helpers + + +# extracts values of the passed var definition from given spec file +# params: +# $1: spec file (as generated by gnabuild.eclass) +# $2: variable name +get_var_from_spec() { + local var=$(grep -e "^ *$2=" $1|cut -d= -f2) + echo ${var} +} + + +# Cycle through given libs and form a ':' separated list of settings for the given +# var. Repeating settings are omitted, that is unique entry is added only first +# time it is encountered. +# +# params: +# $1 - name of env var to process +# $2 - name of gnat profile +# $3.. - list of libs to check (to avoid its composition every time) +# - the list is expanded to list of args at the point of call +get_lib_var_settings() { + local envVar=$1 + local toset=$2 + #echo "get_lib_var_settings params:$@" >> /tmp/eselect-gnat.rep + if [[ "none" != ${3} ]]; then + local envString + local specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) + if [[ -n ${specLine} ]]; then + envString="${specLine}" + fi + shift + # + while [[ -n $3 ]]; do + specLine=$(get_var_from_spec ${SPECSDIR}/$3/${toset} ${envVar}) + #echo "$3:${specLine}." >> /tmp/eselect-gnat.rep + if [[ -n ${specLine} ]] && [[ ! ${envString} =~ ${specLine} ]]; then + envString="${envString}:${specLine}" + fi + shift + done + echo "${envString}" + fi +} + + + +# The action! +# Part common for do_set and do_update of gnat.eselect, also used in gnat.eclass +# to set environment during lib build and installation +# +# params: +# $1 - profile to set (toset param inside) +# $2 - envfile + +generate_envFile() { + local toset=$1 + local envfile=$2 + + local binpath="$(get_var_from_spec ${SPECSDIR}/${toset} binpath)" + local libexecpath="$(get_var_from_spec ${SPECSDIR}/${toset} libexecpath)" + local libs=( $(find_libs4profile ${toset}) ) + #echo "generate_envFile: ${libs[@]}" >> /tmp/eselect-gnat.rep + if (( 0 == ${#libs[@]} )); then + libs="none" + fi + + local MyPath="${binpath}:${libexecpath}:$(get_lib_var_settings PATH ${toset} ${libs[@]})" + echo "PATH=${MyPath}" > "${envfile}" + echo "ROOTPATH=${MyPath}" >> "${envfile}" + echo "MANPATH=$(get_var_from_spec ${SPECSDIR}/${toset} manpath):$(get_lib_var_settings MANPATH ${toset} ${libs[@]})" >> "${envfile}" + echo "INFOPATH=$(get_var_from_spec ${SPECSDIR}/${toset} infopath):$(get_lib_var_settings INFOPATH ${toset} ${libs[@]})" >> "${envfile}" + # the next three use the common base + local libBase=$(get_var_from_spec ${SPECSDIR}/${toset} ldpath) + echo "LDPATH=${libBase}:${libBase}/adalib:$(get_lib_var_settings LDPATH ${toset} ${libs[@]})" >> "${envfile}" + echo "ADA_INCLUDE_PATH=${libBase}/adainclude:$(get_lib_var_settings ADA_INCLUDE_PATH ${toset} ${libs[@]})" >> "${envfile}" + echo "ADA_OBJECTS_PATH=${libBase}/adalib:$(get_lib_var_settings ADA_OBJECTS_PATH ${toset} ${libs[@]})" >> "${envfile}" + # ADA_PROJECT_PATH may not be set in any of the installed packages, + # we should only create this line if cumulative var is non-empty + My_ProjectPath=$(get_lib_var_settings ADA_PROJECT_PATH ${toset} ${libs[@]}) + if [[ -n ${My_ProjectPath} ]]; then + echo "ADA_PROJECT_PATH=${My_ProjectPath}" >> "${envfile}" + fi +} + diff --git a/app-eselect/eselect-gnat/files/gnat.eselect-1.3 b/app-eselect/eselect-gnat/files/gnat.eselect-1.3 new file mode 100644 index 000000000000..16777ce65660 --- /dev/null +++ b/app-eselect/eselect-gnat/files/gnat.eselect-1.3 @@ -0,0 +1,207 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: gnat.eselect-1.3,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +DESCRIPTION="Manage the installed gnat compilers" +MAINTAINER="ada@gentoo.org" +SVN_DATE='$Date: 2015/03/31 16:48:57 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +# "inheriting" common stuff +# this crude sourcing has to stay the way it is, as common code +# cannot be part of some eclass (bug #192505) +. /usr/share/gnat/lib/gnat-common.bash + + +### Phylosophy +# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} +# Each lib creates a dir with its name under ${SPECSDIR} and populates it with +# similar specs files (same name scheme) +# Recognizing gnat specs from lib specs is then eazy - test entry for being a +# dir, then just check what gnat profiles are installed for each lib.. +# doset then creates env file that combines settings for gnat and for the +# corresponding profile of each installed lib.. + + +### Helpers + +# return *the* name of the active profile, checking that we do not have multiple +# env files. +# There can be only one! +get_current_gnat() { + local profiles=( $(get_env_list) ) + + if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi + + if (( 1 == ${#profiles[@]} )); then + local active=${profiles[0]#${MARKER}} + else + die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" + fi + + if [ -f ${SPECSDIR}/${active} ]; then + echo ${active} + else + die -q "the active env.d profile does not correspond to any installed gnat!" + fi +} + +# check if the passed arg represents the installed gnat and return it or +# not_found +# takes args: +# $1 - list ID to check +get_name_from_list() { + compiler=$1 + + compilers=( $(find_all_compilers) ) + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + if [[ ${compilers[$i]} == ${compiler} ]] ; then + echo ${compiler} + return + fi + done + + echo "(not-found)" +} + + +# removes env files (for compiler and libs) +# params: +# $1: the name of profile for which to remove env file +unset_env() { + rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null +} + + +### show action ### + +describe_show() { + echo "Show the active gnat compiler/profile and installed libs" +} + +do_show() { + write_list_start "Current gnat version:" + active=$(get_current_gnat) + if [ ! -z ${active} ] ; then # not sure why [ -n ] does not do the same + write_kv_list_entry "$active" "" + libs=( $(find_libs4profile ${active}) ) + write_list_start "Active libs:" + write_numbered_list "${libs[@]}" + else + write_kv_list_entry "(none set)" "" + fi +} + +### list action ### + +describe_list() { + echo "List installed gnat compilers and libs" +} + +do_list() { + compilers=( $(find_all_compilers ) ) + active=$(get_current_gnat) + + write_list_start "Available gnat compilers:" + + if [[ -n ${compilers[@]} ]] ; then + local i + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + linkversion=${compilers[${i}]} + + [[ $linkversion == $active ]] && \ + compilers[${i}]="${compilers[${i}]} $(highlight '*' )" + done + write_numbered_list "${compilers[@]}" + + # now the libs + libs=( $(find_all_libs) ) + write_list_start "Installed libs:" + for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do + [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ + libs[${i}]="${libs[${i}]} $(highlight '*' )" + done + write_numbered_list "${libs[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + + +### set action ### + +describe_set() { + echo "Set active gnat compiler" +} + +# The set action. Parameters: +# $1 - name of profile to set, obligatory, passed by eselect +# $2 - optional, name of env file to generate. Used from gnat.eclass. +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which gnat to use" + fi + + local toset=$(get_name_from_list $1) + if [[ ${toset} == "(not-found)" ]] ; then + die -q "I don't recognise the selection" + fi + + # the action! + # in this implementation simply create an appropriate env file + local active=$(get_current_gnat) + if [[ -z ${2} ]] ; then + local envfile="${ENVDIR}/${MARKER}${toset}" + + # now we need to remove an old env file, which is guaranteed to + # be unique by get_current_gnat above + if [[ -n ${active} ]] ; then + unset_env ${active} + fi + # just for a good measure remove the one we are going to write + unset_env ${toset} + else + local envfile="$2" + fi + + generate_envFile ${toset} ${envfile} + + # force update environment + # should be replaced with "do_action env update" when #172472 gets resolved + env-update &> /dev/null +} + + + +### update action ### +# +# This action regenerates the /etc/env.d file for the current profile. Basically +# the same as set, only it does not take any parameters. It should be called from ebuilds +# installing Ada libs + +describe_update() { + echo "Update active gnat profile picking up new libs." +} + +do_update() { + local toset=$(get_current_gnat) + local envfile="${ENVDIR}/${MARKER}${toset}" + generate_envFile ${toset} ${envfile} + do_action env update &> /dev/null +} + +### unset action ### + +describe_unset() { + echo "Remove settings for currently active gnat" +} + +do_unset() { + local active=$(get_current_gnat) + # check whether we have any profile set before removing anything.. + if [[ -n ${active} ]] ; then + unset_env ${active} + do_action env update &> /dev/null + fi +} diff --git a/app-eselect/eselect-gnat/files/gnat.eselect-1.4 b/app-eselect/eselect-gnat/files/gnat.eselect-1.4 new file mode 100644 index 000000000000..38e4c1b56a87 --- /dev/null +++ b/app-eselect/eselect-gnat/files/gnat.eselect-1.4 @@ -0,0 +1,230 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: gnat.eselect-1.4,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +DESCRIPTION="Manage the installed gnat compilers" +MAINTAINER="ada@gentoo.org" +SVN_DATE='$Date: 2015/03/31 16:48:57 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +# "inheriting" common stuff +# this crude sourcing has to stay the way it is, as common code +# cannot be part of some eclass (bug #192505) +. /usr/share/gnat/lib/gnat-common.bash + + +### Phylosophy +# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} +# Each lib creates a dir with its name under ${SPECSDIR} and populates it with +# similar specs files (same name scheme) +# Recognizing gnat specs from lib specs is then eazy - test entry for being a +# dir, then just check what gnat profiles are installed for each lib.. +# doset then creates env file that combines settings for gnat and for the +# corresponding profile of each installed lib.. + + +### Helpers + +# return *the* name of the active profile, checking that we do not have multiple +# env files. +# There can be only one! +get_current_gnat() { + local profiles=( $(get_env_list) ) + + if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi + + if (( 1 == ${#profiles[@]} )); then + local active=${profiles[0]#${MARKER}} + else + die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" + fi + + echo ${active} +# disabling this check, as we want to use get_current_gnat with empty profile +# as an indication that last gnat in SLOT was removed +# if [ -f ${SPECSDIR}/${active} ]; then +# echo ${active} +# else +# die -q "the active env.d profile does not correspond to any installed gnat!" +# fi +} + +# validity check that was removed from get_current_gnat, in case we need it +# somewhere.. +# Arguments: +# $1 - name of the gnat profiel to check +profile_is_valid() { + if [[ -n $1 ]] ; then + [[ -f ${SPECSDIR}/$1 ]] || return 1 + fi +} + +# check if the passed arg represents the installed gnat and return it or +# not_found +# takes args: +# $1 - list ID to check +get_name_from_list() { + compiler=$1 + + compilers=( $(find_all_compilers) ) + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + if [[ ${compilers[$i]} == ${compiler} ]] ; then + echo ${compiler} + return + fi + done + + echo "(not-found)" +} + + +# removes env files (for compiler and libs) +# params: +# $1: the name of profile for which to remove env file +unset_env() { + rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null +} + + +### show action ### + +describe_show() { + echo "Show the active gnat compiler/profile and installed libs" +} + +do_show() { + active=$(get_current_gnat) + if $(profile_is_valid ${active}); then + write_list_start "Current gnat version:" + if [[ -n ${active} ]] ; then + write_kv_list_entry "$active" "" + libs=( $(find_libs4profile ${active}) ) + write_list_start "Active libs:" + write_numbered_list "${libs[@]}" + else + write_kv_list_entry "(none set)" "" + fi + else + write_error_msg "The active profile in ${ENVDIR} is not valid! Please set a valid profile!" + fi +} + +### list action ### + +describe_list() { + echo "List installed gnat compilers and libs" +} + +do_list() { + compilers=( $(find_all_compilers ) ) + active=$(get_current_gnat) + + write_list_start "Available gnat compilers:" + + if [[ -n ${compilers[@]} ]] ; then + local i + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + linkversion=${compilers[${i}]} + + [[ $linkversion == $active ]] && \ + compilers[${i}]="${compilers[${i}]} $(highlight '*' )" + done + write_numbered_list "${compilers[@]}" + + # now the libs + libs=( $(find_all_libs) ) + write_list_start "Installed libs:" + for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do + [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ + libs[${i}]="${libs[${i}]} $(highlight '*' )" + done + write_numbered_list "${libs[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + + +### set action ### + +describe_set() { + echo "Set active gnat compiler" +} + +# The set action. Parameters: +# $1 - name of profile to set, obligatory, passed by eselect +# $2 - optional, name of env file to generate. Used from gnat.eclass. +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which gnat to use" + fi + + local toset=$(get_name_from_list $1) + if [[ ${toset} == "(not-found)" ]] ; then + die -q "I don't recognise the selection" + fi + + # the action! + # in this implementation simply create an appropriate env file + local active=$(get_current_gnat) + if [[ -z ${2} ]] ; then + local envfile="${ENVDIR}/${MARKER}${toset}" + + # now we need to remove an old env file, which is guaranteed to + # be unique by get_current_gnat above + if [[ -n ${active} ]] ; then + unset_env ${active} + fi + # just for a good measure remove the one we are going to write + unset_env ${toset} + else + local envfile="$2" + fi + + generate_envFile ${toset} ${envfile} + + # force update environment + # should be replaced with "do_action env update" when #172472 gets resolved + env-update &> /dev/null +} + + + +### update action ### +# +# This action regenerates the /etc/env.d file for the current profile. Basically +# the same as set, only it does not take any parameters. It should be called from ebuilds +# installing Ada libs or in the pkg_postrm in gnatbuild.eclass, to clean up the +# profile if last gnat in SLOT was removed. + +describe_update() { + echo "Update active gnat profile picking up new libs." +} + +do_update() { + local toset=$(get_current_gnat) + local envfile="${ENVDIR}/${MARKER}${toset}" + # now check whether to update or unset the profile + if $(profile_is_valid ${toset}); then + generate_envFile ${toset} ${envfile} + else + unset_env ${toset} + fi + do_action env update &> /dev/null +} + +### unset action ### + +describe_unset() { + echo "Remove settings for currently active gnat" +} + +do_unset() { + local active=$(get_current_gnat) + # check whether we have any profile set before removing anything.. + if [[ -n ${active} ]] ; then + unset_env ${active} + do_action env update &> /dev/null + fi +} diff --git a/app-eselect/eselect-gnat/files/gnat.eselect-1.5 b/app-eselect/eselect-gnat/files/gnat.eselect-1.5 new file mode 100644 index 000000000000..893658f954b1 --- /dev/null +++ b/app-eselect/eselect-gnat/files/gnat.eselect-1.5 @@ -0,0 +1,226 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: gnat.eselect-1.5,v 1.1 2015/03/31 16:48:57 ulm Exp $ + +DESCRIPTION="Manage the installed gnat compilers" +MAINTAINER="ada@gentoo.org" +SVN_DATE='$Date: 2015/03/31 16:48:57 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +# "inheriting" common stuff +# this crude sourcing has to stay the way it is, as common code +# cannot be part of some eclass (bug #192505) +. /usr/share/gnat/lib/gnat-common.bash + + +### Phylosophy +# Each gnat installs a "specs" file named ${ARCH}-${PN}-${SLOT} under ${SPECSDIR} +# Each lib creates a dir with its name under ${SPECSDIR} and populates it with +# similar specs files (same name scheme) +# Recognizing gnat specs from lib specs is then eazy - test entry for being a +# dir, then just check what gnat profiles are installed for each lib.. +# doset then creates env file that combines settings for gnat and for the +# corresponding profile of each installed lib.. + + +### Helpers + +# return *the* name of the active profile, checking that we do not have multiple +# env files. +# There can be only one! +get_current_gnat() { + local profiles=( $(get_env_list) ) + + if [ ${profiles[@]} == "${MARKER}*" ]; then exit; fi + + if (( 1 == ${#profiles[@]} )); then + local active=${profiles[0]#${MARKER}} + else + die -q "${ENVDIR} contains multiple gnat profiles, please cleanup!" + fi + + echo ${active} +# disabling this check, as we want to use get_current_gnat with empty profile +# as an indication that last gnat in SLOT was removed +# if [ -f ${SPECSDIR}/${active} ]; then +# echo ${active} +# else +# die -q "the active env.d profile does not correspond to any installed gnat!" +# fi +} + +# validity check that was removed from get_current_gnat, in case we need it +# somewhere.. +# Arguments: +# $1 - name of the gnat profiel to check +profile_is_valid() { + if [[ -n $1 ]] ; then + [[ -f ${SPECSDIR}/$1 ]] || return 1 + fi +} + +# check if the passed arg represents the installed gnat and return it or +# not_found +# takes args: +# $1 - list ID to check +get_name_from_list() { + compiler=$1 + + compilers=( $(find_all_compilers) ) + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + if [[ ${compilers[$i]} == ${compiler} ]] ; then + echo ${compiler} + return + fi + done + + echo "(not-found)" +} + + +# removes env files (for compiler and libs) +# params: +# $1: the name of profile for which to remove env file +unset_env() { + rm -f ${ENVDIR}/${MARKER}$1 &> /dev/null +} + + +### show action ### + +describe_show() { + echo "Show the active gnat compiler/profile and installed libs" +} + +do_show() { + active=$(get_current_gnat) + if $(profile_is_valid ${active}); then + write_list_start "Current gnat version:" + if [[ -n ${active} ]] ; then + write_kv_list_entry "$active" "" + libs=( $(find_libs4profile ${active}) ) + write_list_start "Active libs:" + write_numbered_list "${libs[@]}" + else + write_kv_list_entry "(none set)" "" + fi + else + write_error_msg "The active profile in ${ENVDIR} is not valid! Please set a valid profile!" + fi +} + +### list action ### + +describe_list() { + echo "List installed gnat compilers and libs" +} + +do_list() { + compilers=( $(find_all_compilers ) ) + active=$(get_current_gnat) + + write_list_start "Available gnat compilers:" + + local i + for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do + linkversion=${compilers[${i}]} + + [[ $linkversion == $active ]] && \ + compilers[${i}]=$(highlight_marker "${compilers[${i}]}") + done + write_numbered_list -m "(none)" "${compilers[@]}" + + # now the libs + libs=( $(find_all_libs) ) + write_list_start "Installed libs:" + for (( i = 0 ; i < ${#libs[@]} ; i = i + 1 )) ; do + [ -f ${SPECSDIR}/${libs[$i]}/${active} ] && \ + libs[${i}]=$(highlight_marker "${libs[${i}]}") + done + write_numbered_list -m "(no libs)" "${libs[@]}" +} + + +### set action ### + +describe_set() { + echo "Set active gnat compiler" +} + +# The set action. Parameters: +# $1 - name of profile to set, obligatory, passed by eselect +# $2 - optional, name of env file to generate. Used from gnat.eclass. +do_set() { + if [[ -z ${1} ]] ; then + # no parameter + die -q "You didn't tell me which gnat to use" + fi + + local toset=$(get_name_from_list $1) + if [[ ${toset} == "(not-found)" ]] ; then + die -q "I don't recognise the selection" + fi + + # the action! + # in this implementation simply create an appropriate env file + local active=$(get_current_gnat) + if [[ -z ${2} ]] ; then + local envfile="${ENVDIR}/${MARKER}${toset}" + + # now we need to remove an old env file, which is guaranteed to + # be unique by get_current_gnat above + if [[ -n ${active} ]] ; then + unset_env ${active} + fi + # just for a good measure remove the one we are going to write + unset_env ${toset} + else + local envfile="$2" + fi + + generate_envFile ${toset} ${envfile} + + # force update environment + # should be replaced with "do_action env update" when #172472 gets resolved + env-update &> /dev/null +} + + + +### update action ### +# +# This action regenerates the /etc/env.d file for the current profile. Basically +# the same as set, only it does not take any parameters. It should be called from ebuilds +# installing Ada libs or in the pkg_postrm in gnatbuild.eclass, to clean up the +# profile if last gnat in SLOT was removed. + +describe_update() { + echo "Update active gnat profile picking up new libs." +} + +do_update() { + local toset=$(get_current_gnat) + local envfile="${ENVDIR}/${MARKER}${toset}" + # now check whether to update or unset the profile + if $(profile_is_valid ${toset}); then + generate_envFile ${toset} ${envfile} + else + unset_env ${toset} + fi + do_action env update &> /dev/null +} + +### unset action ### + +describe_unset() { + echo "Remove settings for currently active gnat" +} + +do_unset() { + local active=$(get_current_gnat) + # check whether we have any profile set before removing anything.. + if [[ -n ${active} ]] ; then + unset_env ${active} + do_action env update &> /dev/null + fi +} diff --git a/app-eselect/eselect-gnat/metadata.xml b/app-eselect/eselect-gnat/metadata.xml new file mode 100644 index 000000000000..3a0ddbad4e34 --- /dev/null +++ b/app-eselect/eselect-gnat/metadata.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>ada</herd> +<longdescription>The eselect module for the supported gnat compilers.</longdescription> +</pkgmetadata> |