public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-09-19 20:27 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-09-19 20:27 UTC (permalink / raw
  To: gentoo-commits

george      07/09/19 20:27:25

  Modified:             gnat.eclass
  Log:
  adapted gnat.eclass to use split off common code in eselect-gnat (##192505 and 167000)

Revision  Changes    Path
1.25                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.25&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.25&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.24&r2=1.25

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- gnat.eclass	28 May 2007 15:49:48 -0000	1.24
+++ gnat.eclass	19 Sep 2007 20:27:25 -0000	1.25
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.24 2007/05/28 15:49:48 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.25 2007/09/19 20:27:25 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -14,17 +14,29 @@
 # called from the (exported) gnat_src_compile function of eclass. These
 # functions should operate similarly to the starndard src_compile and
 # src_install. The only difference, that they should use $SL variable instead of
-# $S (this is where the working cop of source is held) and $DL instead of $D as
+# $S (this is where the working copy of source is held) and $DL instead of $D as
 # its installation point.
 
 inherit flag-o-matic eutils
 
-EXPORT_FUNCTIONS pkg_setup pkg_postinst src_unpack src_compile
+# The environment is set locally in src_compile and src_install functions
+# by the common code sourced here and in gnat-eselect module.
+# This is the standard location for this code (belongs to eselect-gnat,
+# since eselect should work even in the absense of portage tree and we can 
+# guarantee to some extent presence of gnat-eselect when anything gnat-related
+# gets processed. See #192505)
+#
+# Note!
+# It may not be safe to source this at top level. Only source inside local
+# functions!
+GnatCommon="/usr/share/gnat/lib/gnat-common.bash"
+
+EXPORT_FUNCTIONS pkg_setup pkg_postinst src_compile
 
 DESCRIPTION="Common procedures for building Ada libs using split gnat compilers"
 
 # really need to make sure we have eselect with new eclass version
-DEPEND=">=app-admin/eselect-gnat-0.8"
+DEPEND=">=app-admin/eselect-gnat-1.1"
 
 
 # ----------------------------------
@@ -47,9 +59,6 @@
 # installed in lib_install
 DL=${WORKDIR}/LocalDest
 
-# location of cleaned-up eselect script, for sourcing
-EselectScript=${WORKDIR}/gnat.eselect
-
 # file containing environment formed by gnat-eselect (build-time)
 BuildEnv=${WORKDIR}/BuildEnv
 
@@ -225,15 +234,6 @@
 
 
 
-gnat_src_unpack() {
-	debug-print-function $FUNCNAME $*
-	unpack ${A}
-	cat /usr/share/eselect/modules/gnat.eselect | \
-		grep -v svn_date_to_version | \
-		grep -v DESCRIPTION | \
-		grep -v env-update > ${EselectScript}
-}
-
 
 # standard lib_compile plug. Adapted from base.eclass
 lib_compile() {
@@ -274,7 +274,7 @@
 
 	# We source the eselect-gnat module and use its functions directly, instead of
 	# duplicating code or trying to violate sandbox in some way..
-	. ${EselectScript} || die "cannot source eselect-gnat module"
+	. ${GnatCommon} || die "failed to source gnat-common lib"
 
 	compilers=( $(find_compilers ) )
 	if [[ -n ${compilers[@]} ]] ; then
@@ -289,9 +289,9 @@
 			# setup environment
 			# As eselect-gnat also manages the libs, this will ensure the right
 			# lib profiles are activated too (in case we depend on some Ada lib)
-			do_set ${compilers[${i}]} ${BuildEnv}
-			expand_BuildEnv ${BuildEnv}
-			. ${BuildEnv}
+			generate_envFile ${compilers[${i}]} ${BuildEnv} && \
+			expand_BuildEnv ${BuildEnv} && \
+			. ${BuildEnv}  || die "failed to switch to ${compilers[${i}]}"
 			# many libs (notably xmlada and gtkada) do not like to see
 			# themselves installed. Need to strip them from ADA_*_PATH
 			# NOTE: this should not be done in pkg_setup, as we setup
@@ -323,7 +323,7 @@
 	debug-print-function $FUNCNAME $*
 
 	# prep lib specs directory
-	. ${EselectScript} || die "cannot source eselect-gnat module"
+	. ${GnatCommon} || die "failed to source gnat-common lib"
 	dodir ${SPECSDIR}/${PN}
 
 	compilers=( $(find_compilers ) )



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-09-25 21:01 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-09-25 21:01 UTC (permalink / raw
  To: gentoo-commits

george      07/09/25 21:01:02

  Modified:             gnat.eclass
  Log:
  removed duplicated helper functions

Revision  Changes    Path
1.26                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.26&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.26&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.25&r2=1.26

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- gnat.eclass	19 Sep 2007 20:27:25 -0000	1.25
+++ gnat.eclass	25 Sep 2007 21:01:02 -0000	1.26
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.25 2007/09/19 20:27:25 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.26 2007/09/25 21:01:02 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -89,46 +89,6 @@
 # ------------------------------------
 # Helpers
 #
-# may be moved to a seperate eclas, if enough accumulated inthis one and in
-# gnatbuild.eclass..
-
-# 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
-# params:
-#  $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
-# params:
-#  $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
-# params:
-#  $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
-# params:
-#  $1 - the string to extract the slot from
-get_gnat_Arch() {
-	echo ${1%-gnat-*}
-}
-
 
 
 # The purpose of this one is to remove all parts of the env entry specific to a



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-09-26 20:09 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-09-26 20:09 UTC (permalink / raw
  To: gentoo-commits

george      07/09/26 20:09:03

  Modified:             gnat.eclass
  Log:
  lib -> get_libdir fix

Revision  Changes    Path
1.27                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.27&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.27&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.26&r2=1.27

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- gnat.eclass	25 Sep 2007 21:01:02 -0000	1.26
+++ gnat.eclass	26 Sep 2007 20:09:03 -0000	1.27
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.26 2007/09/25 21:01:02 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.27 2007/09/26 20:09:03 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -48,7 +48,7 @@
 PREFIX=/usr
 AdalibSpecsDir=${PREFIX}/include/ada
 AdalibDataDir=${PREFIX}/share/ada
-AdalibLibTop=${PREFIX}/lib/ada
+AdalibLibTop=${PREFIX}/$(get_libdir)/ada
 
 # build-time locations
 # SL is a "localized" S, - location where sources are copied for



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-09-26 20:41 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-09-26 20:41 UTC (permalink / raw
  To: gentoo-commits

george      07/09/26 20:41:34

  Modified:             gnat.eclass
  Log:
  added get_active_profile helper function

Revision  Changes    Path
1.28                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.28&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.28&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.27&r2=1.28

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- gnat.eclass	26 Sep 2007 20:09:03 -0000	1.27
+++ gnat.eclass	26 Sep 2007 20:41:33 -0000	1.28
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.27 2007/09/26 20:09:03 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.28 2007/09/26 20:41:33 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -125,6 +125,34 @@
 }
 
 
+# Returns a name of active gnat profile. Peroroms some validity checks. No input
+# parameters, analyzes the system setup directly.
+get_active_profile() {
+	# get common code and settings
+	. ${GnatCommon} || die "failed to source gnat-common lib"
+
+	local profiles=( $(get_env_list) ) 
+
+	if [[ ${profiles[@]} == "${MARKER}*" ]]; then 
+		exit 
+		# returning empty string
+	fi
+
+	if (( 1 == ${#profiles[@]} )); then
+		local active=${profiles[0]#${MARKER}}
+	else
+		die "${ENVDIR} contains multiple gnat profiles, please cleanup!"
+	fi
+
+	if [[ -f ${SPECSDIR}/${active} ]]; then
+		echo ${active}
+	else
+		die "The profile active in ${ENVDIR} does not correspond to any installed gnat!"
+	fi
+}
+
+
+
 # ------------------------------------
 # Functions
 



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-09-27 12:56 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-09-27 12:56 UTC (permalink / raw
  To: gentoo-commits

george      07/09/27 12:56:42

  Modified:             gnat.eclass
  Log:
  changed exit to return

Revision  Changes    Path
1.29                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.29&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.29&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.28&r2=1.29

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- gnat.eclass	26 Sep 2007 20:41:33 -0000	1.28
+++ gnat.eclass	27 Sep 2007 12:56:41 -0000	1.29
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.28 2007/09/26 20:41:33 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.29 2007/09/27 12:56:41 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -134,7 +134,7 @@
 	local profiles=( $(get_env_list) ) 
 
 	if [[ ${profiles[@]} == "${MARKER}*" ]]; then 
-		exit 
+		return 
 		# returning empty string
 	fi
 



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-12-14 12:16 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-12-14 12:16 UTC (permalink / raw
  To: gentoo-commits

george      07/12/14 12:16:56

  Modified:             gnat.eclass
  Log:
  update to support unified libs layout, added (hopefully most) quotes

Revision  Changes    Path
1.30                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.30&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.30&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.29&r2=1.30

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- gnat.eclass	27 Sep 2007 12:56:41 -0000	1.29
+++ gnat.eclass	14 Dec 2007 12:16:56 -0000	1.30
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.29 2007/09/27 12:56:41 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.30 2007/12/14 12:16:56 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -42,9 +42,13 @@
 # ----------------------------------
 # Globals
 
-# Locations
-# Gnat profile dependent files go under under ${LibTop}/${Gnat_Profile}/${PN}
-# and common files go unde SpecsDir, DataDir
+# Lib install locations
+#
+# Gnat profile dependent files go under ${LibTop}/${Gnat_Profile}/${PN}
+# and common files go under SpecsDir, DataDir..
+# In order not to pollute PATH and LDPATH attempt should be mabe to install
+# binaries and what makes sence for individual packages under
+# ${AdalibLibTop}/${Gnat_Profile}/bin
 PREFIX=/usr
 AdalibSpecsDir=${PREFIX}/include/ada
 AdalibDataDir=${PREFIX}/share/ada
@@ -55,9 +59,17 @@
 # profile-specific build
 SL=${WORKDIR}/LocalSource
 
-# DL is a "localized destination", where ARCH/SLOT dependent binaries should be
-# installed in lib_install
+# DL* are "localized destinations" where ARCH/SLOT dependent stuff should be
+# installed in lib_install.   There are three:
+#
 DL=${WORKDIR}/LocalDest
+#	a generic location for the lib (.a, .so) files
+#
+DLbin=${WORKDIR}/LocalBinDest
+#	binaries that should be in the PATH, will be moved to common Ada bin dir
+#
+DLgpr=${WORKDIR}/LocalGPRDest
+#	gpr's should go here.
 
 # file containing environment formed by gnat-eselect (build-time)
 BuildEnv=${WORKDIR}/BuildEnv
@@ -271,15 +283,15 @@
 			debug-print-section "compiling for gnat profile ${compilers[${i}]}"
 
 			# copy sources
-			mkdir ${DL}
-			cp -dpR ${S} ${SL}
+			mkdir "${DL}" "${DLbin}" "${DLgpr}"
+			cp -dpR "${S}" "${SL}"
 
 			# setup environment
 			# As eselect-gnat also manages the libs, this will ensure the right
 			# lib profiles are activated too (in case we depend on some Ada lib)
 			generate_envFile ${compilers[${i}]} ${BuildEnv} && \
-			expand_BuildEnv ${BuildEnv} && \
-			. ${BuildEnv}  || die "failed to switch to ${compilers[${i}]}"
+			expand_BuildEnv "${BuildEnv}" && \
+			. "${BuildEnv}"  || die "failed to switch to ${compilers[${i}]}"
 			# many libs (notably xmlada and gtkada) do not like to see
 			# themselves installed. Need to strip them from ADA_*_PATH
 			# NOTE: this should not be done in pkg_setup, as we setup
@@ -288,16 +300,18 @@
 			export ADA_OBJECTS_PATH=$(filter_env_var ADA_OBJECTS_PATH)
 
 			# call compilation callback
-			cd ${SL}
+			cd "${SL}"
 			gnat_filter_flags ${compilers[${i}]}
 			lib_compile ${compilers[${i}]} || die "failed compiling for ${compilers[${i}]}"
 
 			# call install callback
-			cd ${SL}
+			cd "${SL}"
 			lib_install ${compilers[${i}]} || die "failed installing profile-specific part for ${compilers[${i}]}"
 			# move installed and cleanup
-			mv ${DL} ${DL}-${compilers[${i}]}
-			rm -rf ${SL}
+			mv "${DL}" "${DL}-${compilers[${i}]}"
+			mv "${DLbin}" "${DLbin}-${compilers[${i}]}"
+			mv "${DLgpr}" "${DLgpr}-${compilers[${i}]}"
+			rm -rf "${SL}"
 		done
 	else
 		die "please make sure you have at least one gnat compiler installed!"
@@ -323,9 +337,13 @@
 			local DLlocation=${AdalibLibTop}/${compilers[${i}]}
 			dodir ${DLlocation}
 			cp -dpR "${DL}-${compilers[${i}]}" "${D}/${DLlocation}/${PN}"
+			cp -dpR "${DLbin}-${compilers[${i}]}" "${D}/${DLlocation}"/bin
+			cp -dpR "${DLgpr}-${compilers[${i}]}" "${D}/${DLlocation}"/gpr
 			# create profile-specific specs file
 			cp ${LibEnv} ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
 			sed -i -e "s:%DL%:${DLlocation}/${PN}:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+			sed -i -e "s:%DLbin%:${DLlocation}/bin:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+			sed -i -e "s:%DLgpr%:${DLlocation}/gpr:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
 		done
 	else
 		die || "please make sure you have at least one gnat compiler installed!"



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-12-27  1:40 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-12-27  1:40 UTC (permalink / raw
  To: gentoo-commits

george      07/12/27 01:40:44

  Modified:             gnat.eclass
  Log:
  updated gnat.eclass to support primary compilers and versioned Ada sandard dependencies

Revision  Changes    Path
1.31                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.31&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.31&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.30&r2=1.31

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- gnat.eclass	14 Dec 2007 12:16:56 -0000	1.30
+++ gnat.eclass	27 Dec 2007 01:40:44 -0000	1.31
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.30 2007/12/14 12:16:56 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.31 2007/12/27 01:40:44 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -35,8 +35,9 @@
 
 DESCRIPTION="Common procedures for building Ada libs using split gnat compilers"
 
-# really need to make sure we have eselect with new eclass version
-DEPEND=">=app-admin/eselect-gnat-1.1"
+# make sure we have an appropriately recent eselect-gnat installed, as we are
+# using some common code here.
+DEPEND=">=app-admin/eselect-gnat-1.3"
 
 
 # ----------------------------------
@@ -99,6 +100,61 @@
 
 
 # ------------------------------------
+# Dependency processing related stuff
+
+# A simple wrapper to get the relevant part of the DEPEND
+# params:
+#  $1 - should contain dependency specification analogous to DEPEND,
+#       if omitted, DEPEND is processed
+get_ada_dep() {
+	[[ -z "$1" ]] && DEP="${DEPEND}" || DEP="$1"
+	local TempStr
+	for fn in $DEP; do # here $DEP should *not* be in ""
+		[[ $fn =~ "virtual/ada" ]] && TempStr=${fn/*virtual\//}
+		# above match should be to full virtual/ada, as simply "ada" is a common
+		# part of ${PN}, even for some packages under dev-ada
+	done
+#	debug-print-function $FUNCNAME "TempStr=${TempStr:0:8}"
+	[[ -n ${TempStr} ]] && echo ${TempStr:0:8}
+}
+
+# This function is used to check whether the requested gnat profile matches the
+# requested Ada standard
+# !!ATTN!!
+# This must match dependencies as specified in vitrual/ada !!!
+#
+# params:
+#  $1 - the requested gnat profile in usual form (e.g. x86_64-pc-linux-gnu-gnat-gcc-4.1)
+#  $2 - Ada standard specification, as would be specified in DEPEND. 
+#       Valid  values: ada-1995, ada-2005, ada
+#       Since standard variants are (mostly) backwards-compatible, ada-1995 and
+#       simply "ada" produce the same results (at least until ada-1983 is adde,
+#       which is rather unlikely).
+belongs_to_standard() {
+#	debug-print-function $FUNCNAME $*
+	. ${GnatCommon} || die "failed to source gnat-common lib"
+	if [[ $2 == 'ada' ]] || [[ $2 == 'ada-1995' ]]; then
+#		debug-print-function "ada or ada-1995 match"
+		return 0 # no restrictions imposed
+	elif [[ "$2" == 'ada-2005' ]]; then
+		local GnatSlot=$(get_gnat_SLOT $1)
+		local ReducedSlot=${GnatSlot//\./}
+		if [[ $(get_gnat_Pkg $1) == "gcc" ]]; then
+#			debug-print-function "got gcc profile, GnatSlot=${ReducedSlot}"
+			[[ ${ReducedSlot} -ge "43" ]] && return 0 || return 1
+		elif [[ $(get_gnat_Pkg $1) == "gpl" ]]; then
+#			debug-print-function "got gpl profile, GnatSlot=${ReducedSlot}"
+			[[ ${ReducedSlot} -ge "41" ]] && return 0 || return 1
+		else
+			return 1 # unknown compiler encountered
+		fi
+	else
+		return 1 # unknown standard requested, check spelling!
+	fi
+}
+
+
+# ------------------------------------
 # Helpers
 #
 
@@ -137,7 +193,7 @@
 }
 
 
-# Returns a name of active gnat profile. Peroroms some validity checks. No input
+# Returns a name of active gnat profile. Performs some validity checks. No input
 # parameters, analyzes the system setup directly.
 get_active_profile() {
 	# get common code and settings
@@ -226,7 +282,7 @@
 	elog "for the installed library. In order to immediately activate these"
 	elog "settings please run:"
 	elog
-	elog "env-update"
+	#elog "env-update"
 	elog "source /etc/profile"
 	einfo
 	einfo "Otherwise the settings will become active next time you login"
@@ -276,45 +332,56 @@
 	# duplicating code or trying to violate sandbox in some way..
 	. ${GnatCommon} || die "failed to source gnat-common lib"
 
-	compilers=( $(find_compilers ) )
+	compilers=( $(find_primary_compilers ) )
 	if [[ -n ${compilers[@]} ]] ; then
 		local i
+		local AdaDep=$(get_ada_dep)
 		for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do
-			debug-print-section "compiling for gnat profile ${compilers[${i}]}"
+			if $(belongs_to_standard ${compilers[${i}]} ${AdaDep}); then
+				einfo "compiling for gnat profile ${compilers[${i}]}"
 
-			# copy sources
-			mkdir "${DL}" "${DLbin}" "${DLgpr}"
-			cp -dpR "${S}" "${SL}"
-
-			# setup environment
-			# As eselect-gnat also manages the libs, this will ensure the right
-			# lib profiles are activated too (in case we depend on some Ada lib)
-			generate_envFile ${compilers[${i}]} ${BuildEnv} && \
-			expand_BuildEnv "${BuildEnv}" && \
-			. "${BuildEnv}"  || die "failed to switch to ${compilers[${i}]}"
-			# many libs (notably xmlada and gtkada) do not like to see
-			# themselves installed. Need to strip them from ADA_*_PATH
-			# NOTE: this should not be done in pkg_setup, as we setup
-			# environment right above
-			export ADA_INCLUDE_PATH=$(filter_env_var ADA_INCLUDE_PATH)
-			export ADA_OBJECTS_PATH=$(filter_env_var ADA_OBJECTS_PATH)
-
-			# call compilation callback
-			cd "${SL}"
-			gnat_filter_flags ${compilers[${i}]}
-			lib_compile ${compilers[${i}]} || die "failed compiling for ${compilers[${i}]}"
-
-			# call install callback
-			cd "${SL}"
-			lib_install ${compilers[${i}]} || die "failed installing profile-specific part for ${compilers[${i}]}"
-			# move installed and cleanup
-			mv "${DL}" "${DL}-${compilers[${i}]}"
-			mv "${DLbin}" "${DLbin}-${compilers[${i}]}"
-			mv "${DLgpr}" "${DLgpr}-${compilers[${i}]}"
-			rm -rf "${SL}"
+				# copy sources
+				mkdir "${DL}" "${DLbin}" "${DLgpr}"
+				cp -dpR "${S}" "${SL}"
+
+				# setup environment
+				# As eselect-gnat also manages the libs, this will ensure the right
+				# lib profiles are activated too (in case we depend on some Ada lib)
+				generate_envFile ${compilers[${i}]} ${BuildEnv} && \
+				expand_BuildEnv "${BuildEnv}" && \
+				. "${BuildEnv}"  || die "failed to switch to ${compilers[${i}]}"
+				# many libs (notably xmlada and gtkada) do not like to see
+				# themselves installed. Need to strip them from ADA_*_PATH
+				# NOTE: this should not be done in pkg_setup, as we setup
+				# environment right above
+				export ADA_INCLUDE_PATH=$(filter_env_var ADA_INCLUDE_PATH)
+				export ADA_OBJECTS_PATH=$(filter_env_var ADA_OBJECTS_PATH)
+
+				# call compilation callback
+				cd "${SL}"
+				gnat_filter_flags ${compilers[${i}]}
+				lib_compile ${compilers[${i}]} || die "failed compiling for ${compilers[${i}]}"
+
+				# call install callback
+				cd "${SL}"
+				lib_install ${compilers[${i}]} || die "failed installing profile-specific part for ${compilers[${i}]}"
+				# move installed and cleanup
+				mv "${DL}" "${DL}-${compilers[${i}]}"
+				mv "${DLbin}" "${DLbin}-${compilers[${i}]}"
+				mv "${DLgpr}" "${DLgpr}-${compilers[${i}]}"
+				rm -rf "${SL}"
+			else
+				einfo "skipping gnat profile ${compilers[${i}]}"
+			fi
 		done
 	else
-		die "please make sure you have at least one gnat compiler installed!"
+		ewarn "Please note!"
+		elog "Treatment of installed Ada compilers has recently changed!"
+		elog "Libs are now being built only for \"primary\" compilers."
+		elog "Please list gnat profiles (as reported by \"eselect gnat list\")"
+		elog "that you want to regularly use (i.e., not just for testing)"
+		elog "in ${PRIMELIST}, one per line."
+		die "please make sure you have at least one gnat compiler installed and set as primary!"
 	fi
 }
 
@@ -328,22 +395,27 @@
 	. ${GnatCommon} || die "failed to source gnat-common lib"
 	dodir ${SPECSDIR}/${PN}
 
-	compilers=( $(find_compilers ) )
+	compilers=( $(find_primary_compilers) )
 	if [[ -n ${compilers[@]} ]] ; then
 		local i
+		local AdaDep=$(get_ada_dep)
 		for (( i = 0 ; i < ${#compilers[@]} ; i = i + 1 )) ; do
-			debug-print-section "installing for gnat profile ${compilers[${i}]}"
+			if $(belongs_to_standard ${compilers[${i}]} ${AdaDep}); then
+				debug-print-section "installing for gnat profile ${compilers[${i}]}"
 
-			local DLlocation=${AdalibLibTop}/${compilers[${i}]}
-			dodir ${DLlocation}
-			cp -dpR "${DL}-${compilers[${i}]}" "${D}/${DLlocation}/${PN}"
-			cp -dpR "${DLbin}-${compilers[${i}]}" "${D}/${DLlocation}"/bin
-			cp -dpR "${DLgpr}-${compilers[${i}]}" "${D}/${DLlocation}"/gpr
-			# create profile-specific specs file
-			cp ${LibEnv} ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-			sed -i -e "s:%DL%:${DLlocation}/${PN}:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-			sed -i -e "s:%DLbin%:${DLlocation}/bin:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-			sed -i -e "s:%DLgpr%:${DLlocation}/gpr:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+				local DLlocation=${AdalibLibTop}/${compilers[${i}]}
+				dodir ${DLlocation}
+				cp -dpR "${DL}-${compilers[${i}]}" "${D}/${DLlocation}/${PN}"
+				cp -dpR "${DLbin}-${compilers[${i}]}" "${D}/${DLlocation}"/bin
+				cp -dpR "${DLgpr}-${compilers[${i}]}" "${D}/${DLlocation}"/gpr
+				# create profile-specific specs file
+				cp ${LibEnv} ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+				sed -i -e "s:%DL%:${DLlocation}/${PN}:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+				sed -i -e "s:%DLbin%:${DLlocation}/bin:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+				sed -i -e "s:%DLgpr%:${DLlocation}/gpr:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+			else
+				einfo "skipping gnat profile ${compilers[${i}]}"
+			fi
 		done
 	else
 		die || "please make sure you have at least one gnat compiler installed!"



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2007-12-29 23:41 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2007-12-29 23:41 UTC (permalink / raw
  To: gentoo-commits

george      07/12/29 23:41:30

  Modified:             gnat.eclass
  Log:
  actually added the rule enforcing that all primary compilers be present before Ada lib can be emerged (#151343)

Revision  Changes    Path
1.32                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.32&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.32&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.31&r2=1.32

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- gnat.eclass	27 Dec 2007 01:40:44 -0000	1.31
+++ gnat.eclass	29 Dec 2007 23:41:29 -0000	1.32
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.31 2007/12/27 01:40:44 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.32 2007/12/29 23:41:29 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -31,6 +31,9 @@
 # functions!
 GnatCommon="/usr/share/gnat/lib/gnat-common.bash"
 
+# !!NOTE!!
+# src_install should not be exported!
+# Instead gnat_src_install should be explicitly called from within src_install.
 EXPORT_FUNCTIONS pkg_setup pkg_postinst src_compile
 
 DESCRIPTION="Common procedures for building Ada libs using split gnat compilers"
@@ -269,6 +272,17 @@
 
 gnat_pkg_setup() {
 	debug-print-function $FUNCNAME $*
+
+	# check whether all the primary compilers are installed
+	. ${GnatCommon} || die "failed to source gnat-common lib"
+	for fn in $(cat ${PRIMELIST}); do
+		if [[ ! -f ${SPECSDIR}/${fn} ]]; then 
+			elog "The ${fn} Ada compiler profile is specified as primary, but is not installed."
+			elog "Please rectify the situation before emerging Ada library!"
+			die "Primary compiler is missing"
+		fi
+	done
+	
 	export ADAC=${ADAC:-gnatgcc}
 	export ADAMAKE=${ADAMAKE:-gnatmake}
 	export ADABIND=${ADABIND:-gnatbind}



-- 
gentoo-commits@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2008-02-13 20:09 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2008-02-13 20:09 UTC (permalink / raw
  To: gentoo-commits

george      08/02/13 20:09:27

  Modified:             gnat.eclass
  Log:
  fixed quoting

Revision  Changes    Path
1.34                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.34&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.34&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.33&r2=1.34

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- gnat.eclass	6 Jan 2008 19:30:24 -0000	1.33
+++ gnat.eclass	13 Feb 2008 20:09:27 -0000	1.34
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.33 2008/01/06 19:30:24 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.34 2008/02/13 20:09:27 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -423,10 +423,10 @@
 				cp -dpR "${DLbin}-${compilers[${i}]}" "${D}/${DLlocation}"/bin
 				cp -dpR "${DLgpr}-${compilers[${i}]}" "${D}/${DLlocation}"/gpr
 				# create profile-specific specs file
-				cp ${LibEnv} ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-				sed -i -e "s:%DL%:${DLlocation}/${PN}:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-				sed -i -e "s:%DLbin%:${DLlocation}/bin:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
-				sed -i -e "s:%DLgpr%:${DLlocation}/gpr:g" ${D}/${SPECSDIR}/${PN}/${compilers[${i}]}
+				cp ${LibEnv} "${D}/${SPECSDIR}/${PN}/${compilers[${i}]}"
+				sed -i -e "s:%DL%:${DLlocation}/${PN}:g" "${D}/${SPECSDIR}/${PN}/${compilers[${i}]}"
+				sed -i -e "s:%DLbin%:${DLlocation}/bin:g" "${D}/${SPECSDIR}/${PN}/${compilers[${i}]}"
+				sed -i -e "s:%DLgpr%:${DLlocation}/gpr:g" "${D}/${SPECSDIR}/${PN}/${compilers[${i}]}"
 			else
 				einfo "skipping gnat profile ${compilers[${i}]}"
 			fi



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2008-04-12  7:42 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2008-04-12  7:42 UTC (permalink / raw
  To: gentoo-commits

george      08/04/12 07:42:48

  Modified:             gnat.eclass
  Log:
  updated failure notice on missing primary compilers (#217279)

Revision  Changes    Path
1.35                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.35&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.35&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.34&r2=1.35

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- gnat.eclass	13 Feb 2008 20:09:27 -0000	1.34
+++ gnat.eclass	12 Apr 2008 07:42:47 -0000	1.35
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.34 2008/02/13 20:09:27 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.35 2008/04/12 07:42:47 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -60,7 +60,7 @@
 
 # build-time locations
 # SL is a "localized" S, - location where sources are copied for
-# profile-specific build
+#bi profile-specific build
 SL=${WORKDIR}/LocalSource
 
 # DL* are "localized destinations" where ARCH/SLOT dependent stuff should be
@@ -279,6 +279,12 @@
 		if [[ ! -f ${SPECSDIR}/${fn} ]]; then 
 			elog "The ${fn} Ada compiler profile is specified as primary, but is not installed."
 			elog "Please rectify the situation before emerging Ada library!"
+			elog "Please either install again all the missing compilers listed"
+			elog "as primary, or edit /etc/ada/primary_compilers and update the"
+			elog "list of primary compilers there."
+			einfo ""
+			ewarn "If you do the latter, please don't forget to rebuild all"
+			ewarn "affected libs!"
 			die "Primary compiler is missing"
 		fi
 	done



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2008-07-19  9:20 Torsten Veller (tove)
  0 siblings, 0 replies; 14+ messages in thread
From: Torsten Veller (tove) @ 2008-07-19  9:20 UTC (permalink / raw
  To: gentoo-commits

tove        08/07/19 09:20:07

  Modified:             gnat.eclass
  Log:
  die || string -> die string

Revision  Changes    Path
1.36                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.36&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.36&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.35&r2=1.36

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- gnat.eclass	12 Apr 2008 07:42:47 -0000	1.35
+++ gnat.eclass	19 Jul 2008 09:20:06 -0000	1.36
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.35 2008/04/12 07:42:47 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.36 2008/07/19 09:20:06 tove Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -438,6 +438,6 @@
 			fi
 		done
 	else
-		die || "please make sure you have at least one gnat compiler installed!"
+		die "please make sure you have at least one gnat compiler installed!"
 	fi
 }



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2009-01-12 22:55 Markus Meier (maekke)
  0 siblings, 0 replies; 14+ messages in thread
From: Markus Meier (maekke) @ 2009-01-12 22:55 UTC (permalink / raw
  To: gentoo-commits

maekke      09/01/12 22:55:53

  Modified:             gnat.eclass
  Log:
  whitespace

Revision  Changes    Path
1.37                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.37&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.37&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.36&r2=1.37

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- gnat.eclass	19 Jul 2008 09:20:06 -0000	1.36
+++ gnat.eclass	12 Jan 2009 22:55:53 -0000	1.37
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.36 2008/07/19 09:20:06 tove Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.37 2009/01/12 22:55:53 maekke Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -276,7 +276,7 @@
 	# check whether all the primary compilers are installed
 	. ${GnatCommon} || die "failed to source gnat-common lib"
 	for fn in $(cat ${PRIMELIST}); do
-		if [[ ! -f ${SPECSDIR}/${fn} ]]; then 
+		if [[ ! -f ${SPECSDIR}/${fn} ]]; then
 			elog "The ${fn} Ada compiler profile is specified as primary, but is not installed."
 			elog "Please rectify the situation before emerging Ada library!"
 			elog "Please either install again all the missing compilers listed"
@@ -288,7 +288,7 @@
 			die "Primary compiler is missing"
 		fi
 	done
-	
+
 	export ADAC=${ADAC:-gnatgcc}
 	export ADAMAKE=${ADAMAKE:-gnatmake}
 	export ADABIND=${ADABIND:-gnatbind}






^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2009-03-26  9:56 George Shapovalov (george)
  0 siblings, 0 replies; 14+ messages in thread
From: George Shapovalov (george) @ 2009-03-26  9:56 UTC (permalink / raw
  To: gentoo-commits

george      09/03/26 09:56:51

  Modified:             gnat.eclass
  Log:
  expanded Ada standard checking to be exact for 1995 also

Revision  Changes    Path
1.38                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.38&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.38&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.37&r2=1.38

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- gnat.eclass	12 Jan 2009 22:55:53 -0000	1.37
+++ gnat.eclass	26 Mar 2009 09:56:51 -0000	1.38
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.37 2009/01/12 22:55:53 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.38 2009/03/26 09:56:51 george Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -130,18 +130,32 @@
 #  $1 - the requested gnat profile in usual form (e.g. x86_64-pc-linux-gnu-gnat-gcc-4.1)
 #  $2 - Ada standard specification, as would be specified in DEPEND. 
 #       Valid  values: ada-1995, ada-2005, ada
-#       Since standard variants are (mostly) backwards-compatible, ada-1995 and
-#       simply "ada" produce the same results (at least until ada-1983 is adde,
-#       which is rather unlikely).
+#
+#       This used to treat ada-1995 and ada alike, but some packages (still
+#       requested by users) no longer compile with new compilers (not the
+#       standard issue, but rather compiler becoming stricter most of the time).
+#       Plus there are some "intermediary versions", not fully 2005 compliant
+#       but already causing problems.  Therefore, now we do exact matching.
 belongs_to_standard() {
 #	debug-print-function $FUNCNAME $*
 	. ${GnatCommon} || die "failed to source gnat-common lib"
-	if [[ $2 == 'ada' ]] || [[ $2 == 'ada-1995' ]]; then
+	local GnatSlot=$(get_gnat_SLOT $1)
+	local ReducedSlot=${GnatSlot//\./}
+	#
+	if [[ $2 == 'ada' ]] ; then
 #		debug-print-function "ada or ada-1995 match"
 		return 0 # no restrictions imposed
-	elif [[ "$2" == 'ada-2005' ]]; then
-		local GnatSlot=$(get_gnat_SLOT $1)
-		local ReducedSlot=${GnatSlot//\./}
+	elif [[ "$2" == 'ada-1995' ]] ; then
+		if [[ $(get_gnat_Pkg $1) == "gcc" ]]; then
+#			debug-print-function "got gcc profile, GnatSlot=${ReducedSlot}"
+			[[ ${ReducedSlot} -le "42" ]] && return 0 || return 1
+		elif [[ $(get_gnat_Pkg $1) == "gpl" ]]; then
+#			debug-print-function "got gpl profile, GnatSlot=${ReducedSlot}"
+			[[ ${ReducedSlot} -lt "41" ]] && return 0 || return 1
+		else
+			return 1 # unknown compiler encountered
+		fi
+	elif [[ "$2" == 'ada-2005' ]] ; then
 		if [[ $(get_gnat_Pkg $1) == "gcc" ]]; then
 #			debug-print-function "got gcc profile, GnatSlot=${ReducedSlot}"
 			[[ ${ReducedSlot} -ge "43" ]] && return 0 || return 1






^ permalink raw reply	[flat|nested] 14+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
@ 2010-01-13 15:06 Tomas Chvatal (scarabeus)
  0 siblings, 0 replies; 14+ messages in thread
From: Tomas Chvatal (scarabeus) @ 2010-01-13 15:06 UTC (permalink / raw
  To: gentoo-commits

scarabeus    10/01/13 15:06:12

  Modified:             gnat.eclass
  Log:
  Use correct fallback function, since we dont inherit base eclass at all.

Revision  Changes    Path
1.39                 eclass/gnat.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.39&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.39&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.38&r2=1.39

Index: gnat.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- gnat.eclass	26 Mar 2009 09:56:51 -0000	1.38
+++ gnat.eclass	13 Jan 2010 15:06:11 -0000	1.39
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.38 2009/03/26 09:56:51 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.39 2010/01/13 15:06:11 scarabeus Exp $
 #
 # Author: George Shapovalov <george@gentoo.org>
 # Belongs to: ada herd <ada@gentoo.org>
@@ -328,7 +328,7 @@
 # standard lib_compile plug. Adapted from base.eclass
 lib_compile() {
 	debug-print-function $FUNCNAME $*
-	[ -z "$1" ] && base_src_compile all
+	[ -z "$1" ] && lib_compile all
 
 	cd ${SL}
 






^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-01-13 15:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-26  9:56 [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass George Shapovalov (george)
  -- strict thread matches above, loose matches on Subject: below --
2010-01-13 15:06 Tomas Chvatal (scarabeus)
2009-01-12 22:55 Markus Meier (maekke)
2008-07-19  9:20 Torsten Veller (tove)
2008-04-12  7:42 George Shapovalov (george)
2008-02-13 20:09 George Shapovalov (george)
2007-12-29 23:41 George Shapovalov (george)
2007-12-27  1:40 George Shapovalov (george)
2007-12-14 12:16 George Shapovalov (george)
2007-09-27 12:56 George Shapovalov (george)
2007-09-26 20:41 George Shapovalov (george)
2007-09-26 20:09 George Shapovalov (george)
2007-09-25 21:01 George Shapovalov (george)
2007-09-19 20:27 George Shapovalov (george)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox