diff --git a/sdk_container/src/third_party/portage-stable/eclass/ChangeLog b/sdk_container/src/third_party/portage-stable/eclass/ChangeLog-2015 similarity index 88% rename from sdk_container/src/third_party/portage-stable/eclass/ChangeLog rename to sdk_container/src/third_party/portage-stable/eclass/ChangeLog-2015 index 595a30d433..273257d5dc 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/ChangeLog +++ b/sdk_container/src/third_party/portage-stable/eclass/ChangeLog-2015 @@ -1,6 +1,273 @@ # ChangeLog for eclass directory # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1678 2015/06/22 14:18:19 pesa Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1750 2015/08/08 09:32:50 mgorny Exp $ + + 08 Aug 2015; Michał Górny git-r3.eclass: + Add some boldness to output. Update/fix pkg_needrebuild() for + smart-live-rebuild. + + 07 Aug 2015; Davide Pesavento qt5-build.eclass: + Fix bugs #549140 and #552942. + + 07 Aug 2015; Davide Pesavento qt5-build.eclass: + Allow passing arguments to qmake from ebuilds via the myqmakeargs array. + + 06 Aug 2015; Sergei Trofimovich ghc-package.eclass, + haskell-cabal.eclass: + Add new helpers: 'ghc-pm-version' to get ghc version as seen by package + manager and 'ghc-is-dynamic' to workaround ghc-api bug + https://ghc.haskell.org/trac/ghc/ticket/10301 in ebuild. + + 05 Aug 2015; William Hubbs golang-vcs-snapshot.eclass: + add || die and fix indentation + + 05 Aug 2015; William Hubbs +golang-vcs-snapshot.eclass: + Add eclass for vcs snapshots of software written in Go. + + 03 Aug 2015; Michael Sterrett python-utils-r1.eclass: + Add quotes to support reading from files with spaces in the filename. + + 03 Aug 2015; Michael Palimaka kde5.eclass: + Do not compress handbooks. + + 02 Aug 2015; James Le Cuirot java-utils-2.eclass: + Allow java-pkg_get-javac to be called alone. Fixes bug #172594. Thanks to + sping for the patch. Also simplify die logic around java-pkg_javac-args. die + handling has improved since this was written. + + 31 Jul 2015; Patrice Clement java-utils-2.eclass: + Document JAVA_RM_FILES variable. Also, fix documentation and correct typos in + java-pkg_rm_files. + + 30 Jul 2015; James Le Cuirot java-utils-2.eclass: + Fix JAVA_RM_FILES by simplifying java-utils-2_src_prepare on the basis that + we won't be committing EAPI 0|1 ebuilds any more. + + 30 Jul 2015; Brian Evans mysql-multilib.eclass: + Revert bad mycmakeargs changes and introduce 3 eclass variables to have extra + defines in the ebuild + + 30 Jul 2015; Brian Evans mysql-multilib.eclass: + Reset variables between ABIs + + 30 Jul 2015; Brian Evans mysql-multilib.eclass: + Add blocker below virtual/mysql-5.6-r4 for new split ebuilds + + 29 Jul 2015; Brian Evans mysql-multilib.eclass: + Fix pkg_config function error with non-existant USE flags + + 28 Jul 2015; Brian Evans mysql-multilib.eclass: + Fix configuring non-native abi which leads to build failure wrt bug 556162 + + 28 Jul 2015; Brian Evans mysql-cmake.eclass, + mysql-multilib.eclass: + Add support for the split client/server options to the mysql eclasses + + 27 Jul 2015; William Hubbs +golang-base.eclass, + golang-build.eclass, golang-vcs.eclass: + Add golang-base.eclass for the basic golang functions and set up the + other go eclasses to use it. + + + 27 Jul 2015; Michał Górny python-utils-r1.eclass: + python_wrapper_setup(): make banned helpers exit with 127. + + 27 Jul 2015; Michał Górny python-utils-r1.eclass: + Ban calling pythonN and pythonN-config when the other version of Python is + selected (i.e. ban python2 when python3 is used). + + 27 Jul 2015; Michał Górny python-utils-r1.eclass: + python_wrapper_setup(): wrap pythonN-config as well as suggested by PEP and + required by some applications, bug #555594. + + 27 Jul 2015; Michał Górny python-utils-r1.eclass: + python_wrapper_setup(): replace symlinks with shell wrappers to avoid + triggering Python 3.4+ magical prefix support. + + 27 Jul 2015; Mike Gilbert python-r1.eclass: + Drop the USE_PYTHON warning. + + 25 Jul 2015; Michał Górny python-utils-r1.eclass: + Add missing ||die to "rm -f" calls, i.e. in case we do not have permission to + remove the files. + + 23 Jul 2015; William Hubbs golang-build.eclass: + Add functions to retrieve Go library paths and install Go packages. + + 22 Jul 2015; Michael Palimaka kde4-meta.eclass: + Fix oldpim unpack by Andreas Sturmlechner + wrt bug #555566. + + 22 Jul 2015; Patrice Clement java-utils-2.eclass: + Introduce java-pkg_rm_files as a helper function along with JAVA_RM_FILES + array to readily get rid of useless files. + + 20 Jul 2015; Sergei Trofimovich haskell-cabal.eclass: + Workaround upstream cabal tests hangup bug #537500 by Michael Orlitzky; use + ghc's haddock for doc generation. + + 19 Jul 2015; Mike Pagano kernel-2.eclass: + Change kernel upgrade http link and remove reference to deblob in elog + message. See bug #553484 + + 19 Jul 2015; Johannes Huber kde4-base.eclass: + Cleanup SRC_URIs. + + 18 Jul 2015; Mike Gilbert distutils-r1.eclass: + Add entire python directory to SANDBOX_PREDICT, bug 554252. + + 17 Jul 2015; Ian Stakenvicius (_AxS_) + mozconfig-v6.38.eclass, mozconfig-v6.39.eclass: + Updated gstreamer dependencies to current stable and dropped gst-plugins-mad + since gst-plugins-libav now officially provides mp3 decoding + + 17 Jul 2015; Brian Evans depend.php.eclass: + Remove deprecated functions from depend.php.eclass as announced 30 days ago + + 17 Jul 2015; Brian Evans -php-common-r1.eclass, + -php-ext-base-r1.eclass, -php-ezc.eclass: + Drop old, unused eclasses wrt bug 551910 + + 17 Jul 2015; Ian Stakenvicius (_AxS_) + mozconfig-v6.38.eclass, mozconfig-v6.39.eclass: + Added gst-plugins-mad:1.0 dependency for USE=gstreamer to ensure mp3 + streaming support + + 16 Jul 2015; Ian Stakenvicius (_AxS_) mozlinguas.eclass: + minor update within mozlinguas.eclass + + 16 Jul 2015; Ian Stakenvicius (_AxS_) mozlinguas.eclass: + Fixed the mozlinguas.eclass upgrade, recommitting. + + 16 Jul 2015; Ian Stakenvicius (_AxS_) + mozconfig-v6.38.eclass, mozconfig-v6.39.eclass, mozcoreconf-v3.eclass, + mozextension.eclass, mozlinguas.eclass: + Update mozilla support eclasses + + 16 Jul 2015; Michał Górny distutils-r1.eclass: + Forbid also installing "examples" package, bug #555038. + + 16 Jul 2015; Lars Wendler apache-2.eclass: + Added slot dependency for openssl. Raised minimum required EAPI version to 5. + + 15 Jul 2015; Andreas K. Huettel kde4-meta.eclass: + Fix unpacking of noakonadi branch + + 14 Jul 2015; Anthony G. Basile bitcoincore.eclass: + Update for bitcoind 0.11.0. + + 13 Jul 2015; Davide Pesavento qt5-build.eclass: + Initial support for Qt 5.5 + + 09 Jul 2015; Michał Górny git-r3.eclass: + Do not attempt to use submodules for which the checkout path does not exist + (has been removed), bug #551100. + + 09 Jul 2015; Michał Górny gnome2.eclass: + Remove meaningless nonfatal from elibtoolize call, bug #551154. + + 09 Jul 2015; Hans de Graaff ruby-single.eclass: + Update documentation. + + 08 Jul 2015; Bernard Cafarelli webapp.eclass: + Fix elog in webapp_serverowned and ebeep in newer EAPIs + + 07 Jul 2015; Ian Stakenvicius (_AxS_) + -mozconfig-v4.31.eclass, -mozconfig-v5.33.eclass, +mozconfig-v6.38.eclass, + +mozconfig-v6.39.eclass: + removed old mozconfig eclasses, added new + + 06 Jul 2015; William Hubbs golang-build.eclass: + Add back the subslot operator in the dependency on Go. We need this so that + we have the Go version the package was built with recorded. + + 06 Jul 2015; Michael Palimaka kde5.eclass: + Add missing USE dependency default wrt bug #554056. + + 05 Jul 2015; Hans de Graaff ruby-fakegem.eclass: + Document that some variables must be set before inheriting the eclass. + + 04 Jul 2015; Mike Gilbert distutils-r1.eclass, + python-any-r1.eclass, python-r1.eclass, python-single-r1.eclass, + python-utils-r1.eclass: + Replace links to python-r1 dev guide with links to the wiki. + + 04 Jul 2015; Manuel Rüger python-r1.eclass: + Update URI. + + 03 Jul 2015; William Hubbs golang-build.eclass: + drop the slot dependency; it was pointed out to me that they do not trigger + rebuilds in DEPEND + + 01 Jul 2015; Manuel Rüger kde4-base.eclass: + Sync with overlay. Add SRC_URIs for newer KDE SC, KDE Workspace releases and + KDEPIM 4.4 no-akonadi branches. + + 29 Jun 2015; Manuel Rüger ruby-ng.eclass: + Quote RUBY_S and sub_S as the directory could contain spaces. + + 29 Jun 2015; Davide Pesavento qmake-utils.eclass: + Introduce qt{4,5}_get_plugindir(). Rephrase some eclass doc. + + 28 Jun 2015; James Le Cuirot java-utils-2.eclass: + The -source flag was added in 1.3 or 1.4 (not sure) and we have special code + to handle this but no one in their right mind would build with 1.2 or 1.3 + now. Removing this code allows the ecj-gcj ebuild to call java-pkg_javac-args + without a proper VM present. + + 28 Jun 2015; Johannes Huber kde5.eclass: + Loop optimization as suggested by Michal Górny on -dev + ml. + + 27 Jun 2015; Johannes Huber kde5-functions.eclass, + kde5.eclass: + Sync kde5*eclass with kde overlay. Handle more whitespace variations by + Michael Palimaka . Fixes translation handling by + Michael Palimaka and Andreas Sturmlechner + , bug #552664. Raises deps on KDE Frameworks + and KDE Plasma Manuel Rüger . + + 27 Jun 2015; Mike Pagano kernel-2.eclass: + Fix conditional bug for UNIPATCH_DROP + + 27 Jun 2015; Mike Pagano kernel-2.eclass: + Fix for kdbus. Thanks to Arfrever. + + 27 Jun 2015; Mike Pagano kernel-2.eclass: + Add the kdbus use flag and eclass variable to the kernel-2.eclass for + optional kdbus inclusion. + + 27 Jun 2015; Mike Pagano kernel-2.eclass: + Reverting kdbus changes in eclass. Caused invalid iuse for other ebuilds. + + 26 Jun 2015; Mike Pagano kernel-2.eclass: + Add the option to include the kdbus patchset into gentoo-sources. Default is + not to include it. + + 26 Jun 2015; Michał Górny multilib-build.eclass: + Remove emul-linux-x86 hack, since emul-linux-x86 is no more. + + 24 Jun 2015; William Hubbs golang-build.eclass: + typo fix, use double brackets + + 24 Jun 2015; William Hubbs +golang-build.eclass: + Add an eclass for building Go software + + 24 Jun 2015; depend.php.eclass: + depend.php.eclass is deprecated and is set to be removed 30 days after bug + 552836 is resolved + + 24 Jun 2015; php-lib-r1.eclass: + Remove depend.php and dodoc-php in favor of just dodoc + + 24 Jun 2015; Justin Lecher waf-utils.eclass: + Drop base.eclass usage + + 23 Jun 2015; William Hubbs golang-vcs.eclass: + The GOPATH environment variable is now passed directly to the + commands that need it. + The correct directory of source files is copied to the correct + location under ${S}. 22 Jun 2015; Davide Pesavento qmake-utils.eclass: Introduce qt{4,5}_get_libdir(). diff --git a/sdk_container/src/third_party/portage-stable/eclass/ELT-patches/as-needed/2.4.3 b/sdk_container/src/third_party/portage-stable/eclass/ELT-patches/as-needed/2.4.3 new file mode 100644 index 0000000000..a31e9edab0 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/ELT-patches/as-needed/2.4.3 @@ -0,0 +1,38 @@ +--- ltmain.sh ++++ ltmain.sh +@@ -7225,10 +7225,15 @@ + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + ++ -Wl,--as-needed|-Wl,--no-as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, +@@ -7609,10 +7614,19 @@ + + for deplib in $libs; do + lib= + found=false + case $deplib in ++ -Wl,--as-needed|-Wl,--no-as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" diff --git a/sdk_container/src/third_party/portage-stable/eclass/apache-2.eclass b/sdk_container/src/third_party/portage-stable/eclass/apache-2.eclass index e07693da2b..3f9e706f8b 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/apache-2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/apache-2.eclass @@ -17,7 +17,13 @@ inherit autotools eutils flag-o-matic multilib ssl-cert user toolchain-funcs ver case ${EAPI:-0} in 0|1|2|3|4) - die "This eclass requires >=EAPI-5" + die "This eclass is banned for EAPI<5" + ;; + 5) + :; + ;; + 6) + die "This eclass is not yet ready for EAPI-6" ;; esac diff --git a/sdk_container/src/third_party/portage-stable/eclass/autotools.eclass b/sdk_container/src/third_party/portage-stable/eclass/autotools.eclass index 782c77ca6e..3039a466b9 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/autotools.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/autotools.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.176 2015/06/03 04:06:08 vapier Exp $ +# $Id$ # @ECLASS: autotools.eclass # @MAINTAINER: @@ -56,7 +56,7 @@ inherit libtool # Do NOT change this variable in your ebuilds! # If you want to force a newer minor version, you can specify the correct # WANT value by using a colon: : -_LATEST_AUTOMAKE=( 1.14.1:1.14 1.15:1.15 ) +_LATEST_AUTOMAKE=( 1.15:1.15 ) _automake_atom="sys-devel/automake" _autoconf_atom="sys-devel/autoconf" @@ -198,7 +198,7 @@ eautoreconf() { intltool false "autotools_run_tool intltoolize --automake --copy --force" gtkdoc false "autotools_run_tool --at-missing gtkdocize --copy" gnomedoc false "autotools_run_tool --at-missing gnome-doc-prepare --copy --force" - libtool false "_elibtoolize --install --copy --force" + libtool false "_elibtoolize --auto-ltdl --install --copy --force" ) for (( i = 0; i < ${#tools[@]}; i += 3 )) ; do if _at_uses_${tools[i]} ; then @@ -258,12 +258,13 @@ _at_uses_pkg() { } _at_uses_autoheader() { _at_uses_pkg A{C,M}_CONFIG_HEADER{S,}; } _at_uses_automake() { _at_uses_pkg AM_INIT_AUTOMAKE; } -_at_uses_gettext() { _at_uses_pkg AM_GNU_GETTEXT_VERSION; } +_at_uses_gettext() { _at_uses_pkg AM_GNU_GETTEXT_{,REQUIRE_}VERSION; } _at_uses_glibgettext() { _at_uses_pkg AM_GLIB_GNU_GETTEXT; } _at_uses_intltool() { _at_uses_pkg {AC,IT}_PROG_INTLTOOL; } _at_uses_gtkdoc() { _at_uses_pkg GTK_DOC_CHECK; } _at_uses_gnomedoc() { _at_uses_pkg GNOME_DOC_INIT; } _at_uses_libtool() { _at_uses_pkg A{C,M}_PROG_LIBTOOL LT_INIT; } +_at_uses_libltdl() { _at_uses_pkg LT_CONFIG_LTDL_DIR; } # @FUNCTION: eaclocal_amflags # @DESCRIPTION: @@ -313,6 +314,11 @@ eaclocal() { _elibtoolize() { local LIBTOOLIZE=${LIBTOOLIZE:-$(type -P glibtoolize > /dev/null && echo glibtoolize || echo libtoolize)} + if [[ $1 == "--auto-ltdl" ]] ; then + shift + _at_uses_libltdl && set -- "$@" --ltdl + fi + [[ -f GNUmakefile.am || -f Makefile.am ]] && set -- "$@" --automake autotools_run_tool ${LIBTOOLIZE} "$@" @@ -475,13 +481,14 @@ autotools_run_tool() { autotools_env_setup - local STDERR_TARGET="${T}/$1.out" + # Allow people to pass in full paths. #549268 + local STDERR_TARGET="${T}/${1##*/}.out" # most of the time, there will only be one run, but if there are # more, make sure we get unique log filenames if [[ -e ${STDERR_TARGET} ]] ; then local i=1 while :; do - STDERR_TARGET="${T}/$1-${i}.out" + STDERR_TARGET="${T}/${1##*/}-${i}.out" [[ -e ${STDERR_TARGET} ]] || break : $(( i++ )) done @@ -518,13 +525,13 @@ autotools_run_tool() { # Keep a list of all the macros we might use so that we only # have to run the trace code once. Order doesn't matter. ALL_AUTOTOOLS_MACROS=( - A{C,M}_PROG_LIBTOOL LT_INIT + A{C,M}_PROG_LIBTOOL LT_INIT LT_CONFIG_LTDL_DIR A{C,M}_CONFIG_HEADER{S,} AC_CONFIG_SUBDIRS AC_CONFIG_AUX_DIR AC_CONFIG_MACRO_DIR AM_INIT_AUTOMAKE AM_GLIB_GNU_GETTEXT - AM_GNU_GETTEXT_VERSION + AM_GNU_GETTEXT_{,REQUIRE_}VERSION {AC,IT}_PROG_INTLTOOL GTK_DOC_CHECK GNOME_DOC_INIT diff --git a/sdk_container/src/third_party/portage-stable/eclass/bitcoincore.eclass b/sdk_container/src/third_party/portage-stable/eclass/bitcoincore.eclass index 8a90faf3fc..0362c8cdcf 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/bitcoincore.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/bitcoincore.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/bitcoincore.eclass,v 1.4 2015/05/27 00:18:02 blueness Exp $ +# $Id$ # # @ECLASS: bitcoincore.eclass # @MAINTAINER: @@ -76,13 +76,30 @@ case "${PV}" in 0.10*) BITCOINCORE_SERIES="0.10.x" LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-0.0.0_pre20141212" - BITCOINCORE_RBF_DIFF="16f45600c8c372a738ffef544292864256382601...a23678edc70204599299459a206709a00e039db7" - BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.10.2.patch" + case "${PVR}" in + 0.10.2) + BITCOINCORE_RBF_DIFF="16f45600c8c372a738ffef544292864256382601...a23678edc70204599299459a206709a00e039db7" + BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.10.2.patch" + ;; + *) + BITCOINCORE_RBF_DIFF="16f45600c8c372a738ffef544292864256382601...4890416cde655559eba09d3fd6f79db7d0d6314a" + BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.10.2-r1.patch" + ;; + esac BITCOINCORE_XT_DIFF="047a89831760ff124740fe9f58411d57ee087078...d4084b62c42c38bfe302d712b98909ab26ecce2f" ;; +0.11*) + BITCOINCORE_SERIES="0.11.x" + LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-0.0.0_pre20150423" + # RBF is bundled with ljr patchset since 0.11.1 + if [ "${PVR}" = "0.11.0" ]; then + BITCOINCORE_RBF_DIFF="5f032c75eefb0fe8ff79ed9595da1112c05f5c4a...660b96d24916b8ef4e0677e5d6162e24e2db447e" + BITCOINCORE_RBF_PATCHFILE="${MyPN}-rbf-v0.11.0rc3.patch" + fi + ;; 9999*) BITCOINCORE_SERIES="9999" - LIBSECP256K1_DEPEND="=dev-libs/libsecp256k1-9999" + LIBSECP256K1_DEPEND=">dev-libs/libsecp256k1-0.0.0_pre20150422" ;; *) die "Unrecognised version" @@ -100,7 +117,7 @@ if [ -z "$BITCOINCORE_COMMITHASH" ]; then EGIT_PROJECT='bitcoin' EGIT_REPO_URI="git://github.com/bitcoin/bitcoin.git https://github.com/bitcoin/bitcoin.git" else - SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${BITCOINCORE_COMMITHASH}.tar.gz -> ${MyPN}-v${PV}.tgz" + SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${BITCOINCORE_COMMITHASH}.tar.gz -> ${MyPN}-v${PV}${BITCOINCORE_SRC_SUFFIX}.tgz" if [ -z "${BITCOINCORE_NO_SYSLIBS}" ]; then SRC_URI="${SRC_URI} http://luke.dashjr.org/programs/${MyPN}/files/${MyPN}d/luke-jr/${BITCOINCORE_SERIES}/$(LJR_PV ljr)/${LJR_PATCHDIR}.txz -> ${LJR_PATCHDIR}.tar.xz" fi @@ -108,7 +125,7 @@ else BITCOINXT_PATCHFILE="${MyPN}xt-v${PV}.patch" SRC_URI="${SRC_URI} xt? ( https://github.com/bitcoinxt/bitcoinxt/compare/${BITCOINCORE_XT_DIFF}.diff -> ${BITCOINXT_PATCHFILE} )" fi - if in_bcc_policy rbf; then + if in_bcc_policy rbf && [ -n "${BITCOINCORE_RBF_DIFF}" ]; then SRC_URI="${SRC_URI} bitcoin_policy_rbf? ( https://github.com/petertodd/bitcoin/compare/${BITCOINCORE_RBF_DIFF}.diff -> ${BITCOINCORE_RBF_PATCHFILE} )" fi S="${WORKDIR}/${MyPN}-${BITCOINCORE_COMMITHASH}" @@ -177,6 +194,9 @@ bitcoincore_pkg_pretend() { einfo "Extra functionality improvements to Bitcoin Core are enabled." bitcoincore_policymsg_flag=true fi + bitcoincore_policymsg cltv \ + "CLTV policy is enabled: Your node will recognise and assist OP_CHECKLOCKTIMEVERIFY (BIP65) transactions." \ + "CLTV policy is disabled: Your node will not recognise OP_CHECKLOCKTIMEVERIFY (BIP65) transactions." bitcoincore_policymsg cpfp \ "CPFP policy is enabled: If you mine, you will give consideration to child transaction fees to pay for their parents." \ "CPFP policy is disabled: If you mine, you will ignore transactions unless they have sufficient fee themselves, even if child transactions offer a fee to cover their cost." @@ -187,18 +207,17 @@ bitcoincore_pkg_pretend() { "Replace By Fee policy is enabled: Your node will preferentially mine and relay transactions paying the highest fee, regardless of receive order." \ "Replace By Fee policy is disabled: Your node will only accept the first transaction seen consuming a conflicting input, regardless of fee offered by later ones." bitcoincore_policymsg spamfilter \ - "Enhanced spam filter is enabled: A blacklist (seen as controversial by some) will be used by your node. This may impact your ability to use some services (see link for a list)." \ - "Enhanced spam filter is disabled: Your node will not be checking for notorious spammers, and may assist them." + "Enhanced spam filter policy is enabled: Your node will identify notorious spam scripts and avoid assisting them. This may impact your ability to use some services (see link for a list)." \ + "Enhanced spam filter policy is disabled: Your node will not be checking for notorious spam scripts, and may assist them." $bitcoincore_policymsg_flag && einfo "For more information on any of the above, see ${LJR_PATCH_DESC}" } bitcoincore_prepare() { + local mypolicy if [ -n "${BITCOINCORE_NO_SYSLIBS}" ]; then true elif [ "${PV}" = "9999" ]; then - epatch "${FILESDIR}/0.9.0-sys_leveldb.patch" - # Temporarily use embedded secp256k1 while API is in flux - #epatch "${FILESDIR}/${PV}-sys_libsecp256k1.patch" + epatch "${FILESDIR}/${PV}-syslibs.patch" else epatch "$(LJR_PATCH syslibs)" fi @@ -224,7 +243,11 @@ bitcoincore_prepare() { use bitcoin_policy_${mypolicy} || continue case "${mypolicy}" in rbf) - epatch "${DISTDIR}/${BITCOINCORE_RBF_PATCHFILE}" + if [ -n "${BITCOINCORE_RBF_PATCHFILE}" ]; then + epatch "${DISTDIR}/${BITCOINCORE_RBF_PATCHFILE}" + else + epatch "$(LJR_PATCH ${mypolicy})" + fi ;; *) epatch "$(LJR_PATCH ${mypolicy})" @@ -236,11 +259,7 @@ bitcoincore_prepare() { bitcoincore_autoreconf() { eautoreconf rm -r src/leveldb || die - - # Temporarily using embedded secp256k1 for 9999 while API is in flux - if [ "${PV}" != "9999" ]; then - rm -r src/secp256k1 || die - fi + rm -r src/secp256k1 || die } bitcoincore_src_prepare() { @@ -265,7 +284,7 @@ bitcoincore_conf() { else my_econf="${my_econf} --disable-wallet" fi - if [ -z "${BITCOINCORE_NO_SYSLIBS}" ] && [ "${PV}" != "9999" ]; then + if [ -z "${BITCOINCORE_NO_SYSLIBS}" ]; then my_econf="${my_econf} --disable-util-cli --disable-util-tx" else my_econf="${my_econf} --without-utils" diff --git a/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass b/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass index d25f42b2d3..c004be77cd 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/check-reqs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.15 2014/03/29 16:06:44 ulm Exp $ +# $Id$ # @ECLASS: check-reqs.eclass # @MAINTAINER: @@ -38,6 +38,8 @@ # These checks should probably mostly work on non-Linux, and they should # probably degrade gracefully if they don't. Probably. +if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then + inherit eutils # @ECLASS-VARIABLE: CHECKREQS_MEMORY @@ -63,21 +65,23 @@ inherit eutils EXPORT_FUNCTIONS pkg_setup case "${EAPI:-0}" in 0|1|2|3) ;; - 4|5) EXPORT_FUNCTIONS pkg_pretend ;; + 4|5|6) EXPORT_FUNCTIONS pkg_pretend ;; *) die "EAPI=${EAPI} is not supported" ;; esac # @FUNCTION: check_reqs # @DESCRIPTION: -# Obsolete function executing all the checks and priting out results +# Obsolete function executing all the checks and printing out results check_reqs() { debug-print-function ${FUNCNAME} "$@" + [[ ${EAPI:-0} == [012345] ]] || die "${FUNCNAME} is banned in EAPI > 5" + echo - ewarn "QA: Package calling old ${FUNCNAME} function." - ewarn "QA: Please file a bug against the package." - ewarn "QA: It should call check-reqs_pkg_pretend and check-reqs_pkg_setup" - ewarn "QA: and possibly use EAPI=4 or later." + eqawarn "Package calling old ${FUNCNAME} function." + eqawarn "Please file a bug against the package." + eqawarn "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup" + eqawarn "and possibly use EAPI=4 or later." echo check-reqs_pkg_setup "$@" @@ -106,6 +110,7 @@ check-reqs_pkg_pretend() { } # @FUNCTION: check-reqs_prepare +# @INTERNAL # @DESCRIPTION: # Internal function that checks the variables that should be defined. check-reqs_prepare() { @@ -122,6 +127,7 @@ check-reqs_prepare() { } # @FUNCTION: check-reqs_run +# @INTERNAL # @DESCRIPTION: # Internal function that runs the check based on variable settings. check-reqs_run() { @@ -130,6 +136,8 @@ check-reqs_run() { # some people are *censored* unset CHECKREQS_FAILED + [[ ${EAPI:-0} == [0123] ]] && local MERGE_TYPE="" + # use != in test, because MERGE_TYPE only exists in EAPI 4 and later if [[ ${MERGE_TYPE} != binary ]]; then [[ -n ${CHECKREQS_MEMORY} ]] && \ @@ -155,11 +163,12 @@ check-reqs_run() { fi } -# @FUNCTION: check-reqs_get_mebibytes +# @FUNCTION: check-reqs_get_kibibytes +# @INTERNAL # @DESCRIPTION: -# Internal function that returns number in mebibytes. -# Returns 1024 for 1G or 1048576 for 1T. -check-reqs_get_mebibytes() { +# Internal function that returns number in KiB. +# Returns 1024**2 for 1G or 1024**3 for 1T. +check-reqs_get_kibibytes() { debug-print-function ${FUNCNAME} "$@" [[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]" @@ -168,9 +177,10 @@ check-reqs_get_mebibytes() { local size=${1%[GMT]} case ${unit} in - G) echo $((1024 * size)) ;; - [M0-9]) echo ${size} ;; - T) echo $((1024 * 1024 * size)) ;; + G) echo $((1024 * 1024 * size)) ;; + M) echo $((1024 * size)) ;; + T) echo $((1024 * 1024 * 1024 * size)) ;; + [0-9]) echo $((1024 * size)) ;; *) die "${FUNCNAME}: Unknown unit: ${unit}" ;; @@ -178,6 +188,7 @@ check-reqs_get_mebibytes() { } # @FUNCTION: check-reqs_get_number +# @INTERNAL # @DESCRIPTION: # Internal function that returns the numerical value without the unit. # Returns "1" for "1G" or "150" for "150T". @@ -188,19 +199,21 @@ check-reqs_get_number() { local unit=${1:(-1)} local size=${1%[GMT]} + local msg=eerror + [[ ${EAPI:-0} == [012345] ]] && msg=eqawarn # Check for unset units and warn about them. # Backcompat. if [[ ${size} == ${1} ]]; then - ewarn "QA: Package does not specify unit for the size check" - ewarn "QA: Assuming mebibytes." - ewarn "QA: File bug against the package. It should specify the unit." + ${msg} "Package does not specify unit for the size check" + ${msg} "File bug against the package. It should specify the unit." fi echo ${size} } # @FUNCTION: check-reqs_get_unit +# @INTERNAL # @DESCRIPTION: # Internal function that return the unit without the numerical value. # Returns "GiB" for "1G" or "TiB" for "150T". @@ -222,6 +235,7 @@ check-reqs_get_unit() { } # @FUNCTION: check-reqs_output +# @INTERNAL # @DESCRIPTION: # Internal function that prints the warning and dies if required based on # the test results. @@ -233,7 +247,7 @@ check-reqs_output() { [[ ${EBUILD_PHASE} == "pretend" && -z ${I_KNOW_WHAT_I_AM_DOING} ]] && msg="eerror" if [[ -n ${CHECKREQS_FAILED} ]]; then ${msg} - ${msg} "Space constrains set in the ebuild were not met!" + ${msg} "Space constraints set in the ebuild were not met!" ${msg} "The build will most probably fail, you should enhance the space" ${msg} "as per failed tests." ${msg} @@ -244,6 +258,7 @@ check-reqs_output() { } # @FUNCTION: check-reqs_memory +# @INTERNAL # @DESCRIPTION: # Internal function that checks size of RAM. check-reqs_memory() { @@ -266,7 +281,7 @@ check-reqs_memory() { actual_memory=$(echo $actual_memory | sed -e 's/^[^:=]*[:=]//' ) fi if [[ -n ${actual_memory} ]] ; then - if [[ ${actual_memory} -lt $((1024 * $(check-reqs_get_mebibytes ${size}))) ]] ; then + if [[ ${actual_memory} -lt $(check-reqs_get_kibibytes ${size}) ]] ; then eend 1 check-reqs_unsatisfied \ ${size} \ @@ -281,6 +296,7 @@ check-reqs_memory() { } # @FUNCTION: check-reqs_disk +# @INTERNAL # @DESCRIPTION: # Internal function that checks space on the harddrive. check-reqs_disk() { @@ -290,16 +306,16 @@ check-reqs_disk() { local path=${1} local size=${2} - local space_megs + local space_kbi check-reqs_start_phase \ ${size} \ "disk space at \"${path}\"" - space_megs=$(df -Pm "${1}" 2>/dev/null | awk 'FNR == 2 {print $4}') + space_kbi=$(df -Pk "${1}" 2>/dev/null | awk 'FNR == 2 {print $4}') - if [[ $? == 0 && -n ${space_megs} ]] ; then - if [[ ${space_megs} -lt $(check-reqs_get_mebibytes ${size}) ]] ; then + if [[ $? == 0 && -n ${space_kbi} ]] ; then + if [[ ${space_kbi} -lt $(check-reqs_get_kibibytes ${size}) ]] ; then eend 1 check-reqs_unsatisfied \ ${size} \ @@ -314,6 +330,7 @@ check-reqs_disk() { } # @FUNCTION: check-reqs_start_phase +# @INTERNAL # @DESCRIPTION: # Internal function that inform about started check check-reqs_start_phase() { @@ -329,6 +346,7 @@ check-reqs_start_phase() { } # @FUNCTION: check-reqs_unsatisfied +# @INTERNAL # @DESCRIPTION: # Internal function that inform about check result. # It has different output between pretend and setup phase, @@ -353,3 +371,6 @@ check-reqs_unsatisfied() { # Internal, do not set yourself. CHECKREQS_FAILED="true" } + +_CHECK_REQS_ECLASS_=1 +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/cmake-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/cmake-utils.eclass index 3334a25e3e..12b8dff178 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/cmake-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/cmake-utils.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.114 2015/02/18 06:19:32 bircoph Exp $ +# $Id$ # @ECLASS: cmake-utils.eclass # @MAINTAINER: @@ -20,7 +20,6 @@ if [[ -z ${_CMAKE_UTILS_ECLASS} ]]; then _CMAKE_UTILS_ECLASS=1 - # @ECLASS-VARIABLE: BUILD_DIR # @DESCRIPTION: # Build directory where all cmake processed files should be generated. @@ -64,7 +63,6 @@ _CMAKE_UTILS_ECLASS=1 # @DESCRIPTION: # Do we want to remove anything? yes or whatever else for no : ${CMAKE_REMOVE_MODULES:=yes} -CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-yes}" # @ECLASS-VARIABLE: CMAKE_REMOVE_MODULES_LIST # @DESCRIPTION: @@ -104,6 +102,8 @@ CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-yes}" # This is useful when only part of application is using cmake build system. # Valid values are: always [default], optional (where the value is the useflag # used for optionality) +# +# This is banned in EAPI 6 and later. : ${WANT_CMAKE:=always} # @ECLASS-VARIABLE: CMAKE_EXTRA_CACHE_FILE @@ -112,24 +112,25 @@ CMAKE_REMOVE_MODULES="${CMAKE_REMOVE_MODULES:-yes}" # for econf and is needed to pass TRY_RUN results when cross-compiling. # Should be set by user in a per-package basis in /etc/portage/package.env. +case ${EAPI} in + 2|3|4|5|6) : ;; + *) die "EAPI=${EAPI:-0} is not supported" ;; +esac + +inherit toolchain-funcs multilib flag-o-matic eutils versionator + +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install + CMAKEDEPEND="" case ${WANT_CMAKE} in always) ;; *) + [[ ${EAPI} == [2345] ]] || die "WANT_CMAKE is banned in EAPI 6 and later" IUSE+=" ${WANT_CMAKE}" CMAKEDEPEND+="${WANT_CMAKE}? ( " ;; esac -inherit toolchain-funcs multilib flag-o-matic eutils - -case ${EAPI} in - 2|3|4|5) : ;; - *) die "EAPI=${EAPI:-0} is not supported" ;; -esac - -CMAKE_EXPF="src_prepare src_configure src_compile src_test src_install" -EXPORT_FUNCTIONS ${CMAKE_EXPF} case ${CMAKE_MAKEFILE_GENERATOR} in emake) @@ -148,17 +149,20 @@ if [[ ${PN} != cmake ]]; then CMAKEDEPEND+=" >=dev-util/cmake-${CMAKE_MIN_VERSION}" fi -CMAKEDEPEND+=" userland_GNU? ( >=sys-apps/findutils-4.4.0 )" - [[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )" DEPEND="${CMAKEDEPEND}" unset CMAKEDEPEND # Internal functions used by cmake-utils_use_* -_use_me_now() { +_cmake_use_me_now() { debug-print-function ${FUNCNAME} "$@" + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + [[ ${EAPI} == [2345] ]] || die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" + local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 []" if [[ ! -z $3 ]]; then @@ -173,9 +177,16 @@ _use_me_now() { done fi } -_use_me_now_inverted() { +_cmake_use_me_now_inverted() { debug-print-function ${FUNCNAME} "$@" + local arg=$2 + [[ ! -z $3 ]] && arg=$3 + + if [[ ${EAPI} != [2345] && "${FUNCNAME[1]}" != cmake-utils_use_find_package ]] ; then + die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" + fi + local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 []" if [[ ! -z $3 ]]; then @@ -192,7 +203,7 @@ _use_me_now_inverted() { } # Determine using IN or OUT source build -_check_build_dir() { +_cmake_check_build_dir() { : ${CMAKE_USE_DIR:=${S}} if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then # we build in source dir @@ -219,16 +230,21 @@ _check_build_dir() { # Backwards compatibility for getting the value. CMAKE_BUILD_DIR=${BUILD_DIR} - mkdir -p "${BUILD_DIR}" + mkdir -p "${BUILD_DIR}" || die echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\"" } # Determine which generator to use -_generator_to_use() { +_cmake_generator_to_use() { local generator_name case ${CMAKE_MAKEFILE_GENERATOR} in ninja) + # if ninja is enabled but not installed, the build could fail + # this could happen if ninja is manually enabled (eg. make.conf) but not installed + if ! has_version dev-util/ninja; then + die "CMAKE_MAKEFILE_GENERATOR is set to ninja, but ninja is not installed. Please install dev-util/ninja or unset CMAKE_MAKEFILE_GENERATOR." + fi generator_name="Ninja" ;; emake) @@ -243,21 +259,32 @@ _generator_to_use() { echo ${generator_name} } -# @FUNCTION: comment_add_subdirectory +# @FUNCTION: cmake_comment_add_subdirectory # @USAGE: # @DESCRIPTION: # Comment out an add_subdirectory call in CMakeLists.txt in the current directory -comment_add_subdirectory() { +cmake_comment_add_subdirectory() { if [[ -z ${1} ]]; then die "comment_add_subdirectory must be passed the directory name to comment" fi if [[ -e "CMakeLists.txt" ]]; then - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1//\//\\/}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${1//\//\\/}[[:space:]]*)/I s/^/#DONOTCOMPILE /" \ -i CMakeLists.txt || die "failed to comment add_subdirectory(${1})" fi } +# @FUNCTION: comment_add_subdirectory +# @USAGE: +# @DESCRIPTION: +# Comment out an add_subdirectory call in CMakeLists.txt in the current directory +# Banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead. +comment_add_subdirectory() { + [[ ${EAPI} == [2345] ]] || die "comment_add_subdirectory is banned in EAPI 6 and later - use cmake_comment_add_subdirectory instead" + + cmake_comment_add_subdirectory "$@" +} + # @FUNCTION: cmake-utils_use_with # @USAGE: [flag name] # @DESCRIPTION: @@ -265,7 +292,7 @@ comment_add_subdirectory() { # # `cmake-utils_use_with foo FOO` echoes -DWITH_FOO=ON if foo is enabled # and -DWITH_FOO=OFF if it is disabled. -cmake-utils_use_with() { _use_me_now WITH_ "$@" ; } +cmake-utils_use_with() { _cmake_use_me_now WITH_ "$@" ; } # @FUNCTION: cmake-utils_use_enable # @USAGE: [flag name] @@ -274,17 +301,23 @@ cmake-utils_use_with() { _use_me_now WITH_ "$@" ; } # # `cmake-utils_use_enable foo FOO` echoes -DENABLE_FOO=ON if foo is enabled # and -DENABLE_FOO=OFF if it is disabled. -cmake-utils_use_enable() { _use_me_now ENABLE_ "$@" ; } +cmake-utils_use_enable() { _cmake_use_me_now ENABLE_ "$@" ; } # @FUNCTION: cmake-utils_use_find_package -# @USAGE: [flag name] +# @USAGE: # @DESCRIPTION: # Based on use_enable. See ebuild(5). # # `cmake-utils_use_find_package foo LibFoo` echoes -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=OFF # if foo is enabled and -DCMAKE_DISABLE_FIND_PACKAGE_LibFoo=ON if it is disabled. # This can be used to make find_package optional. -cmake-utils_use_find_package() { _use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; } +cmake-utils_use_find_package() { + if [[ ${EAPI} != [2345] && "$#" != 2 ]] ; then + die "Usage: cmake-utils_use_find_package " + fi + + _cmake_use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE_ "$@" ; +} # @FUNCTION: cmake-utils_use_disable # @USAGE: [flag name] @@ -293,7 +326,7 @@ cmake-utils_use_find_package() { _use_me_now_inverted CMAKE_DISABLE_FIND_PACKAGE # # `cmake-utils_use_enable foo FOO` echoes -DDISABLE_FOO=OFF if foo is enabled # and -DDISABLE_FOO=ON if it is disabled. -cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; } +cmake-utils_use_disable() { _cmake_use_me_now_inverted DISABLE_ "$@" ; } # @FUNCTION: cmake-utils_use_no # @USAGE: [flag name] @@ -302,7 +335,7 @@ cmake-utils_use_disable() { _use_me_now_inverted DISABLE_ "$@" ; } # # `cmake-utils_use_no foo FOO` echoes -DNO_FOO=OFF if foo is enabled # and -DNO_FOO=ON if it is disabled. -cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; } +cmake-utils_use_no() { _cmake_use_me_now_inverted NO_ "$@" ; } # @FUNCTION: cmake-utils_use_want # @USAGE: [flag name] @@ -311,7 +344,7 @@ cmake-utils_use_no() { _use_me_now_inverted NO_ "$@" ; } # # `cmake-utils_use_want foo FOO` echoes -DWANT_FOO=ON if foo is enabled # and -DWANT_FOO=OFF if it is disabled. -cmake-utils_use_want() { _use_me_now WANT_ "$@" ; } +cmake-utils_use_want() { _cmake_use_me_now WANT_ "$@" ; } # @FUNCTION: cmake-utils_use_build # @USAGE: [flag name] @@ -320,7 +353,7 @@ cmake-utils_use_want() { _use_me_now WANT_ "$@" ; } # # `cmake-utils_use_build foo FOO` echoes -DBUILD_FOO=ON if foo is enabled # and -DBUILD_FOO=OFF if it is disabled. -cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; } +cmake-utils_use_build() { _cmake_use_me_now BUILD_ "$@" ; } # @FUNCTION: cmake-utils_use_has # @USAGE: [flag name] @@ -329,7 +362,7 @@ cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; } # # `cmake-utils_use_has foo FOO` echoes -DHAVE_FOO=ON if foo is enabled # and -DHAVE_FOO=OFF if it is disabled. -cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; } +cmake-utils_use_has() { _cmake_use_me_now HAVE_ "$@" ; } # @FUNCTION: cmake-utils_use_use # @USAGE: [flag name] @@ -338,7 +371,7 @@ cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; } # # `cmake-utils_use_use foo FOO` echoes -DUSE_FOO=ON if foo is enabled # and -DUSE_FOO=OFF if it is disabled. -cmake-utils_use_use() { _use_me_now USE_ "$@" ; } +cmake-utils_use_use() { _cmake_use_me_now USE_ "$@" ; } # @FUNCTION: cmake-utils_use # @USAGE: [flag name] @@ -347,7 +380,7 @@ cmake-utils_use_use() { _use_me_now USE_ "$@" ; } # # `cmake-utils_use foo FOO` echoes -DFOO=ON if foo is enabled # and -DFOO=OFF if it is disabled. -cmake-utils_use() { _use_me_now "" "$@" ; } +cmake-utils_use() { _cmake_use_me_now "" "$@" ; } # @FUNCTION: cmake-utils_useno # @USAGE: [flag name] @@ -356,11 +389,11 @@ cmake-utils_use() { _use_me_now "" "$@" ; } # # `cmake-utils_useno foo NOFOO` echoes -DNOFOO=OFF if foo is enabled # and -DNOFOO=ON if it is disabled. -cmake-utils_useno() { _use_me_now_inverted "" "$@" ; } +cmake-utils_useno() { _cmake_use_me_now_inverted "" "$@" ; } # Internal function for modifying hardcoded definitions. # Removes dangerous definitions that override Gentoo settings. -_modify-cmakelists() { +_cmake_modify-cmakelists() { debug-print-function ${FUNCNAME} "$@" # Only edit the files once @@ -376,7 +409,7 @@ _modify-cmakelists() { || die "${LINENO}: failed to disable hardcoded settings" # NOTE Append some useful summary here - cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ + cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<- _EOF_ || die MESSAGE(STATUS "<<< Gentoo configuration >>> Build type \${CMAKE_BUILD_TYPE} @@ -391,18 +424,47 @@ _modify-cmakelists() { _EOF_ } +# temporary function for moving cmake cleanups from from src_configure -> src_prepare. +# bug #378850 +_cmake_cleanup_cmake() { + : ${CMAKE_USE_DIR:=${S}} + + if [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] ; then + local name + for name in ${CMAKE_REMOVE_MODULES_LIST} ; do + find "${S}" -name ${name}.cmake -exec rm -v {} + || die + done + fi + + # check if CMakeLists.txt exist and if no then die + if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then + eerror "Unable to locate CMakeLists.txt under:" + eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\"" + eerror "Consider not inheriting the cmake eclass." + die "FATAL: Unable to find CMakeLists.txt" + fi + + # Remove dangerous things. + _cmake_modify-cmakelists +} + enable_cmake-utils_src_prepare() { debug-print-function ${FUNCNAME} "$@" - pushd "${S}" > /dev/null + pushd "${S}" > /dev/null || die - debug-print "$FUNCNAME: PATCHES=$PATCHES" - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - - debug-print "$FUNCNAME: applying user patches" - epatch_user + if [[ ${EAPI} != [2345] ]]; then + default_src_prepare + _cmake_cleanup_cmake + else + debug-print "$FUNCNAME: PATCHES=$PATCHES" + [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - popd > /dev/null + debug-print "$FUNCNAME: applying user patches" + epatch_user + fi + + popd > /dev/null || die } # @VARIABLE: mycmakeargs @@ -423,28 +485,12 @@ enable_cmake-utils_src_prepare() { enable_cmake-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" - [[ "${CMAKE_REMOVE_MODULES}" == "yes" ]] && { - local name - for name in ${CMAKE_REMOVE_MODULES_LIST} ; do - find "${S}" -name ${name}.cmake -exec rm -v {} + - done - } + [[ ${EAPI} == [2345] ]] && _cmake_cleanup_cmake - _check_build_dir - - # check if CMakeLists.txt exist and if no then die - if [[ ! -e ${CMAKE_USE_DIR}/CMakeLists.txt ]] ; then - eerror "Unable to locate CMakeLists.txt under:" - eerror "\"${CMAKE_USE_DIR}/CMakeLists.txt\"" - eerror "Consider not inheriting the cmake eclass." - die "FATAL: Unable to find CMakeLists.txt" - fi - - # Remove dangerous things. - _modify-cmakelists + _cmake_check_build_dir # Fix xdg collision with sandbox - export XDG_CONFIG_HOME="${T}" + local -x XDG_CONFIG_HOME="${T}" # @SEE CMAKE_BUILD_TYPE if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then @@ -457,18 +503,28 @@ enable_cmake-utils_src_configure() { # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.) local build_rules=${BUILD_DIR}/gentoo_rules.cmake - cat > "${build_rules}" <<- _EOF_ + # Since cmake-3.4.0_rc1 "" no longer contains includes and thus + # we need to add "" + local includes= + if [[ ${PN} == cmake ]] ; then + if $(version_is_at_least 3.4.0 $(get_version_component_range 1-3 ${PV})) ; then + includes="" + fi + elif ROOT=/ has_version \>=dev-util/cmake-3.4.0_rc1 ; then + includes="" + fi + cat > "${build_rules}" <<- _EOF_ || die SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE) - SET (CMAKE_ASM_COMPILE_OBJECT " ${CFLAGS} -o -c " CACHE STRING "ASM compile command" FORCE) - SET (CMAKE_C_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "C compile command" FORCE) - SET (CMAKE_CXX_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "C++ compile command" FORCE) - SET (CMAKE_Fortran_COMPILE_OBJECT " ${FCFLAGS} -o -c " CACHE STRING "Fortran compile command" FORCE) + SET (CMAKE_ASM_COMPILE_OBJECT " ${includes} ${CFLAGS} -o -c " CACHE STRING "ASM compile command" FORCE) + SET (CMAKE_C_COMPILE_OBJECT " ${includes} ${CPPFLAGS} -o -c " CACHE STRING "C compile command" FORCE) + SET (CMAKE_CXX_COMPILE_OBJECT " ${includes} ${CPPFLAGS} -o -c " CACHE STRING "C++ compile command" FORCE) + SET (CMAKE_Fortran_COMPILE_OBJECT " ${includes} ${FCFLAGS} -o -c " CACHE STRING "Fortran compile command" FORCE) SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE) SET (PKG_CONFIG_EXECUTABLE $(type -P $(tc-getPKG_CONFIG)) CACHE FILEPATH "pkg-config executable" FORCE) _EOF_ local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake - cat > ${toolchain_file} <<- _EOF_ + cat > ${toolchain_file} <<- _EOF_ || die SET (CMAKE_C_COMPILER $(tc-getCC)) SET (CMAKE_CXX_COMPILER $(tc-getCXX)) SET (CMAKE_Fortran_COMPILER $(tc-getFC)) @@ -480,18 +536,23 @@ enable_cmake-utils_src_configure() { Cygwin) sysname="CYGWIN_NT-5.1" ;; HPUX) sysname="HP-UX" ;; linux) sysname="Linux" ;; - Winnt) sysname="Windows" ;; + Winnt) + sysname="Windows" + cat >> "${toolchain_file}" <<- _EOF_ || die + SET (CMAKE_RC_COMPILER $(tc-getRC)) + _EOF_ + ;; *) sysname="${KERNEL}" ;; esac - cat >> "${toolchain_file}" <<- _EOF_ + cat >> "${toolchain_file}" <<- _EOF_ || die SET (CMAKE_SYSTEM_NAME "${sysname}") _EOF_ if [ "${SYSROOT:-/}" != "/" ] ; then # When cross-compiling with a sysroot (e.g. with crossdev's emerge wrappers) # we need to tell cmake to use libs/headers from the sysroot but programs from / only. - cat >> "${toolchain_file}" <<- _EOF_ + cat >> "${toolchain_file}" <<- _EOF_ || die set(CMAKE_FIND_ROOT_PATH "${SYSROOT}") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) @@ -500,10 +561,10 @@ enable_cmake-utils_src_configure() { fi fi - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= + [[ ${EAPI} == 2 ]] && ! use prefix && local EPREFIX= if [[ ${EPREFIX} ]]; then - cat >> "${build_rules}" <<- _EOF_ + cat >> "${build_rules}" <<- _EOF_ || die # in Prefix we need rpath and must ensure cmake gets our default linker path # right ... except for Darwin hosts IF (NOT APPLE) @@ -528,7 +589,7 @@ enable_cmake-utils_src_configure() { # Common configure parameters (invariants) local common_config=${BUILD_DIR}/gentoo_common_config.cmake local libdir=$(get_libdir) - cat > "${common_config}" <<- _EOF_ + cat > "${common_config}" <<- _EOF_ || die SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE) SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for libraries") _EOF_ @@ -537,7 +598,15 @@ enable_cmake-utils_src_configure() { # Convert mycmakeargs to an array, for backwards compatibility # Make the array a local variable since <=portage-2.1.6.x does not # support global arrays (see bug #297255). - if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then + local mycmakeargstype=$(declare -p mycmakeargs 2>&-) + if [[ "${mycmakeargstype}" != "declare -a mycmakeargs="* ]]; then + if [[ -n "${mycmakeargstype}" ]] ; then + if [[ ${EAPI} == [2345] ]]; then + eqawarn "Declaring mycmakeargs as a variable is deprecated. Please use an array instead." + else + die "Declaring mycmakeargs as a variable is banned in EAPI=${EAPI}. Please use an array instead." + fi + fi local mycmakeargs_local=(${mycmakeargs}) else local mycmakeargs_local=("${mycmakeargs[@]}") @@ -555,7 +624,7 @@ enable_cmake-utils_src_configure() { local cmakeargs=( ${warn_unused_cli} -C "${common_config}" - -G "$(_generator_to_use)" + -G "$(_cmake_generator_to_use)" -DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}" "${mycmakeargs_local[@]}" -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" @@ -569,11 +638,11 @@ enable_cmake-utils_src_configure() { cmakeargs+=( -C "${CMAKE_EXTRA_CACHE_FILE}" ) fi - pushd "${BUILD_DIR}" > /dev/null + pushd "${BUILD_DIR}" > /dev/null || die debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}" echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed" - popd > /dev/null + popd > /dev/null || die } enable_cmake-utils_src_compile() { @@ -604,11 +673,11 @@ _ninjaopts_from_makeopts() { export NINJAOPTS="${ninjaopts[*]}" } -# @FUNCTION: ninja_src_make +# @FUNCTION: _cmake_ninja_src_make # @INTERNAL # @DESCRIPTION: # Build the package using ninja generator -ninja_src_make() { +_cmake_ninja_src_make() { debug-print-function ${FUNCNAME} "$@" [[ -e build.ninja ]] || die "build.ninja not found. Error during configure stage." @@ -625,11 +694,11 @@ ninja_src_make() { "$@" || die } -# @FUNCTION: emake_src_make +# @FUNCTION: _cmake_emake_src_make # @INTERNAL # @DESCRIPTION: # Build the package using make generator -emake_src_make() { +_cmake_emake_src_make() { debug-print-function ${FUNCNAME} "$@" [[ -e Makefile ]] || die "Makefile not found. Error during configure stage." @@ -649,26 +718,26 @@ emake_src_make() { cmake-utils_src_make() { debug-print-function ${FUNCNAME} "$@" - _check_build_dir - pushd "${BUILD_DIR}" > /dev/null + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die - ${CMAKE_MAKEFILE_GENERATOR}_src_make "$@" + _cmake_${CMAKE_MAKEFILE_GENERATOR}_src_make "$@" - popd > /dev/null + popd > /dev/null || die } enable_cmake-utils_src_test() { debug-print-function ${FUNCNAME} "$@" - _check_build_dir - pushd "${BUILD_DIR}" > /dev/null + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; } [[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure ) if ctest "${myctestargs[@]}" "$@" ; then einfo "Tests succeeded." - popd > /dev/null + popd > /dev/null || die return 0 else if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then @@ -683,7 +752,7 @@ enable_cmake-utils_src_test() { fi # die might not die due to nonfatal - popd > /dev/null + popd > /dev/null || die return 1 fi } @@ -691,21 +760,21 @@ enable_cmake-utils_src_test() { enable_cmake-utils_src_install() { debug-print-function ${FUNCNAME} "$@" - _check_build_dir - pushd "${BUILD_DIR}" > /dev/null + _cmake_check_build_dir + pushd "${BUILD_DIR}" > /dev/null || die DESTDIR="${D}" ${CMAKE_MAKEFILE_GENERATOR} install "$@" || die "died running ${CMAKE_MAKEFILE_GENERATOR} install" - popd > /dev/null + popd > /dev/null || die - pushd "${S}" > /dev/null + pushd "${S}" > /dev/null || die einstalldocs - popd > /dev/null + popd > /dev/null || die } # @FUNCTION: cmake-utils_src_prepare # @DESCRIPTION: # Apply ebuild and user patches. cmake-utils_src_prepare() { - _execute_optionally "src_prepare" "$@" + _cmake_execute_optionally "src_prepare" "$@" } # @FUNCTION: cmake-utils_src_configure @@ -713,7 +782,7 @@ cmake-utils_src_prepare() { # General function for configuring with cmake. Default behaviour is to start an # out-of-source build. cmake-utils_src_configure() { - _execute_optionally "src_configure" "$@" + _cmake_execute_optionally "src_configure" "$@" } # @FUNCTION: cmake-utils_src_compile @@ -721,25 +790,25 @@ cmake-utils_src_configure() { # General function for compiling with cmake. # Automatically detects the build type. All arguments are passed to emake. cmake-utils_src_compile() { - _execute_optionally "src_compile" "$@" + _cmake_execute_optionally "src_compile" "$@" } # @FUNCTION: cmake-utils_src_test # @DESCRIPTION: # Function for testing the package. Automatically detects the build type. cmake-utils_src_test() { - _execute_optionally "src_test" "$@" + _cmake_execute_optionally "src_test" "$@" } # @FUNCTION: cmake-utils_src_install # @DESCRIPTION: # Function for installing the package. Automatically detects the build type. cmake-utils_src_install() { - _execute_optionally "src_install" "$@" + _cmake_execute_optionally "src_install" "$@" } # Optionally executes phases based on WANT_CMAKE variable/USE flag. -_execute_optionally() { +_cmake_execute_optionally() { local phase="$1" ; shift if [[ ${WANT_CMAKE} = always ]]; then enable_cmake-utils_${phase} "$@" diff --git a/sdk_container/src/third_party/portage-stable/eclass/distutils-r1.eclass b/sdk_container/src/third_party/portage-stable/eclass/distutils-r1.eclass index 22afd1e60a..7965e9106a 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/distutils-r1.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/distutils-r1.eclass @@ -1,8 +1,8 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.113 2015/02/20 17:57:22 mgorny Exp $ +# $Id$ -# @ECLASS: distutils-r1 +# @ECLASS: distutils-r1.eclass # @MAINTAINER: # Python team # @AUTHOR: @@ -40,14 +40,14 @@ # as well. Thus, all the variables defined and documented there are # relevant to the packages using distutils-r1. # -# For more information, please see the python-r1 Developer's Guide: -# http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml +# For more information, please see the wiki: +# https://wiki.gentoo.org/wiki/Project:Python/distutils-r1 case "${EAPI:-0}" in 0|1|2|3) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 4|5) + 4|5|6) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -79,7 +79,8 @@ esac if [[ ! ${_DISTUTILS_R1} ]]; then -inherit eutils toolchain-funcs +[[ ${EAPI} == [45] ]] && inherit eutils +inherit toolchain-funcs if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then inherit multiprocessing python-r1 @@ -150,6 +151,8 @@ fi # @ECLASS-VARIABLE: EXAMPLES # @DEFAULT_UNSET # @DESCRIPTION: +# OBSOLETE: this variable is deprecated and banned in EAPI 6 +# # An array containing examples installed into 'examples' doc # subdirectory. The files and directories listed there must exist # in the directory from which distutils-r1_python_install_all() is run @@ -236,10 +239,13 @@ fi esetup.py() { debug-print-function ${FUNCNAME} "${@}" + local die_args=() + [[ ${EAPI} != [45] ]] && die_args+=( -n ) + set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}" echo "${@}" >&2 - "${@}" || die + "${@}" || die "${die_args[@]}" || return ${?} } # @FUNCTION: distutils_install_for_testing @@ -309,9 +315,12 @@ _distutils-r1_disable_ez_setup() { distutils-r1_python_prepare_all() { debug-print-function ${FUNCNAME} "${@}" - [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" - - epatch_user + if [[ ${EAPI} != [45] ]]; then + default + else + [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" + epatch_user + fi # by default, use in-source build if python_prepare() is used if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then @@ -337,7 +346,7 @@ distutils-r1_python_prepare_all() { distutils-r1_python_prepare() { debug-print-function ${FUNCNAME} "${@}" - : + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)" } # @FUNCTION: distutils-r1_python_configure @@ -346,7 +355,7 @@ distutils-r1_python_prepare() { distutils-r1_python_configure() { debug-print-function ${FUNCNAME} "${@}" - : + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)" } # @FUNCTION: _distutils-r1_create_setup_cfg @@ -410,7 +419,7 @@ _distutils-r1_create_setup_cfg() { _distutils-r1_copy_egg_info() { mkdir -p "${BUILD_DIR}" || die # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +' - find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || die + find -name '*.egg-info' -type d -exec cp -R -p {} "${BUILD_DIR}"/ ';' || die } # @FUNCTION: distutils-r1_python_compile @@ -505,7 +514,7 @@ distutils-r1_python_install() { # python likes to compile any module it sees, which triggers sandbox # failures if some packages haven't compiled their modules yet. - addpredict "$(python_get_sitedir)" + addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}" addpredict /usr/lib/portage/pym addpredict /usr/local # bug 498232 @@ -549,11 +558,17 @@ distutils-r1_python_install() { esetup.py install --root="${root}" "${args[@]}" - if [[ -d ${root}$(python_get_sitedir)/tests ]]; then - die "Package installs 'tests' package, file collisions likely." - fi + local forbidden_package_names=( examples test tests ) + local p + for p in "${forbidden_package_names[@]}"; do + if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then + die "Package installs '${p}' package which is forbidden and likely a bug in the build system." + fi + done if [[ -d ${root}/usr/$(get_libdir)/pypy/share ]]; then - eqawarn "Package installs 'share' in PyPy prefix, see bug #465546." + local cmd=die + [[ ${EAPI} == [45] ]] && cmd=eqawarn + "${cmd}" "Package installs 'share' in PyPy prefix, see bug #465546." fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then @@ -571,6 +586,8 @@ distutils-r1_python_install_all() { einstalldocs if declare -p EXAMPLES &>/dev/null; then + [[ ${EAPI} != [45] ]] && die "EXAMPLES are banned in EAPI ${EAPI}" + local INSDESTTREE=/usr/share/doc/${PF}/examples doins -r "${EXAMPLES[@]}" docompress -x "${INSDESTTREE}" @@ -603,6 +620,14 @@ distutils-r1_run_phase() { fi local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}" + # Bug 559644 + # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to + # problems in setup.py scripts that try to import modules/packages from that path + # during the build process (Python at startup evaluates PYTHONPATH, if the dir is + # not valid then associates a NullImporter object to ${BUILD_DIR}/lib storing it + # in the sys.path_importer_cache) + mkdir -p "${BUILD_DIR}/lib" || die + # We need separate home for each implementation, for .pydistutils.cfg. if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then local -x HOME=${HOME}/${EPYTHON} @@ -653,6 +678,7 @@ _distutils-r1_run_common_phase() { done } python_foreach_impl _distutils_try_impl + unset -f _distutils_try_impl local PYTHON_COMPAT=( "${best_impl}" ) fi @@ -669,6 +695,8 @@ _distutils-r1_run_foreach_impl() { debug-print-function ${FUNCNAME} "${@}" if [[ ${DISTUTILS_NO_PARALLEL_BUILD} ]]; then + [[ ${EAPI} == [45] ]] || die "DISTUTILS_NO_PARALLEL_BUILD is banned in EAPI ${EAPI}" + eqawarn "DISTUTILS_NO_PARALLEL_BUILD is no longer meaningful. Now all builds" eqawarn "are non-parallel. Please remove it from the ebuild." @@ -705,7 +733,10 @@ distutils-r1_src_prepare() { fi if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then - eqawarn "QA warning: python_prepare_all() didn't call distutils-r1_python_prepare_all" + local cmd=die + [[ ${EAPI} == [45] ]] && cmd=eqawarn + + "${cmd}" "QA: python_prepare_all() didn't call distutils-r1_python_prepare_all" fi if declare -f python_prepare >/dev/null; then @@ -776,7 +807,10 @@ distutils-r1_src_install() { fi if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then - eqawarn "QA warning: python_install_all() didn't call distutils-r1_python_install_all" + local cmd=die + [[ ${EAPI} == [45] ]] && cmd=eqawarn + + "${cmd}" "QA: python_install_all() didn't call distutils-r1_python_install_all" fi } diff --git a/sdk_container/src/third_party/portage-stable/eclass/elisp.eclass b/sdk_container/src/third_party/portage-stable/eclass/elisp.eclass index b7eb7bde73..660865c95c 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/elisp.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/elisp.eclass @@ -1,10 +1,10 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.59 2015/05/24 21:46:16 ulm Exp $ +# $Id$ # # @ECLASS: elisp.eclass # @MAINTAINER: -# Gentoo GNU Emacs project +# Gentoo GNU Emacs project # @AUTHOR: # Matthew Kennedy # Jeremy Maitin-Shepard @@ -65,13 +65,21 @@ # DOCS="blah.txt ChangeLog" is automatically used to install the given # files by dodoc in src_install(). -inherit elisp-common eutils +inherit elisp-common -case "${EAPI:-0}" in - 0|1) EXPORT_FUNCTIONS src_{unpack,compile,install} \ - pkg_{setup,postinst,postrm} ;; - *) EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ - pkg_{setup,postinst,postrm} ;; +case ${EAPI:-0} in + 0|1) + inherit eutils + EXPORT_FUNCTIONS src_{unpack,compile,install} \ + pkg_{setup,postinst,postrm} ;; + 2|3|4|5) + inherit eutils + EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ + pkg_{setup,postinst,postrm} ;; + 6) + EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,install} \ + pkg_{setup,postinst,postrm} ;; + *) die "${ECLASS}: EAPI ${EAPI} not supported" ;; esac DEPEND=">=virtual/emacs-${NEED_EMACS:-23}" @@ -105,7 +113,7 @@ elisp_src_unpack() { [[ -d ${S} ]] || S=${WORKDIR} fi - case "${EAPI:-0}" in + case ${EAPI:-0} in 0|1) [[ -d ${S} ]] && cd "${S}" elisp_src_prepare ;; esac @@ -117,21 +125,28 @@ elisp_src_unpack() { # for in the current working dir, WORKDIR, and FILESDIR. elisp_src_prepare() { - local patch + local patch file for patch in ${ELISP_PATCHES}; do if [[ -f ${patch} ]]; then - epatch "${patch}" + file="${patch}" elif [[ -f ${WORKDIR}/${patch} ]]; then - epatch "${WORKDIR}/${patch}" + file="${WORKDIR}/${patch}" elif [[ -f ${FILESDIR}/${patch} ]]; then - epatch "${FILESDIR}/${patch}" + file="${FILESDIR}/${patch}" else die "Cannot find ${patch}" fi + case ${EAPI:-0} in + 0|1|2|3|4|5) epatch "${file}" ;; + 6) eapply "${file}" ;; + esac done # apply any user patches - epatch_user + case ${EAPI:-0} in + 0|1|2|3|4|5) epatch_user ;; + 6) eapply_user ;; + esac if [[ -n ${ELISP_REMOVE} ]]; then rm ${ELISP_REMOVE} || die diff --git a/sdk_container/src/third_party/portage-stable/eclass/eutils.eclass b/sdk_container/src/third_party/portage-stable/eclass/eutils.eclass index daef9a8152..0004c2cd76 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/eutils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.444 2015/03/20 18:28:11 vapier Exp $ +# $Id$ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -20,50 +20,6 @@ _EUTILS_ECLASS=1 inherit multilib toolchain-funcs -if has "${EAPI:-0}" 0 1 2; then - -# @FUNCTION: epause -# @USAGE: [seconds] -# @DESCRIPTION: -# Sleep for the specified number of seconds (default of 5 seconds). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, -# don't wait at all. Defined in EAPIs 0 1 and 2. -epause() { - [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} -} - -# @FUNCTION: ebeep -# @USAGE: [number of beeps] -# @DESCRIPTION: -# Issue the specified number of beeps (default of 5 beeps). Useful when -# printing a message the user should probably be reading and often used in -# conjunction with the epause function. If the EBEEP_IGNORE env var is set, -# don't beep at all. Defined in EAPIs 0 1 and 2. -ebeep() { - local n - if [[ -z ${EBEEP_IGNORE} ]] ; then - for ((n=1 ; n <= ${1:-5} ; n++)) ; do - echo -ne "\a" - sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null - echo -ne "\a" - sleep 1 - done - fi -} - -else - -ebeep() { - ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org" -} - -epause() { - ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at http://bugs.gentoo.org" -} - -fi - # @FUNCTION: eqawarn # @USAGE: [message] # @DESCRIPTION: @@ -83,7 +39,7 @@ fi # Remove CVS directories recursiveley. Useful when a source tarball contains # internal CVS directories. Defaults to $PWD. ecvs_clean() { - [[ -z $* ]] && set -- . + [[ $# -eq 0 ]] && set -- . find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf } @@ -94,10 +50,20 @@ ecvs_clean() { # Remove .svn directories recursiveley. Useful when a source tarball contains # internal Subversion directories. Defaults to $PWD. esvn_clean() { - [[ -z $* ]] && set -- . + [[ $# -eq 0 ]] && set -- . find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf } +# @FUNCTION: egit_clean +# @USAGE: [list of dirs] +# @DESCRIPTION: +# Remove .git* directories/files recursiveley. Useful when a source tarball +# contains internal Git directories. Defaults to $PWD. +egit_clean() { + [[ $# -eq 0 ]] && set -- . + find "$@" -type d -name '.git*' -prune -print0 | xargs -0 rm -rf +} + # @FUNCTION: estack_push # @USAGE: [items to push] # @DESCRIPTION: @@ -143,7 +109,7 @@ estack_pop() { if [[ -n ${_estack_retvar} ]] ; then eval ${_estack_retvar}=\"\${${_estack_name}\[${_estack_i}\]}\" fi - eval unset ${_estack_name}\[${_estack_i}\] + eval unset \"${_estack_name}\[${_estack_i}\]\" } # @FUNCTION: evar_push @@ -591,7 +557,7 @@ epatch() { ( _epatch_draw_line "***** ${patchname} *****" echo - echo "PATCH COMMAND: ${patch_cmd} < '${PATCH_TARGET}'" + echo "PATCH COMMAND: ${patch_cmd} --dry-run -f < '${PATCH_TARGET}'" echo _epatch_draw_line "***** ${patchname} *****" ${patch_cmd} --dry-run -f < "${PATCH_TARGET}" 2>&1 @@ -606,6 +572,7 @@ epatch() { _epatch_draw_line "***** ${patchname} *****" echo echo "ACTUALLY APPLYING ${patchname} ..." + echo "PATCH COMMAND: ${patch_cmd} < '${PATCH_TARGET}'" echo _epatch_draw_line "***** ${patchname} *****" ${patch_cmd} < "${PATCH_TARGET}" 2>&1 @@ -662,69 +629,6 @@ epatch() { : # everything worked } -# @FUNCTION: epatch_user -# @USAGE: -# @DESCRIPTION: -# Applies user-provided patches to the source tree. The patches are -# taken from /etc/portage/patches//[:SLOT]/, where the first -# of these three directories to exist will be the one to use, ignoring -# any more general directories which might exist as well. They must end -# in ".patch" to be applied. -# -# User patches are intended for quick testing of patches without ebuild -# modifications, as well as for permanent customizations a user might -# desire. Obviously, there can be no official support for arbitrarily -# patched ebuilds. So whenever a build log in a bug report mentions that -# user patches were applied, the user should be asked to reproduce the -# problem without these. -# -# Not all ebuilds do call this function, so placing patches in the -# stated directory might or might not work, depending on the package and -# the eclasses it inherits and uses. It is safe to call the function -# repeatedly, so it is always possible to add a call at the ebuild -# level. The first call is the time when the patches will be -# applied. -# -# Ideally, this function should be called after gentoo-specific patches -# have been applied, so that their code can be modified as well, but -# before calls to e.g. eautoreconf, as the user patches might affect -# autotool input files as well. -epatch_user() { - [[ $# -ne 0 ]] && die "epatch_user takes no options" - - # Allow multiple calls to this function; ignore all but the first - local applied="${T}/epatch_user.log" - [[ -e ${applied} ]] && return 2 - - # don't clobber any EPATCH vars that the parent might want - local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches - for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT}}; do - EPATCH_SOURCE=${base}/${CTARGET}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check} - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check} - if [[ -d ${EPATCH_SOURCE} ]] ; then - EPATCH_SOURCE=${EPATCH_SOURCE} \ - EPATCH_SUFFIX="patch" \ - EPATCH_FORCE="yes" \ - EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ - epatch - echo "${EPATCH_SOURCE}" > "${applied}" - has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" - return 0 - fi - done - echo "none" > "${applied}" - return 1 -} -# @FUNCTION: epatch_user_death_notice -# @INTERNAL -# @DESCRIPTION: -# Include an explicit notice in the die message itself that user patches were -# applied to this build. -epatch_user_death_notice() { - ewarn "!!! User patches were applied to this build!" -} - # @FUNCTION: emktemp # @USAGE: [temp dir] # @DESCRIPTION: @@ -1396,20 +1300,34 @@ built_with_use() { [[ ${opt} = "-a" ]] } +# If an overlay has eclass overrides, but doesn't actually override the +# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's +# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So +# add a check to locate the ELT-patches/ regardless of what's going on. +# Note: Duplicated in libtool.eclass. +_EUTILS_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} +eutils_elt_patch_dir() { + local d="${ECLASSDIR}/ELT-patches" + if [[ ! -d ${d} ]] ; then + d="${_EUTILS_ECLASSDIR_LOCAL}/ELT-patches" + fi + echo "${d}" +} + # @FUNCTION: epunt_cxx # @USAGE: [dir to scan] # @DESCRIPTION: # Many configure scripts wrongly bail when a C++ compiler could not be # detected. If dir is not specified, then it defaults to ${S}. # -# http://bugs.gentoo.org/73450 +# https://bugs.gentoo.org/73450 epunt_cxx() { local dir=$1 [[ -z ${dir} ]] && dir=${S} ebegin "Removing useless C++ checks" local f p any_found while IFS= read -r -d '' f; do - for p in "${PORTDIR}"/eclass/ELT-patches/nocxx/*.patch ; do + for p in "$(eutils_elt_patch_dir)"/nocxx/*.patch ; do if patch --no-backup-if-mismatch -p1 "${f}" "${p}" >/dev/null ; then any_found=1 break @@ -1498,23 +1416,6 @@ path_exists() { esac } -# @FUNCTION: in_iuse -# @USAGE: -# @DESCRIPTION: -# Determines whether the given flag is in IUSE. Strips IUSE default prefixes -# as necessary. -# -# Note that this function should not be used in the global scope. -in_iuse() { - debug-print-function ${FUNCNAME} "${@}" - [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" - - local flag=${1} - local liuse=( ${IUSE} ) - - has "${flag}" "${liuse[@]#[+-]}" -} - # @FUNCTION: use_if_iuse # @USAGE: # @DESCRIPTION: @@ -1526,17 +1427,6 @@ use_if_iuse() { use $1 } -# @FUNCTION: usex -# @USAGE: [true output] [false output] [true suffix] [false suffix] -# @DESCRIPTION: -# Proxy to declare usex for package managers or EAPIs that do not provide it -# and use the package manager implementation when available (i.e. EAPI >= 5). -# If USE flag is set, echo [true output][true suffix] (defaults to "yes"), -# otherwise echo [false output][false suffix] (defaults to "no"). -if has "${EAPI:-0}" 0 1 2 3 4; then - usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963 -fi - # @FUNCTION: prune_libtool_files # @USAGE: [--all|--modules] # @DESCRIPTION: @@ -1683,6 +1573,192 @@ prune_libtool_files() { fi } +# @FUNCTION: optfeature +# @USAGE: [other atoms] +# @DESCRIPTION: +# Print out a message suggesting an optional package (or packages) which +# provide the described functionality +# +# The following snippet would suggest app-misc/foo for optional foo support, +# app-misc/bar or app-misc/baz[bar] for optional bar support +# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support. +# @CODE +# optfeature "foo support" app-misc/foo +# optfeature "bar support" app-misc/bar app-misc/baz[bar] +# optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c +# @CODE +optfeature() { + debug-print-function ${FUNCNAME} "$@" + local i j msg + local desc=$1 + local flag=0 + shift + for i; do + for j in ${i}; do + if has_version "${j}"; then + flag=1 + else + flag=0 + break + fi + done + if [[ ${flag} -eq 1 ]]; then + break + fi + done + if [[ ${flag} -eq 0 ]]; then + for i; do + msg=" " + for j in ${i}; do + msg+=" ${j} and" + done + msg="${msg:0: -4} for ${desc}" + elog "${msg}" + done + fi +} + +fi + +check_license() { + die "you no longer need this as portage supports ACCEPT_LICENSE itself" +} + +case ${EAPI:-0} in +0|1|2) + +# @FUNCTION: epause +# @USAGE: [seconds] +# @DESCRIPTION: +# Sleep for the specified number of seconds (default of 5 seconds). Useful when +# printing a message the user should probably be reading and often used in +# conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, +# don't wait at all. Defined in EAPIs 0 1 and 2. +epause() { + [[ -z ${EPAUSE_IGNORE} ]] && sleep ${1:-5} +} + +# @FUNCTION: ebeep +# @USAGE: [number of beeps] +# @DESCRIPTION: +# Issue the specified number of beeps (default of 5 beeps). Useful when +# printing a message the user should probably be reading and often used in +# conjunction with the epause function. If the EBEEP_IGNORE env var is set, +# don't beep at all. Defined in EAPIs 0 1 and 2. +ebeep() { + local n + if [[ -z ${EBEEP_IGNORE} ]] ; then + for ((n=1 ; n <= ${1:-5} ; n++)) ; do + echo -ne "\a" + sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null + echo -ne "\a" + sleep 1 + done + fi +} + +;; +*) + +ebeep() { + ewarn "QA Notice: ebeep is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" +} + +epause() { + ewarn "QA Notice: epause is not defined in EAPI=${EAPI}, please file a bug at https://bugs.gentoo.org" +} + +;; +esac + +case ${EAPI:-0} in +0|1|2|3|4) + +# @FUNCTION: usex +# @USAGE: [true output] [false output] [true suffix] [false suffix] +# @DESCRIPTION: +# Proxy to declare usex for package managers or EAPIs that do not provide it +# and use the package manager implementation when available (i.e. EAPI >= 5). +# If USE flag is set, echo [true output][true suffix] (defaults to "yes"), +# otherwise echo [false output][false suffix] (defaults to "no"). +usex() { use "$1" && echo "${2-yes}$4" || echo "${3-no}$5" ; } #382963 + +;; +esac + +case ${EAPI:-0} in +0|1|2|3|4|5) + +# @VARIABLE: EPATCH_USER_SOURCE +# @DESCRIPTION: +# Location for user patches, see the epatch_user function. +# Should be set by the user. Don't set this in ebuilds. +: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches} + +# @FUNCTION: epatch_user +# @USAGE: +# @DESCRIPTION: +# Applies user-provided patches to the source tree. The patches are +# taken from /etc/portage/patches//[:SLOT]/, where the first +# of these three directories to exist will be the one to use, ignoring +# any more general directories which might exist as well. They must end +# in ".patch" to be applied. +# +# User patches are intended for quick testing of patches without ebuild +# modifications, as well as for permanent customizations a user might +# desire. Obviously, there can be no official support for arbitrarily +# patched ebuilds. So whenever a build log in a bug report mentions that +# user patches were applied, the user should be asked to reproduce the +# problem without these. +# +# Not all ebuilds do call this function, so placing patches in the +# stated directory might or might not work, depending on the package and +# the eclasses it inherits and uses. It is safe to call the function +# repeatedly, so it is always possible to add a call at the ebuild +# level. The first call is the time when the patches will be +# applied. +# +# Ideally, this function should be called after gentoo-specific patches +# have been applied, so that their code can be modified as well, but +# before calls to e.g. eautoreconf, as the user patches might affect +# autotool input files as well. +epatch_user() { + [[ $# -ne 0 ]] && die "epatch_user takes no options" + + # Allow multiple calls to this function; ignore all but the first + local applied="${T}/epatch_user.log" + [[ -e ${applied} ]] && return 2 + + # don't clobber any EPATCH vars that the parent might want + local EPATCH_SOURCE check + for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT%/*}}; do + EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CTARGET}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check} + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check} + if [[ -d ${EPATCH_SOURCE} ]] ; then + EPATCH_SOURCE=${EPATCH_SOURCE} \ + EPATCH_SUFFIX="patch" \ + EPATCH_FORCE="yes" \ + EPATCH_MULTI_MSG="Applying user patches from ${EPATCH_SOURCE} ..." \ + epatch + echo "${EPATCH_SOURCE}" > "${applied}" + has epatch_user_death_notice ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" epatch_user_death_notice" + return 0 + fi + done + echo "none" > "${applied}" + return 1 +} + +# @FUNCTION: epatch_user_death_notice +# @INTERNAL +# @DESCRIPTION: +# Include an explicit notice in the die message itself that user patches were +# applied to this build. +epatch_user_death_notice() { + ewarn "!!! User patches were applied to this build!" +} + # @FUNCTION: einstalldocs # @DESCRIPTION: # Install documentation using DOCS and HTML_DOCS. @@ -1744,51 +1820,22 @@ einstalldocs() { return 0 } -check_license() { die "you no longer need this as portage supports ACCEPT_LICENSE itself"; } - -# @FUNCTION: optfeature -# @USAGE: [other atoms] +# @FUNCTION: in_iuse +# @USAGE: # @DESCRIPTION: -# Print out a message suggesting an optional package (or packages) which -# provide the described functionality +# Determines whether the given flag is in IUSE. Strips IUSE default prefixes +# as necessary. # -# The following snippet would suggest app-misc/foo for optional foo support, -# app-misc/bar or app-misc/baz[bar] for optional bar support -# and either both app-misc/a and app-misc/b or app-misc/c for alphabet support. -# @CODE -# optfeature "foo support" app-misc/foo -# optfeature "bar support" app-misc/bar app-misc/baz[bar] -# optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c -# @CODE -optfeature() { - debug-print-function ${FUNCNAME} "$@" - local i j msg - local desc=$1 - local flag=0 - shift - for i; do - for j in ${i}; do - if has_version "${j}"; then - flag=1 - else - flag=0 - break - fi - done - if [[ ${flag} -eq 1 ]]; then - break - fi - done - if [[ ${flag} -eq 0 ]]; then - for i; do - msg=" " - for j in ${i}; do - msg+=" ${j} and" - done - msg="${msg:0: -4} for ${desc}" - elog "${msg}" - done - fi +# Note that this function should not be used in the global scope. +in_iuse() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()" + + local flag=${1} + local liuse=( ${IUSE} ) + + has "${flag}" "${liuse[@]#[+-]}" } -fi +;; +esac diff --git a/sdk_container/src/third_party/portage-stable/eclass/flag-o-matic.eclass b/sdk_container/src/third_party/portage-stable/eclass/flag-o-matic.eclass index 38b6ac59f7..e0b19e9aaa 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/flag-o-matic.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/flag-o-matic.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v 1.206 2015/05/24 07:05:30 vapier Exp $ +# $Id$ # @ECLASS: flag-o-matic.eclass # @MAINTAINER: @@ -23,48 +23,50 @@ all-flag-vars() { # {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags # Note: shell globs and character lists are allowed setup-allowed-flags() { - ALLOWED_FLAGS="-pipe" - ALLOWED_FLAGS+=" -O -O1 -O2 -Os -Og -mcpu -march -mtune" - ALLOWED_FLAGS+=" -fstack-protector* -fsanitize=*" - ALLOWED_FLAGS+=" -fbounds-check -fbounds-checking -fno-strict-overflow" - ALLOWED_FLAGS+=" -fno-PIE -fno-pie -nopie -fno-unit-at-a-time" - ALLOWED_FLAGS+=" -g -g[0-9] -ggdb -ggdb[0-9] -gdwarf-* gstabs -gstabs+" - ALLOWED_FLAGS+=" -fno-ident -fpermissive -frecord-gcc-switches" - ALLOWED_FLAGS+=" -fdiagnostics*" - ALLOWED_FLAGS+=" -W* -w" + ALLOWED_FLAGS=( + -pipe -O '-O[12sg]' -mcpu -march -mtune + '-fstack-protector*' '-fsanitize*' + -fbounds-check -fbounds-checking -fno-strict-overflow + -fno-PIE -fno-pie -nopie -fno-unit-at-a-time + -g '-g[0-9]' -ggdb '-ggdb[0-9]' '-gdwarf-*' gstabs -gstabs+ + -fno-ident -fpermissive -frecord-gcc-switches + '-fdiagnostics*' + '-W*' -w + + # CPPFLAGS and LDFLAGS + '-[DUILR]*' '-Wl,*' + ) # allow a bunch of flags that negate features / control ABI - ALLOWED_FLAGS+=" -fno-stack-protector* -fabi-version=* \ - -fno-strict-aliasing -fno-bounds-check -fno-bounds-checking -fstrict-overflow \ - -fno-omit-frame-pointer -fno-builtin*" - ALLOWED_FLAGS+=" -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse \ - -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 \ - -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt \ - -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt \ - -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu \ - -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe \ - -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat \ - -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi \ - -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel \ - -mstack-bias -mno-stack-bias -msecure-plt -m*-toc -mfloat-abi \ - -mfix-r10000 -mno-fix-r10000 -D* -U*" + ALLOWED_FLAGS+=( + '-fno-stack-protector*' '-fabi-version=*' + -fno-strict-aliasing -fno-bounds-check -fno-bounds-checking -fstrict-overflow + -fno-omit-frame-pointer '-fno-builtin*' + ) + ALLOWED_FLAGS+=( + -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse + -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 + -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt + -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt + -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu + -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe + -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat + -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi + -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel + -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi + -mfix-r10000 -mno-fix-r10000 - # 4.5 - ALLOWED_FLAGS+=" -mno-fma4 -mno-movbe -mno-xop -mno-lwp" - # 4.6 - ALLOWED_FLAGS+=" -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm" - # 4.7 - ALLOWED_FLAGS+=" -mno-avx2 -mno-bmi2 -mno-fma -mno-lzcnt" - # 4.8 - ALLOWED_FLAGS+=" -mno-fxsr -mno-rtm -mno-xsave -mno-xsaveopt" - # 4.9 - ALLOWED_FLAGS+=" -mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha" - - # CPPFLAGS and LDFLAGS - ALLOWED_FLAGS+=" -I* -L* -R* -Wl,*" - - export ALLOWED_FLAGS - return 0 + # gcc 4.5 + -mno-fma4 -mno-movbe -mno-xop -mno-lwp + # gcc 4.6 + -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm + # gcc 4.7 + -mno-avx2 -mno-bmi2 -mno-fma -mno-lzcnt + # gcc 4.8 + -mno-fxsr -mno-hle -mno-rtm -mno-xsave -mno-xsaveopt + # gcc 4.9 + -mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha + ) } # inverted filters for hardened compiler. This is trying to unpick @@ -375,6 +377,7 @@ filter-mfpmath() { strip-flags() { local x y var + local ALLOWED_FLAGS setup-allowed-flags set -f # disable pathname expansion @@ -384,7 +387,7 @@ strip-flags() { for x in ${!var} ; do local flag=${x%%=*} - for y in ${ALLOWED_FLAGS} ; do + for y in "${ALLOWED_FLAGS[@]}" ; do if [[ -z ${flag%%${y}} ]] ; then new+=( "${x}" ) break diff --git a/sdk_container/src/third_party/portage-stable/eclass/git-2.eclass b/sdk_container/src/third_party/portage-stable/eclass/git-2.eclass index 7f72447d72..6101ad4103 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/git-2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/git-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.35 2014/11/20 15:32:09 mgorny Exp $ +# $Id$ # @ECLASS: git-2.eclass # @MAINTAINER: @@ -13,6 +13,10 @@ # # This eclass is DEPRECATED. Please use git-r3 instead. +if [[ ${EAPI} == 6 ]]; then + die "${ECLASS}.eclass is banned in EAPI ${EAPI}" +fi + # This eclass support all EAPIs EXPORT_FUNCTIONS src_unpack @@ -180,7 +184,7 @@ git-2_submodules() { fi debug-print "${FUNCNAME}: working in \"${1}\"" - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die debug-print "${FUNCNAME}: git submodule init" git submodule init || die @@ -189,7 +193,7 @@ git-2_submodules() { debug-print "${FUNCNAME}: git submodule update" git submodule update || die - popd > /dev/null + popd > /dev/null || die fi } @@ -204,7 +208,7 @@ git-2_branch() { local branchname src debug-print "${FUNCNAME}: working in \"${EGIT_SOURCEDIR}\"" - pushd "${EGIT_SOURCEDIR}" > /dev/null + pushd "${EGIT_SOURCEDIR}" > /dev/null || die local branchname=branch-${EGIT_BRANCH} src=origin/${EGIT_BRANCH} if [[ ${EGIT_COMMIT} != ${EGIT_BRANCH} ]]; then @@ -215,7 +219,7 @@ git-2_branch() { git checkout -b ${branchname} ${src} \ || die "${FUNCNAME}: changing the branch failed" - popd > /dev/null + popd > /dev/null || die } # @FUNCTION: git-2_gc @@ -228,13 +232,13 @@ git-2_gc() { local args if [[ ${EGIT_REPACK} || ${EGIT_PRUNE} ]]; then - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die ebegin "Garbage collecting the repository" [[ ${EGIT_PRUNE} ]] && args='--prune' debug-print "${FUNCNAME}: git gc ${args}" git gc ${args} eend $? - popd > /dev/null + popd > /dev/null || die fi } @@ -306,12 +310,12 @@ git-2_move_source() { debug-print-function ${FUNCNAME} "$@" debug-print "${FUNCNAME}: ${MOVE_COMMAND} \"${EGIT_DIR}\" \"${EGIT_SOURCEDIR}\"" - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die mkdir -p "${EGIT_SOURCEDIR}" \ || die "${FUNCNAME}: failed to create ${EGIT_SOURCEDIR}" ${MOVE_COMMAND} "${EGIT_SOURCEDIR}" \ || die "${FUNCNAME}: sync to \"${EGIT_SOURCEDIR}\" failed" - popd > /dev/null + popd > /dev/null || die } # @FUNCTION: git-2_initial_clone @@ -388,22 +392,22 @@ git-2_fetch() { if [[ ! -d ${EGIT_DIR} ]]; then git-2_initial_clone - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die cursha=$(git rev-parse ${UPSTREAM_BRANCH}) echo "GIT NEW clone -->" echo " repository: ${EGIT_REPO_URI_SELECTED}" echo " at the commit: ${cursha}" - popd > /dev/null + popd > /dev/null || die elif [[ ${EVCS_OFFLINE} ]]; then - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die cursha=$(git rev-parse ${UPSTREAM_BRANCH}) echo "GIT offline update -->" echo " repository: $(git config remote.origin.url)" echo " at the commit: ${cursha}" - popd > /dev/null + popd > /dev/null || die else - pushd "${EGIT_DIR}" > /dev/null + pushd "${EGIT_DIR}" > /dev/null || die oldsha=$(git rev-parse ${UPSTREAM_BRANCH}) git-2_update_repo cursha=$(git rev-parse ${UPSTREAM_BRANCH}) @@ -421,7 +425,7 @@ git-2_fetch() { # print nice statistic of what was changed git --no-pager diff --stat ${oldsha}..${UPSTREAM_BRANCH} - popd > /dev/null + popd > /dev/null || die fi # export the version the repository is at export EGIT_VERSION="${cursha}" @@ -454,7 +458,7 @@ git-2_bootstrap() { # combination with --keep-going it would lead in not-updating # pakcages that are up-to-date. if [[ ${EGIT_BOOTSTRAP} ]]; then - pushd "${EGIT_SOURCEDIR}" > /dev/null + pushd "${EGIT_SOURCEDIR}" > /dev/null || die einfo "Starting bootstrap" if [[ -f ${EGIT_BOOTSTRAP} ]]; then @@ -478,7 +482,7 @@ git-2_bootstrap() { fi einfo "Bootstrap finished" - popd > /dev/null + popd > /dev/null || die fi } diff --git a/sdk_container/src/third_party/portage-stable/eclass/git-r3.eclass b/sdk_container/src/third_party/portage-stable/eclass/git-r3.eclass index eca443bce1..957ff08c29 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/git-r3.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/git-r3.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/git-r3.eclass,v 1.49 2015/06/22 08:39:36 mrueg Exp $ +# $Id$ # @ECLASS: git-r3.eclass # @MAINTAINER: @@ -11,7 +11,7 @@ # git as remote repository. case "${EAPI:-0}" in - 0|1|2|3|4|5) + 0|1|2|3|4|5|6) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -185,19 +185,19 @@ _git-r3_env_setup() { ;; single) if [[ ${EGIT_CLONE_TYPE} == shallow ]]; then - einfo "git-r3: ebuild needs to be cloned in 'single' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in '\e[1msingle\e[22m' mode, adjusting" EGIT_CLONE_TYPE=single fi ;; single+tags) if [[ ${EGIT_CLONE_TYPE} == shallow || ${EGIT_CLONE_TYPE} == single ]]; then - einfo "git-r3: ebuild needs to be cloned in 'single+tags' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in '\e[1msingle+tags\e[22m' mode, adjusting" EGIT_CLONE_TYPE=single+tags fi ;; mirror) if [[ ${EGIT_CLONE_TYPE} != mirror ]]; then - einfo "git-r3: ebuild needs to be cloned in 'mirror' mode, adjusting" + einfo "git-r3: ebuild needs to be cloned in '\e[1mmirror\e[22m' mode, adjusting" EGIT_CLONE_TYPE=mirror fi ;; @@ -314,7 +314,7 @@ _git-r3_set_gitdir() { if [[ ! -d ${EGIT3_STORE_DIR} ]]; then ( addwrite / - mkdir -p "${EGIT3_STORE_DIR}" || die + mkdir -p "${EGIT3_STORE_DIR}" ) || die "Unable to create ${EGIT3_STORE_DIR}" fi @@ -362,8 +362,13 @@ _git-r3_set_submodules() { submodule."${subname}".update) [[ ${upd} == none ]] && continue + # https://github.com/git/git/blob/master/refs.c#L39 + # for now, we just filter /. because of #572312 + local enc_subname=${subname//\/.//_} + [[ ${enc_subname} == .* ]] && enc_subname=_${enc_subname#.} + submodules+=( - "${subname}" + "${enc_subname}" "$(echo "${data}" | git config -f /dev/fd/0 \ submodule."${subname}".url || die)" "$(echo "${data}" | git config -f /dev/fd/0 \ @@ -532,7 +537,7 @@ git-r3_fetch() { umask "${EVCS_UMASK}" || die "Bad options to umask: ${EVCS_UMASK}" fi for r in "${repos[@]}"; do - einfo "Fetching ${r} ..." + einfo "Fetching \e[1m${r}\e[22m ..." local fetch_command=( git fetch "${r}" ) local clone_type=${EGIT_CLONE_TYPE} @@ -553,11 +558,11 @@ git-r3_fetch() { # so automatically switch to single+tags mode. if [[ ${clone_type} == shallow ]]; then einfo " Google Code does not support shallow clones" - einfo " using EGIT_CLONE_TYPE=single+tags" + einfo " using \e[1mEGIT_CLONE_TYPE=single+tags\e[22m" clone_type=single+tags elif [[ ${clone_type} == single ]]; then einfo " git-r3: Google Code does not send tags properly in 'single' mode" - einfo " using EGIT_CLONE_TYPE=single+tags" + einfo " using \e[1mEGIT_CLONE_TYPE=single+tags\e[22m" clone_type=single+tags fi fi @@ -581,11 +586,11 @@ git-r3_fetch() { if [[ ${remote_ref} == HEAD ]]; then # HEAD fetch_l=HEAD - elif [[ ${remote_ref} == refs/heads/* ]]; then - # regular branch + elif [[ ${remote_ref} == refs/* ]]; then + # regular branch, tag or some other explicit ref fetch_l=${remote_ref} else - # tag or commit... + # tag or commit id... # let ls-remote figure it out local tagref=$(git ls-remote "${r}" "refs/tags/${remote_ref}") @@ -594,8 +599,8 @@ git-r3_fetch() { # tag fetch_l=refs/tags/${remote_ref} else - # commit - # so we need to fetch the branch + # commit id + # so we need to fetch the whole branch if [[ ${branch} ]]; then fetch_l=${branch} else @@ -697,7 +702,7 @@ git-r3_fetch() { [[ ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI" # submodules can reference commits in any branch - # always use the 'clone' mode to accomodate that, bug #503332 + # always use the 'mirror' mode to accomodate that, bug #503332 local EGIT_CLONE_TYPE=mirror # recursively fetch submodules @@ -710,17 +715,24 @@ git-r3_fetch() { local subname=${submodules[0]} local url=${submodules[1]} local path=${submodules[2]} - local commit=$(git rev-parse "${local_ref}:${path}") - if [[ ! ${commit} ]]; then - die "Unable to get commit id for submodule ${subname}" + # use only submodules for which path does exist + # (this is in par with 'git submodule'), bug #551100 + # note: git cat-file does not work for submodules + if [[ $(git ls-tree -d "${local_ref}" "${path}") ]] + then + local commit=$(git rev-parse "${local_ref}:${path}" || die) + + if [[ ! ${commit} ]]; then + die "Unable to get commit id for submodule ${subname}" + fi + + local subrepos + _git-r3_set_subrepos "${url}" "${repos[@]}" + + git-r3_fetch "${subrepos[*]}" "${commit}" "${local_id}/${subname}" fi - local subrepos - _git-r3_set_subrepos "${url}" "${repos[@]}" - - git-r3_fetch "${subrepos[*]}" "${commit}" "${local_id}/${subname}" - submodules=( "${submodules[@]:3}" ) # shift done fi @@ -764,7 +776,7 @@ git-r3_checkout() { local -x GIT_DIR _git-r3_set_gitdir "${repos[0]}" - einfo "Checking out ${repos[0]} to ${out_dir} ..." + einfo "Checking out \e[1m${repos[0]}\e[22m to \e[1m${out_dir}\e[22m ..." if ! git cat-file -e refs/git-r3/"${local_id}"/__main__; then if [[ ${EVCS_OFFLINE} ]]; then @@ -814,6 +826,7 @@ git-r3_checkout() { "${@}" || die "git checkout ${remote_ref:-${new_commit_id}} failed" } git-r3_sub_checkout + unset -f git-r3_sub_checkout local old_commit_id=$( git rev-parse --quiet --verify refs/git-r3/"${local_id}"/__old__ @@ -849,11 +862,16 @@ git-r3_checkout() { local subname=${submodules[0]} local url=${submodules[1]} local path=${submodules[2]} - local subrepos - _git-r3_set_subrepos "${url}" "${repos[@]}" - git-r3_checkout "${subrepos[*]}" "${out_dir}/${path}" \ - "${local_id}/${subname}" + # use only submodules for which path does exist + # (this is in par with 'git submodule'), bug #551100 + if [[ -d ${out_dir}/${path} ]]; then + local subrepos + _git-r3_set_subrepos "${url}" "${repos[@]}" + + git-r3_checkout "${subrepos[*]}" "${out_dir}/${path}" \ + "${local_id}/${subname}" + fi submodules=( "${submodules[@]:3}" ) # shift done @@ -904,12 +922,11 @@ git-r3_peek_remote_ref() { local r success for r in "${repos[@]}"; do - einfo "Peeking ${remote_ref} on ${r} ..." >&2 + einfo "Peeking \e[1m${remote_ref}\e[22m on \e[1m${r}\e[22m ..." >&2 - local is_branch lookup_ref - if [[ ${remote_ref} == refs/heads/* || ${remote_ref} == HEAD ]] + local lookup_ref + if [[ ${remote_ref} == refs/* || ${remote_ref} == HEAD ]] then - is_branch=1 lookup_ref=${remote_ref} else # ls-remote by commit is going to fail anyway, @@ -954,16 +971,23 @@ git-r3_src_unpack() { } # https://bugs.gentoo.org/show_bug.cgi?id=482666 -git-r3_pkg_outofdate() { +git-r3_pkg_needrebuild() { debug-print-function ${FUNCNAME} "$@" local new_commit_id=$(git-r3_peek_remote_ref) - ewarn "old: ${EGIT_VERSION}" - ewarn "new: ${new_commit_id}" - [[ ${new_commit_id} && ${old_commit_id} ]] || return 2 + [[ ${new_commit_id} && ${EGIT_VERSION} ]] || die "Lookup failed" + + if [[ ${EGIT_VERSION} != ${new_commit_id} ]]; then + einfo "Update from \e[1m${EGIT_VERSION}\e[22m to \e[1m${new_commit_id}\e[22m" + else + einfo "Local and remote at \e[1m${EGIT_VERSION}\e[22m" + fi [[ ${EGIT_VERSION} != ${new_commit_id} ]] } +# 'export' locally until this gets into EAPI +pkg_needrebuild() { git-r3_pkg_needrebuild; } + _GIT_R3=1 fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/gnome2.eclass b/sdk_container/src/third_party/portage-stable/eclass/gnome2.eclass index 274d746fd6..8077f71273 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/gnome2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/gnome2.eclass @@ -91,6 +91,7 @@ gnome2_src_prepare() { gnome2_disable_deprecation_warning # Run libtoolize + # https://bugzilla.gnome.org/show_bug.cgi?id=655517 elibtoolize ${ELTCONF} } diff --git a/sdk_container/src/third_party/portage-stable/eclass/golang-base.eclass b/sdk_container/src/third_party/portage-stable/eclass/golang-base.eclass new file mode 100644 index 0000000000..c6aa415c36 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/golang-base.eclass @@ -0,0 +1,78 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: golang-build.eclass +# @MAINTAINER: +# William Hubbs +# @BLURB: Eclass that provides base functions for Go packages. +# @DESCRIPTION: +# This eclass provides base functions for software written in the Go +# programming language; it also provides the build-time dependency on +# dev-lang/go. + +case "${EAPI:-0}" in + 5|6) + ;; + *) + die "${ECLASS}: Unsupported eapi (EAPI=${EAPI})" + ;; +esac + +if [[ -z ${_GOLANG_BASE} ]]; then + +_GOLANG_BASE=1 + +DEPEND=">=dev-lang/go-1.4.2:=" +STRIP_MASK="*.a" + +# @ECLASS-VARIABLE: EGO_PN +# @REQUIRED +# @DESCRIPTION: +# This is the import path for the go package to build. Please emerge +# dev-lang/go and read "go help importpath" for syntax. +# +# Example: +# @CODE +# EGO_PN=github.com/user/package +# @CODE + +# @FUNCTION: ego_pn_check +# @DESCRIPTION: +# Make sure EGO_PN has a value. +ego_pn_check() { + [[ -z "${EGO_PN}" ]] && + die "${ECLASS}.eclass: EGO_PN is not set" + return 0 +} + +# @FUNCTION: get_golibdir +# @DESCRIPTION: +# Return the non-prefixed library directory where Go packages +# should be installed +get_golibdir() { + echo /usr/lib/go-gentoo +} + +# @FUNCTION: get_golibdir_gopath +# @DESCRIPTION: +# Return the library directory where Go packages should be installed +# This is the prefixed version which should be included in GOPATH +get_golibdir_gopath() { + echo "${EPREFIX}$(get_golibdir)" +} + +# @FUNCTION: golang_install_pkgs +# @DESCRIPTION: +# Install Go packages. +# This function assumes that $cwd is a Go workspace. +golang_install_pkgs() { + debug-print-function ${FUNCNAME} "$@" + + ego_pn_check + insinto "$(get_golibdir)" + insopts -m0644 -p # preserve timestamps for bug 551486 + doins -r pkg src +} + +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/golang-build.eclass b/sdk_container/src/third_party/portage-stable/eclass/golang-build.eclass new file mode 100644 index 0000000000..cc2a2ec894 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/golang-build.eclass @@ -0,0 +1,84 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: golang-build.eclass +# @MAINTAINER: +# William Hubbs +# @BLURB: Eclass for compiling go packages. +# @DESCRIPTION: +# This eclass provides default src_compile, src_test and src_install +# functions for software written in the Go programming language. + +inherit golang-base + +case "${EAPI:-0}" in + 5|6) + ;; + *) + die "${ECLASS}: Unsupported eapi (EAPI=${EAPI})" + ;; +esac + +EXPORT_FUNCTIONS src_compile src_install src_test + +if [[ -z ${_GOLANG_BUILD} ]]; then + +_GOLANG_BUILD=1 + +# @ECLASS-VARIABLE: EGO_BUILD_FLAGS +# @DEFAULT_UNSET +# @DESCRIPTION: +# This allows you to pass build flags to the Go compiler. These flags +# are common to the "go build" and "go install" commands used below. +# Please emerge dev-lang/go and run "go help build" for the +# documentation for these flags. +# +# Example: +# @CODE +# EGO_BUILD_FLAGS="-ldflags \"-X main.version ${PV}\"" +# @CODE + +# @ECLASS-VARIABLE: EGO_PN +# @REQUIRED +# @DESCRIPTION: +# This is the import path for the go package(s) to build. Please emerge +# dev-lang/go and read "go help importpath" for syntax. +# +# Example: +# @CODE +# EGO_PN=github.com/user/package +# @CODE + +golang-build_src_compile() { + debug-print-function ${FUNCNAME} "$@" + + ego_pn_check + set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ + go build -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" + echo "$@" + "$@" || die +} + +golang-build_src_install() { + debug-print-function ${FUNCNAME} "$@" + + ego_pn_check + set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ + go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" + echo "$@" + "$@" || die + golang_install_pkgs +} + +golang-build_src_test() { + debug-print-function ${FUNCNAME} "$@" + + ego_pn_check + set -- env GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \ + go test -v -work -x "${EGO_PN}" + echo "$@" + "$@" || die +} + +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/golang-vcs-snapshot.eclass b/sdk_container/src/third_party/portage-stable/eclass/golang-vcs-snapshot.eclass new file mode 100644 index 0000000000..2d84c28d0c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/golang-vcs-snapshot.eclass @@ -0,0 +1,56 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: golang-vcs-snapshot.eclass +# @MAINTAINER: +# William Hubbs +# @BLURB: support eclass for unpacking VCS snapshot tarballs for +# software written in the Go programming language +# @DESCRIPTION: +# This eclass provides a convenience src_unpack() which unpacks the +# first tarball mentioned in SRC_URI to its appropriate location in +# ${WORKDIR}/${P}, treating ${WORKDIR}/${P} as a go workspace. +# +# The location where the tarball is extracted is defined as +# ${WORKDIR}/${P}/src/${EGO_PN}. +# +# The typical use case is VCS snapshots coming from github, bitbucket +# and similar services. +# +# Please note that this eclass currently handles only tarballs +# (.tar.gz), but support for more formats may be added in the future. +# +# @EXAMPLE: +# +# @CODE +# EGO_PN=github.com/user/package +# inherit golang-vcs-snapshot +# +# SRC_URI="http://github.com/example/${PN}/tarball/v${PV} -> ${P}.tar.gz" +# @CODE +# +# The above example will extract the tarball to +# ${WORKDIR}/${P}/src/github.com/user/package + +inherit golang-base + +case ${EAPI:-0} in + 5|6) ;; + *) die "${ECLASS} API in EAPI ${EAPI} not yet established." +esac + +EXPORT_FUNCTIONS src_unpack + +# @FUNCTION: golang-vcs-snapshot_src_unpack +# @DESCRIPTION: +# Extract the first archive from ${A} to the appropriate location for GOPATH. +golang-vcs-snapshot_src_unpack() { + local x + ego_pn_check + set -- ${A} + x="$1" + mkdir -p "${WORKDIR}/${P}/src/${EGO_PN%/...}" || die + tar -C "${WORKDIR}/${P}/src/${EGO_PN%/...}" -x --strip-components 1 \ + -f "${DISTDIR}/${x}" || die +} diff --git a/sdk_container/src/third_party/portage-stable/eclass/golang-vcs.eclass b/sdk_container/src/third_party/portage-stable/eclass/golang-vcs.eclass index 0f3c381238..6448ddda6f 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/golang-vcs.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/golang-vcs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/golang-vcs.eclass,v 1.2 2015/06/18 15:19:04 williamh Exp $ +# $Id$ # @ECLASS: golang-vcs.eclass # @MAINTAINER: @@ -10,10 +10,10 @@ # This eclass is written to ease the maintenance of live ebuilds # of software written in the Go programming language. -inherit eutils +inherit eutils golang-base case "${EAPI:-0}" in - 5) + 5|6) ;; *) die "${ECLASS}: Unsupported eapi (EAPI=${EAPI})" @@ -26,8 +26,6 @@ if [[ -z ${_GOLANG_VCS} ]]; then _GOLANG_VCS=1 -DEPEND=">=dev-lang/go-1.4.2" - # @ECLASS-VARIABLE: EGO_PN # @REQUIRED # @DESCRIPTION: @@ -40,20 +38,6 @@ DEPEND=">=dev-lang/go-1.4.2" # EGO_PN="github.com/user1/package1 github.com/user2/package2" # @CODE -# @ECLASS-VARIABLE: EGO_SRC -# @DESCRIPTION: -# This is the Go upstream repository which will be copied to -# ${WORKDIR}/${P}. -# If it isn't set, it defaults to the first word of ${EGO_PN}. -# This should be set if you are retrieving a repository that includes -# multiple packages, e.g. golang.org/x/tools. -# -# Example: -# @CODE -# EGO_PN="github.com/user/repository/package" -# EGO_SRC="github.com/user/repository" -# @CODE - # @ECLASS-VARIABLE: EGO_STORE_DIR # @DESCRIPTION: # Storage directory for Go sources. @@ -79,7 +63,7 @@ DEPEND=">=dev-lang/go-1.4.2" # @FUNCTION: _golang-vcs_env_setup # @INTERNAL # @DESCRIPTION: -# Create EGO_STORE_DIR if necessary and set GOPATH. +# Create EGO_STORE_DIR if necessary. _golang-vcs_env_setup() { debug-print-function ${FUNCNAME} "$@" @@ -96,15 +80,10 @@ _golang-vcs_env_setup() { fi addwrite "${EGO_STORE_DIR}" - export GOPATH="${EGO_STORE_DIR}" [[ -n ${EVCS_UMASK} ]] && eumask_pop mkdir -p "${WORKDIR}/${P}/src" || die "${ECLASS}: unable to create ${WORKDIR}/${P}" - if [ -z "${EGO_SRC}" ]; then - set -- ${EGO_PN} - EGO_SRC="$1" - fi return 0 } @@ -115,35 +94,29 @@ _golang-vcs_env_setup() { _golang-vcs_fetch() { debug-print-function ${FUNCNAME} "$@" - [[ -z ${EGO_PN} ]] && - die "${ECLASS}: EGO_PN is not set" + ego_pn_check - if [[ -n ${EVCS_OFFLINE} ]]; then - export GOPATH="${WORKDIR}/${P}:${GOPATH}" - return 0 + if [[ -z ${EVCS_OFFLINE} ]]; then + [[ -n ${EVCS_UMASK} ]] && eumask_push ${EVCS_UMASK} + + set -- env GOPATH="${EGO_STORE_DIR}" go get -d -t -u -v -x "${EGO_PN}" + echo "$@" + "$@" || die + # The above dies if you pass repositories in EGO_PN instead of + # packages, e.g. golang.org/x/tools instead of golang.org/x/tools/cmd/vet. + # This is being discussed in the following upstream issue: + # https://github.com/golang/go/issues/11090 + + [[ -n ${EVCS_UMASK} ]] && eumask_pop fi - - [[ -n ${EVCS_UMASK} ]] && eumask_push ${EVCS_UMASK} - - set -- go get -d -t -u -v -x "${EGO_PN}" + local go_srcpath="${WORKDIR}/${P}/src/${EGO_PN%/...}" + set -- mkdir -p "${go_srcpath}" echo "$@" - "$@" || die - # The above dies if you pass repositories in EGO_PN instead of - # packages, e.g. golang.org/x/tools instead of golang.org/x/tools/cmd/vet. - # This is being discussed in the following upstream issue: - # https://github.com/golang/go/issues/11090 - # I am hoping this will be fixed so "go get -d" is successful if - # downloading the top level repository is successful. - - [[ -n ${EVCS_UMASK} ]] && eumask_pop - export GOPATH="${WORKDIR}/${P}:${EGO_STORE_DIR}" - set -- mkdir -p "${WORKDIR}/${P}/src/${EGO_SRC}" + "$@" || die "Unable to create ${go_srcpath}" + set -- cp -r "${EGO_STORE_DIR}/src/${EGO_PN%/...}" \ + "${go_srcpath}/.." echo "$@" - "$@" || die "Unable to create ${WORKDIR}/${P}/src/${EGO_SRC}" - set -- cp -r "${EGO_STORE_DIR}/src/${EGO_SRC}/*" \ - "${WORKDIR}/${P}/src/${EGO_SRC}" - echo "$@" - $@ || die "Unable to copy sources to ${WORKDIR}/${P}" + "$@" || die "Unable to copy sources to ${go_srcpath}" return 0 } diff --git a/sdk_container/src/third_party/portage-stable/eclass/kernel-2.eclass b/sdk_container/src/third_party/portage-stable/eclass/kernel-2.eclass index 8beeac62eb..84009ef112 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/kernel-2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/kernel-2.eclass @@ -1,12 +1,12 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.305 2015/05/30 16:09:05 mpagano Exp $ +# $Id$ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 # # Original author: John Mylchreest -# Maintainer: kernel-misc@gentoo.org +# Maintainer: kernel@gentoo.org # # Please direct your bugs to the current eclass maintainer :) @@ -37,7 +37,7 @@ # K_EXTRAEWARN - same as K_EXTRAEINFO except using ewarn instead of einfo # K_SYMLINK - if this is set, then forcably create symlink anyway # -# K_BASE_VER - for git-sources, declare the base version this patch is +# K_BASE_VER - for git-sources, declare the base version this patch is # based off of. # K_DEFCONFIG - Allow specifying a different defconfig target. # If length zero, defaults to "defconfig". @@ -57,7 +57,7 @@ # code. If empty, will be set to "1" if deblobbing is # possible. Test ONLY for "1". # K_DEBLOB_TAG - This will be the version of deblob script. It's a upstream SVN tag -# such asw -gnu or -gnu1. +# such asw -gnu or -gnu1. # K_PREDEBLOBBED - This kernel was already deblobbed elsewhere. # If false, either optional deblobbing will be available # or the license will note the inclusion of freedist @@ -65,6 +65,9 @@ # K_LONGTERM - If set, the eclass will search for the kernel source # in the long term directories on the upstream servers # as the location has been changed by upstream +# K_KDBUS_AVAILABLE - If set, the ebuild contains the option of installing the +# kdbus patch. This patch is not installed without the 'kdbus' +# and 'experimental' use flags. # H_SUPPORTEDARCH - this should be a space separated list of ARCH's which # can be supported by the headers ebuild @@ -99,7 +102,7 @@ if [[ ${CTARGET} == ${CHOST} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then export CTARGET=${CATEGORY/cross-} fi -HOMEPAGE="http://www.kernel.org/ http://www.gentoo.org/ ${HOMEPAGE}" +HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}" : ${LICENSE:="GPL-2"} # This is the latest KV_PATCH of the deblob tool available from the @@ -129,9 +132,20 @@ debug-print-kernel2-variables() { #Eclass functions only from here onwards ... #============================================================== handle_genpatches() { - local tarball + local tarball want_unipatch_list [[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1 + if [[ -n ${1} ]]; then + # set UNIPATCH_LIST_GENPATCHES only on explicit request + # since that requires 'use' call which can be used only in phase + # functions, while the function is also called in global scope + if [[ ${1} == --set-unipatch-list ]]; then + want_unipatch_list=1 + else + die "Usage: ${FUNCNAME} [--set-unipatch-list]" + fi + fi + debug-print "Inside handle_genpatches" local OKV_ARRAY IFS="." read -r -a OKV_ARRAY <<<"${OKV}" @@ -158,11 +172,11 @@ handle_genpatches() { use_cond_start="experimental? ( " use_cond_end=" )" - if use experimental ; then + if [[ -n ${want_unipatch_list} ]] && use experimental ; then UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" fi - else + elif [[ -n ${want_unipatch_list} ]]; then UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" fi @@ -393,7 +407,7 @@ detect_version() { fi - + debug-print-kernel2-variables handle_genpatches @@ -451,6 +465,10 @@ if [[ ${ETYPE} == sources ]]; then DESCRIPTION="Sources based on the Linux Kernel." IUSE="symlink build" + if [[ -n ${K_KDBUS_AVAILABLE} ]]; then + IUSE="${IUSE} kdbus" + fi + # Bug #266157, deblob for libre support if [[ -z ${K_PREDEBLOBBED} ]] ; then # Bug #359865, force a call to detect_version if needed @@ -791,10 +809,13 @@ postinst_sources() { # if we have USE=symlink, then force K_SYMLINK=1 use symlink && K_SYMLINK=1 - # if we're using a deblobbed kernel, it's not supported - [[ $K_DEBLOB_AVAILABLE == 1 ]] && \ - use deblob && \ - K_SECURITY_UNSUPPORTED=deblob + # We do support security on a deblobbed kernel, bug #555878. + # If some particular kernel version doesn't have security + # supported because of USE=deblob or otherwise, one can still + # set K_SECURITY_UNSUPPORTED on a per ebuild basis. + #[[ $K_DEBLOB_AVAILABLE == 1 ]] && \ + # use deblob && \ + # K_SECURITY_UNSUPPORTED=deblob # if we are to forcably symlink, delete it if it already exists first. if [[ ${K_SYMLINK} > 0 ]]; then @@ -817,7 +838,7 @@ postinst_sources() { echo elog "If you are upgrading from a previous kernel, you may be interested" elog "in the following document:" - elog " - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml" + elog " - General upgrade guide: https://wiki.gentoo.org/wiki/Kernel/Upgrade" echo # if K_EXTRAEINFO is set then lets display it now @@ -840,17 +861,14 @@ postinst_sources() { # optionally display security unsupported message # Start with why - if [[ ${K_SECURITY_UNSUPPORTED} = deblob ]]; then - ewarn "Deblobbed kernels may not be up-to-date security-wise" - ewarn "as they depend on external scripts." - elif [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then + if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then ewarn "${PN} is UNSUPPORTED by Gentoo Security." fi # And now the general message. if [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then ewarn "This means that it is likely to be vulnerable to recent security issues." ewarn "For specific information on why this kernel is unsupported, please read:" - ewarn "http://www.gentoo.org/proj/en/security/kernel.xml" + ewarn "https://wiki.gentoo.org/wiki/Project:Kernel_Security" fi # warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765) @@ -997,11 +1015,11 @@ unipatch() { done UNIPATCH_DROP+=" $(basename ${j})" done - else + else UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" - # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010 + # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010 if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then @@ -1013,7 +1031,14 @@ unipatch() { UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch" fi fi - fi + + # if kdbus use flag is not set, drop the kdbus patch + if [[ $UNIPATCH_DROP != *"5015_kdbus*.patch"* ]]; then + if ! has kdbus ${IUSE} || ! use kdbus; then + UNIPATCH_DROP="${UNIPATCH_DROP} 5015_kdbus*.patch" + fi + fi + fi done #populate KPATCH_DIRS so we know where to look to remove the excludes @@ -1065,9 +1090,10 @@ unipatch() { # https://bugs.gentoo.org/show_bug.cgi?id=507656 # #################################################################### if [[ ${PN} == "git-sources" ]] ; then - if [[ ${KV_MAJOR}${KV_PATCH} -ge 315 && ${RELEASETYPE} == -rc ]] ; then + if [[ ${KV_MAJOR} -gt 3 || ( ${KV_MAJOR} -eq 3 && ${KV_PATCH} -gt 15 ) && + ${RELEASETYPE} == -rc ]] ; then ebegin "Applying ${i/*\//} (-p1)" - if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then + if [ $(patch -p1 --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -le 2 ]; then eend 0 rm ${STDERR_T} break @@ -1217,6 +1243,8 @@ kernel-2_src_unpack() { universal_unpack debug-print "Doing unipatch" + # request UNIPATCH_LIST_GENPATCHES in phase since it calls 'use' + handle_genpatches --set-unipatch-list [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" diff --git a/sdk_container/src/third_party/portage-stable/eclass/libtool.eclass b/sdk_container/src/third_party/portage-stable/eclass/libtool.eclass index a92db7640a..9434480b25 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/libtool.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/libtool.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.112 2014/07/11 08:21:58 ulm Exp $ +# $Id$ # @ECLASS: libtool.eclass # @MAINTAINER: @@ -21,8 +21,9 @@ _LIBTOOL_ECLASS=1 # libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's # eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So # add a check to locate the ELT-patches/ regardless of what's going on. +# Note: Duplicated in eutils.eclass. _LIBTOOL_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*} -elt_patch_dir() { +libtool_elt_patch_dir() { local d="${ECLASSDIR}/ELT-patches" if [[ ! -d ${d} ]] ; then d="${_LIBTOOL_ECLASSDIR_LOCAL}/ELT-patches" @@ -92,7 +93,7 @@ ELT_walk_patches() { local ret=1 local file=$1 local patch_set=$2 - local patch_dir="$(elt_patch_dir)/${patch_set}" + local patch_dir="$(libtool_elt_patch_dir)/${patch_set}" local rem_int_dep=$3 [[ -z ${patch_set} ]] && return 1 @@ -106,7 +107,7 @@ ELT_walk_patches() { sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" ) fi - pushd "$(elt_patch_dir)" >/dev/null || die + pushd "$(libtool_elt_patch_dir)" >/dev/null || die # Go through the patches in reverse order (newer version to older) for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do diff --git a/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass b/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass index 90c87dcd01..16740a3126 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass @@ -1,10 +1,10 @@ -# Copyright 1999-2015 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.107 2015/06/02 07:39:52 vapier Exp $ +# $Id$ # @ECLASS: linux-info.eclass # @MAINTAINER: -# kernel-misc@gentoo.org +# kernel@gentoo.org # @AUTHOR: # Original author: John Mylchreest # @BLURB: eclass used for accessing kernel related information @@ -716,13 +716,15 @@ check_extra_config() { ewarn "to absence of any configured kernel sources or compiled" ewarn "config:" for config in ${CONFIG_CHECK}; do - local_error="ERROR_${config#\~}" + config=${config#\~} + config=${config#\!} + local_error="ERROR_${config}" msg="${!local_error}" - if [[ "x${msg}" == "x" ]]; then - local_error="WARNING_${config#\~}" + if [[ -z ${msg} ]]; then + local_error="WARNING_${config}" msg="${!local_error}" fi - ewarn " - ${config#\~}${msg:+ - }${msg}" + ewarn " - ${config}${msg:+ - }${msg}" done ewarn "You're on your own to make sure they are set if needed." export LINUX_CONFIG_EXISTS_DONE="${old_LINUX_CONFIG_EXISTS_DONE}" diff --git a/sdk_container/src/third_party/portage-stable/eclass/mount-boot.eclass b/sdk_container/src/third_party/portage-stable/eclass/mount-boot.eclass index c0a6890e5d..e8bd9f63be 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/mount-boot.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/mount-boot.eclass @@ -1,77 +1,129 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mount-boot.eclass,v 1.18 2011/01/09 03:18:38 vapier Exp $ -# +# $Id$ + +# @ECLASS: mount-boot.eclass +# @MAINTAINER: +# base-system@gentoo.org +# @BLURB: functions for packages that install files into /boot +# @DESCRIPTION: # This eclass is really only useful for bootloaders. # # If the live system has a separate /boot partition configured, then this # function tries to ensure that it's mounted in rw mode, exiting with an -# error if it cant. It does nothing if /boot isn't a separate partition. -# -# MAINTAINER: base-system@gentoo.org +# error if it can't. It does nothing if /boot isn't a separate partition. -EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_prerm pkg_postrm +EXPORT_FUNCTIONS pkg_pretend pkg_preinst pkg_postinst pkg_prerm pkg_postrm -mount-boot_mount_boot_partition() { - if [[ -n ${DONT_MOUNT_BOOT} ]] ; then - return - else - elog - elog "To avoid automounting and auto(un)installing with /boot," - elog "just export the DONT_MOUNT_BOOT variable." - elog +# @FUNCTION: mount-boot_disabled +# @INTERNAL +# @DESCRIPTION: +# Detect whether the current environment/build settings are such that we do not +# want to mess with any mounts. +mount-boot_is_disabled() { + # Since this eclass only deals with /boot, skip things when ROOT is active. + if [[ "${ROOT:-/}" != "/" ]] ; then + return 0 fi + # If we're only building a package, then there's no need to check things. + if [[ "${MERGE_TYPE}" == "buildonly" ]] ; then + return 0 + fi + + # The user wants us to leave things be. + if [[ -n ${DONT_MOUNT_BOOT} ]] ; then + return 0 + fi + + # OK, we want to handle things ourselves. + return 1 +} + +# @FUNCTION: mount-boot_check_status +# @INTERNAL +# @DESCRIPTION: +# Figure out what kind of work we need to do in order to have /boot be sane. +# Return values are: +# 0 - Do nothing at all! +# 1 - It's mounted, but is currently ro, so need to remount rw. +# 2 - It's not mounted, so need to mount it rw. +mount-boot_check_status() { + # Get out fast if possible. + mount-boot_is_disabled && return 0 + # note that /dev/BOOT is in the Gentoo default /etc/fstab file local fstabstate=$(awk '!/^#|^[[:blank:]]+#|^\/dev\/BOOT/ {print $2}' /etc/fstab | egrep "^/boot$" ) local procstate=$(awk '$2 ~ /^\/boot$/ {print $2}' /proc/mounts) local proc_ro=$(awk '{ print $2 " ," $4 "," }' /proc/mounts | sed -n '/\/boot .*,ro,/p') - if [ -n "${fstabstate}" ] && [ -n "${procstate}" ]; then - if [ -n "${proc_ro}" ]; then - einfo - einfo "Your boot partition, detected as being mounted as /boot, is read-only." - einfo "Remounting it in read-write mode ..." - einfo - mount -o remount,rw /boot - if [ "$?" -ne 0 ]; then - eerror - eerror "Unable to remount in rw mode. Please do it manually!" - eerror - die "Can't remount in rw mode. Please do it manually!" - fi - touch /boot/.e.remount + if [ -n "${fstabstate}" ] && [ -n "${procstate}" ] ; then + if [ -n "${proc_ro}" ] ; then + echo + einfo "Your boot partition, detected as being mounted at /boot, is read-only." + einfo "It will be remounted in read-write mode temporarily." + return 1 else - einfo - einfo "Your boot partition was detected as being mounted as /boot." + echo + einfo "Your boot partition was detected as being mounted at /boot." einfo "Files will be installed there for ${PN} to function correctly." - einfo + return 0 fi - elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ]; then - mount /boot -o rw - if [ "$?" -eq 0 ]; then - einfo - einfo "Your boot partition was not mounted as /boot, but portage" - einfo "was able to mount it without additional intervention." - einfo "Files will be installed there for ${PN} to function correctly." - einfo - else - eerror - eerror "Cannot automatically mount your /boot partition." - eerror "Your boot partition has to be mounted rw before the installation" - eerror "can continue. ${PN} needs to install important files there." - eerror - die "Please mount your /boot partition manually!" - fi - touch /boot/.e.mount + elif [ -n "${fstabstate}" ] && [ -z "${procstate}" ] ; then + echo + einfo "Your boot partition was not mounted at /boot, so it will be automounted for you." + einfo "Files will be installed there for ${PN} to function correctly." + return 2 else - einfo + echo einfo "Assuming you do not have a separate /boot partition." - einfo + return 0 fi } +mount-boot_pkg_pretend() { + # Get out fast if possible. + mount-boot_is_disabled && return 0 + + elog "To avoid automounting and auto(un)installing with /boot," + elog "just export the DONT_MOUNT_BOOT variable." + mount-boot_check_status +} + +mount-boot_mount_boot_partition() { + mount-boot_check_status + case $? in + 0) # Nothing to do. + ;; + 1) # Remount it rw. + mount -o remount,rw /boot + if [ $? -ne 0 ] ; then + echo + eerror "Unable to remount in rw mode. Please do it manually!" + die "Can't remount in rw mode. Please do it manually!" + fi + touch /boot/.e.remount + ;; + 2) # Mount it rw. + mount /boot -o rw + if [ $? -ne 0 ] ; then + echo + eerror "Cannot automatically mount your /boot partition." + eerror "Your boot partition has to be mounted rw before the installation" + eerror "can continue. ${PN} needs to install important files there." + die "Please mount your /boot partition manually!" + fi + touch /boot/.e.mount + ;; + esac +} + mount-boot_pkg_preinst() { + # Handle older EAPIs. + case ${EAPI:-0} in + [0-3]) mount-boot_pkg_pretend ;; + esac + mount-boot_mount_boot_partition } @@ -82,20 +134,15 @@ mount-boot_pkg_prerm() { } mount-boot_umount_boot_partition() { - if [[ -n ${DONT_MOUNT_BOOT} ]] ; then - return - fi + # Get out fast if possible. + mount-boot_is_disabled && return 0 if [ -e /boot/.e.remount ] ; then - einfo - einfo "Automatically remounting /boot as ro" - einfo + einfo "Automatically remounting /boot as ro as it was previously." rm -f /boot/.e.remount mount -o remount,ro /boot elif [ -e /boot/.e.mount ] ; then - einfo - einfo "Automatically unmounting /boot" - einfo + einfo "Automatically unmounting /boot as it was previously." rm -f /boot/.e.mount umount /boot fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/multibuild.eclass b/sdk_container/src/third_party/portage-stable/eclass/multibuild.eclass index d9a86e920a..3d05f46d2a 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/multibuild.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/multibuild.eclass @@ -1,8 +1,8 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.20 2014/12/13 08:42:42 mgorny Exp $ +# $Id$ -# @ECLASS: multibuild +# @ECLASS: multibuild.eclass # @MAINTAINER: # Michał Górny # @AUTHOR: @@ -17,7 +17,7 @@ case "${EAPI:-0}" in 0|1|2|3) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; - 4|5) + 4|5|6) ;; *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" @@ -146,6 +146,8 @@ multibuild_foreach_variant() { multibuild_parallel_foreach_variant() { debug-print-function ${FUNCNAME} "${@}" + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}" + multibuild_foreach_variant "${@}" } @@ -193,7 +195,7 @@ multibuild_copy_sources() { _multibuild_create_source_copy() { einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}" - cp -pr "${cp_args[@]}" \ + cp -p -R "${cp_args[@]}" \ "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die } diff --git a/sdk_container/src/third_party/portage-stable/eclass/multilib-build.eclass b/sdk_container/src/third_party/portage-stable/eclass/multilib-build.eclass index 3509366fbd..deb03dbdd9 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/multilib-build.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/multilib-build.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.65 2014/12/13 08:41:37 mgorny Exp $ +# $Id$ # @ECLASS: multilib-build.eclass # @MAINTAINER: @@ -21,10 +21,11 @@ if [[ ! ${_MULTILIB_BUILD} ]]; then # EAPI=4 is required for meaningful MULTILIB_USEDEP. case ${EAPI:-0} in - 4|5) ;; + 4|5|6) ;; *) die "EAPI=${EAPI} is not supported" ;; esac +[[ ${EAPI} == [45] ]] && inherit eutils inherit multibuild multilib # @ECLASS-VARIABLE: _MULTILIB_FLAGS @@ -49,6 +50,7 @@ _MULTILIB_FLAGS=( abi_s390_32:s390 abi_s390_64:s390x ) +readonly _MULTILIB_FLAGS # @ECLASS-VARIABLE: MULTILIB_COMPAT # @DEFAULT_UNSET @@ -124,8 +126,10 @@ _multilib_build_set_globals() { IUSE=${flags[*]} MULTILIB_USEDEP=${usedeps// /,} + readonly MULTILIB_USEDEP } _multilib_build_set_globals +unset -f _multilib_build_set_globals # @FUNCTION: multilib_get_enabled_abis # @DESCRIPTION: @@ -196,9 +200,10 @@ _multilib_multibuild_wrapper() { debug-print-function ${FUNCNAME} "${@}" local ABI=${MULTIBUILD_VARIANT#*.} - local MULTILIB_ABI_FLAG=${MULTIBUILD_VARIANT%.*} + local -r MULTILIB_ABI_FLAG=${MULTIBUILD_VARIANT%.*} multilib_toolchain_setup "${ABI}" + readonly ABI "${@}" } @@ -244,6 +249,8 @@ multilib_parallel_foreach_abi() { multilib_for_best_abi() { debug-print-function ${FUNCNAME} "${@}" + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead" + eqawarn "QA warning: multilib_for_best_abi() function is deprecated and should" eqawarn "not be used. The multilib_is_native_abi() check may be used instead." @@ -261,19 +268,24 @@ multilib_for_best_abi() { # runs (if any). Dies if header files differ. multilib_check_headers() { _multilib_header_cksum() { - [[ -d ${ED}usr/include ]] && \ - find "${ED}"usr/include -type f \ - -exec cksum {} + | sort -k2 + set -o pipefail + + if [[ -d ${ED}usr/include ]]; then + find "${ED}"usr/include -type f \ + -exec cksum {} + | sort -k2 + fi } - local cksum=$(_multilib_header_cksum) + local cksum cksum_prev local cksum_file=${T}/.multilib_header_cksum + cksum=$(_multilib_header_cksum) || die + unset -f _multilib_header_cksum if [[ -f ${cksum_file} ]]; then - local cksum_prev=$(< "${cksum_file}") + cksum_prev=$(< "${cksum_file}") || die if [[ ${cksum} != ${cksum_prev} ]]; then - echo "${cksum}" > "${cksum_file}.new" + echo "${cksum}" > "${cksum_file}.new" || die eerror "Header files have changed between ABIs." @@ -287,7 +299,7 @@ multilib_check_headers() { die "Header checksum mismatch, aborting." fi else - echo "${cksum}" > "${cksum_file}" + echo "${cksum}" > "${cksum_file}" || die fi } @@ -408,9 +420,9 @@ multilib_prepare_wrappers() { if [[ -L ${root}/${f} ]]; then # rewrite the symlink target - local target=$(readlink "${root}/${f}") - local target_dir - local target_fn=${target##*/} + local target + target=$(readlink "${root}/${f}") || die + local target_dir target_fn=${target##*/} [[ ${target} == */* ]] && target_dir=${target%/*} @@ -452,7 +464,7 @@ multilib_prepare_wrappers() { if [[ ! -f ${ED}/tmp/multilib-include${f} ]]; then dodir "/tmp/multilib-include${dir}" # a generic template - cat > "${wrapper}" <<_EOF_ + cat > "${wrapper}" <<_EOF_ || die /* This file is auto-generated by multilib-build.eclass * as a multilib-friendly wrapper. For the original content, * please see the files that are #included below. @@ -513,14 +525,6 @@ _EOF_ sed -e "/${MULTILIB_ABI_FLAG} /s&error.*&include <${CHOST}${f}>&" \ -i "${wrapper}" || die - # Hack for emul-linux-x86 compatibility. - # It assumes amd64 will come after x86, and will use amd64 - # headers if no specific x86 headers were installed. - if [[ ${ABI} == amd64 ]]; then - sed -e "/abi_x86_32 /s&error.*&include <${CHOST}${f}>&" \ - -i "${wrapper}" || die - fi - # Needed for swig. if multilib_is_native_abi; then sed -e "/Native ABI/s&error.*&include <${CHOST}${f}>&" \ @@ -581,6 +585,8 @@ multilib_is_native_abi() { multilib_build_binaries() { debug-print-function ${FUNCNAME} "${@}" + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use multilib_is_native_abi() instead" + eqawarn "QA warning: multilib_build_binaries is deprecated. Please use the equivalent" eqawarn "multilib_is_native_abi function instead." diff --git a/sdk_container/src/third_party/portage-stable/eclass/multilib-minimal.eclass b/sdk_container/src/third_party/portage-stable/eclass/multilib-minimal.eclass index e1a5ac422a..127614da1e 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/multilib-minimal.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/multilib-minimal.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-minimal.eclass,v 1.10 2014/12/13 08:41:37 mgorny Exp $ +# $Id$ # @ECLASS: multilib-minimal.eclass # @MAINTAINER: @@ -25,12 +25,13 @@ # EAPI=4 is required for meaningful MULTILIB_USEDEP. case ${EAPI:-0} in - 4|5) ;; + 4|5|6) ;; *) die "EAPI=${EAPI} is not supported" ;; esac -inherit eutils multilib-build +[[ ${EAPI} == [45] ]] && inherit eutils +inherit multilib-build EXPORT_FUNCTIONS src_configure src_compile src_test src_install diff --git a/sdk_container/src/third_party/portage-stable/eclass/multilib.eclass b/sdk_container/src/third_party/portage-stable/eclass/multilib.eclass index b32a95563e..69582b652c 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/multilib.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/multilib.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.107 2015/05/26 14:25:16 ottxor Exp $ +# $Id$ # @ECLASS: multilib.eclass # @MAINTAINER: @@ -49,15 +49,17 @@ has_multilib_profile() { # fall back on old behavior. Any profile that has these set should also # depend on a newer version of portage (not yet released) which uses these # over CONF_LIBDIR in econf, dolib, etc... -get_libdir() { - local CONF_LIBDIR - if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then - # if there is an override, we want to use that... always. - echo ${CONF_LIBDIR_OVERRIDE} - else - get_abi_LIBDIR - fi -} +if has "${EAPI:-0}" 0 1 2 3 4 5; then + get_libdir() { + local CONF_LIBDIR + if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then + # if there is an override, we want to use that... always. + echo ${CONF_LIBDIR_OVERRIDE} + else + get_abi_LIBDIR + fi + } +fi # @FUNCTION: get_abi_var # @USAGE: [ABI] diff --git a/sdk_container/src/third_party/portage-stable/eclass/multiprocessing.eclass b/sdk_container/src/third_party/portage-stable/eclass/multiprocessing.eclass index 3890f9197d..06e004aa16 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/multiprocessing.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/multiprocessing.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.9 2014/07/11 08:21:58 ulm Exp $ +# $Id$ # @ECLASS: multiprocessing.eclass # @MAINTAINER: @@ -86,9 +86,10 @@ makeopts_loadavg() { # This assumes the first .* will be more greedy than the second .* # since POSIX doesn't specify a non-greedy match (i.e. ".*?"). local lavg=$(echo " $* " | sed -r -n \ - -e 's:.*[[:space:]](-l|--load-average[=[:space:]])[[:space:]]*([0-9]+|[0-9]+\.[0-9]+)[^0-9.]*:\2:p' \ - -e 's:.*[[:space:]](-l|--load-average)[[:space:]].*:999:p') - echo ${lavg:-1} + -e 's:.*[[:space:]](-l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+|[0-9]+\.[0-9]+).*:\3:p' \ + -e 's:.*[[:space:]](-l|--(load-average|max-load))[[:space:]].*:999:p') + # Default to 999 since the default is to not use a load limit. + echo ${lavg:-999} } # @FUNCTION: multijob_init diff --git a/sdk_container/src/third_party/portage-stable/eclass/mysql-multilib-r1.eclass b/sdk_container/src/third_party/portage-stable/eclass/mysql-multilib-r1.eclass index 1512b21d4d..65ebe85a2a 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/mysql-multilib-r1.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/mysql-multilib-r1.eclass @@ -38,15 +38,21 @@ MYSQL_EXTRAS="" # @DESCRIPTION: # An array of CMake arguments added to native and non-native -inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} mysql_fx versionator \ - multilib prefix toolchain-funcs user cmake-utils multilib-minimal +# Keeping eutils in EAPI=6 for emktemp in pkg_config + +inherit eutils systemd flag-o-matic ${MYSQL_EXTRAS} versionator \ + prefix toolchain-funcs user cmake-utils multilib-minimal + +if [[ "${EAPI}x" == "5x" ]]; then + inherit multilib mysql_fx +fi # # Supported EAPI versions and export functions # case "${EAPI:-0}" in - 5) ;; + 5|6) ;; *) die "Unsupported EAPI: ${EAPI}" ;; esac @@ -82,19 +88,18 @@ if [[ -z ${MYSQL_PV_MAJOR} ]] ; then MYSQL_PV_MAJOR="$(get_version_component_ran # depend on this variable. # In particular, the code below transforms a $PVR like "5.0.18-r3" in "5001803" # We also strip off upstream's trailing letter that they use to respin tarballs -MYSQL_VERSION_ID="" -tpv="${PV%[a-z]}" -tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" -for vatom in 0 1 2 3 ; do - # pad to length 2 - tpv[${vatom}]="00${tpv[${vatom}]}" - MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" -done -# strip leading "0" (otherwise it's considered an octal number by BASH) -MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} - -# This eclass should only be used with at least mysql-5.5.35 -mysql_version_is_at_least "5.5.35" || die "This eclass should only be used with >=mysql-5.5.35" +if [[ "${EAPI}x" == "5x" ]]; then + MYSQL_VERSION_ID="" + tpv="${PV%[a-z]}" + tpv=( ${tpv//[-._]/ } ) ; tpv[3]="${PVR:${#PV}}" ; tpv[3]="${tpv[3]##*-r}" + for vatom in 0 1 2 3 ; do + # pad to length 2 + tpv[${vatom}]="00${tpv[${vatom}]}" + MYSQL_VERSION_ID="${MYSQL_VERSION_ID}${tpv[${vatom}]:0-2}" + done + # strip leading "0" (otherwise it's considered an octal number by BASH) + MYSQL_VERSION_ID=${MYSQL_VERSION_ID##"0"} +fi # Work out the default SERVER_URI correctly if [[ -z ${SERVER_URI} ]]; then @@ -223,7 +228,7 @@ mysql-multilib-r1_pkg_pretend() { if [[ ${MERGE_TYPE} != binary ]] ; then local GCC_MAJOR_SET=$(gcc-major-version) local GCC_MINOR_SET=$(gcc-minor-version) - if use_if_iuse tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ + if in_iuse tokudb && use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \ ${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then eerror "${PN} with tokudb needs to be built with gcc-4.7 or later." eerror "Please use gcc-config to switch to gcc-4.7 or later version." @@ -285,14 +290,16 @@ mysql-multilib-r1_src_prepare() { if [[ ${MY_EXTRAS_VER} != none ]]; then # Apply the patches for this MySQL version - EPATCH_SUFFIX="patch" - mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" - # Clean out old items - rm -f "${EPATCH_SOURCE}"/* - # Now link in right patches - mysql_mv_patches - # And apply - epatch + if [[ "${EAPI}x" == "5x" ]]; then + EPATCH_SUFFIX="patch" + mkdir -p "${EPATCH_SOURCE}" || die "Unable to create epatch directory" + # Clean out old items + rm -f "${EPATCH_SOURCE}"/* + # Now link in right patches + mysql_mv_patches + # And apply + epatch + fi fi # last -fPIC fixup, per bug #305873 @@ -332,7 +339,11 @@ mysql-multilib-r1_src_prepare() { rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga" fi - epatch_user + if [[ "${EAPI}x" == "5x" ]] ; then + epatch_user + else + default + fi } # @FUNCTION: mysql-multilib-r1_src_configure @@ -342,7 +353,7 @@ mysql-multilib-r1_src_configure() { # Bug #114895, bug #110149 filter-flags "-O" "-O[01]" - append-cxxflags -felide-constructors -fno-rtti + append-cxxflags -felide-constructors # bug #283926, with GCC4.4, this is required to get correct behavior. append-flags -fno-strict-aliasing @@ -388,7 +399,7 @@ multilib_src_configure() { -DINSTALL_UNIX_ADDRDIR=${EPREFIX}/var/run/mysqld/mysqld.sock -DWITH_DEFAULT_COMPILER_OPTIONS=0 -DWITH_DEFAULT_FEATURE_SET=0 - -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_unitdir)" + -DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)" ) if in_iuse systemd ; then @@ -680,7 +691,7 @@ mysql-multilib-r1_pkg_postinst() { fi done - if use_if_iuse pam ; then + if in_iuse pam && use pam; then einfo elog "This install includes the PAM authentication plugin." elog "To activate and configure the PAM plugin, please read:" @@ -708,7 +719,7 @@ mysql-multilib-r1_pkg_postinst() { einfo fi - if use_if_iuse galera ; then + if in_iuse galera && use galera ; then einfo elog "Be sure to edit the my.cnf file to activate your cluster settings." elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\"" @@ -1038,9 +1049,80 @@ mysql-multilib-r1_disable_test() { # and some check WITHOUT_. Also, this can easily extend to non-storage plugins. mysql-cmake_use_plugin() { [[ -z $2 ]] && die "mysql-cmake_use_plugin " - if use_if_iuse $1 ; then + if in_iuse $1 && use $1 ; then echo "-DWITH_$2=1 -DPLUGIN_$2=YES" else echo "-DWITHOUT_$2=1 -DWITH_$2=0 -DPLUGIN_$2=NO" fi } + +# @FUNCTION: mysql_init_vars +# @DESCRIPTION: +# void mysql_init_vars() +# Initialize global variables +# 2005-11-19 +if [[ "${EAPI}x" != "5x" ]]; then + +mysql_init_vars() { + MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mysql"} + MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"} + MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"} + MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"} + MY_INCLUDEDIR=${MY_INCLUDEDIR="${EPREFIX}/usr/include/mysql"} + MY_LIBDIR=${MY_LIBDIR="${EPREFIX}/usr/$(get_libdir)/mysql"} + + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" + if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + | sed -e 's/.*=\s*//' \ + | tail -n1` + fi + fi + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" + fi + elog "MySQL MY_DATADIR is ${MY_DATADIR}" + + if [[ -z "${PREVIOUS_DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then + # If you get this and you're wondering about it, see bug #207636 + elog "MySQL datadir found in ${MY_DATADIR}" + elog "A new one will not be created." + PREVIOUS_DATADIR="yes" + else + PREVIOUS_DATADIR="no" + fi + export PREVIOUS_DATADIR + fi + else + if [[ ${EBUILD_PHASE} == "config" ]]; then + local new_MY_DATADIR + new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + | sed -ne '/datadir/s|^--datadir=||p' \ + | tail -n1` + + if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then + ewarn "MySQL MY_DATADIR has changed" + ewarn "from ${MY_DATADIR}" + ewarn "to ${new_MY_DATADIR}" + MY_DATADIR="${new_MY_DATADIR}" + fi + fi + fi + + if [ "${MY_SOURCEDIR:-unset}" == "unset" ]; then + MY_SOURCEDIR=${SERVER_URI##*/} + MY_SOURCEDIR=${MY_SOURCEDIR%.tar*} + fi + + export MY_SHAREDSTATEDIR MY_SYSCONFDIR + export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR + export MY_INCLUDEDIR MY_DATADIR MY_SOURCEDIR +} +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/oasis.eclass b/sdk_container/src/third_party/portage-stable/eclass/oasis.eclass index 7a341ceb4c..6299f28c30 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/oasis.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/oasis.eclass @@ -62,7 +62,8 @@ IUSE="+ocamlopt" [ -n "${OASIS_BUILD_DOCS}" ] && IUSE="${IUSE} doc" [ -n "${OASIS_BUILD_TESTS}" ] && IUSE="${IUSE} test" -DEPEND="${RDEPEND}" +DEPEND="${RDEPEND} + || ( dev-ml/ocamlbuild < variable > diff --git a/sdk_container/src/third_party/portage-stable/eclass/perl-functions.eclass b/sdk_container/src/third_party/portage-stable/eclass/perl-functions.eclass new file mode 100644 index 0000000000..7568473183 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/perl-functions.eclass @@ -0,0 +1,281 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: perl-functions.eclass +# @MAINTAINER: +# perl@gentoo.org +# @AUTHOR: +# Seemant Kulleen +# Andreas K. Huettel +# @BLURB: helper functions eclass for perl modules +# @DESCRIPTION: +# The perl-functions eclass is designed to allow easier installation of perl +# modules, and their incorporation into the Gentoo Linux system. +# It provides helper functions, no phases or variable manipulation in +# global scope. + +[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives + +case "${EAPI:-0}" in + 5|6) + ;; + *) + die "EAPI=${EAPI} is not supported by perl-functions.eclass" + ;; +esac + +perlinfo_done=false + +# @FUNCTION: perl_set_version +# @USAGE: perl_set_version +# @DESCRIPTION: +# Extract version information and installation paths from the current Perl +# interpreter. +# +# This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB, +# ARCH_LIB, VENDOR_LIB, VENDOR_ARCH +# +# This function used to be called perlinfo as well. +perl_set_version() { + debug-print-function $FUNCNAME "$@" + debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}" + ${perlinfo_done} && return 0 + perlinfo_done=true + + local f version install{{site,vendor}{arch,lib},archlib} + eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )" + PERL_VERSION=${version} + SITE_ARCH=${installsitearch} + SITE_LIB=${installsitelib} + ARCH_LIB=${installarchlib} + VENDOR_LIB=${installvendorlib} + VENDOR_ARCH=${installvendorarch} +} + +# @FUNCTION: perl_delete_localpod +# @USAGE: perl_delete_localpod +# @DESCRIPTION: +# Remove stray perllocal.pod files in the temporary install directory D. +# +# This function used to be called fixlocalpod as well. +perl_delete_localpod() { + debug-print-function $FUNCNAME "$@" + + find "${D}" -type f -name perllocal.pod -delete + find "${D}" -depth -mindepth 1 -type d -empty -delete +} + +# @FUNCTION: perl_fix_osx_extra +# @USAGE: perl_fix_osx_extra +# @DESCRIPTION: +# Look through ${S} for AppleDouble encoded files and get rid of them. +perl_fix_osx_extra() { + debug-print-function $FUNCNAME "$@" + + local f + find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do + einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}" + rm -f "${f}" + f=${f#${S}/} + grep -q "${f}" "${S}"/MANIFEST && \ + elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}" + done +} + +# @FUNCTION: perl_delete_module_manpages +# @USAGE: perl_delete_module_manpages +# @DESCRIPTION: +# Bump off manpages installed by the current module such as *.3pm files as well +# as empty directories. +perl_delete_module_manpages() { + debug-print-function $FUNCNAME "$@" + + if [[ -d "${ED}"/usr/share/man ]] ; then + find "${ED}"/usr/share/man -type f -name "*.3pm" -delete + find "${ED}"/usr/share/man -depth -type d -empty -delete + fi +} + +# @FUNCTION: perl_delete_packlist +# @USAGE: perl_delete_packlist +# @DESCRIPTION: +# Look through ${D} for .packlist files, empty .bs files and empty directories, +# and get rid of items found. +perl_delete_packlist() { + debug-print-function $FUNCNAME "$@" + perl_set_version + if [[ -d ${D}/${VENDOR_ARCH} ]] ; then + find "${D}/${VENDOR_ARCH}" -type f -a -name .packlist -delete + perl_delete_emptybsdir + fi +} + +# @FUNCTION: perl_delete_emptybsdir +# @USAGE: perl_delete_emptybsdir +# @DESCRIPTION: +# Look through ${D} for empty .bs files and empty directories, +# and get rid of items found. +perl_delete_emptybsdir() { + debug-print-function $FUNCNAME "$@" + perl_set_version + if [[ -d ${D}/${VENDOR_ARCH} ]] ; then + find "${D}/${VENDOR_ARCH}" -type f \ + -a -name '*.bs' -a -empty -delete + find "${D}" -depth -mindepth 1 -type d -empty -delete + fi +} + +# @FUNCTION: perl_fix_packlist +# @USAGE: perl_fix_packlist +# @DESCRIPTION: +# Look through ${D} for .packlist text files containing the temporary installation +# folder (i.e. ${D}). If the pattern is found, silently replace it with `/'. +perl_fix_packlist() { + debug-print-function $FUNCNAME "$@" + + find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f ; do + if file "${f}" | grep -q -i " text" ; then + sed -i -e "s:${D}:/:g" "${f}" + fi + done +} + +# @FUNCTION: perl_remove_temppath +# @USAGE: perl_remove_temppath +# @DESCRIPTION: +# Look through ${D} for text files containing the temporary installation +# folder (i.e. ${D}). If the pattern is found, replace it with `/' and warn. +perl_remove_temppath() { + debug-print-function $FUNCNAME "$@" + + find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do + if file "${f}" | grep -q -i " text" ; then + grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}" + sed -i -e "s:${D}:/:g" "${f}" + fi + done +} + +# @FUNCTION: perl_rm_files +# @USAGE: perl_rm_files "file_1" "file_2" +# @DESCRIPTION: +# Remove certain files from a Perl release and remove them from the MANIFEST +# while we're there. +# +# Most useful in src_prepare for nuking bad tests, and is highly recommended +# for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they +# test is completely irrelevant to end users, and frequently fail simply +# because the authors of Test::Pod... changed their recommendations, and thus +# failures are only useful feedback to Authors, not users. +# +# Removing from MANIFEST also avoids needless log messages warning +# users about files "missing from their kit". +perl_rm_files() { + debug-print-function $FUNCNAME "$@" + local skipfile="${T}/.gentoo_makefile_skip" + local manifile="${S}/MANIFEST" + local manitemp="${T}/.gentoo_manifest_temp" + oldifs="$IFS" + IFS="\n" + for filename in "$@"; do + einfo "Removing un-needed ${filename}"; + # Remove the file + rm -f "${S}/${filename}" + [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}" + done + if [[ -e "${manifile}" && -e "${skipfile}" ]]; then + einfo "Fixing Manifest" + grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}" + mv -f -- "${manitemp}" "${manifile}" + rm -- "${skipfile}"; + fi + IFS="$oldifs" +} + +# @FUNCTION: perl_link_duallife_scripts +# @USAGE: perl_link_duallife_scripts +# @DESCRIPTION: +# Moves files and generates symlinks so dual-life packages installing scripts do not +# lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes +# only sense for perl-core packages. +perl_link_duallife_scripts() { + debug-print-function $FUNCNAME "$@" + if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then + return 0 + fi + + local i ff + if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then + for i in "${DUALLIFESCRIPTS[@]}" ; do + alternatives_auto_makesym "/${i}" "/${i}-[0-9]*" + done + for i in "${DUALLIFEMAN[@]}" ; do + ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*` + ff=${ff##*.1} + alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*" + done + else + pushd "${ED}" > /dev/null + for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do + mv ${i}{,-${PV}-${P}} || die + #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/} + DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i} + done + for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do + mv ${i} ${i%.1}-${PV}-${P}.1 || die + DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i} + done + popd > /dev/null + fi +} + +# @FUNCTION: perl_check_env +# @USAGE: perl_check_env +# @DESCRIPTION: +# Checks a blacklist of known-suspect ENV values that can be accidentally set by users +# doing personal perl work, which may accidentally leak into portage and break the +# system perl installaton. +# Dies if any of the suspect fields are found, and tell the user what needs to be unset. +# There's a workaround, but you'll have to read the code for it. +perl_check_env() { + local errored value; + + for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do + # Next unless match + [ -v $i ] || continue; + + # Warn only once, and warn only when one of the bad values are set. + # record failure here. + if [ ${errored:-0} == 0 ]; then + if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then + elog "perl-module.eclass: Suspicious environment values found."; + else + eerror "perl-module.eclass: Suspicious environment values found."; + fi + fi + errored=1 + + # Read ENV Value + eval "value=\$$i"; + + # Print ENV name/value pair + if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then + elog " $i=\"$value\""; + else + eerror " $i=\"$value\""; + fi + done + + # Return if there were no failures + [ ${errored:-0} == 0 ] && return; + + # Return if user knows what they're doing + if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then + elog "Continuing anyway, seems you know what you're doing." + return + fi + + eerror "Your environment settings may lead to undefined behavior and/or build failures." + die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details." +} diff --git a/sdk_container/src/third_party/portage-stable/eclass/perl-module.eclass b/sdk_container/src/third_party/portage-stable/eclass/perl-module.eclass index 947e79a1fe..8b2f3a44b6 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/perl-module.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/perl-module.eclass @@ -1,25 +1,48 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.166 2015/06/13 19:01:10 dilfridge Exp $ +# $Id$ # @ECLASS: perl-module.eclass # @MAINTAINER: # perl@gentoo.org # @AUTHOR: # Seemant Kulleen -# @BLURB: eclass for perl modules +# Andreas K. Hüttel +# @BLURB: eclass for installing Perl module distributions # @DESCRIPTION: -# The perl-module eclass is designed to allow easier installation of perl -# modules, and their incorporation into the Gentoo Linux system. +# The perl-module eclass is designed to allow easier installation of Perl +# module distributions, and their incorporation into the Gentoo Linux system. +# All exported functions from perl-functions.eclass (inherited here) +# explicitly also belong to the interface of perl-module.eclass. +# If your package does not use any Perl-specific build system (as, e.g., +# ExtUtils::MakeMaker or Module::Build), we recommend to use perl-functions.eclass +# instead. -inherit eutils multiprocessing unpacker -[[ ${CATEGORY} == "perl-core" ]] && inherit alternatives - -PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install" - -case "${EAPI:-0}" in +case ${EAPI:-0} in 5) - [[ ${CATEGORY} == "perl-core" ]] && \ + inherit eutils multiprocessing unpacker perl-functions + PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install" + ;; + 6) + inherit multiprocessing perl-functions + PERL_EXPF="src_prepare src_configure src_compile src_test src_install" + ;; + *) + die "EAPI=${EAPI} is not supported by perl-module.eclass" + ;; +esac + +# @ECLASS-VARIABLE: GENTOO_DEPEND_ON_PERL +# @DESCRIPTION: +# This variable controls whether a runtime and build time dependency on +# dev-lang/perl is automatically added by the eclass. It defaults to yes. +# Set to no to disable, set to noslotop to add a perl dependency without +# slot operator (EAPI=6). All packages installing into the vendor_perl +# path must use yes here. + +case ${EAPI:-0} in + 5) + [[ ${CATEGORY} == perl-core ]] && \ PERL_EXPF+=" pkg_postinst pkg_postrm" case "${GENTOO_DEPEND_ON_PERL:-yes}" in @@ -35,44 +58,112 @@ case "${EAPI:-0}" in RDEPEND="${DEPEND}" ;; esac - ;; - *) - die "EAPI=${EAPI} is not supported by perl-module.eclass" - ;; -esac -case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in - yes) + case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in + yes) + EXPORT_FUNCTIONS ${PERL_EXPF} + ;; + no) + debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no" + ;; + *) + die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass" + ;; + esac + ;; + 6) + [[ ${CATEGORY} == perl-core ]] && \ + PERL_EXPF+=" pkg_postinst pkg_postrm" + + case "${GENTOO_DEPEND_ON_PERL:-yes}" in + yes) + DEPEND="dev-lang/perl:=" + RDEPEND="dev-lang/perl:=" + ;; + noslotop) + DEPEND="dev-lang/perl" + RDEPEND="dev-lang/perl" + ;; + esac + + if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT}" ]]; then + eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT is banned in EAPI=6. If you don't want a slot operator" + die "set GENTOO_DEPEND_ON_PERL=noslotop instead." + fi + + if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then + eerror "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6. Use perl-module.eclass if you need" + die "phase functions, perl-functions.eclass if not." + fi + EXPORT_FUNCTIONS ${PERL_EXPF} ;; - no) - debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no" - ;; *) - die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass" + die "EAPI=${EAPI:-0} is not supported by perl-module.eclass" ;; esac LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}" -if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then - : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}} - S=${MY_S:-${WORKDIR}/${MY_P}} +# @ECLASS-VARIABLE: DIST_NAME +# @DESCRIPTION: +# (EAPI=6) This variable provides a way to override PN for the calculation of S, +# SRC_URI, and HOMEPAGE. Defaults to PN. + +# @ECLASS-VARIABLE: DIST_VERSION +# @DESCRIPTION: +# (EAPI=6) This variable provides a way to override PV for the calculation of S and SRC_URI. +# Use it to provide the non-normalized, upstream version number. Defaults to PV. +# Named MODULE_VERSION in EAPI=5. + +# @ECLASS-VARIABLE: DIST_A_EXT +# @DESCRIPTION: +# (EAPI=6) This variable provides a way to override the distfile extension for the calculation of +# SRC_URI. Defaults to tar.gz. Named MODULE_A_EXT in EAPI=5. + +# @ECLASS-VARIABLE: DIST_A +# @DESCRIPTION: +# (EAPI=6) This variable provides a way to override the distfile name for the calculation of +# SRC_URI. Defaults to ${DIST_NAME}-${DIST_VERSION}.${DIST_A_EXT} Named MODULE_A in EAPI=5. + +# @ECLASS-VARIABLE: DIST_AUTHOR +# @DESCRIPTION: +# (EAPI=6) This variable sets the module author name for the calculation of +# SRC_URI. Named MODULE_AUTHOR in EAPI=5. + +if [[ ${EAPI:-0} == 5 ]]; then + if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then + : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}} + S=${MY_S:-${WORKDIR}/${MY_P}} + fi + MODULE_NAME=${MY_PN:-${PN}} + MODULE_P=${MY_P:-${P}} + + [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \ + MODULE_A="${MODULE_P}.${MODULE_A_EXT:-tar.gz}" + [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ + SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" + [[ -z "${HOMEPAGE}" ]] && \ + HOMEPAGE="http://search.cpan.org/dist/${MODULE_NAME}/" + + SRC_TEST="skip" +else + DIST_NAME=${DIST_NAME:-${PN}} + DIST_P=${DIST_NAME}-${DIST_VERSION:-${PV}} + S=${WORKDIR}/${DIST_P} + + [[ -z "${SRC_URI}" && -z "${DIST_A}" ]] && \ + DIST_A="${DIST_P}.${DIST_A_EXT:-tar.gz}" + [[ -z "${SRC_URI}" && -n "${DIST_AUTHOR}" ]] && \ + SRC_URI="mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${DIST_SECTION:+${DIST_SECTION}/}${DIST_A}" + [[ -z "${HOMEPAGE}" ]] && \ + HOMEPAGE="http://search.cpan.org/dist/${DIST_NAME}/" fi -[[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \ - MODULE_A="${MY_P:-${P}}.${MODULE_A_EXT:-tar.gz}" -[[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \ - SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}" -[[ -z "${HOMEPAGE}" ]] && \ - HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/" - SRC_PREP="no" -SRC_TEST="skip" PREFER_BUILDPL="yes" pm_echovar="" -perlinfo_done=false # @FUNCTION: perl-module_src_unpack # @USAGE: perl-module_src_unpack @@ -81,7 +172,7 @@ perlinfo_done=false # This function is to be called during the ebuild src_unpack() phase. perl-module_src_unpack() { debug-print-function $FUNCNAME "$@" - + [[ ${EAPI:-0} == 5 ]] || die "perl-module_src_unpack is banned in EAPI=6 or later" unpacker_src_unpack } @@ -92,15 +183,20 @@ perl-module_src_unpack() { # This function is to be called during the ebuild src_prepare() phase. perl-module_src_prepare() { debug-print-function $FUNCNAME "$@" - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - debug-print "$FUNCNAME: applying user patches" - epatch_user + + if [[ ${EAPI:-0} == 5 ]] ; then + [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" + debug-print "$FUNCNAME: applying user patches" + epatch_user + else + default + fi + if [[ ${PERL_RM_FILES[@]} ]]; then debug-print "$FUNCNAME: stripping unneeded files" perl_rm_files "${PERL_RM_FILES[@]}" fi perl_fix_osx_extra - esvn_clean } # @FUNCTION: perl-module_src_configure @@ -111,7 +207,9 @@ perl-module_src_prepare() { perl-module_src_configure() { debug-print-function $FUNCNAME "$@" - [[ ${SRC_PREP} = yes ]] && return 0 + if [[ ${EAPI:-0} == 5 && ${SRC_PREP} == yes ]]; then + return 0 + fi SRC_PREP="yes" perl_check_env @@ -132,29 +230,21 @@ perl-module_src_configure() { if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then einfo "Using Module::Build::Tiny" if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then - eqawarn "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it." - eqawarn " Add dev-perl/Module-Build-Tiny to DEPEND!" - if [[ -n ${PERLQAFATAL} ]]; then - eerror "Bailing out due to PERLQAFATAL=1"; - die - fi + eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it." + die " Add dev-perl/Module-Build-Tiny to DEPEND!" fi else einfo "Using Module::Build" if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${DEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then - eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it." - eqawarn " Add dev-perl/Module-Build to DEPEND!" - if [[ -n ${PERLQAFATAL} ]]; then - eerror "Bailing out due to PERLQAFATAL=1"; - die - fi + eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it." + die " Add dev-perl/Module-Build to DEPEND!" fi fi set -- \ --installdirs=vendor \ --libdoc= \ --destdir="${D}" \ - --create_packlist=0 \ + --create_packlist=1 \ "${myconf_local[@]}" einfo "perl Build.PL" "$@" perl Build.PL "$@" <<< "${pm_echovar}" \ @@ -206,42 +296,81 @@ perl-module_src_compile() { fi } +# @ECLASS-VARIABLE: DIST_TEST +# @DESCRIPTION: +# (EAPI=6) Variable that controls if tests are run in the test phase +# at all, and if yes under which conditions. Defaults to "do parallel" +# If neither "do" nor "parallel" is recognized, tests are skipped. +# (In EAPI=5 the variable is called SRC_TEST, defaults to "skip", and +# recognizes fewer options.) +# The following space-separated keywords are recognized: +# do : run tests +# parallel : run tests in parallel +# verbose : increase test verbosity +# network : do not try to disable network tests + +# @ECLASS-VARIABLE: DIST_TEST_OVERRIDE +# @DESCRIPTION: +# (EAPI=6) Variable that controls if tests are run in the test phase +# at all, and if yes under which conditions. It is intended for use in +# make.conf or the environment by ebuild authors during testing, and +# accepts the same values as DIST_TEST. If set, it overrides DIST_TEST +# completely. DO NOT USE THIS IN EBUILDS! + # @FUNCTION: perl-module_src-test # @USAGE: perl-module_src_test() # @DESCRIPTION: -# This code attempts to work out your threadingness from MAKEOPTS -# and apply them to Test::Harness. -# -# If you want more verbose testing, set TEST_VERBOSE=1 -# in your bashrc | /etc/portage/make.conf | ENV -# -# or ebuild writers: -# If you wish to enable default tests w/ 'make test' , -# -# SRC_TEST="do" -# -# If you wish to have threads run in parallel ( using the users makeopts ) -# all of the following have been tested to work. -# -# SRC_TEST="do parallel" -# SRC_TEST="parallel" -# SRC_TEST="parallel do" -# SRC_TEST=parallel -# +# This code attempts to work out your threadingness and runs tests +# according to the settings of DIST_TEST using Test::Harness. perl-module_src_test() { debug-print-function $FUNCNAME "$@" - if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then - if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then + local my_test_control + local my_test_verbose + + if [[ ${EAPI:-0} == 5 ]] ; then + my_test_control=${SRC_TEST} + my_test_verbose=${TEST_VERBOSE:-0} + if has 'do' ${my_test_control} || has 'parallel' ${my_test_control} ; then + if has "${my_test_verbose}" 0 && has 'parallel' ${my_test_control} ; then + export HARNESS_OPTIONS=j$(makeopts_jobs) + einfo "Test::Harness Jobs=$(makeopts_jobs)" + fi + else + einfo Skipping tests due to SRC_TEST=${SRC_TEST} + return 0 + fi + else + [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE} + my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}} + + if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} ; then + einfo Skipping tests due to DIST_TEST=${my_test_control} + return 0 + fi + + if has verbose ${my_test_control} ; then + my_test_verbose=1 + else + my_test_verbose=0 + fi + + if has parallel ${my_test_control} ; then export HARNESS_OPTIONS=j$(makeopts_jobs) einfo "Test::Harness Jobs=$(makeopts_jobs)" fi - ${perlinfo_done} || perl_set_version - if [[ -f Build ]] ; then - ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed" - elif [[ -f Makefile ]] ; then - emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || die "test failed" + + # this might sometimes work... + if ! has network ${my_test_control} ; then + export NO_NETWORK_TESTING=1 fi fi + + perl_set_version + if [[ -f Build ]] ; then + ./Build test verbose=${my_test_verbose} || die "test failed" + elif [[ -f Makefile ]] ; then + emake test TEST_VERBOSE=${my_test_verbose} || die "test failed" + fi } # @FUNCTION: perl-module_src_install @@ -278,7 +407,12 @@ perl-module_src_install() { perl_delete_module_manpages perl_delete_localpod - perl_delete_packlist + if [[ ${EAPI:-0} == 5 ]] ; then + perl_delete_packlist + else + perl_fix_packlist + perl_delete_emptybsdir + fi perl_remove_temppath for f in Change* CHANGES README* TODO FAQ ${mydoc}; do @@ -298,9 +432,8 @@ perl-module_src_install() { perl-module_pkg_postinst() { debug-print-function $FUNCNAME "$@" if [[ ${CATEGORY} != perl-core ]] ; then - eqawarn "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category." - eqawarn " This does not do anything; the call can be safely removed." - return 0 + eerror "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category." + die " This does not do anything; the call can be removed." fi perl_link_duallife_scripts } @@ -315,233 +448,8 @@ perl-module_pkg_postinst() { perl-module_pkg_postrm() { debug-print-function $FUNCNAME "$@" if [[ ${CATEGORY} != perl-core ]] ; then - eqawarn "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category." - eqawarn " This does not do anything; the call can be safely removed." - return 0 + eerror "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category." + die " This does not do anything; the call can be removed." fi perl_link_duallife_scripts } - -# @FUNCTION: perl_set_version -# @USAGE: perl_set_version -# @DESCRIPTION: -# Extract version information and installation paths from the current Perl -# interpreter. -# -# This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB, -# ARCH_LIB, VENDOR_LIB, VENDOR_ARCH -# -# This function used to be called perlinfo as well. -perl_set_version() { - debug-print-function $FUNCNAME "$@" - debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}" - ${perlinfo_done} && return 0 - perlinfo_done=true - - local f version install{{site,vendor}{arch,lib},archlib} - eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )" - PERL_VERSION=${version} - SITE_ARCH=${installsitearch} - SITE_LIB=${installsitelib} - ARCH_LIB=${installarchlib} - VENDOR_LIB=${installvendorlib} - VENDOR_ARCH=${installvendorarch} -} - -# @FUNCTION: perl_delete_localpod -# @USAGE: perl_delete_localpod -# @DESCRIPTION: -# Remove stray perllocal.pod files in the temporary install directory D. -# -# This function used to be called fixlocalpod as well. -perl_delete_localpod() { - debug-print-function $FUNCNAME "$@" - - find "${D}" -type f -name perllocal.pod -delete - find "${D}" -depth -mindepth 1 -type d -empty -delete -} - -# @FUNCTION: perl_fix_osx_extra -# @USAGE: perl_fix_osx_extra -# @DESCRIPTION: -# Look through ${S} for AppleDouble encoded files and get rid of them. -perl_fix_osx_extra() { - debug-print-function $FUNCNAME "$@" - - local f - find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do - einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}" - rm -f "${f}" - f=${f#${S}/} - grep -q "${f}" "${S}"/MANIFEST && \ - elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}" - done -} - -# @FUNCTION: perl_delete_module_manpages -# @USAGE: perl_delete_module_manpages -# @DESCRIPTION: -# Bump off manpages installed by the current module such as *.3pm files as well -# as empty directories. -perl_delete_module_manpages() { - debug-print-function $FUNCNAME "$@" - - if [[ -d "${ED}"/usr/share/man ]] ; then - find "${ED}"/usr/share/man -type f -name "*.3pm" -delete - find "${ED}"/usr/share/man -depth -type d -empty -delete - fi -} - -# @FUNCTION: perl_delete_packlist -# @USAGE: perl_delete_packlist -# @DESCRIPTION: -# Look through ${D} for .packlist files, empty .bs files and empty directories, -# and get rid of items found. -perl_delete_packlist() { - debug-print-function $FUNCNAME "$@" - perl_set_version - if [[ -d ${D}/${VENDOR_ARCH} ]] ; then - find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \ - -o \( -name '*.bs' -a -empty \) \) -delete - find "${D}" -depth -mindepth 1 -type d -empty -delete - fi -} - -# @FUNCTION: perl_remove_temppath -# @USAGE: perl_remove_temppath -# @DESCRIPTION: -# Look through ${D} for text files containing the temporary installation -# folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'. -perl_remove_temppath() { - debug-print-function $FUNCNAME "$@" - - find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do - if file "${f}" | grep -q -i " text" ; then - grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}" - sed -i -e "s:${D}:/:g" "${f}" - fi - done -} - -# @FUNCTION: perl_rm_files -# @USAGE: perl_rm_files "file_1" "file_2" -# @DESCRIPTION: -# Remove certain files from a Perl release and remove them from the MANIFEST -# while we're there. -# -# Most useful in src_prepare for nuking bad tests, and is highly recommended -# for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they -# test is completely irrelevant to end users, and frequently fail simply -# because the authors of Test::Pod... changed their recommendations, and thus -# failures are only useful feedback to Authors, not users. -# -# Removing from MANIFEST also avoids needless log messages warning -# users about files "missing from their kit". -perl_rm_files() { - debug-print-function $FUNCNAME "$@" - local skipfile="${T}/.gentoo_makefile_skip" - local manifile="${S}/MANIFEST" - local manitemp="${T}/.gentoo_manifest_temp" - oldifs="$IFS" - IFS="\n" - for filename in "$@"; do - einfo "Removing un-needed ${filename}"; - # Remove the file - rm -f "${S}/${filename}" - [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}" - done - if [[ -e "${manifile}" && -e "${skipfile}" ]]; then - einfo "Fixing Manifest" - grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}" - mv -f -- "${manitemp}" "${manifile}" - rm -- "${skipfile}"; - fi - IFS="$oldifs" -} - -# @FUNCTION: perl_link_duallife_scripts -# @USAGE: perl_link_duallife_scripts -# @DESCRIPTION: -# Moves files and generates symlinks so dual-life packages installing scripts do not -# lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes -# only sense for perl-core packages. -perl_link_duallife_scripts() { - debug-print-function $FUNCNAME "$@" - if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then - return 0 - fi - - local i ff - if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then - for i in "${DUALLIFESCRIPTS[@]}" ; do - alternatives_auto_makesym "/${i}" "/${i}-[0-9]*" - done - for i in "${DUALLIFEMAN[@]}" ; do - ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*` - ff=${ff##*.1} - alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*" - done - else - pushd "${ED}" > /dev/null - for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do - mv ${i}{,-${PV}-${P}} || die - #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/} - DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i} - done - for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do - mv ${i} ${i%.1}-${PV}-${P}.1 || die - DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i} - done - popd > /dev/null - fi -} - -# @FUNCTION: perl_check_env -# @USAGE: perl_check_env -# @DESCRIPTION: -# Checks a blacklist of known-suspect ENV values that can be accidentally set by users -# doing personal perl work, which may accidentally leak into portage and break the -# system perl installaton. -# Dies if any of the suspect fields are found, and tell the user what needs to be unset. -# There's a workaround, but you'll have to read the code for it. -perl_check_env() { - local errored value; - - for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do - # Next unless match - [ -v $i ] || continue; - - # Warn only once, and warn only when one of the bad values are set. - # record failure here. - if [ ${errored:-0} == 0 ]; then - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then - elog "perl-module.eclass: Suspicious environment values found."; - else - eerror "perl-module.eclass: Suspicious environment values found."; - fi - fi - errored=1 - - # Read ENV Value - eval "value=\$$i"; - - # Print ENV name/value pair - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then - elog " $i=\"$value\""; - else - eerror " $i=\"$value\""; - fi - done - - # Return if there were no failures - [ ${errored:-0} == 0 ] && return; - - # Return if user knows what they're doing - if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then - elog "Continuing anyway, seems you know what you're doing." - return - fi - - eerror "Your environment settings may lead to undefined behavior and/or build failures." - die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details." -} diff --git a/sdk_container/src/third_party/portage-stable/eclass/portability.eclass b/sdk_container/src/third_party/portage-stable/eclass/portability.eclass index 2e4e01d514..4f29725e2e 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/portability.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/portability.eclass @@ -98,7 +98,7 @@ dlopen_lib() { # @USAGE: # @RETURN: system version of make # @DESCRIPTION: -# Gets the name of the BSD-ish make command (pmake from NetBSD) +# Gets the name of the BSD-ish make command (bmake from NetBSD) # # This will return make (provided by system packages) for BSD userlands, # or bsdmake for Darwin userlands and pmake for the rest of userlands, @@ -107,12 +107,12 @@ dlopen_lib() { # Note: the bsdmake for Darwin userland is with compatibility with MacOSX # default name. get_bmake() { - if [[ ${USERLAND} == *BSD ]]; then + if [[ ${CBUILD:-${CHOST}} == *bsd* ]]; then echo make - elif [[ ${USERLAND} == "Darwin" ]]; then + elif [[ ${CBUILD:-${CHOST}} == *darwin* ]]; then echo bsdmake else - echo pmake + echo bmake fi } diff --git a/sdk_container/src/third_party/portage-stable/eclass/qmake-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/qmake-utils.eclass index 4daede66aa..37c0f81c0f 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/qmake-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/qmake-utils.eclass @@ -1,10 +1,10 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qmake-utils.eclass,v 1.11 2015/06/22 14:18:19 pesa Exp $ +# $Id$ # @ECLASS: qmake-utils.eclass # @MAINTAINER: -# Qt herd +# qt@gentoo.org # @AUTHOR: # Davide Pesavento # @BLURB: Common functions for qmake-based packages. @@ -17,11 +17,13 @@ if [[ -z ${_QMAKE_UTILS_ECLASS} ]]; then _QMAKE_UTILS_ECLASS=1 -inherit eutils multilib toolchain-funcs +[[ ${EAPI:-0} == [012345] ]] && inherit multilib +inherit eutils toolchain-funcs # @FUNCTION: qt4_get_bindir # @DESCRIPTION: # Echoes the directory where Qt4 binaries are installed. +# EPREFIX is already prepended to the returned path. qt4_get_bindir() { has "${EAPI:-0}" 0 1 2 && use !prefix && EPREFIX= @@ -36,7 +38,6 @@ qt4_get_bindir() { # @FUNCTION: qt4_get_headerdir # @DESCRIPTION: # Echoes the directory where Qt4 headers are installed. -# Does not take EPREFIX into account. qt4_get_headerdir() { echo /usr/include/qt4 } @@ -44,7 +45,6 @@ qt4_get_headerdir() { # @FUNCTION: qt4_get_libdir # @DESCRIPTION: # Echoes the directory where Qt4 libraries are installed. -# Does not take EPREFIX into account. qt4_get_libdir() { echo /usr/$(get_libdir)/qt4 } @@ -52,14 +52,21 @@ qt4_get_libdir() { # @FUNCTION: qt4_get_mkspecsdir # @DESCRIPTION: # Echoes the directory where Qt4 mkspecs are installed. -# Does not take EPREFIX into account. qt4_get_mkspecsdir() { echo /usr/share/qt4/mkspecs } +# @FUNCTION: qt4_get_plugindir +# @DESCRIPTION: +# Echoes the directory where Qt4 plugins are installed. +qt4_get_plugindir() { + echo $(qt4_get_libdir)/plugins +} + # @FUNCTION: qt5_get_bindir # @DESCRIPTION: # Echoes the directory where Qt5 binaries are installed. +# EPREFIX is already prepended to the returned path. qt5_get_bindir() { has "${EAPI:-0}" 0 1 2 && use !prefix && EPREFIX= @@ -69,7 +76,6 @@ qt5_get_bindir() { # @FUNCTION: qt5_get_headerdir # @DESCRIPTION: # Echoes the directory where Qt5 headers are installed. -# Does not take EPREFIX into account. qt5_get_headerdir() { echo /usr/include/qt5 } @@ -77,7 +83,6 @@ qt5_get_headerdir() { # @FUNCTION: qt5_get_libdir # @DESCRIPTION: # Echoes the directory where Qt5 libraries are installed. -# Does not take EPREFIX into account. qt5_get_libdir() { echo /usr/$(get_libdir) } @@ -85,11 +90,17 @@ qt5_get_libdir() { # @FUNCTION: qt5_get_mkspecsdir # @DESCRIPTION: # Echoes the directory where Qt5 mkspecs are installed. -# Does not take EPREFIX into account. qt5_get_mkspecsdir() { echo $(qt5_get_libdir)/qt5/mkspecs } +# @FUNCTION: qt5_get_plugindir +# @DESCRIPTION: +# Echoes the directory where Qt5 plugins are installed. +qt5_get_plugindir() { + echo $(qt5_get_libdir)/qt5/plugins +} + # @FUNCTION: qmake-utils_find_pro_file # @RETURN: zero or one qmake .pro file names # @INTERNAL @@ -136,10 +147,10 @@ qmake-utils_find_pro_file() { # @FUNCTION: eqmake4 # @USAGE: [project_file] [parameters to qmake] # @DESCRIPTION: -# Wrapper for Qt4's qmake. If project_file isn't specified, eqmake4 will -# look for it in the current directory (${S}, non-recursively). If more -# than one project file are found, then ${PN}.pro is processed, provided -# that it exists. Otherwise eqmake4 fails. +# Wrapper for Qt4's qmake. If project_file is not specified, eqmake4 looks +# for one in the current directory (non-recursively). If multiple project +# files are found, then ${PN}.pro is used, if it exists, otherwise eqmake4 +# will not be able to continue. # # All other arguments are appended unmodified to qmake command line. # diff --git a/sdk_container/src/third_party/portage-stable/eclass/qt4-build-multilib.eclass b/sdk_container/src/third_party/portage-stable/eclass/qt4-build-multilib.eclass index 7d647897ea..51a2f303d0 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/qt4-build-multilib.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/qt4-build-multilib.eclass @@ -1,10 +1,10 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build-multilib.eclass,v 1.28 2015/06/16 21:38:00 pesa Exp $ +# $Id$ # @ECLASS: qt4-build-multilib.eclass # @MAINTAINER: -# Qt herd +# qt@gentoo.org # @AUTHOR: # Davide Pesavento # @BLURB: Eclass for Qt4 split ebuilds with multilib support. @@ -637,10 +637,11 @@ qt4_qmake() { local projectdir=${PWD/#${BUILD_DIR}/${S}} "${BUILD_DIR}"/bin/qmake \ + "${projectdir}" \ CONFIG+=nostrip \ LIBS+=-L"${QT4_LIBDIR}" \ - "${projectdir}" \ - || die "qmake failed (${projectdir})" + "${myqmakeargs[@]}" \ + || die "qmake failed (${projectdir#${S}/})" } # @FUNCTION: qt4_install_module_qconfigs diff --git a/sdk_container/src/third_party/portage-stable/eclass/qt4-build.eclass b/sdk_container/src/third_party/portage-stable/eclass/qt4-build.eclass deleted file mode 100644 index 5ed6d3895a..0000000000 --- a/sdk_container/src/third_party/portage-stable/eclass/qt4-build.eclass +++ /dev/null @@ -1,804 +0,0 @@ -# Copyright 1999-2015 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.163 2015/04/01 18:45:04 pesa Exp $ - -# @ECLASS: qt4-build.eclass -# @MAINTAINER: -# Qt herd -# @BLURB: Eclass for Qt4 split ebuilds. -# @DESCRIPTION: -# This eclass contains various functions that are used when building Qt4. - -case ${EAPI} in - 4|5) : ;; - *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;; -esac - -inherit eutils flag-o-matic multilib toolchain-funcs - -HOMEPAGE="https://www.qt.io/" -LICENSE="|| ( LGPL-2.1 GPL-3 )" -SLOT="4" - -case ${PV} in - 4.?.9999) - QT4_BUILD_TYPE="live" - EGIT_REPO_URI=( - "git://code.qt.io/qt/qt.git" - "https://code.qt.io/git/qt/qt.git" - "https://github.com/qtproject/qt.git" - ) - EGIT_BRANCH=${PV%.9999} - inherit git-r3 - ;; - *) - QT4_BUILD_TYPE="release" - MY_P=qt-everywhere-opensource-src-${PV/_/-} - SRC_URI="http://download.qt.io/archive/qt/${PV%.*}/${PV}/${MY_P}.tar.gz" - S=${WORKDIR}/${MY_P} - ;; -esac - -IUSE="aqua debug pch" -[[ ${PN} != qtxmlpatterns ]] && IUSE+=" +exceptions" - -DEPEND="virtual/pkgconfig" -if [[ ${QT4_BUILD_TYPE} == live ]]; then - DEPEND+=" dev-lang/perl" -fi - -# @FUNCTION: qt4-build_pkg_setup -# @DESCRIPTION: -# Sets up PATH and LD_LIBRARY_PATH. -qt4-build_pkg_setup() { - # Warn users of possible breakage when downgrading to a previous release. - # Downgrading revisions within the same release is safe. - if has_version ">${CATEGORY}/${P}-r9999:4"; then - ewarn - ewarn "Downgrading Qt is completely unsupported and can break your system!" - ewarn - fi - - PATH="${S}/bin${PATH:+:}${PATH}" - if [[ ${CHOST} != *-darwin* ]]; then - LD_LIBRARY_PATH="${S}/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}" - else - DYLD_LIBRARY_PATH="${S}/lib${DYLD_LIBRARY_PATH:+:}${DYLD_LIBRARY_PATH}" - # On MacOS we *need* at least src/gui/kernel/qapplication_mac.mm for - # platform detection. Note: needs to come before any directories to - # avoid extract failure. - [[ ${CHOST} == *-apple-darwin* ]] && \ - QT4_EXTRACT_DIRECTORIES="src/gui/kernel/qapplication_mac.mm - ${QT4_EXTRACT_DIRECTORIES}" - fi -} - -# @ECLASS-VARIABLE: PATCHES -# @DEFAULT_UNSET -# @DESCRIPTION: -# Array variable containing all the patches to be applied. This variable -# is expected to be defined in the global scope of ebuilds. Make sure to -# specify the full path. This variable is used in src_prepare phase. -# -# Example: -# @CODE -# PATCHES=( -# "${FILESDIR}/mypatch.patch" -# "${FILESDIR}/patches_folder/" -# ) -# @CODE - -# @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES -# @DEFAULT_UNSET -# @DESCRIPTION: -# Space-separated list of directories that will be extracted -# from Qt tarball. - -# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES -# @DEFAULT_UNSET -# @DESCRIPTION: -# Space-separated list of directories that will be configured, -# compiled, and installed. All paths must be relative to ${S}. - -# @FUNCTION: qt4-build_src_unpack -# @DESCRIPTION: -# Unpacks the sources. -qt4-build_src_unpack() { - setqtenv - - if [[ $(gcc-major-version) -lt 4 ]] || [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 4 ]]; then - ewarn - ewarn "Using a GCC version lower than 4.4 is not supported." - ewarn - fi - - if [[ ${PN} == qtwebkit ]]; then - eshopts_push -s extglob - if is-flagq '-g?(gdb)?([1-9])'; then - ewarn - ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)." - ewarn "You may experience really long compilation times and/or increased memory usage." - ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug." - ewarn "For more info check out https://bugs.gentoo.org/307861" - ewarn - fi - eshopts_pop - fi - - case ${QT4_BUILD_TYPE} in - live) - git-r3_src_unpack - ;; - release) - local tarball="${MY_P}.tar.gz" target= targets= - for target in configure LICENSE.GPL3 LICENSE.LGPL projects.pro \ - src/{qbase,qt_targets,qt_install}.pri bin config.tests \ - mkspecs qmake ${QT4_EXTRACT_DIRECTORIES} - do - targets+="${MY_P}/${target} " - done - - ebegin "Unpacking parts of ${tarball}:" ${targets//${MY_P}\/} - tar -xzf "${DISTDIR}/${tarball}" ${targets} - eend $? || die "failed to unpack" - ;; - esac -} - -# @FUNCTION: qt4-build_src_prepare -# @DESCRIPTION: -# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix -# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in make.conf. -qt4-build_src_prepare() { - setqtenv - - if [[ ${QT4_BUILD_TYPE} == live ]]; then - QTDIR="." ./bin/syncqt || die "syncqt failed" - fi - - # avoid X11 dependency in non-gui packages - local nolibx11_pkgs="qtbearer qtcore qtdbus qtscript qtsql qttest qtxmlpatterns" - has ${PN} ${nolibx11_pkgs} && qt_nolibx11 - - if use aqua; then - # provide a proper macx-g++-64 - use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir) - - sed -e '/^CONFIG/s:app_bundle::' \ - -e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \ - -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die - fi - - if [[ ${CATEGORY}/${PN} != dev-qt/qtcore ]]; then - skip_qmake_build - skip_project_generation - symlink_binaries_to_buildtree - else - # Bug 373061 - # qmake bus errors with -O2 or -O3 but -O1 works - if [[ ${CHOST} == *86*-apple-darwin* ]]; then - replace-flags -O[23] -O1 - fi - - # Bug 503500 - # undefined reference with -Os and --as-needed - if use x86; then - replace-flags -Os -O2 - fi - fi - - # Bug 261632 - if use ppc64; then - append-flags -mminimal-toc - fi - - # Bug 417105 - # graphite on gcc 4.7 causes miscompilations - if [[ $(gcc-version) == "4.7" ]]; then - filter-flags -fgraphite-identity - fi - - if use_if_iuse c++0x; then - append-cxxflags -std=c++0x - fi - - # Respect CC, CXX, {C,CXX,LD}FLAGS in .qmake.cache - sed -e "/^SYSTEM_VARIABLES=/i \ - CC='$(tc-getCC)'\n\ - CXX='$(tc-getCXX)'\n\ - CFLAGS='${CFLAGS}'\n\ - CXXFLAGS='${CXXFLAGS}'\n\ - LDFLAGS='${LDFLAGS}'\n\ - QMakeVar set QMAKE_CFLAGS_RELEASE\n\ - QMakeVar set QMAKE_CFLAGS_DEBUG\n\ - QMakeVar set QMAKE_CXXFLAGS_RELEASE\n\ - QMakeVar set QMAKE_CXXFLAGS_DEBUG\n\ - QMakeVar set QMAKE_LFLAGS_RELEASE\n\ - QMakeVar set QMAKE_LFLAGS_DEBUG\n"\ - -i configure \ - || die "sed SYSTEM_VARIABLES failed" - - # Respect CC, CXX, LINK and *FLAGS in config.tests - find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \ - sed -i -e "/bin\/qmake/ s: \"\$SRCDIR/: \ - 'QMAKE_CC=$(tc-getCC)' 'QMAKE_CXX=$(tc-getCXX)' 'QMAKE_LINK=$(tc-getCXX)' \ - 'QMAKE_CFLAGS+=${CFLAGS}' 'QMAKE_CXXFLAGS+=${CXXFLAGS}' 'QMAKE_LFLAGS+=${LDFLAGS}'&:" \ - || die "sed config.tests failed" - - # Bug 172219 - sed -e 's:/X11R6/:/:' -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die - - if [[ ${CHOST} == *-darwin* ]]; then - # Set FLAGS *and* remove -arch, since our gcc-apple is multilib - # crippled (by design) :/ - local mac_gpp_conf= - if [[ -f mkspecs/common/mac-g++.conf ]]; then - # qt < 4.8 has mac-g++.conf - mac_gpp_conf="mkspecs/common/mac-g++.conf" - elif [[ -f mkspecs/common/g++-macx.conf ]]; then - # qt >= 4.8 has g++-macx.conf - mac_gpp_conf="mkspecs/common/g++-macx.conf" - else - die "no known conf file for mac found" - fi - sed \ - -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=-headerpad_max_install_names ${LDFLAGS}:" \ - -e "s:-arch\s\w*::g" \ - -i ${mac_gpp_conf} \ - || die "sed ${mac_gpp_conf} failed" - - # Fix configure's -arch settings that appear in qmake/Makefile and also - # fix arch handling (automagically duplicates our -arch arg and breaks - # pch). Additionally disable Xarch support. - local mac_gcc_confs="${mac_gpp_conf}" - if [[ -f mkspecs/common/gcc-base-macx.conf ]]; then - mac_gcc_confs+=" mkspecs/common/gcc-base-macx.conf" - fi - sed \ - -e "s:-arch i386::" \ - -e "s:-arch ppc::" \ - -e "s:-arch x86_64::" \ - -e "s:-arch ppc64::" \ - -e "s:-arch \$i::" \ - -e "/if \[ ! -z \"\$NATIVE_64_ARCH\" \]; then/,/fi/ d" \ - -e "s:CFG_MAC_XARCH=yes:CFG_MAC_XARCH=no:g" \ - -e "s:-Xarch_x86_64::g" \ - -e "s:-Xarch_ppc64::g" \ - -i configure ${mac_gcc_confs} \ - || die "sed -arch/-Xarch failed" - - # On Snow Leopard don't fall back to 10.5 deployment target. - if [[ ${CHOST} == *-apple-darwin10 ]]; then - sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \ - -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \ - -i configure ${mac_gpp_conf} \ - || die "sed deployment target failed" - fi - fi - - # this one is needed for all systems with a separate -liconv, apart from - # Darwin, for which the sources already cater for -liconv - if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then - sed -e 's|mac:\(LIBS += -liconv\)|\1|g' \ - -i config.tests/unix/iconv/iconv.pro \ - || die "sed iconv.pro failed" - fi - - # we need some patches for Solaris - sed -i -e '/^QMAKE_LFLAGS_THREAD/a\QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,' \ - mkspecs/$(qt_mkspecs_dir)/qmake.conf || die - # use GCC over SunStudio - sed -i -e '/PLATFORM=solaris-cc/s/cc/g++/' configure || die - # do not flirt with non-Prefix stuff, we're quite possessive - sed -i -e '/^QMAKE_\(LIB\|INC\)DIR\(_X11\|_OPENGL\|\)\t/s/=.*$/=/' \ - mkspecs/$(qt_mkspecs_dir)/qmake.conf || die - - # apply patches - [[ -n ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - epatch_user -} - -# @FUNCTION: qt4-build_src_configure -# @DESCRIPTION: -# Default configure phase -qt4-build_src_configure() { - setqtenv - - local conf=" - -prefix ${QTPREFIXDIR} - -bindir ${QTBINDIR} - -libdir ${QTLIBDIR} - -docdir ${QTDOCDIR} - -headerdir ${QTHEADERDIR} - -plugindir ${QTPLUGINDIR} - -importdir ${QTIMPORTDIR} - -datadir ${QTDATADIR} - -translationdir ${QTTRANSDIR} - -sysconfdir ${QTSYSCONFDIR} - -examplesdir ${QTEXAMPLESDIR} - -demosdir ${QTDEMOSDIR} - -opensource -confirm-license - -shared -fast -largefile -stl -verbose - -nomake examples -nomake demos" - - # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported - # $(tc-arch). Therefore we convert it to supported values. - case "$(tc-arch)" in - amd64|x64-*) conf+=" -arch x86_64" ;; - ppc-macos) conf+=" -arch ppc" ;; - ppc|ppc64|ppc-*) conf+=" -arch powerpc" ;; - sparc|sparc-*|sparc64-*) conf+=" -arch sparc" ;; - x86-macos) conf+=" -arch x86" ;; - x86|x86-*) conf+=" -arch i386" ;; - alpha|arm|ia64|mips|s390) conf+=" -arch $(tc-arch)" ;; - arm64|hppa|sh) conf+=" -arch generic" ;; - *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; - esac - - conf+=" -platform $(qt_mkspecs_dir)" - - [[ $(get_libdir) != lib ]] && conf+=" -L${EPREFIX}/usr/$(get_libdir)" - - # debug/release - if use debug; then - conf+=" -debug" - else - conf+=" -release" - fi - conf+=" -no-separate-debug-info" - - # exceptions USE flag - conf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)" - - # disable rpath (bug 380415), except on prefix (bug 417169) - use prefix || conf+=" -no-rpath" - - # precompiled headers don't work on hardened, where the flag is masked - conf+=" $(qt_use pch)" - - # -reduce-relocations - # This flag seems to introduce major breakage to applications, - # mostly to be seen as a core dump with the message "QPixmap: Must - # construct a QApplication before a QPaintDevice" on Solaris. - # -- Daniel Vergien - [[ ${CHOST} != *-solaris* ]] && conf+=" -reduce-relocations" - - # this one is needed for all systems with a separate -liconv, apart from - # Darwin, for which the sources already cater for -liconv - if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then - conf+=" -liconv" - fi - - if use_if_iuse glib; then - local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)" - # avoid the -pthread argument - conf+=" ${glibflags//-pthread}" - unset glibflags - fi - - if use aqua; then - # On (snow) leopard use the new (frameworked) cocoa code. - if [[ ${CHOST##*-darwin} -ge 9 ]]; then - conf+=" -cocoa -framework" - # We need the source's headers, not the installed ones. - conf+=" -I${S}/include" - # Add hint for the framework location. - conf+=" -F${QTLIBDIR}" - - # We are crazy and build cocoa + qt3support :-) - if use qt3support; then - sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ - -i configure || die - fi - else - conf+=" -no-framework" - fi - else - # freetype2 include dir is non-standard, thus pass it to configure - conf+=" $(pkg-config --cflags-only-I freetype2)" - fi - - conf+=" ${myconf}" - myconf= - - echo ./configure ${conf} - ./configure ${conf} || die "./configure failed" - - prepare_directories ${QT4_TARGET_DIRECTORIES} -} - -# @FUNCTION: qt4-build_src_compile -# @DESCRIPTION: -# Actual compile phase -qt4-build_src_compile() { - setqtenv - - build_directories ${QT4_TARGET_DIRECTORIES} -} - -# @FUNCTION: qt4-build_src_test -# @DESCRIPTION: -# Runs tests only in target directories. -qt4-build_src_test() { - # QtMultimedia does not have any test suite (bug #332299) - [[ ${CATEGORY}/${PN} == dev-qt/qtmultimedia ]] && return - - for dir in ${QT4_TARGET_DIRECTORIES}; do - emake -j1 check -C ${dir} - done -} - -# @FUNCTION: fix_includes -# @DESCRIPTION: -# For MacOS X we need to add some symlinks when frameworks are -# being used, to avoid complications with some more or less stupid packages. -fix_includes() { - if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then - local frw dest f h rdir - # Some packages tend to include - dodir "${QTHEADERDIR#${EPREFIX}}"/Qt - - # Fake normal headers when frameworks are installed... eases life later - # on, make sure we use relative links though, as some ebuilds assume - # these dirs exist in src_install to add additional files - f=${QTHEADERDIR} - h=${QTLIBDIR} - while [[ -n ${f} && ${f%%/*} == ${h%%/*} ]] ; do - f=${f#*/} - h=${h#*/} - done - rdir=${h} - f="../" - while [[ ${h} == */* ]] ; do - f="${f}../" - h=${h#*/} - done - rdir="${f}${rdir}" - - for frw in "${D}${QTLIBDIR}"/*.framework; do - [[ -e "${frw}"/Headers ]] || continue - f=$(basename ${frw}) - dest="${QTHEADERDIR#${EPREFIX}}"/${f%.framework} - dosym "${rdir}"/${f}/Headers "${dest}" - - # Link normal headers as well. - for hdr in "${D}/${QTLIBDIR}/${f}"/Headers/*; do - h=$(basename ${hdr}) - dosym "../${rdir}"/${f}/Headers/${h} \ - "${QTHEADERDIR#${EPREFIX}}"/Qt/${h} - done - done - fi -} - -# @FUNCTION: qt4-build_src_install -# @DESCRIPTION: -# Perform the actual installation including some library fixes. -qt4-build_src_install() { - setqtenv - - install_directories ${QT4_TARGET_DIRECTORIES} - install_qconfigs - fix_library_files - fix_includes - - # remove .la files since we are building only shared libraries - prune_libtool_files -} - -# @FUNCTION: setqtenv -# @INTERNAL -setqtenv() { - # Set up installation directories - QTPREFIXDIR=${EPREFIX}/usr - QTBINDIR=${QTPREFIXDIR}/bin - QTLIBDIR=${QTPREFIXDIR}/$(get_libdir)/qt4 - QTPCDIR=${QTPREFIXDIR}/$(get_libdir)/pkgconfig - QTDOCDIR=${QTPREFIXDIR}/share/doc/qt-${PV} - QTHEADERDIR=${QTPREFIXDIR}/include/qt4 - QTPLUGINDIR=${QTLIBDIR}/plugins - QTIMPORTDIR=${QTLIBDIR}/imports - QTDATADIR=${QTPREFIXDIR}/share/qt4 - QTTRANSDIR=${QTDATADIR}/translations - QTSYSCONFDIR=${EPREFIX}/etc/qt4 - QTEXAMPLESDIR=${QTDATADIR}/examples - QTDEMOSDIR=${QTDATADIR}/demos - QMAKE_LIBDIR_QT=${QTLIBDIR} - - PLATFORM=$(qt_mkspecs_dir) - unset QMAKESPEC - - export XDG_CONFIG_HOME="${T}" -} - -# @FUNCTION: prepare_directories -# @USAGE: < directories > -# @INTERNAL -# @DESCRIPTION: -# Generates Makefiles for the given list of directories. -prepare_directories() { - for x in "$@"; do - pushd "${S}"/${x} >/dev/null || die - einfo "Running qmake in: ${x}" - "${S}"/bin/qmake \ - "LIBS+=-L${QTLIBDIR}" \ - "CONFIG+=nostrip" \ - || die "qmake failed" - popd >/dev/null || die - done -} - -# @FUNCTION: build_directories -# @USAGE: < directories > -# @INTERNAL -# @DESCRIPTION: -# Compiles the code in the given list of directories. -build_directories() { - for x in "$@"; do - pushd "${S}"/${x} >/dev/null || die - emake \ - AR="$(tc-getAR) cqs" \ - CC="$(tc-getCC)" \ - CXX="$(tc-getCXX)" \ - LINK="$(tc-getCXX)" \ - RANLIB=":" \ - STRIP=":" - popd >/dev/null || die - done -} - -# @FUNCTION: install_directories -# @USAGE: < directories > -# @INTERNAL -# @DESCRIPTION: -# Runs emake install in the given directories, which are separated by spaces. -install_directories() { - for x in "$@"; do - pushd "${S}"/${x} >/dev/null || die - emake INSTALL_ROOT="${D}" install - popd >/dev/null || die - done -} - -# @ECLASS-VARIABLE: QCONFIG_ADD -# @DESCRIPTION: -# List options that need to be added to QT_CONFIG in qconfig.pri -: ${QCONFIG_ADD:=} - -# @ECLASS-VARIABLE: QCONFIG_REMOVE -# @DESCRIPTION: -# List options that need to be removed from QT_CONFIG in qconfig.pri -: ${QCONFIG_REMOVE:=} - -# @ECLASS-VARIABLE: QCONFIG_DEFINE -# @DESCRIPTION: -# List variables that should be defined at the top of QtCore/qconfig.h -: ${QCONFIG_DEFINE:=} - -# @FUNCTION: install_qconfigs -# @INTERNAL -# @DESCRIPTION: -# Install gentoo-specific mkspecs configurations. -install_qconfigs() { - local x - if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} ]]; then - for x in QCONFIG_ADD QCONFIG_REMOVE; do - [[ -n ${!x} ]] && echo ${x}=${!x} >> "${T}"/${PN}-qconfig.pri - done - insinto ${QTDATADIR#${EPREFIX}}/mkspecs/gentoo - doins "${T}"/${PN}-qconfig.pri - fi - - if [[ -n ${QCONFIG_DEFINE} ]]; then - for x in ${QCONFIG_DEFINE}; do - echo "#define ${x}" >> "${T}"/gentoo-${PN}-qconfig.h - done - insinto ${QTHEADERDIR#${EPREFIX}}/Gentoo - doins "${T}"/gentoo-${PN}-qconfig.h - fi -} - -# @FUNCTION: generate_qconfigs -# @INTERNAL -# @DESCRIPTION: -# Generates gentoo-specific qconfig.{h,pri}. -generate_qconfigs() { - if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${CATEGORY}/${PN} == dev-qt/qtcore ]]; then - local x qconfig_add qconfig_remove qconfig_new - for x in "${ROOT}${QTDATADIR}"/mkspecs/gentoo/*-qconfig.pri; do - [[ -f ${x} ]] || continue - qconfig_add+=" $(sed -n 's/^QCONFIG_ADD=//p' "${x}")" - qconfig_remove+=" $(sed -n 's/^QCONFIG_REMOVE=//p' "${x}")" - done - - # these error checks do not use die because dying in pkg_post{inst,rm} - # just makes things worse. - if [[ -e "${ROOT}${QTDATADIR}"/mkspecs/gentoo/qconfig.pri ]]; then - # start with the qconfig.pri that qtcore installed - if ! cp "${ROOT}${QTDATADIR}"/mkspecs/gentoo/qconfig.pri \ - "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then - eerror "cp qconfig failed." - return 1 - fi - - # generate list of QT_CONFIG entries from the existing list - # including qconfig_add and excluding qconfig_remove - for x in $(sed -n 's/^QT_CONFIG +=//p' \ - "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri) ${qconfig_add}; do - has ${x} ${qconfig_remove} || qconfig_new+=" ${x}" - done - - # replace the existing QT_CONFIG list with qconfig_new - if ! sed -i -e "s/QT_CONFIG +=.*/QT_CONFIG += ${qconfig_new}/" \ - "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then - eerror "Sed for QT_CONFIG failed" - return 1 - fi - - # create Gentoo/qconfig.h - if [[ ! -e ${ROOT}${QTHEADERDIR}/Gentoo ]]; then - if ! mkdir -p "${ROOT}${QTHEADERDIR}"/Gentoo; then - eerror "mkdir ${QTHEADERDIR}/Gentoo failed" - return 1 - fi - fi - : > "${ROOT}${QTHEADERDIR}"/Gentoo/gentoo-qconfig.h - for x in "${ROOT}${QTHEADERDIR}"/Gentoo/gentoo-*-qconfig.h; do - [[ -f ${x} ]] || continue - cat "${x}" >> "${ROOT}${QTHEADERDIR}"/Gentoo/gentoo-qconfig.h - done - else - rm -f "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri - rm -f "${ROOT}${QTHEADERDIR}"/Gentoo/gentoo-qconfig.h - rmdir "${ROOT}${QTDATADIR}"/mkspecs \ - "${ROOT}${QTDATADIR}" \ - "${ROOT}${QTHEADERDIR}"/Gentoo \ - "${ROOT}${QTHEADERDIR}" 2>/dev/null - fi - fi -} - -# @FUNCTION: qt4-build_pkg_postrm -# @DESCRIPTION: -# Regenerate configuration when the package is completely removed. -qt4-build_pkg_postrm() { - generate_qconfigs -} - -# @FUNCTION: qt4-build_pkg_postinst -# @DESCRIPTION: -# Regenerate configuration, plus throw a message about possible -# breakages and proposed solutions. -qt4-build_pkg_postinst() { - generate_qconfigs -} - -# @FUNCTION: skip_qmake_build -# @INTERNAL -# @DESCRIPTION: -# Patches configure to skip qmake compilation, as it's already installed by qtcore. -skip_qmake_build() { - sed -i -e "s:if true:if false:g" "${S}"/configure || die -} - -# @FUNCTION: skip_project_generation -# @INTERNAL -# @DESCRIPTION: -# Exit the script early by throwing in an exit before all of the .pro files are scanned. -skip_project_generation() { - sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure || die -} - -# @FUNCTION: symlink_binaries_to_buildtree -# @INTERNAL -# @DESCRIPTION: -# Symlinks generated binaries to buildtree, so they can be used during compilation time. -symlink_binaries_to_buildtree() { - for bin in qmake moc uic rcc; do - ln -s "${QTBINDIR}"/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed" - done -} - -# @FUNCTION: fix_library_files -# @INTERNAL -# @DESCRIPTION: -# Fixes the paths in *.la, *.prl, *.pc, as they are wrong due to sandbox and -# moves the *.pc files into the pkgconfig directory. -fix_library_files() { - local libfile - for libfile in "${D}"/${QTLIBDIR}/{*.la,*.prl,pkgconfig/*.pc}; do - if [[ -e ${libfile} ]]; then - sed -i -e "s:${S}/lib:${QTLIBDIR}:g" ${libfile} || die "sed on ${libfile} failed" - fi - done - - # pkgconfig files refer to WORKDIR/bin as the moc and uic locations - for libfile in "${D}"/${QTLIBDIR}/pkgconfig/*.pc; do - if [[ -e ${libfile} ]]; then - sed -i -e "s:${S}/bin:${QTBINDIR}:g" ${libfile} || die "sed on ${libfile} failed" - - # Move .pc files into the pkgconfig directory - dodir ${QTPCDIR#${EPREFIX}} - mv ${libfile} "${D}"/${QTPCDIR}/ || die "moving ${libfile} to ${D}/${QTPCDIR}/ failed" - fi - done - - # Don't install an empty directory - rmdir "${D}"/${QTLIBDIR}/pkgconfig -} - -# @FUNCTION: qt_use -# @USAGE: < flag > [ feature ] [ enableval ] -# @DESCRIPTION: -# This will echo "-${enableval}-${feature}" if is enabled, or -# "-no-${feature}" if it's disabled. If [feature] is not specified, -# will be used for that. If [enableval] is not specified, it omits the -# "-${enableval}" part. -qt_use() { - use "$1" && echo "${3:+-$3}-${2:-$1}" || echo "-no-${2:-$1}" -} - -# @FUNCTION: qt_mkspecs_dir -# @RETURN: the specs-directory w/o path -# @DESCRIPTION: -# Allows us to define which mkspecs dir we want to use. -qt_mkspecs_dir() { - local spec= - - case "${CHOST}" in - *-freebsd*|*-dragonfly*) - spec=freebsd ;; - *-openbsd*) - spec=openbsd ;; - *-netbsd*) - spec=netbsd ;; - *-darwin*) - if use aqua; then - # mac with carbon/cocoa - spec=macx - else - # darwin/mac with x11 - spec=darwin - fi - ;; - *-solaris*) - spec=solaris ;; - *-linux-*|*-linux) - spec=linux ;; - *) - die "${FUNCNAME}(): Unknown CHOST '${CHOST}'" ;; - esac - - case "$(tc-getCXX)" in - *g++*) - spec+=-g++ ;; - *icpc*) - spec+=-icc ;; - *) - die "${FUNCNAME}(): Unknown compiler '$(tc-getCXX)'" ;; - esac - - # Add -64 for 64bit profiles - if use x64-freebsd || - use amd64-linux || - use x64-macos || - use x64-solaris || - use sparc64-solaris - then - spec+=-64 - fi - - echo "${spec}" -} - -# @FUNCTION: qt_nolibx11 -# @INTERNAL -# @DESCRIPTION: -# Skip X11 tests for packages that don't need X libraries installed. -qt_nolibx11() { - sed -i -e '/^if.*PLATFORM_X11.*CFG_GUI/,/^fi$/d' "${S}"/configure || die -} - -EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_install src_test pkg_postrm pkg_postinst diff --git a/sdk_container/src/third_party/portage-stable/eclass/qt4-r2.eclass b/sdk_container/src/third_party/portage-stable/eclass/qt4-r2.eclass index c988d83fcc..1273f1d815 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/qt4-r2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/qt4-r2.eclass @@ -1,18 +1,20 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-r2.eclass,v 1.31 2014/11/01 23:48:16 pesa Exp $ +# $Id$ # @ECLASS: qt4-r2.eclass # @MAINTAINER: -# Qt herd +# qt@gentoo.org # @BLURB: Eclass for Qt4-based packages, second edition. # @DESCRIPTION: # This eclass contains various functions that may be useful when -# dealing with packages using Qt4 libraries. Requires EAPI=2 or later. +# dealing with packages using Qt4 libraries. Supports only EAPIs +# 2, 3, 4, and 5. Use qmake-utils.eclass in EAPI 6 and later. case ${EAPI} in 2|3|4|5) : ;; - *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;; + 6) die "qt4-r2.eclass is banned in EAPI 6 and later" ;; + *) die "qt4-r2.eclass: unsupported EAPI=${EAPI:-0}" ;; esac inherit base eutils qmake-utils diff --git a/sdk_container/src/third_party/portage-stable/eclass/qt5-build.eclass b/sdk_container/src/third_party/portage-stable/eclass/qt5-build.eclass index 73a409c491..368af3766a 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/qt5-build.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/qt5-build.eclass @@ -1,37 +1,64 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt5-build.eclass,v 1.20 2015/06/17 15:48:58 pesa Exp $ +# $Id$ # @ECLASS: qt5-build.eclass # @MAINTAINER: -# Qt herd +# qt@gentoo.org # @AUTHOR: # Davide Pesavento # @BLURB: Eclass for Qt5 split ebuilds. # @DESCRIPTION: # This eclass contains various functions that are used when building Qt5. -# Requires EAPI 5. +# Requires EAPI 5 or 6. + +if [[ ${CATEGORY} != dev-qt ]]; then + die "qt5-build.eclass is only to be used for building Qt 5." +fi case ${EAPI} in - 5) : ;; + 5|6) : ;; *) die "qt5-build.eclass: unsupported EAPI=${EAPI:-0}" ;; esac -inherit eutils flag-o-matic multilib toolchain-funcs virtualx - -QT5_MINOR_VERSION=${PV#*.} -QT5_MINOR_VERSION=${QT5_MINOR_VERSION%%.*} - -HOMEPAGE="https://www.qt.io/" -LICENSE="|| ( LGPL-2.1 LGPL-3 ) FDL-1.3" -SLOT="5" - # @ECLASS-VARIABLE: QT5_MODULE # @DESCRIPTION: # The upstream name of the module this package belongs to. Used for # SRC_URI and EGIT_REPO_URI. Must be defined before inheriting the eclass. : ${QT5_MODULE:=${PN}} +# @ECLASS-VARIABLE: QT5_TARGET_SUBDIRS +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array variable containing the source directories that should be built. +# All paths must be relative to ${S}. + +# @ECLASS-VARIABLE: QT5_GENTOO_CONFIG +# @DEFAULT_UNSET +# @DESCRIPTION: +# Array of triplets that are evaluated in src_install +# to generate the per-package list of enabled QT_CONFIG features and macro +# definitions, which are then merged together with all other Qt5 packages +# installed on the system to obtain the global qconfig.{h,pri} files. + +# @ECLASS-VARIABLE: VIRTUALX_REQUIRED +# @DESCRIPTION: +# For proper description see virtualx.eclass man page. +# Here we redefine default value to be manual, if your package needs virtualx +# for tests you should proceed with setting VIRTUALX_REQUIRED=test. +: ${VIRTUALX_REQUIRED:=manual} + +[[ ${EAPI} == 5 ]] && inherit multilib +inherit eutils flag-o-matic toolchain-funcs versionator virtualx + +HOMEPAGE="https://www.qt.io/" +LICENSE="|| ( LGPL-2.1 LGPL-3 ) FDL-1.3" + +QT5_MINOR_VERSION=$(get_version_component_range 2) +readonly QT5_MINOR_VERSION + +SLOT="5" + case ${PV} in 5.9999) # git dev branch @@ -58,6 +85,7 @@ case ${PV} in S=${WORKDIR}/${MY_P} ;; esac +readonly QT5_BUILD_TYPE EGIT_REPO_URI=( "git://code.qt.io/qt/${QT5_MODULE}.git" @@ -66,6 +94,14 @@ EGIT_REPO_URI=( ) [[ ${QT5_BUILD_TYPE} == live ]] && inherit git-r3 +# @ECLASS-VARIABLE: QT5_BUILD_DIR +# @DESCRIPTION: +# Build directory for out-of-source builds. +case ${QT5_BUILD_TYPE} in + live) : ${QT5_BUILD_DIR:=${S}_build} ;; + release) : ${QT5_BUILD_DIR:=${S}} ;; # workaround for bug 497312 +esac + IUSE="debug test" [[ ${PN} == qtwebkit ]] && RESTRICT+=" mirror" # bug 524584 @@ -76,77 +112,39 @@ DEPEND=" virtual/pkgconfig " if [[ ${PN} != qttest ]]; then - if [[ ${QT5_MODULE} == qtbase ]]; then - DEPEND+=" test? ( ~dev-qt/qttest-${PV} )" - else - DEPEND+=" test? ( >=dev-qt/qttest-${PV}:5 )" - fi + DEPEND+=" test? ( ~dev-qt/qttest-${PV} )" fi RDEPEND=" dev-qt/qtchooser " -EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test pkg_postinst pkg_postrm - - -# @ECLASS-VARIABLE: PATCHES -# @DEFAULT_UNSET -# @DESCRIPTION: -# Array variable containing all the patches to be applied. This variable -# is expected to be defined in the global scope of ebuilds. Make sure to -# specify the full path. This variable is used in src_prepare phase. -# -# Example: -# @CODE -# PATCHES=( -# "${FILESDIR}/mypatch.patch" -# "${FILESDIR}/mypatch2.patch" -# ) -# @CODE - -# @ECLASS-VARIABLE: QT5_TARGET_SUBDIRS -# @DEFAULT_UNSET -# @DESCRIPTION: -# Array variable containing the source directories that should be built. -# All paths must be relative to ${S}. - -# @ECLASS-VARIABLE: QT5_BUILD_DIR -# @DESCRIPTION: -# Build directory for out-of-source builds. -case ${QT5_BUILD_TYPE} in - live) : ${QT5_BUILD_DIR:=${S}_build} ;; - release) : ${QT5_BUILD_DIR:=${S}} ;; # workaround for bug 497312 -esac - -# @ECLASS-VARIABLE: QT5_GENTOO_CONFIG -# @DEFAULT_UNSET -# @DESCRIPTION: -# Array of triplets that are evaluated in src_install -# to generate the per-package list of enabled QT_CONFIG features and macro -# definitions, which are then merged together with all other Qt5 packages -# installed on the system to obtain the global qconfig.{h,pri} files. - -# @ECLASS-VARIABLE: VIRTUALX_REQUIRED -# @DESCRIPTION: -# For proper description see virtualx.eclass man page. -# Here we redefine default value to be manual, if your package needs virtualx -# for tests you should proceed with setting VIRTUALX_REQUIRED=test. -: ${VIRTUALX_REQUIRED:=manual} - ###### Phase functions ###### +EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test pkg_postinst pkg_postrm + # @FUNCTION: qt5-build_src_unpack # @DESCRIPTION: # Unpacks the sources. qt5-build_src_unpack() { - if [[ $(gcc-major-version) -lt 4 ]] || [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 5 ]]; then - ewarn - ewarn "Using a GCC version lower than 4.5 is not supported." - ewarn + local gcc_version_check_fatal=false + local min_gcc4_minor_version=5 + if [[ ${QT5_MINOR_VERSION} -ge 6 ]]; then + gcc_version_check_fatal=true + fi + if [[ ${QT5_MINOR_VERSION} -ge 7 || ${PN} == qtwebengine ]]; then + min_gcc4_minor_version=7 + fi + if [[ $(gcc-major-version) -lt 4 ]] || \ + [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt ${min_gcc4_minor_version} ]]; then + if ${gcc_version_check_fatal}; then + die "GCC version 4.${min_gcc4_minor_version} or later is required to build this package" + else + ewarn "Using a GCC version lower than 4.${min_gcc4_minor_version} is not supported" + fi fi - if [[ ${PN} == qtwebkit ]]; then + if [[ ${PN} == qtwebengine || ${PN} == qtwebkit ]]; then eshopts_push -s extglob if is-flagq '-g?(gdb)?([1-9])'; then ewarn @@ -192,14 +190,27 @@ qt5-build_src_prepare() { configure || die "sed failed (QMAKE_CONF_COMPILER)" # Respect toolchain and flags in config.tests - find config.tests/unix -name '*.test' -type f \ - -execdir sed -i -e '/bin\/qmake/ s/-nocache //' '{}' + \ - || die "sed failed (config.tests)" + find config.tests/unix -name '*.test' -type f -execdir \ + sed -i -e '/bin\/qmake/ s/-nocache //' '{}' + || die + + # Don't add -O3 to CXXFLAGS (bug 549140) + sed -i -e '/CONFIG\s*+=/ s/optimize_full//' \ + src/{corelib/corelib,gui/gui}.pro || die "sed failed (optimize_full)" + + # Don't inject -msse/-mavx/... into CXXFLAGS when detecting + # compiler support for extended instruction sets (bug 552942) + if [[ ${QT5_MINOR_VERSION} -ge 5 ]]; then + find config.tests/common -name '*.pro' -type f -execdir \ + sed -i -e '/else:QMAKE_CXXFLAGS\s*+=/ d' '{}' + || die + fi fi - # apply patches - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - epatch_user + if [[ ${EAPI} == 5 ]]; then + [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" + epatch_user + else + default + fi } # @FUNCTION: qt5-build_src_configure @@ -225,29 +236,27 @@ qt5-build_src_compile() { # @DESCRIPTION: # Runs tests in the target directories. qt5-build_src_test() { - # '-after SUBDIRS-=...' disables broken cmake tests (bug 474004) - qt5_foreach_target_subdir qt5_qmake -after SUBDIRS-=cmake SUBDIRS-=installed_cmake + # disable broken cmake tests (bug 474004) + local myqmakeargs=("${myqmakeargs[@]}" -after SUBDIRS-=cmake SUBDIRS-=installed_cmake) + + qt5_foreach_target_subdir qt5_qmake qt5_foreach_target_subdir emake # create a custom testrunner script that correctly sets - # {,DY}LD_LIBRARY_PATH before executing the given test + # LD_LIBRARY_PATH before executing the given test local testrunner=${QT5_BUILD_DIR}/gentoo-testrunner - cat <<-EOF > "${testrunner}" + cat > "${testrunner}" <<-_EOF_ || die #!/bin/sh export LD_LIBRARY_PATH="${QT5_BUILD_DIR}/lib:${QT5_LIBDIR}" - export DYLD_LIBRARY_PATH="${QT5_BUILD_DIR}/lib:${QT5_LIBDIR}" "\$@" - EOF + _EOF_ chmod +x "${testrunner}" - _qt5_test_runner() { - qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check - } - + set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check if [[ ${VIRTUALX_REQUIRED} == test ]]; then - VIRTUALX_COMMAND="_qt5_test_runner" virtualmake + virtx "$@" else - _qt5_test_runner + "$@" fi } @@ -282,7 +291,7 @@ qt5-build_src_install() { || die "sed failed (qconfig.h)" # install qtchooser configuration file - cat > "${T}/qt5-${CHOST}.conf" <<-_EOF_ + cat > "${T}/qt5-${CHOST}.conf" <<-_EOF_ || die ${QT5_BINDIR} ${QT5_LIBDIR} _EOF_ @@ -402,6 +411,10 @@ qt5_prepare_env() { QT5_EXAMPLESDIR=${QT5_DATADIR}/examples QT5_TESTSDIR=${QT5_DATADIR}/tests QT5_SYSCONFDIR=${EPREFIX}/etc/xdg + readonly QT5_PREFIX QT5_HEADERDIR QT5_LIBDIR QT5_ARCHDATADIR \ + QT5_BINDIR QT5_PLUGINDIR QT5_LIBEXECDIR QT5_IMPORTDIR \ + QT5_QMLDIR QT5_DATADIR QT5_DOCDIR QT5_TRANSLATIONDIR \ + QT5_EXAMPLESDIR QT5_TESTSDIR QT5_SYSCONFDIR if [[ ${QT5_MODULE} == qtbase ]]; then # see mkspecs/features/qt_config.prf @@ -412,28 +425,31 @@ qt5_prepare_env() { # @FUNCTION: qt5_foreach_target_subdir # @INTERNAL # @DESCRIPTION: -# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS. +# Executes the command given as argument from inside each directory +# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically. qt5_foreach_target_subdir() { [[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("") - local ret=0 subdir= + local die_args=() + [[ ${EAPI} != 5 ]] && die_args+=(-n) + + local subdir= for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do if [[ ${EBUILD_PHASE} == test ]]; then subdir=tests/auto${subdir#src} [[ -d ${S}/${subdir} ]] || continue fi - mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die + local msg="Running $* ${subdir:+in ${subdir}}" + einfo "${msg}" - einfo "Running $* ${subdir:+in ${subdir}}" - "$@" - ((ret+=$?)) + mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die "${die_args[@]}" || return $? + pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die "${die_args[@]}" || return $? - popd >/dev/null || die + "$@" || die "${die_args[@]}" "${msg} failed" || return $? + + popd >/dev/null || die "${die_args[@]}" || return $? done - - return ${ret} } # @FUNCTION: qt5_symlink_tools_to_build_dir @@ -445,7 +461,6 @@ qt5_symlink_tools_to_build_dir() { local tool= tools=() if [[ ${PN} != qtcore ]]; then tools+=(qmake moc rcc qlalr) - [[ ${PN} != qdoc ]] && tools+=(qdoc) [[ ${PN} != qtdbus ]] && tools+=(qdbuscpp2xml qdbusxml2cpp) [[ ${PN} != qtwidgets ]] && tools+=(uic) fi @@ -494,11 +509,15 @@ qt5_base_configure() { -release -no-separate-debug-info + # no need to forcefully build host tools in optimized mode, + # just follow the overall debug/release build type + $([[ ${QT5_MINOR_VERSION} -ge 6 ]] && echo -no-optimized-tools) + # licensing stuff -opensource -confirm-license - # let configure automatically figure out if C++11 is supported - #-c++11 + # autodetect the highest supported version of the C++ standard + #-c++std # build shared libraries -shared @@ -517,16 +536,16 @@ qt5_base_configure() { # obsolete flag, does nothing #-qml-debug - # instruction set support - $(is-flagq -mno-sse2 && echo -no-sse2) - $(is-flagq -mno-sse3 && echo -no-sse3) - $(is-flagq -mno-ssse3 && echo -no-ssse3) - $(is-flagq -mno-sse4.1 && echo -no-sse4.1) - $(is-flagq -mno-sse4.2 && echo -no-sse4.2) - $(is-flagq -mno-avx && echo -no-avx) - $(is-flagq -mno-avx2 && echo -no-avx2) - $(is-flagq -mno-dsp && echo -no-mips_dsp) - $(is-flagq -mno-dspr2 && echo -no-mips_dspr2) + # extended instruction sets support + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-sse2 && echo -no-sse2) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-sse3 && echo -no-sse3) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-ssse3 && echo -no-ssse3) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-sse4.1 && echo -no-sse4.1) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-sse4.2 && echo -no-sse4.2) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-avx && echo -no-avx) + $([[ ${QT5_MINOR_VERSION} -le 4 ]] && is-flagq -mno-avx2 && echo -no-avx2) + $(is-flagq -mno-dsp && echo -no-mips_dsp) + $(is-flagq -mno-dspr2 && echo -no-mips_dspr2) # use pkg-config to detect include and library paths -pkg-config @@ -535,27 +554,26 @@ qt5_base_configure() { -system-zlib -system-pcre - # don't specify -no-gif because there is no way to override it later - #-no-gif - # disable everything to prevent automagic deps (part 1) -no-mtdev -no-journald + $([[ ${QT5_MINOR_VERSION} -ge 6 ]] && echo -no-syslog) -no-libpng -no-libjpeg -no-freetype -no-harfbuzz -no-openssl $([[ ${QT5_MINOR_VERSION} -ge 5 ]] && echo -no-libproxy) + $([[ ${QT5_MINOR_VERSION} -ge 5 ]] && echo -no-xkbcommon-{x11,evdev}) -no-xinput2 -no-xcb-xlib + # don't specify -no-gif because there is no way to override it later + #-no-gif + # always enable glib event loop support -glib # disable everything to prevent automagic deps (part 2) -no-pulseaudio -no-alsa - - # override in qtgui and qtwidgets where x11-libs/cairo[qt4] is blocked - # to avoid adding qt4 include paths (bug 433826) - -no-gtkstyle + $([[ ${QT5_MINOR_VERSION} -ge 7 ]] && echo -no-gtk || echo -no-gtkstyle) # exclude examples and tests from default build -nomake examples @@ -568,9 +586,6 @@ qt5_base_configure() { # print verbose information about each configure test -verbose - # doesn't actually matter since we override CXXFLAGS - #-no-optimized-qmake - # obsolete flag, does nothing #-nis @@ -578,15 +593,20 @@ qt5_base_configure() { -iconv # disable everything to prevent automagic deps (part 3) - -no-cups -no-evdev -no-icu -no-fontconfig -no-dbus + -no-cups -no-evdev + $([[ ${QT5_MINOR_VERSION} -ge 5 ]] && echo -no-tslib) + -no-icu -no-fontconfig + -no-dbus - # don't strip + # let portage handle stripping -no-strip - # precompiled headers are not that useful for us - # and cause problems on hardened, so turn them off + # precompiled headers can cause problems on hardened, so turn them off -no-pch + # link-time code generation is not something we want to enable by default + $([[ ${QT5_MINOR_VERSION} -ge 6 ]] && echo -no-ltcg) + # reduced relocations cause major breakage on at least arm and ppc, so # don't specify anything and let the configure figure out if they are # supported; see also https://bugreports.qt.io/browse/QTBUG-36129 @@ -596,7 +616,10 @@ qt5_base_configure() { #-use-gold-linker # disable all platform plugins by default, override in qtgui - -no-xcb -no-eglfs -no-directfb -no-linuxfb -no-kms + -no-xcb -no-eglfs -no-kms + $([[ ${QT5_MINOR_VERSION} -ge 6 ]] && echo -no-gbm) + -no-directfb -no-linuxfb + $([[ ${QT5_MINOR_VERSION} -ge 6 ]] && echo -no-mirclient) # disable undocumented X11-related flags, override in qtgui # (not shown in ./configure -help output) @@ -604,8 +627,7 @@ qt5_base_configure() { # disable obsolete/unused X11-related flags # (not shown in ./configure -help output) - -no-mitshm -no-xcursor -no-xfixes -no-xinerama -no-xinput - -no-xrandr -no-xshape -no-xsync -no-xvideo + -no-mitshm -no-xcursor -no-xfixes -no-xrandr -no-xshape -no-xsync # always enable session management support: it doesn't need extra deps # at configure time and turning it off is dangerous, see bug 518262 @@ -614,9 +636,16 @@ qt5_base_configure() { # typedef qreal to double (warning: changing this flag breaks the ABI) -qreal double - # disable opengl and egl by default, override in qtgui and qtopengl + # disable OpenGL and EGL support by default, override in qtgui, + # qtopengl, qtprintsupport and qtwidgets -no-opengl -no-egl + # disable libinput-based generic plugin by default, override in qtgui + $([[ ${QT5_MINOR_VERSION} -ge 5 ]] && echo -no-libinput) + + # disable gstreamer by default, override in qtmultimedia + $([[ ${QT5_MINOR_VERSION} -ge 5 ]] && echo -no-gstreamer) + # use upstream default #-no-system-proxies @@ -650,6 +679,7 @@ qt5_qmake() { fi "${qmakepath}"/qmake \ + "${projectdir}" \ CONFIG+=$(usex debug debug release) \ CONFIG-=$(usex debug release debug) \ QMAKE_AR="$(tc-getAR) cqs" \ @@ -671,9 +701,8 @@ qt5_qmake() { QMAKE_LFLAGS="${LDFLAGS}" \ QMAKE_LFLAGS_RELEASE= \ QMAKE_LFLAGS_DEBUG= \ - "${projectdir}" \ - "$@" \ - || die "qmake failed (${projectdir})" + "${myqmakeargs[@]}" \ + || die "qmake failed (${projectdir#${S}/})" } # @FUNCTION: qt5_install_module_qconfigs diff --git a/sdk_container/src/third_party/portage-stable/eclass/ros-catkin.eclass b/sdk_container/src/third_party/portage-stable/eclass/ros-catkin.eclass new file mode 100644 index 0000000000..412ff66e01 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/eclass/ros-catkin.eclass @@ -0,0 +1,248 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +# @ECLASS: ros-catkin.eclass +# @MAINTAINER: +# ros@gentoo.org +# @AUTHOR: +# Alexis Ballier +# @BLURB: Template eclass for catkin based ROS packages. +# @DESCRIPTION: +# Provides function for building ROS packages on Gentoo. +# It supports selectively building messages, multi-python installation, live ebuilds (git only). + +case "${EAPI:-0}" in + 0|1|2|3|4) + die "EAPI='${EAPI}' is not supported" + ;; + *) + ;; +esac + +# @ECLASS-VARIABLE: ROS_REPO_URI +# @DESCRIPTION: +# URL of the upstream repository. Usually on github. +# Serves for fetching tarballs, live ebuilds and inferring the meta-package name. +EGIT_REPO_URI="${ROS_REPO_URI}" + +# @ECLASS-VARIABLE: ROS_SUBDIR +# @DEFAULT_UNSET +# @DESCRIPTION: +# Subdir in which current packages is located. +# Usually, a repository contains several packages, hence a typical value is: +# ROS_SUBDIR=${PN} + +SCM="" +if [ "${PV#9999}" != "${PV}" ] ; then + SCM="git-r3" +fi + +# @ECLASS-VARIABLE: PYTHON_COMPAT +# @DESCRIPTION: +# Tells the eclass the package has python code and forwards it to python-r1.eclass. +PYTHON_ECLASS="" +CATKIN_PYTHON_USEDEP="" +if [ -n "${PYTHON_COMPAT}" ] ; then + PYTHON_ECLASS="python-r1 python-utils-r1" +fi + +inherit ${SCM} ${PYTHON_ECLASS} cmake-utils + +CATKIN_DO_PYTHON_MULTIBUILD="" +if [ -n "${PYTHON_COMPAT}" ] ; then + CATKIN_PYTHON_USEDEP="[${PYTHON_USEDEP}]" + CATKIN_DO_PYTHON_MULTIBUILD="yes" +fi + +IUSE="test" +RDEPEND=" + dev-util/catkin${CATKIN_PYTHON_USEDEP} + dev-python/empy${CATKIN_PYTHON_USEDEP} +" +DEPEND="${RDEPEND}" + +if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + RDEPEND="${RDEPEND} dev-lang/python-exec:2 ${PYTHON_DEPS}" + DEPEND="${DEPEND} ${PYTHON_DEPS}" +fi + +# @ECLASS-VARIABLE: CATKIN_HAS_MESSAGES +# @DESCRIPTION: +# Set it to a non-empty value before inherit to tell the eclass the package has messages to build. +# Messages will be built based on ROS_MESSAGES USE_EXPANDed variable. + +# @ECLASS-VARIABLE: CATKIN_MESSAGES_TRANSITIVE_DEPS +# @DESCRIPTION: +# Some messages have dependencies on other messages. +# In that case, CATKIN_MESSAGES_TRANSITIVE_DEPS should contain a space-separated list of atoms +# representing those dependencies. The eclass uses it to ensure proper dependencies on these packages. +if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then + IUSE="${IUSE} +ros_messages_python +ros_messages_cxx ros_messages_eus ros_messages_lisp" + RDEPEND="${RDEPEND} + ros_messages_cxx? ( dev-ros/gencpp:=${CATKIN_PYTHON_USEDEP} ) + ros_messages_eus? ( dev-ros/geneus:=${CATKIN_PYTHON_USEDEP} ) + ros_messages_python? ( dev-ros/genpy:=${CATKIN_PYTHON_USEDEP} ) + ros_messages_lisp? ( dev-ros/genlisp:=${CATKIN_PYTHON_USEDEP} ) + dev-ros/message_runtime + " + DEPEND="${DEPEND} ${RDEPEND} + dev-ros/message_generation + dev-ros/genmsg${CATKIN_PYTHON_USEDEP} + " + if [ -n "${CATKIN_MESSAGES_TRANSITIVE_DEPS}" ] ; then + for i in ${CATKIN_MESSAGES_TRANSITIVE_DEPS} ; do + ds="${i}[ros_messages_python(-)?,ros_messages_cxx(-)?,ros_messages_lisp(-)?,ros_messages_eus(-)?] ros_messages_python? ( ${i}[${PYTHON_USEDEP}] )" + RDEPEND="${RDEPEND} ${ds}" + DEPEND="${DEPEND} ${ds}" + done + fi +fi + +# @ECLASS-VARIABLE: CATKIN_MESSAGES_CXX_USEDEP +# @DESCRIPTION: +# Use it as cat/pkg[${CATKIN_MESSAGES_CXX_USEDEP}] to indicate a dependency on the C++ messages of cat/pkg. +CATKIN_MESSAGES_CXX_USEDEP="ros_messages_cxx(-)" + +# @ECLASS-VARIABLE: CATKIN_MESSAGES_PYTHON_USEDEP +# @DESCRIPTION: +# Use it as cat/pkg[${CATKIN_MESSAGES_PYTHON_USEDEP}] to indicate a dependency on the Python messages of cat/pkg. +CATKIN_MESSAGES_PYTHON_USEDEP="ros_messages_python(-),${PYTHON_USEDEP}" + +# @ECLASS-VARIABLE: CATKIN_MESSAGES_LISP_USEDEP +# @DESCRIPTION: +# Use it as cat/pkg[${CATKIN_MESSAGES_LISP_USEDEP}] to indicate a dependency on the Common-Lisp messages of cat/pkg. +CATKIN_MESSAGES_LISP_USEDEP="ros_messages_lisp(-)" + +# @ECLASS-VARIABLE: CATKIN_MESSAGES_EUS_USEDEP +# @DESCRIPTION: +# Use it as cat/pkg[${CATKIN_MESSAGES_EUS_USEDEP}] to indicate a dependency on the EusLisp messages of cat/pkg. +CATKIN_MESSAGES_EUS_USEDEP="ros_messages_eus(-)" + +if [ "${PV#9999}" != "${PV}" ] ; then + SRC_URI="" + KEYWORDS="" + S=${WORKDIR}/${P}/${ROS_SUBDIR} +else + SRC_URI="${ROS_REPO_URI}/archive/${VER_PREFIX}${PV%_*}${VER_SUFFIX}.tar.gz -> ${ROS_REPO_URI##*/}-${PV}.tar.gz" + S=${WORKDIR}/${VER_PREFIX}${ROS_REPO_URI##*/}-${PV}${VER_SUFFIX}/${ROS_SUBDIR} +fi + +HOMEPAGE="http://wiki.ros.org/${PN}" + +# @FUNCTION: ros-catkin_src_prepare +# @DESCRIPTION: +# Calls cmake-utils_src_prepare (so that PATCHES array is handled there) and initialises the workspace +# by installing a recursive CMakeLists.txt to handle bundles. +ros-catkin_src_prepare() { + cmake-utils_src_prepare + + if [ ! -f "${S}/CMakeLists.txt" ] ; then + catkin_init_workspace || die + fi +} + +# @FUNCTION: ros-catkin_src_configure_internal +# @DESCRIPTION: +# Internal decoration of cmake-utils_src_configure to handle multiple python installs. +ros-catkin_src_configure_internal() { + if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + local mycmakeargs=("${mycmakeargs[@]}" -DPYTHON_EXECUTABLE="${PYTHON}") + python_export PYTHON_SCRIPTDIR + fi + cmake-utils_src_configure "${@}" +} + +# @VARIABLE: mycatkincmakeargs +# @DEFAULT_UNSET +# @DESCRIPTION: +# Optional cmake defines as a bash array. Should be defined before calling +# src_configure. + +# @FUNCTION: ros-catkin_src_configure +# @DESCRIPTION: +# Configures a catkin-based package. +ros-catkin_src_configure() { + export CMAKE_PREFIX_PATH="${EPREFIX}/usr" + export ROS_ROOT="${EPREFIX}/usr/share/ros" + if [ -n "${CATKIN_HAS_MESSAGES}" ] ; then + ROS_LANG_DISABLE="" + use ros_messages_cxx || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:gencpp" + use ros_messages_eus || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:geneus" + use ros_messages_lisp || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:genlisp" + use ros_messages_python || ROS_LANG_DISABLE="${ROS_LANG_DISABLE}:genpy" + export ROS_LANG_DISABLE + fi + local mycmakeargs=( + "$(cmake-utils_use test CATKIN_ENABLE_TESTING)" + "-DCATKIN_BUILD_BINARY_PACKAGE=ON" + "-DCATKIN_PREFIX_PATH=${SYSROOT:-${EROOT}}/usr" + "${mycatkincmakeargs[@]}" + ) + if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + python_foreach_impl ros-catkin_src_configure_internal "${@}" + else + ros-catkin_src_configure_internal "${@}" + fi +} + +# @FUNCTION: ros-catkin_src_compile +# @DESCRIPTION: +# Builds a catkin-based package. +ros-catkin_src_compile() { + if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + python_foreach_impl cmake-utils_src_compile "${@}" + else + cmake-utils_src_compile "${@}" + fi +} + +# @FUNCTION: ros-catkin_src_test_internal +# @DESCRIPTION: +# Decorator around cmake-utils_src_test to ensure tests are built before running them. +ros-catkin_src_test_internal() { + cd "${BUILD_DIR}" || die + if nonfatal cmake-utils_src_make tests -n &> /dev/null ; then + cmake-utils_src_make tests + fi + cmake-utils_src_test "${@}" +} + +# @FUNCTION: ros-catkin_src_test +# @DESCRIPTION: +# Run the tests of a catkin-based package. +ros-catkin_src_test() { + if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + python_foreach_impl ros-catkin_src_test_internal "${@}" + else + ros-catkin_src_test_internal "${@}" + fi +} + +# @FUNCTION: ros-catkin_src_install_with_python +# @DESCRIPTION: +# Decorator around cmake-utils_src_install to ensure python scripts are properly handled w.r.t. python-exec2. +ros-catkin_src_install_with_python() { + python_export PYTHON_SCRIPTDIR + cmake-utils_src_install "${@}" + if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then + dodir /usr/bin + for i in "${D}/${PYTHON_SCRIPTDIR}"/* ; do + dosym ../lib/python-exec/python-exec2 "/usr/bin/${i##*/}" + done + touch "${T}/.catkin_python_symlinks_generated" || die + fi +} + +# @FUNCTION: ros-catkin_src_install +# @DESCRIPTION: +# Installs a catkin-based package. +ros-catkin_src_install() { + if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + python_foreach_impl ros-catkin_src_install_with_python "${@}" + else + cmake-utils_src_install "${@}" + fi +} + +EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install diff --git a/sdk_container/src/third_party/portage-stable/eclass/scons-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/scons-utils.eclass index c458af5d0a..0493ec1dec 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/scons-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/scons-utils.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/scons-utils.eclass,v 1.11 2012/09/27 16:35:42 axs Exp $ +# $Id$ # @ECLASS: scons-utils.eclass # @MAINTAINER: @@ -9,27 +9,42 @@ # @DESCRIPTION: # This eclass provides a set of function to help developers sanely call # dev-util/scons and pass parameters to it. -# @EXAMPLE: # +# Please note that SCons is more like a 'build system creation kit', +# and requires a lot of upstream customization to be used sanely. +# You will often need to request fixes upstream and/or patch the build +# system. In particular: +# +# 1. There are no 'standard' variables. To respect CC, CXX, CFLAGS, +# CXXFLAGS, CPPFLAGS, LDFLAGS, upstream needs to define appropriate +# variables explicitly. In some cases, upstreams respect envvars, +# in others you need to pass them as options. +# +# 2. SCons scrubs out environment by default and replaces it with some +# pre-defined values. To respect environment variables such as PATH, +# Upstreams need to explicitly get them from os.environ and copy them +# to the build environment. +# +# @EXAMPLE: # @CODE # inherit scons-utils toolchain-funcs # -# EAPI=4 +# EAPI=5 # # src_configure() { -# myesconsargs=( +# MYSCONS=( # CC="$(tc-getCC)" -# $(use_scons nls ENABLE_NLS) +# ENABLE_NLS=$(usex nls) # ) # } # # src_compile() { -# escons +# escons "${MYSCONS[@]}" # } # # src_install() { # # note: this can be DESTDIR, INSTALL_ROOT, ... depending on package -# escons DESTDIR="${D}" install +# escons "${MYSCONS[@]}" DESTDIR="${D}" install # } # @CODE @@ -43,6 +58,8 @@ # @VARIABLE: myesconsargs # @DEFAULT_UNSET # @DESCRIPTION: +# DEPRECATED, EAPI 0..5 ONLY: pass options to escons instead +# # List of package-specific options to pass to all SCons calls. Supposed to be # set in src_configure(). @@ -62,18 +79,22 @@ # @ECLASS-VARIABLE: USE_SCONS_TRUE # @DESCRIPTION: +# DEPRECATED: use usex instead +# # The default value for truth in scons-use() (1 by default). : ${USE_SCONS_TRUE:=1} # @ECLASS-VARIABLE: USE_SCONS_FALSE # @DESCRIPTION: +# DEPRECATED: use usex instead +# # The default value for false in scons-use() (0 by default). : ${USE_SCONS_FALSE:=0} # -- EAPI support check -- case ${EAPI:-0} in - 0|1|2|3|4|5) ;; + 0|1|2|3|4|5|6) ;; *) die "EAPI ${EAPI} unsupported." esac @@ -88,36 +109,82 @@ fi # -- public functions -- # @FUNCTION: escons -# @USAGE: [scons-arg] ... +# @USAGE: [...] # @DESCRIPTION: -# Call scons, passing the supplied arguments, ${myesconsargs[@]}, -# filtered ${MAKEOPTS}, ${EXTRA_ESCONS}. Similar to emake. Like emake, -# this function does die on failure in EAPI 4 (unless called nonfatal). +# Call scons, passing the supplied arguments. Like emake, this function +# does die on failure in EAPI 4. Respects nonfatal in EAPI 6 and newer. escons() { local ret debug-print-function ${FUNCNAME} "${@}" + # Use myesconsargs in EAPI 5 and older + if [[ ${EAPI} == [012345] ]]; then + set -- "${myesconsargs[@]}" "${@}" + fi + # if SCONSOPTS are _unset_, use cleaned MAKEOPTS - set -- scons ${SCONSOPTS-$(scons_clean_makeopts)} ${EXTRA_ESCONS} \ - "${myesconsargs[@]}" "${@}" + if [[ ! ${SCONSOPTS+set} ]]; then + local SCONSOPTS + _scons_clean_makeopts + fi + + set -- scons ${SCONSOPTS} ${EXTRA_ESCONS} "${@}" echo "${@}" >&2 "${@}" ret=${?} - [[ ${ret} -ne 0 ]] && has "${EAPI:-0}" 4 5 && die "escons failed." + if [[ ${ret} -ne 0 ]]; then + case "${EAPI:-0}" in + 0|1|2|3) # nonfatal in EAPIs 0 through 3 + ;; + 4|5) # 100% fatal in 4 & 5 + die "escons failed." + ;; + *) # respect nonfatal in 6 onwards + die -n "escons failed." + ;; + esac + fi return ${ret} } -# @FUNCTION: scons_clean_makeopts +# @FUNCTION: _scons_get_default_jobs +# @INTERNAL +# @DESCRIPTION: +# Output the default number of jobs, used if -j is used without +# argument. Tries to figure out the number of logical CPUs, falling +# back to hardcoded constant. +_scons_get_default_jobs() { + local nproc + + if type -P nproc &>/dev/null; then + # GNU + nproc=$(nproc) + elif type -P python &>/dev/null; then + # fallback to python2.6+ + # note: this may fail (raise NotImplementedError) + nproc=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count());' 2>/dev/null) + fi + + if [[ ${nproc} ]]; then + echo $(( nproc + 1 )) + else + # random default + echo 5 + fi +} + +# @FUNCTION: _scons_clean_makeopts +# @INTERNAL # @USAGE: [makeflags] [...] # @DESCRIPTION: # Strip the supplied makeflags (or ${MAKEOPTS} if called without # an argument) of options not supported by SCons and make sure --jobs # gets an argument. Output the resulting flag list (suitable # for an assignment to SCONSOPTS). -scons_clean_makeopts() { - local new_makeopts +_scons_clean_makeopts() { + local new_makeopts=() debug-print-function ${FUNCNAME} "${@}" @@ -132,27 +199,26 @@ scons_clean_makeopts() { # empty MAKEOPTS give out empty SCONSOPTS # thus, we do need to worry about the initial setup if [[ ${*} = ${_SCONS_CACHE_MAKEOPTS} ]]; then - set -- ${_SCONS_CACHE_SCONSOPTS} - debug-print "Cache hit: [${*}]" - echo ${*} + SCONSOPTS=${_SCONS_CACHE_SCONSOPTS} + debug-print "Cache hit: [${SCONSOPTS}]" return fi - export _SCONS_CACHE_MAKEOPTS=${*} + _SCONS_CACHE_MAKEOPTS=${*} while [[ ${#} -gt 0 ]]; do case ${1} in # clean, simple to check -- we like that --jobs=*|--keep-going) - new_makeopts=${new_makeopts+${new_makeopts} }${1} + new_makeopts+=( ${1} ) ;; # need to take a look at the next arg and guess --jobs) if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then - new_makeopts="${new_makeopts+${new_makeopts} }${1} ${2}" + new_makeopts+=( ${1} ${2} ) shift else # no value means no limit, let's pass a random int - new_makeopts=${new_makeopts+${new_makeopts} }${1}=5 + new_makeopts+=( ${1}=$(_scons_get_default_jobs) ) fi ;; # strip other long options @@ -167,20 +233,20 @@ scons_clean_makeopts() { while [[ -n ${str} ]]; do case ${str} in k*) - new_optstr=${new_optstr}k + new_optstr+=k ;; # -j needs to come last j) if [[ ${#} -gt 1 && ${2} =~ ^[0-9]+$ ]]; then - new_optstr="${new_optstr}j ${2}" + new_optstr+="j ${2}" shift else - new_optstr="${new_optstr}j 5" + new_optstr+="j $(_scons_get_default_jobs)" fi ;; # otherwise, everything after -j is treated as an arg j*) - new_optstr=${new_optstr}${str} + new_optstr+=${str} break ;; esac @@ -188,22 +254,23 @@ scons_clean_makeopts() { done if [[ -n ${new_optstr} ]]; then - new_makeopts=${new_makeopts+${new_makeopts} }-${new_optstr} + new_makeopts+=( -${new_optstr} ) fi ;; esac shift done - set -- ${new_makeopts} - export _SCONS_CACHE_SCONSOPTS=${*} - debug-print "New SCONSOPTS: [${*}]" - echo ${*} + SCONSOPTS=${new_makeopts[*]} + _SCONS_CACHE_SCONSOPTS=${SCONSOPTS} + debug-print "New SCONSOPTS: [${SCONSOPTS}]" } # @FUNCTION: use_scons # @USAGE: [var-name] [var-opt-true] [var-opt-false] # @DESCRIPTION: +# DEPRECATED, EAPI 0..5 ONLY: use usex instead +# # Output a SCons parameter with value depending on the USE flag state. # If the USE flag is set, output =; otherwise # =. @@ -215,6 +282,9 @@ scons_clean_makeopts() { # If and/or are omitted, # ${USE_SCONS_TRUE} and/or ${USE_SCONS_FALSE} will be used instead. use_scons() { + [[ ${EAPI} == [012345] ]] \ + || die "${FUNCNAME} is banned in EAPI ${EAPI}, use usex instead" + local flag=${1} local varname=${2:-${flag/\!/no}} local vartrue=${3:-${USE_SCONS_TRUE}} diff --git a/sdk_container/src/third_party/portage-stable/eclass/selinux-policy-2.eclass b/sdk_container/src/third_party/portage-stable/eclass/selinux-policy-2.eclass index 57af0097c6..74093febdd 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/selinux-policy-2.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/selinux-policy-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/selinux-policy-2.eclass,v 1.32 2015/04/21 11:19:10 perfinion Exp $ +# $Id$ # Eclass for installing SELinux policy, and optionally # reloading the reference-policy based modules. @@ -90,7 +90,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Project:SELinux" if [[ -n ${BASEPOL} ]] && [[ "${BASEPOL}" != "9999" ]]; then SRC_URI="https://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files/refpolicy-${PV}.tar.bz2 - http://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${BASEPOL}.tar.bz2" + https://dev.gentoo.org/~swift/patches/selinux-base-policy/patchbundle-selinux-base-policy-${BASEPOL}.tar.bz2" elif [[ "${BASEPOL}" != "9999" ]]; then SRC_URI="https://raw.githubusercontent.com/wiki/TresysTechnology/refpolicy/files/refpolicy-${PV}.tar.bz2" @@ -122,7 +122,7 @@ case "${EAPI:-0}" in *) : ;; esac -EXPORT_FUNCTIONS "src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm" +EXPORT_FUNCTIONS src_unpack src_prepare src_compile src_install pkg_postinst pkg_postrm # @FUNCTION: selinux-policy-2_src_unpack # @DESCRIPTION: @@ -198,6 +198,7 @@ selinux-policy-2_src_prepare() { for i in ${MODS}; do modfiles="$(find ${S}/refpolicy/policy/modules -iname $i.te) $modfiles" modfiles="$(find ${S}/refpolicy/policy/modules -iname $i.fc) $modfiles" + modfiles="$(find ${S}/refpolicy/policy/modules -iname $i.cil) $modfiles" if [ ${add_interfaces} -eq 1 ]; then modfiles="$(find ${S}/refpolicy/policy/modules -iname $i.if) $modfiles" @@ -228,18 +229,13 @@ selinux-policy-2_src_compile() { for i in ${POLICY_TYPES}; do # Support USE flags in builds export M4PARAM="${makeuse}" - if [[ ${BASEPOL} == 2.20140311* ]]; then - # Parallel builds are broken in 2.20140311-r7 and earlier, bug 530178 - emake -j1 NAME=$i -C "${S}"/${i} || die "${i} compile failed" - else - emake NAME=$i -C "${S}"/${i} || die "${i} compile failed" - fi + emake NAME=$i -C "${S}"/${i} || die "${i} compile failed" done } # @FUNCTION: selinux-policy-2_src_install # @DESCRIPTION: -# Install the built .pp files in the correct subdirectory within +# Install the built .pp (or copied .cil) files in the correct subdirectory within # /usr/share/selinux. selinux-policy-2_src_install() { local BASEDIR="/usr/share/selinux" @@ -248,7 +244,11 @@ selinux-policy-2_src_install() { for j in ${MODS}; do einfo "Installing ${i} ${j} policy package" insinto ${BASEDIR}/${i} - doins "${S}"/${i}/${j}.pp || die "Failed to add ${j}.pp to ${i}" + if [ -f "${S}/${i}/${j}.pp" ] ; then + doins "${S}"/${i}/${j}.pp || die "Failed to add ${j}.pp to ${i}" + elif [ -f "${S}/${i}/${j}.cil" ] ; then + doins "${S}"/${i}/${j}.cil || die "Failed to add ${j}.cil to ${i}" + fi if [[ "${POLICY_FILES[@]}" == *"${j}.if"* ]]; then @@ -261,14 +261,11 @@ selinux-policy-2_src_install() { # @FUNCTION: selinux-policy-2_pkg_postinst # @DESCRIPTION: -# Install the built .pp files in the SELinux policy stores, effectively +# Install the built .pp (or copied .cil) files in the SELinux policy stores, effectively # activating the policy on the system. selinux-policy-2_pkg_postinst() { # build up the command in the case of multiple modules local COMMAND - for i in ${MODS}; do - COMMAND="-i ${i}.pp ${COMMAND}" - done for i in ${POLICY_TYPES}; do if [ "${i}" == "strict" ] && [ "${MODS}" = "unconfined" ]; @@ -279,7 +276,14 @@ selinux-policy-2_pkg_postinst() { einfo "Inserting the following modules into the $i module store: ${MODS}" cd /usr/share/selinux/${i} || die "Could not enter /usr/share/selinux/${i}" - semodule -s ${i} ${COMMAND} + for j in ${MODS} ; do + if [ -f "${j}.pp" ] ; then + COMMAND="${j}.pp ${COMMAND}" + elif [ -f "${j}.cil" ] ; then + COMMAND="${j}.cil ${COMMAND}" + fi + done + semodule -s ${i} -i ${COMMAND} if [ $? -ne 0 ]; then ewarn "SELinux module load failed. Trying full reload..."; @@ -313,6 +317,7 @@ selinux-policy-2_pkg_postinst() { else einfo "SELinux modules loaded succesfully." fi + COMMAND=""; done # Relabel depending packages diff --git a/sdk_container/src/third_party/portage-stable/eclass/ssl-cert.eclass b/sdk_container/src/third_party/portage-stable/eclass/ssl-cert.eclass index 33bee2f8de..053e101336 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/ssl-cert.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/ssl-cert.eclass @@ -23,11 +23,18 @@ # Use flag to append dependency to. : ${SSL_CERT_USE:=ssl} -if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then - DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl )" - IUSE="${SSL_CERT_USE}" -else - DEPEND="dev-libs/openssl" +# @ECLASS-VARIABLE: SSL_DEPS_SKIP +# @DESCRIPTION: +# Set to non zero to skip adding to DEPEND and IUSE. +: ${SSL_DEPS_SKIP:=0} + +if [[ "${SSL_DEPS_SKIP}" == "0" ]]; then + if [[ "${SSL_CERT_MANDATORY}" == "0" ]]; then + DEPEND="${SSL_CERT_USE}? ( dev-libs/openssl )" + IUSE="${SSL_CERT_USE}" + else + DEPEND="dev-libs/openssl" + fi fi # @FUNCTION: gen_cnf diff --git a/sdk_container/src/third_party/portage-stable/eclass/systemd.eclass b/sdk_container/src/third_party/portage-stable/eclass/systemd.eclass index f06d85063b..f6cc004257 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/systemd.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/systemd.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/systemd.eclass,v 1.32 2014/05/31 10:23:36 mgorny Exp $ +# $Id$ # @ECLASS: systemd.eclass # @MAINTAINER: @@ -15,46 +15,71 @@ # inherit systemd # # src_configure() { -# local myeconfargs=( +# local myconf=( # --enable-foo -# --disable-bar -# "$(systemd_with_unitdir)" +# --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" # ) # -# econf "${myeconfargs[@]}" +# econf "${myconf[@]}" # } # @CODE -inherit eutils toolchain-funcs +inherit toolchain-funcs case ${EAPI:-0} in - 0|1|2|3|4|5) ;; + 0|1|2|3|4|5|6) ;; *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established." esac DEPEND="virtual/pkgconfig" +# @FUNCTION: _systemd_get_dir +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Try to obtain the variable from systemd.pc. +# If pkg-config or systemd is not installed, return +# instead. +_systemd_get_dir() { + [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} " + local variable=${1} fallback=${2} d + + if $(tc-getPKG_CONFIG) --exists systemd; then + d=$($(tc-getPKG_CONFIG) --variable="${variable}" systemd) || die + else + d=${fallback} + fi + + echo "${d}" +} + # @FUNCTION: _systemd_get_unitdir # @INTERNAL # @DESCRIPTION: # Get unprefixed unitdir. -_systemd_get_unitdir() { - if $(tc-getPKG_CONFIG) --exists systemd; then - echo "$($(tc-getPKG_CONFIG) --variable=systemdsystemunitdir systemd)" - else - echo /usr/lib/systemd/system - fi +_systemd_get_systemunitdir() { + _systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system +} + +# @FUNCTION: systemd_get_systemunitdir +# @DESCRIPTION: +# Output the path for the systemd system unit directory (not including +# ${D}). This function always succeeds, even if systemd is not +# installed. +systemd_get_systemunitdir() { + has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= + debug-print-function ${FUNCNAME} "${@}" + + echo "${EPREFIX}$(_systemd_get_systemunitdir)" } # @FUNCTION: systemd_get_unitdir # @DESCRIPTION: -# Output the path for the systemd unit directory (not including ${D}). -# This function always succeeds, even if systemd is not installed. +# Deprecated alias for systemd_get_systemunitdir. systemd_get_unitdir() { - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= - debug-print-function ${FUNCNAME} "${@}" + [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead" - echo "${EPREFIX}$(_systemd_get_unitdir)" + systemd_get_systemunitdir } # @FUNCTION: _systemd_get_userunitdir @@ -62,11 +87,7 @@ systemd_get_unitdir() { # @DESCRIPTION: # Get unprefixed userunitdir. _systemd_get_userunitdir() { - if $(tc-getPKG_CONFIG) --exists systemd; then - echo "$($(tc-getPKG_CONFIG) --variable=systemduserunitdir systemd)" - else - echo /usr/lib/systemd/user - fi + _systemd_get_dir systemduserunitdir /usr/lib/systemd/user } # @FUNCTION: systemd_get_userunitdir @@ -86,11 +107,7 @@ systemd_get_userunitdir() { # @DESCRIPTION: # Get unprefixed utildir. _systemd_get_utildir() { - if $(tc-getPKG_CONFIG) --exists systemd; then - echo "$($(tc-getPKG_CONFIG) --variable=systemdutildir systemd)" - else - echo /usr/lib/systemd - fi + _systemd_get_dir systemdutildir /usr/lib/systemd } # @FUNCTION: systemd_get_utildir @@ -114,7 +131,7 @@ systemd_dounit() { debug-print-function ${FUNCNAME} "${@}" ( - insinto "$(_systemd_get_unitdir)" + insinto "$(_systemd_get_systemunitdir)" doins "${@}" ) } @@ -128,7 +145,7 @@ systemd_newunit() { debug-print-function ${FUNCNAME} "${@}" ( - insinto "$(_systemd_get_unitdir)" + insinto "$(_systemd_get_systemunitdir)" newins "${@}" ) } @@ -239,7 +256,7 @@ systemd_enable_service() { local target=${1} local service=${2} - local ud=$(_systemd_get_unitdir) + local ud=$(_systemd_get_systemunitdir) local destname=${service##*/} dodir "${ud}"/"${target}".wants && \ @@ -273,13 +290,13 @@ systemd_enable_ntpunit() { die "The .list suffix is appended implicitly to ntpunit.d name." fi - local unitdir=$(systemd_get_unitdir) + local unitdir=$(systemd_get_systemunitdir) local s for s in "${services[@]}"; do if [[ ! -f "${D}${unitdir}/${s}" ]]; then die "ntp-units.d provider ${s} not installed (yet?) in \${D}." fi - echo "${s}" >> "${T}"/${ntpunit_name}.list + echo "${s}" >> "${T}"/${ntpunit_name}.list || die done ( @@ -296,6 +313,9 @@ systemd_enable_ntpunit() { # @FUNCTION: systemd_with_unitdir # @USAGE: [] # @DESCRIPTION: +# Note: deprecated and banned in EAPI 6. Please use full --with-...= +# parameter for improved ebuild readability. +# # Output '--with-systemdsystemunitdir' as expected by systemd-aware configure # scripts. This function always succeeds. Its output may be quoted in order # to preserve whitespace in paths. systemd_to_myeconfargs() is preferred over @@ -306,44 +326,34 @@ systemd_enable_ntpunit() { # argument to this function (`$(systemd_with_unitdir systemdunitdir)'). Please # remember to report a bug upstream as well. systemd_with_unitdir() { + [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-${1:-systemdsystemunitdir}=\"\$(systemd_get_systemunitdir)\" instead" + debug-print-function ${FUNCNAME} "${@}" local optname=${1:-systemdsystemunitdir} - echo --with-${optname}="$(systemd_get_unitdir)" + echo --with-${optname}="$(systemd_get_systemunitdir)" } # @FUNCTION: systemd_with_utildir # @DESCRIPTION: +# Note: deprecated and banned in EAPI 6. Please use full --with-...= +# parameter for improved ebuild readability. +# # Output '--with-systemdsystemutildir' as used by some packages to install # systemd helpers. This function always succeeds. Its output may be quoted # in order to preserve whitespace in paths. systemd_with_utildir() { + [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-systemdutildir=\"\$(systemd_get_utildir)\" instead" + debug-print-function ${FUNCNAME} "${@}" echo --with-systemdutildir="$(systemd_get_utildir)" } -# @FUNCTION: systemd_to_myeconfargs -# @DESCRIPTION: -# Add '--with-systemdsystemunitdir' as expected by systemd-aware configure -# scripts to the myeconfargs variable used by autotools-utils eclass. Handles -# quoting automatically. -systemd_to_myeconfargs() { - debug-print-function ${FUNCNAME} "${@}" - - eqawarn 'systemd_to_myeconfargs() is deprecated and will be removed on 2013-10-11.' - eqawarn 'Please use $(systemd_with_unitdir) instead.' - - myeconfargs=( - "${myeconfargs[@]}" - --with-systemdsystemunitdir="$(systemd_get_unitdir)" - ) -} - # @FUNCTION: systemd_update_catalog # @DESCRIPTION: # Update the journald catalog. This needs to be called after installing -# or removing catalog files. +# or removing catalog files. This must be called in pkg_post* phases. # # If systemd is not installed, no operation will be done. The catalog # will be (re)built once systemd is installed. @@ -352,6 +362,9 @@ systemd_to_myeconfargs() { systemd_update_catalog() { debug-print-function ${FUNCNAME} "${@}" + [[ ${EBUILD_PHASE} == post* ]] \ + || die "${FUNCNAME} disallowed during ${EBUILD_PHASE_FUNC:-${EBUILD_PHASE}}" + # Make sure to work on the correct system. local journalctl=${EPREFIX}/usr/bin/journalctl diff --git a/sdk_container/src/third_party/portage-stable/eclass/toolchain-binutils.eclass b/sdk_container/src/third_party/portage-stable/eclass/toolchain-binutils.eclass index edf4ea2d40..9d513ad0c4 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/toolchain-binutils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/toolchain-binutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.142 2015/05/25 08:41:16 vapier Exp $ +# $Id$ # # Maintainer: Toolchain Ninjas # @@ -56,7 +56,7 @@ fi is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } DESCRIPTION="Tools necessary to build programs" -HOMEPAGE="http://sourceware.org/binutils/" +HOMEPAGE="https://sourceware.org/binutils/" case ${BTYPE} in git) SRC_URI="" ;; @@ -76,7 +76,7 @@ add_src_uri() { else a+=".bz2" fi - set -- mirror://gentoo http://dev.gentoo.org/~vapier/dist + set -- mirror://gentoo https://dev.gentoo.org/~vapier/dist SRC_URI="${SRC_URI} ${@/%//${a}}" } add_src_uri binutils-${BVER}-patches-${PATCHVER}.tar ${PATCHVER} @@ -92,7 +92,7 @@ IUSE="cxx multislot multitarget nls static-libs test vanilla" if version_is_at_least 2.19 ; then IUSE+=" zlib" fi -if ! version_is_at_least 2.23.90 || [[ ${BTYPE} != "rel" ]] || is_cross || use multislot ; then +if ! version_is_at_least 2.25 || [[ ${BTYPE} != "rel" ]] || is_cross || use multislot ; then SLOT="${BVER}" else SLOT="0" @@ -164,6 +164,13 @@ tc-binutils_apply_patches() { fi fi [[ ${#PATCHES[@]} -gt 0 ]] && epatch "${PATCHES[@]}" + + # Make sure our explicit libdir paths don't get clobbered. #562460 + sed -i \ + -e 's:@bfdlibdir@:@libdir@:g' \ + -e 's:@bfdincludedir@:@includedir@:g' \ + {bfd,opcodes}/Makefile.in || die + epatch_user fi @@ -210,7 +217,7 @@ _eprefix_init() { # Intended for ebuilds to override to set their own versioning information. toolchain-binutils_bugurl() { - printf "http://bugs.gentoo.org/" + printf "https://bugs.gentoo.org/" } toolchain-binutils_pkgversion() { printf "Gentoo ${BVER}" diff --git a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass index 0380674265..23b0fa77b3 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/toolchain.eclass @@ -1,11 +1,11 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.675 2015/06/01 16:05:43 vapier Exp $ +# $Id$ # Maintainer: Toolchain Ninjas DESCRIPTION="The GNU Compiler Collection" -HOMEPAGE="http://gcc.gnu.org/" +HOMEPAGE="https://gcc.gnu.org/" RESTRICT="strip" # cross-compilers need controlled stripping inherit eutils fixheadtails flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs versionator @@ -104,6 +104,7 @@ INCLUDEPATH=${TOOLCHAIN_INCLUDEPATH:-${LIBPATH}/include} if is_crosscompile ; then BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CHOST}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} + HOSTLIBPATH=${PREFIX}/${CHOST}/${CTARGET}/lib/${GCC_CONFIG_VER} else BINPATH=${TOOLCHAIN_BINPATH:-${PREFIX}/${CTARGET}/gcc-bin/${GCC_CONFIG_VER}} fi @@ -152,16 +153,20 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then # the older versions, we don't want to bother supporting it. #448024 tc_version_is_at_least 4.8 && IUSE+=" graphite" IUSE_DEF+=( sanitize ) tc_version_is_at_least 4.9 && IUSE+=" cilk" - tc_version_is_at_least 6.0 && IUSE+=" pie" + tc_version_is_at_least 5.0 && IUSE+=" jit" + tc_version_is_at_least 6.0 && IUSE+=" pie +ssp" fi IUSE+=" ${IUSE_DEF[*]/#/+}" # Support upgrade paths here or people get pissed -if ! tc_version_is_at_least 4.7 || is_crosscompile || use multislot || [[ ${GCC_PV} == *_alpha* ]] ; then +if ! tc_version_is_at_least 4.8 || is_crosscompile || use multislot || [[ ${GCC_PV} == *_alpha* ]] ; then SLOT="${GCC_CONFIG_VER}" -else +elif ! tc_version_is_at_least 5.0 ; then SLOT="${GCC_BRANCH_VER}" +else + # Upstream changed versioning w/gcc-5+, so SLOT matches major only. #555164 + SLOT="${GCCMAJOR}" fi #---->> DEPEND <<---- @@ -172,7 +177,7 @@ RDEPEND="sys-libs/zlib tc_version_is_at_least 3 && RDEPEND+=" virtual/libiconv" if tc_version_is_at_least 4 ; then - GMP_MPFR_DEPS=">=dev-libs/gmp-4.3.2 >=dev-libs/mpfr-2.4.2" + GMP_MPFR_DEPS=">=dev-libs/gmp-4.3.2:0 >=dev-libs/mpfr-2.4.2:0" if tc_version_is_at_least 4.3 ; then RDEPEND+=" ${GMP_MPFR_DEPS}" elif in_iuse fortran ; then @@ -180,7 +185,7 @@ if tc_version_is_at_least 4 ; then fi fi -tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1" +tc_version_is_at_least 4.5 && RDEPEND+=" >=dev-libs/mpc-0.8.1:0" if in_iuse graphite ; then if tc_version_is_at_least 5.0 ; then @@ -213,10 +218,6 @@ if in_iuse gcj ; then x11-proto/xextproto =x11-libs/gtk+-2* virtual/pkgconfig - amd64? ( multilib? ( - app-emulation/emul-linux-x86-gtklibs - app-emulation/emul-linux-x86-xlibs - ) ) " tc_version_is_at_least 3.4 && GCJ_GTK_DEPS+=" x11-libs/pango" tc_version_is_at_least 4.2 && GCJ_DEPS+=" app-arch/zip app-arch/unzip" @@ -242,7 +243,7 @@ S=$( gentoo_urls() { local devspace="HTTP~vapier/dist/URI HTTP~rhill/dist/URI HTTP~zorry/patches/gcc/URI HTTP~blueness/dist/URI" - devspace=${devspace//HTTP/http:\/\/dev.gentoo.org\/} + devspace=${devspace//HTTP/https:\/\/dev.gentoo.org\/} echo mirror://gentoo/$1 ${devspace//URI/$1} } @@ -660,7 +661,7 @@ make_gcc_hard() { ewarn "PIE has not been enabled by default" gcc_hard_flags+=" -DEFAULT_SSP" else - # do nothing if hardened is't supported, but don't die either + # do nothing if hardened isn't supported, but don't die either ewarn "hardened is not supported for this arch in this gcc version" return 0 fi @@ -842,6 +843,7 @@ toolchain_src_configure() { is_d && GCC_LANG+=",d" is_gcj && GCC_LANG+=",java" is_go && GCC_LANG+=",go" + is_jit && GCC_LANG+=",jit" if is_objc || is_objcxx ; then GCC_LANG+=",objc" if tc_version_is_at_least 4 ; then @@ -882,7 +884,9 @@ toolchain_src_configure() { # Use the default ("release") checking because upstream usually neglects # to test "disabled" so it has a history of breaking. #317217 if tc_version_is_at_least 3.4 ; then - confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug yes release)}" ) + # The "release" keyword is new to 4.0. #551636 + local off=$(tc_version_is_at_least 4.0 && echo release || echo no) + confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex debug yes ${off})}" ) fi # Branding @@ -903,6 +907,9 @@ toolchain_src_configure() { confgcc+=( --enable-libstdcxx-time ) fi + # The jit language requires this. + is_jit && confgcc+=( --enable-host-shared ) + # # Turn on the -Wl,--build-id flag by default for ELF targets. #525942 # # This helps with locating debug files. # case ${CTARGET} in @@ -1195,7 +1202,11 @@ toolchain_src_configure() { fi if tc_version_is_at_least 6.0 ; then - confgcc+=( $(use_enable pie default-pie) ) + confgcc+=( + $(use_enable pie default-pie) + # This defaults to -fstack-protector-strong. + $(use_enable ssp default-ssp) + ) fi # Disable gcc info regeneration -- it ships with generated info pages @@ -1500,7 +1511,7 @@ toolchain_src_compile() { # Do not make manpages if we do not have perl ... [[ ! -x /usr/bin/perl ]] \ - && find "${WORKDIR}"/build -name '*.[17]' | xargs touch + && find "${WORKDIR}"/build -name '*.[17]' -exec touch {} + gcc_do_make ${GCC_MAKE_TARGET} } @@ -1615,7 +1626,7 @@ toolchain_src_install() { # We remove the generated fixincludes, as they can cause things to break # (ncurses, openssl, etc). We do not prevent them from being built, as # in the following commit which we revert: - # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.647&r2=1.648 + # https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.647&r2=1.648 # This is because bsd userland needs fixedincludes to build gcc, while # linux does not. Both can dispose of them afterwards. while read x ; do @@ -1658,7 +1669,12 @@ toolchain_src_install() { for x in cpp gcc g++ c++ gcov g77 gcj gcjh gfortran gccgo ; do # For some reason, g77 gets made instead of ${CTARGET}-g77... # this should take care of that - [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x} + if [[ -f ${x} ]] ; then + # In case they're hardlinks, clear out the target first + # otherwise the mv below will complain. + rm -f ${CTARGET}-${x} + mv ${x} ${CTARGET}-${x} + fi if [[ -f ${CTARGET}-${x} ]] ; then if ! is_crosscompile ; then @@ -1676,9 +1692,16 @@ toolchain_src_install() { ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_CONFIG_VER} fi done + # Clear out the main go binaries as we don't want to clobber dev-lang/go + # when gcc-config runs. #567806 + if tc_version_is_at_least 5 && is_go ; then + rm -f go gofmt + fi # Now do the fun stripping stuff env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}" + is_crosscompile && \ + env RESTRICT="" CHOST=${CHOST} prepstrip "${D}/${HOSTLIBPATH}" env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}" # gcc used to install helper binaries in lib/ but then moved to libexec/ [[ -d ${D}${PREFIX}/libexec/gcc ]] && \ @@ -1708,9 +1731,8 @@ toolchain_src_install() { # install testsuite results if use regression-test; then docinto testsuite - find "${WORKDIR}"/build -type f -name "*.sum" -print0 | xargs -0 dodoc - find "${WORKDIR}"/build -type f -path "*/testsuite/*.log" -print0 \ - | xargs -0 dodoc + find "${WORKDIR}"/build -type f -name "*.sum" -exec dodoc {} + + find "${WORKDIR}"/build -type f -path "*/testsuite/*.log" -exec dodoc {} + fi # Rather install the script, else portage with changing $FILESDIR @@ -1760,6 +1782,17 @@ gcc_movelibs() { # older versions of gcc did not support --print-multi-os-directory tc_version_is_at_least 3.2 || return 0 + # For non-target libs which are for CHOST and not CTARGET, we want to + # move them to the compiler-specific CHOST internal dir. This is stuff + # that you want to link against when building tools rather than building + # code to run on the target. + if tc_version_is_at_least 5 && is_crosscompile ; then + dodir "${HOSTLIBPATH}" + mv "${D}"/usr/$(get_libdir)/libcc1* "${D}${HOSTLIBPATH}" || die + fi + + # For all the libs that are built for CTARGET, move them into the + # compiler-specific CTARGET internal dir. local x multiarg removedirs="" for multiarg in $($(XGCC) -print-multi-lib) ; do multiarg=${multiarg#*;} @@ -1805,7 +1838,7 @@ gcc_movelibs() { for FROMDIR in ${removedirs} ; do rmdir "${D}"${FROMDIR} >& /dev/null done - find "${D}" -type d | xargs rmdir >& /dev/null + find -depth "${D}" -type d -exec rmdir {} + >& /dev/null } # make sure the libtool archives have libdir set to where they actually @@ -1955,7 +1988,7 @@ toolchain_pkg_postinst() { echo ewarn "You might want to review the GCC upgrade guide when moving between" ewarn "major versions (like 4.2 to 4.3):" - ewarn "http://www.gentoo.org/doc/en/gcc-upgrading.xml" + ewarn "https://wiki.gentoo.org/wiki/Upgrading_GCC" echo # Clean up old paths @@ -2141,6 +2174,11 @@ is_go() { use cxx && use_if_iuse go } +is_jit() { + gcc-lang-supported jit || return 1 + use_if_iuse jit +} + is_multilib() { tc_version_is_at_least 3 || return 1 use multilib diff --git a/sdk_container/src/third_party/portage-stable/eclass/vala.eclass b/sdk_container/src/third_party/portage-stable/eclass/vala.eclass index 7d4a521672..c533153576 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/vala.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/vala.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/vala.eclass,v 1.12 2015/06/09 10:18:38 eva Exp $ +# $Id$ # @ECLASS: vala.eclass # @MAINTAINER: @@ -26,13 +26,13 @@ esac # @ECLASS-VARIABLE: VALA_MIN_API_VERSION # @DESCRIPTION: -# Minimum vala API version (e.g. 0.20). -VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.20} +# Minimum vala API version (e.g. 0.22). +VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.22} # @ECLASS-VARIABLE: VALA_MAX_API_VERSION # @DESCRIPTION: -# Maximum vala API version (e.g. 0.28). -VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.28} +# Maximum vala API version (e.g. 0.30). +VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.30} # @ECLASS-VARIABLE: VALA_USE_DEPEND # @DEFAULT_UNSET @@ -50,7 +50,7 @@ vala_api_versions() { local minimal_supported_minor_version minor_version # Dependency atoms are not generated for Vala versions older than 0.${minimal_supported_minor_version}. - minimal_supported_minor_version="20" + minimal_supported_minor_version="22" for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do if ((minor_version >= minimal_supported_minor_version)); then diff --git a/sdk_container/src/third_party/portage-stable/eclass/virtualx.eclass b/sdk_container/src/third_party/portage-stable/eclass/virtualx.eclass index 0621b18b30..9303fbb479 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/virtualx.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/virtualx.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/virtualx.eclass,v 1.43 2012/10/03 22:47:12 chithanh Exp $ +# $Id$ # @ECLASS: virtualx.eclass # @MAINTAINER: @@ -9,6 +9,21 @@ # Original author: Martin Schlemmer # @BLURB: This eclass can be used for packages that needs a working X environment to build. +if [[ ! ${_VIRTUAL_X} ]]; then + +case "${EAPI:-0}" in + 0|1) + die "virtualx.eclass: EAPI ${EAPI} is too old." + ;; + 2|3|4|5|6) + ;; + *) + die "virtualx.eclass: EAPI ${EAPI} is not supported yet." + ;; +esac + +[[ ${EAPI} == [2345] ]] && inherit eutils + # @ECLASS-VARIABLE: VIRTUALX_REQUIRED # @DESCRIPTION: # Variable specifying the dependency on xorg-server and xhost. @@ -35,8 +50,6 @@ VIRTUALX_DEPEND="${VIRTUALX_DEPEND} # (within virtualmake function). : ${VIRTUALX_COMMAND:="emake"} -has "${EAPI:-0}" 0 1 && die "virtualx eclass require EAPI=2 or newer." - case ${VIRTUALX_REQUIRED} in manual) ;; @@ -45,16 +58,18 @@ case ${VIRTUALX_REQUIRED} in RDEPEND="" ;; optional|tests) + [[ ${EAPI} == [2345] ]] \ + || die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are banned in EAPI > 5' # deprecated section YAY. - ewarn "QA: VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated." - ewarn "QA: You can drop the variable definition completely from ebuild," - ewarn "QA: because it is default behaviour." + eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated." + eqawarn "You can drop the variable definition completely from ebuild," + eqawarn "because it is default behaviour." if [[ -n ${VIRTUALX_USE} ]]; then # so they like to specify the useflag - ewarn "QA: VIRTUALX_USE variable is deprecated." - ewarn "QA: Please read eclass manpage to find out how to use VIRTUALX_REQUIRED" - ewarn "QA: to achieve the same behaviour." + eqawarn "VIRTUALX_USE variable is deprecated." + eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED" + eqawarn "to achieve the same behaviour." fi [[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test" @@ -71,99 +86,139 @@ esac # @FUNCTION: virtualmake # @DESCRIPTION: -# Function which attach to running X session or start new Xvfb session +# Function which start new Xvfb session # where the VIRTUALX_COMMAND variable content gets executed. virtualmake() { debug-print-function ${FUNCNAME} "$@" - local i=0 - local retval=0 - local OLD_SANDBOX_ON="${SANDBOX_ON}" - local XVFB=$(type -p Xvfb) - local XHOST=$(type -p xhost) - local xvfbargs="-screen 0 1280x1024x24" + [[ ${EAPI} == [2345] ]] \ + || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx" # backcompat for maketype if [[ -n ${maketype} ]]; then - ewarn "QA: ebuild is exporting \$maketype=${maketype}" - ewarn "QA: Ebuild should be migrated to use VIRTUALX_COMMAND=${maketype} instead." - ewarn "QA: Setting VIRTUALX_COMMAND to \$maketype conveniently for now." + [[ ${EAPI} == [2345] ]] || die "maketype is banned in EAPI > 5" + eqawarn "ebuild is exporting \$maketype=${maketype}" + eqawarn "Ebuild should be migrated to use 'virtx command' instead." VIRTUALX_COMMAND=${maketype} fi - # If $DISPLAY is not set, or xhost cannot connect to an X - # display, then do the Xvfb hack. - if [[ -n ${XVFB} && -n ${XHOST} ]] && \ - ( [[ -z ${DISPLAY} ]] || ! (${XHOST} &>/dev/null) ) ; then - debug-print "${FUNCNAME}: running Xvfb hack" - export XAUTHORITY= - # The following is derived from Mandrake's hack to allow - # compiling without the X display + virtx "${VIRTUALX_COMMAND}" "${@}" +} - einfo "Scanning for an open DISPLAY to start Xvfb ..." - # If we are in a chrooted environment, and there is already a - # X server started outside of the chroot, Xvfb will fail to start - # on the same display (most cases this is :0 ), so make sure - # Xvfb is started, else bump the display number - # - # Azarah - 5 May 2002 - XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) - debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}" - # We really do not want SANDBOX enabled here - export SANDBOX_ON="0" +# @FUNCTION: virtx +# @USAGE: [command arguments] +# @DESCRIPTION: +# Start new Xvfb session and run commands in it. +# +# IMPORTANT: The command is run nonfatal !!! +# +# This means we are checking for the return code and raise an exception if it +# isn't 0. So you need to make sure that all commands return a proper +# code and not just die. All eclass function used should support nonfatal +# calls properly. +# +# The rational behind this is the tear down of the started Xfvb session. A +# straight die would leave a running session behind. +# +# Example: +# +# @CODE +# src_test() { +# virtx default +# } +# @CODE +# +# @CODE +# python_test() { +# virtx py.test --verbose +# } +# @CODE +# +# @CODE +# my_test() { +# some_command +# return $? +# } +# +# src_test() { +# virtx my_test +# } +# @CODE +virtx() { + debug-print-function ${FUNCNAME} "$@" + [[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument" + + local i=0 + local retval=0 + local OLD_SANDBOX_ON="${SANDBOX_ON}" + local XVFB XHOST XDISPLAY + local xvfbargs="-screen 0 1280x1024x24 +extension RANDR" + XVFB=$(type -p Xvfb) || die + XHOST=$(type -p xhost) || die + + debug-print "${FUNCNAME}: running Xvfb hack" + export XAUTHORITY= + # The following is derived from Mandrake's hack to allow + # compiling without the X display + + einfo "Scanning for an open DISPLAY to start Xvfb ..." + # If we are in a chrooted environment, and there is already a + # X server started outside of the chroot, Xvfb will fail to start + # on the same display (most cases this is :0 ), so make sure + # Xvfb is started, else bump the display number + # + # Azarah - 5 May 2002 + XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) + debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}" + + # We really do not want SANDBOX enabled here + export SANDBOX_ON="0" + + debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}" + ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null & + sleep 2 + + local start=${XDISPLAY} + while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do + # Stop trying after 15 tries + if ((XDISPLAY - start > 15)) ; then + eerror "'${XVFB} :${XDISPLAY} ${xvfbargs}' returns:" + echo + ${XVFB} :${XDISPLAY} ${xvfbargs} + echo + eerror "If possible, correct the above error and try your emerge again." + die "Unable to start Xvfb" + fi + ((XDISPLAY++)) debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}" ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null & sleep 2 + done - local start=${XDISPLAY} - while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do - # Stop trying after 15 tries - if ((XDISPLAY - start > 15)) ; then - eerror "'${XVFB} :${XDISPLAY} ${xvfbargs}' returns:" - echo - ${XVFB} :${XDISPLAY} ${xvfbargs} - echo - eerror "If possible, correct the above error and try your emerge again." - die "Unable to start Xvfb" - fi + # Now enable SANDBOX again if needed. + export SANDBOX_ON="${OLD_SANDBOX_ON}" - ((XDISPLAY++)) - debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}" - ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null & - sleep 2 - done + einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..." - # Now enable SANDBOX again if needed. - export SANDBOX_ON="${OLD_SANDBOX_ON}" - - einfo "Starting Xvfb on \$DISPLAY=${XDISPLAY} ..." - - export DISPLAY=:${XDISPLAY} - # Do not break on error, but setup $retval, as we need - # to kill Xvfb - debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\"" - if has "${EAPI}" 2 3; then - ${VIRTUALX_COMMAND} "$@" - retval=$? - else - nonfatal ${VIRTUALX_COMMAND} "$@" - retval=$? - fi - - # Now kill Xvfb - kill $(cat /tmp/.X${XDISPLAY}-lock) + export DISPLAY=:${XDISPLAY} + # Do not break on error, but setup $retval, as we need + # to kill Xvfb + debug-print "${FUNCNAME}: $@" + if has "${EAPI}" 2 3; then + "$@" + retval=$? else - debug-print "${FUNCNAME}: attaching to running X display" - # Normal make if we can connect to an X display - debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\"" - ${VIRTUALX_COMMAND} "$@" + nonfatal "$@" retval=$? fi + # Now kill Xvfb + kill $(cat /tmp/.X${XDISPLAY}-lock) + # die if our command failed - [[ ${retval} -ne 0 ]] && die "${FUNCNAME}: the ${VIRTUALX_COMMAND} failed." + [[ ${retval} -ne 0 ]] && die "Failed to run '$@'" return 0 # always return 0, it can be altered by failed kill for Xvfb } @@ -175,8 +230,11 @@ virtualmake() { Xmake() { debug-print-function ${FUNCNAME} "$@" - ewarn "QA: you should not execute make directly" - ewarn "QA: rather execute Xemake -j1 if you have issues with parallel make" + [[ ${EAPI} == [2345] ]] \ + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'" + + eqawarn "you should not execute make directly" + eqawarn "rather execute Xemake -j1 if you have issues with parallel make" VIRTUALX_COMMAND="emake -j1" virtualmake "$@" } @@ -186,6 +244,9 @@ Xmake() { Xemake() { debug-print-function ${FUNCNAME} "$@" + [[ ${EAPI} == [2345] ]] \ + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'" + VIRTUALX_COMMAND="emake" virtualmake "$@" } @@ -195,5 +256,11 @@ Xemake() { Xeconf() { debug-print-function ${FUNCNAME} "$@" + [[ ${EAPI} == [2345] ]] \ + || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'" + VIRTUALX_COMMAND="econf" virtualmake "$@" } + +_VIRTUAL_X=1 +fi diff --git a/sdk_container/src/third_party/portage-stable/eclass/virtuoso.eclass b/sdk_container/src/third_party/portage-stable/eclass/virtuoso.eclass deleted file mode 100644 index 8a49da43aa..0000000000 --- a/sdk_container/src/third_party/portage-stable/eclass/virtuoso.eclass +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/virtuoso.eclass,v 1.15 2014/03/07 03:27:47 creffett Exp $ - -# @ECLASS: virtuoso.eclass -# @MAINTAINER: -# Maciej Mrozowski -# Chris Reffett -# -# @BLURB: Provides splitting functionality for Virtuoso -# @DESCRIPTION: -# This eclass provides common code for splitting Virtuoso OpenSource database - -case ${EAPI:-0} in - 2|3|4|5) : ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -inherit autotools multilib eutils - -MY_P="virtuoso-opensource-${PV}" - -case ${PV} in - *9999*) - ECVS_SERVER="virtuoso.cvs.sourceforge.net:/cvsroot/virtuoso" - ECVS_PROJECT='virtuoso' - SRC_URI="" - inherit cvs - ;; - *) - # Use this variable to determine distribution method (live or tarball) - TARBALL="${MY_P}.tar.gz" - SRC_URI="mirror://sourceforge/virtuoso/${TARBALL} mirror://gentoo/VOS-genpatches-${PV}.tar.bz2" - ;; -esac - -EXPORT_FUNCTIONS src_prepare src_configure - -# Set some defaults -HOMEPAGE='http://virtuoso.openlinksw.com/wiki/main/Main/' -LICENSE='GPL-2' -SLOT='0' - -DEPEND=' - >=sys-devel/libtool-2.2.6a -' -RDEPEND='' - -S="${WORKDIR}/${MY_P}" - -# @FUNCTION: virtuoso_src_prepare -# @DESCRIPTION: -# 1. Applies common release patches -# 2. Applies package-specific patches (from ${FILESDIR}/, PATCHES can be used) -# 3. Applies user patches from /etc/portage/patches/${CATEGORY}/${PN}/ -# 4. Modifies makefiles for split build. Uses VOS_EXTRACT -# 5. eautoreconf -virtuoso_src_prepare() { - debug-print-function ${FUNCNAME} "$@" - - EPATCH_SUFFIX='patch' EPATCH_FORCE='yes' epatch - pushd "${S}" >/dev/null - [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" - - debug-print "$FUNCNAME: applying user patches" - epatch_user - - - # @ECLASS-VARIABLE: VOS_EXTRACT - # @DESCRIPTION: - # Lists any subdirectories that are required to be extracted - # and enabled in Makefile.am's for current package. - if [[ -n ${VOS_EXTRACT} ]]; then - # Comment out everything - find . -name Makefile.am -exec \ - sed -e '/SUBDIRS\s*=/s/^/# DISABLED /g' -i {} + \ - || die 'failed to disable subdirs' - - # Uncomment specified - local path - for path in ${VOS_EXTRACT}; do - if [[ -d "${path}" ]]; then - # Uncomment leaf - if [[ -f "${path}"/Makefile.am ]]; then - sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/# DISABLED //g' \ - -i "${path}"/Makefile.am || die "failed to uncomment leaf in ${path}/Makefile.am" - fi - # Process remaining path elements - while true; do - local subdir=`basename "${path}"` - path=`dirname "${path}"` - if [[ -f "${path}"/Makefile.am ]]; then - # Uncomment if necessary - sed -e '/^# DISABLED \s*SUBDIRS\s*=/s/.*/SUBDIRS =/g' \ - -i "${path}"/Makefile.am - # Append subdirs if not there already - if [[ -z `sed -ne "/SUBDIRS\s*=.*${subdir}\b/p" "${path}"/Makefile.am` ]]; then - sed -e "/^SUBDIRS\s*=/s|$| ${subdir}|" \ - -i "${path}"/Makefile.am || die "failed to append ${subdir}" - fi - fi - [[ "${path}" = . ]] && break - done - fi - done - fi - - eautoreconf -} - -# @FUNCTION: virtuoso_src_configure -# @DESCRIPTION: -# Runs ./configure with common and user options specified via myconf variable -virtuoso_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - # Override some variables to make tests work - if [[ ${PN} != virtuoso-server ]]; then - [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= - export ISQL="${EPREFIX}"/usr/bin/isql-v - export SERVER="${EPREFIX}"/usr/bin/virtuoso-t - fi - - econf \ - --with-layout=gentoo \ - --localstatedir="${EPREFIX}"/var \ - --enable-shared \ - --with-pthreads \ - --without-internal-zlib \ - ${myconf} -} diff --git a/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass index eb9642a68f..df5de245e8 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass @@ -15,20 +15,14 @@ # waf-based packages much easier. # Its main features are support of common portage default settings. -inherit eutils multilib toolchain-funcs multiprocessing +[[ ${EAPI} == [45] ]] && inherit eutils +inherit multilib toolchain-funcs multiprocessing case ${EAPI:-0} in - 4|5) EXPORT_FUNCTIONS src_configure src_compile src_install ;; + 4|5|6) EXPORT_FUNCTIONS src_configure src_compile src_install ;; *) die "EAPI=${EAPI} is not supported" ;; esac -# Python with threads is required to run waf. We do not know which python slot -# is being used as the system interpreter, so we are forced to block all -# slots that have USE=-threads. -DEPEND="${DEPEND} - dev-lang/python - !dev-lang/python[-threads]" - # @ECLASS-VARIABLE: WAF_VERBOSE # @DESCRIPTION: # Set to OFF to disable verbose messages during compilation @@ -41,35 +35,41 @@ DEPEND="${DEPEND} waf-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" + local fail if [[ ! ${_PYTHON_ANY_R1} && ! ${_PYTHON_SINGLE_R1} && ! ${_PYTHON_R1} ]]; then - eqawarn "Using waf-utils.eclass without any python-r1 suite eclass is not supported" - eqawarn "and will be banned on 2015-01-24. Please make sure to configure and inherit" - eqawarn "appropriate -r1 eclass. For more information and examples, please see:" - eqawarn " https://wiki.gentoo.org/wiki/Project:Python/waf-utils_integration" + eerror "Using waf-utils.eclass without any python-r1 suite eclass is not supported." + eerror "Please make sure to configure and inherit appropriate -r1 eclass." + eerror "For more information and examples, please see:" + eerror " https://wiki.gentoo.org/wiki/Project:Python/waf-utils_integration" + fail=1 else if [[ ! ${EPYTHON} ]]; then - eqawarn "EPYTHON is unset while calling waf-utils. This most likely means that" - eqawarn "the ebuild did not call the appropriate eclass function before calling waf." + eerror "EPYTHON is unset while calling waf-utils. This most likely means that" + eerror "the ebuild did not call the appropriate eclass function before calling waf." if [[ ${_PYTHON_ANY_R1} ]]; then - eqawarn "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()." + eerror "Please ensure that python-any-r1_pkg_setup is called in pkg_setup()." elif [[ ${_PYTHON_SINGLE_R1} ]]; then - eqawarn "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()." + eerror "Please ensure that python-single-r1_pkg_setup is called in pkg_setup()." else # python-r1 - eqawarn "Please ensure that python_setup is called before waf-utils_src_configure()," - eqawarn "or that the latter is used within python_foreach_impl as appropriate." + eerror "Please ensure that python_setup is called before waf-utils_src_configure()," + eerror "or that the latter is used within python_foreach_impl as appropriate." fi - eqawarn + eerror + fail=1 fi if [[ ${PYTHON_REQ_USE} != *threads* ]]; then - eqawarn "Waf requires threading support in Python. To accomodate this requirement," - eqawarn "please add 'threads(+)' to PYTHON_REQ_USE variable (above inherit line)." - eqawarn "For more information and examples, please see:" - eqawarn " https://wiki.gentoo.org/wiki/Project:Python/waf-utils_integration" + eerror "Waf requires threading support in Python. To accomodate this requirement," + eerror "please add 'threads(+)' to PYTHON_REQ_USE variable (above inherit line)." + eerror "For more information and examples, please see:" + eerror " https://wiki.gentoo.org/wiki/Project:Python/waf-utils_integration" + fail=1 fi fi - local libdir="" + [[ ${fail} ]] && die "Invalid use of waf-utils.eclass" + + local libdir=() # @ECLASS-VARIABLE: WAF_BINARY # @DESCRIPTION: @@ -81,25 +81,16 @@ waf-utils_src_configure() { # @DESCRIPTION: # Variable specifying that you don't want to set the libdir for waf script. # Some scripts does not allow setting it at all and die if they find it. - [[ -z ${NO_WAF_LIBDIR} ]] && libdir="--libdir=${EPREFIX}/usr/$(get_libdir)" + [[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)") tc-export AR CC CPP CXX RANLIB - echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir} $@ configure" + echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${CFLAGS} ${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr ${libdir[@]} $@ configure" - # This condition is required because waf takes even whitespace as function - # calls, awesome isn't it? - if [[ -z ${NO_WAF_LIBDIR} ]]; then - CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \ - "--prefix=${EPREFIX}/usr" \ - "${libdir}" \ - "$@" \ - configure || die "configure failed" - else - CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \ - "--prefix=${EPREFIX}/usr" \ - "$@" \ - configure || die "configure failed" - fi + CCFLAGS="${CFLAGS}" LINKFLAGS="${CFLAGS} ${LDFLAGS}" "${WAF_BINARY}" \ + "--prefix=${EPREFIX}/usr" \ + "${libdir[@]}" \ + "$@" \ + configure || die "configure failed" } # @FUNCTION: waf-utils_src_compile diff --git a/sdk_container/src/third_party/portage-stable/eclass/wxwidgets.eclass b/sdk_container/src/third_party/portage-stable/eclass/wxwidgets.eclass index aa8f920931..dc6db5a8d0 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/wxwidgets.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/wxwidgets.eclass @@ -1,11 +1,11 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.39 2014/04/21 21:55:31 ottxor Exp $ +# $Id$ -# @ECLASS: wxwidgets.eclass +# @ECLASS: wxwidgets.eclass # @MAINTAINER: -# wxwidgets@gentoo.org -# @BLURB: Manages build configuration for wxGTK-using packages. +# wxwidgets@gentoo.org +# @BLURB: Manages build configuration for wxGTK-using packages. # @DESCRIPTION: # This eclass gives ebuilds the ability to build against a specific wxGTK # SLOT and profile without interfering with the system configuration. Any @@ -29,7 +29,7 @@ # DEPEND="wxwidgets? ( x11-libs/wxGTK:2.8[X?] )" # # src_configure() { -# if use wxwidgets; then +# if use wxwidgets; then # WX_GTK_VER="2.8" # if use X; then # need-wxwidgets unicode @@ -52,21 +52,35 @@ # # Note: unless you know your package works with wxbase (which is very # doubtful), always depend on wxGTK[X]. +# +# Debugging: In wxGTK 3.0 and later debugging support is enabled in the +# library by default and needs to be controlled at the package level. +# Use the -DNDEBUG preprocessor flag to disable debugging features. +# (Using need-wxwidgets will do this for you, see below.) -inherit eutils multilib +if [[ -z ${_WXWIDGETS_ECLASS} ]]; then + +case ${EAPI} in + 0|1|2|3|4|5) + inherit eutils flag-o-matic multilib + ;; + *) + die "EAPI=${EAPI:-0} is not supported" + ;; +esac # We do this in global scope so ebuilds can get sane defaults just by # inheriting. if [[ -z ${WX_CONFIG} ]]; then if [[ -n ${WX_GTK_VER} ]]; then - for wxtoolkit in mac gtk2 base; do + for _wxtoolkit in mac gtk2 base; do # newer versions don't have a seperate debug profile - for wxdebug in xxx release- debug-; do - wxconf="${wxtoolkit}-unicode-${wxdebug/xxx/}${WX_GTK_VER}" + for _wxdebug in xxx release- debug-; do + _wxconf="${_wxtoolkit}-unicode-${_wxdebug/xxx/}${WX_GTK_VER}" - [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]] || continue + [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${_wxconf} ]] || continue - WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}" + WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${_wxconf}" WX_ECLASS_CONFIG="${WX_CONFIG}" break done @@ -75,15 +89,26 @@ if [[ -z ${WX_CONFIG} ]]; then [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG fi fi +unset _wxtoolkit +unset _wxdebug +unset _wxconf # @FUNCTION: need-wxwidgets # @USAGE: # @DESCRIPTION: # -# Available configurations are: +# Available profiles are: # # unicode (USE="X") # base-unicode (USE="-X") +# +# This lets you choose which config file from /usr/lib/wx/config is used when +# building the package. It also exports ${WX_CONFIG} with the full path to +# that config. +# +# If your ebuild does not have a debug USE flag, or it has one and it is +# disabled, -DNDEBUG will be automatically added to CPPFLAGS. This can be +# overridden by setting WX_DISABLE_DEBUG if you want to handle it yourself. need-wxwidgets() { local wxtoolkit wxdebug wxconf @@ -93,7 +118,7 @@ need-wxwidgets() { echo die fi - + if [[ ${WX_GTK_VER} != 2.8 && ${WX_GTK_VER} != 2.9 && ${WX_GTK_VER} != 3.0 ]]; then eerror "Invalid WX_GTK_VER: ${WX_GTK_VER} - must be set to a valid wxGTK SLOT." echo @@ -124,6 +149,10 @@ need-wxwidgets() { else wxdebug="release-" fi + else + if [[ -z ${WX_DISABLE_DEBUG} ]]; then + use_if_iuse debug || append-cppflags -DNDEBUG + fi fi wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}" @@ -143,3 +172,6 @@ need-wxwidgets() { einfo "Using wxWidgets: ${wxconf}" echo } + +_WXWIDGETS_ECLASS=1 +fi