From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QurAI-0007R8-Eh for garchives@archives.gentoo.org; Sat, 20 Aug 2011 19:25:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7A3E821C240; Sat, 20 Aug 2011 19:24:22 +0000 (UTC) Received: from oproxy9.bluehost.com (oproxy9.bluehost.com [69.89.24.6]) by pigeon.gentoo.org (Postfix) with SMTP id 02B0121C061 for ; Sat, 20 Aug 2011 19:20:17 +0000 (UTC) Received: (qmail 7720 invoked by uid 0); 20 Aug 2011 19:20:17 -0000 Received: from unknown (HELO box347.bluehost.com) (69.89.31.147) by oproxy9.bluehost.com with SMTP; 20 Aug 2011 19:20:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lotussevencars.com; s=default; h=Mime-Version:Message-ID:Date:Content-Type:References:In-Reply-To:To:Reply-To:From:Subject; bh=SrGp1EQsdyu8qEgGVFCicf0NvqPgXZaBqNKYDZPmaho=; b=NQpOOH4NYRjTiK50H9oMT0JW0tWJgtbVRYGP6UKX0ADD+3r+D4iYzdI91ysEPeLIMUndTQe4vRtHX9tY/lr2pK4F7gHQ5ho8/JTqEZKfN/byGy2N7bkjUMKNhyYGB0lz; Received: from adsl-74-242-230-152.rmo.bellsouth.net ([74.242.230.152] helo=[192.168.3.100]) by box347.bluehost.com with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Qur5L-0007yB-UD for gentoo-user@lists.gentoo.org; Sat, 20 Aug 2011 13:20:16 -0600 Subject: Re: [gentoo-user] Re: Plasma-runtime compilation problems From: Jeff Cranmer To: gentoo-user@lists.gentoo.org In-Reply-To: <4E43289D.2080904@gmail.com> References: <1312947259.12939.4.camel@laptop.limeyworld> <10767017.YZF3DYoQc4@pc> <1313021665.8574.11.camel@laptop.limeyworld> <4E43289D.2080904@gmail.com> Content-Type: multipart/mixed; boundary="=-PYe+5/N6FzmAqvcuIsJ3" Date: Sat, 20 Aug 2011 15:21:41 -0400 Message-ID: <1313868101.8651.1.camel@laptop.limeyworld> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.30.1.2 X-Identified-User: {793:box347.bluehost.com:lotussev:lotussevencars.com} {sentby:smtp auth 74.242.230.152 authed with jeff@lotussevencars.com} X-Archives-Salt: X-Archives-Hash: 099042900fb01ad8b25db803e041eb14 --=-PYe+5/N6FzmAqvcuIsJ3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit > > > I can see where one would think that but it is often not the case. I > had a compile to fail a few months ago, I had to go waaaaay back to find > the original failure. It was far enough back that I had to copy the > whole thing to a editor and use the find feature to find it. I use > Konsole for most of this but I bet it was 7 or 8 screens further back > than where it ended up failing. > > I am on a 4 core rig so that may have a bit to do with it but I have ran > into the same on my older rig that is single core. It is amazing how > far back the original problem is sometimes. > > May want to consider looking further back or just posting as a > attachment or something. > > Dale > > :-) :-) > Sorry for the long delay. Attached are the relevant system logs. Perhaps this will shed some more light on the issue. Jeff --=-PYe+5/N6FzmAqvcuIsJ3 Content-Disposition: attachment; filename="plasma-runtime-4.6.5-build.log" Content-Type: text/x-log; name="plasma-runtime-4.6.5-build.log"; charset="UTF-8" Content-Transfer-Encoding: 7bit  * Package: kde-base/plasma-runtime-4.6.5  * Repository: gentoo  * Maintainer: kde@gentoo.org  * USE: amd64 elibc_glibc kernel_linux multilib userland_GNU  * FEATURES: sandbox >>> Unpacking source... * Unpacking parts of kdebase-runtime-4.6.5.tar.bz2 to /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work ... tar extract command failed at least partially - continuing anyway  [ ok ] >>> Source unpacked in /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work >>> Preparing source in /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5 ... >>> Source prepared. >>> Configuring source in /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5 ... >>> Working in BUILD_DIR: "/var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5_build" cmake --no-warn-unused-cli -C /var/tmp/portage/kde-base/plasma-runtime-4.6.5/temp/gentoo_common_config.cmake -DCMAKE_INSTALL_PREFIX=/usr -DKDE4_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DSYSCONF_INSTALL_DIR=/etc -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/kde-base/plasma-runtime-4.6.5/temp/gentoo_rules.cmake /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5 Not searching for unused variables given on the command line. loading initial cache file /var/tmp/portage/kde-base/plasma-runtime-4.6.5/temp/gentoo_common_config.cmake -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Looking for Q_WS_X11 -- Looking for Q_WS_X11 - found -- Looking for Q_WS_WIN -- Looking for Q_WS_WIN - not found. -- Looking for Q_WS_QWS -- Looking for Q_WS_QWS - not found. -- Looking for Q_WS_MAC -- Looking for Q_WS_MAC - not found. -- Found Qt-Version 4.7.2 (using /usr/bin/qmake) -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so;/usr/lib64/libXft.so;/usr/lib64/libXau.so;/usr/lib64/libXdmcp.so;/usr/lib64/libXpm.so -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so;/usr/lib64/libXft.so;/usr/lib64/libXau.so;/usr/lib64/libXdmcp.so;/usr/lib64/libXpm.so - found -- Looking for gethostbyname -- Looking for gethostbyname - found -- Looking for connect -- Looking for connect - found -- Looking for remove -- Looking for remove - found -- Looking for shmat -- Looking for shmat - found -- Looking for IceConnectionNumber in ICE -- Looking for IceConnectionNumber in ICE - found -- Found X11: /usr/lib64/libX11.so -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Looking for _POSIX_TIMERS -- Looking for _POSIX_TIMERS - found -- Found Automoc4: /usr/bin/automoc4 -- Found Perl: /usr/bin/perl -- Found Phonon: /usr/include -- Performing Test _OFFT_IS_64BIT -- Performing Test _OFFT_IS_64BIT - Success -- Performing Test HAVE_FPIE_SUPPORT -- Performing Test HAVE_FPIE_SUPPORT - Success -- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL -- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success -- Performing Test __KDE_HAVE_GCC_VISIBILITY -- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success -- Found KDE 4.7 include dir: /usr/include -- Found KDE 4.7 library dir: /usr/lib64 -- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler -- Found automoc4: /usr/bin/automoc4 -- Strigi API needs 'signed char' -- Found Strigi: /usr/lib64/libstreams.so -- Found SharedDesktopOntologies: /usr/share/ontology (found version "0.7.0", required is "0.5.0") -- Found Soprano: /usr/include (found version "2.7.0", required is "2.5.63") -- Found Nepomuk: /usr/lib64/libnepomuk.so -- Could NOT find SLP (missing: SLP_LIBRARIES SLP_INCLUDE_DIR) -- Found LibAttica: /usr/lib64/libattica.so (found version "0.2.0", required is "0.1.4") -- Looking for include files HAVE_SYS_WAIT_H -- Looking for include files HAVE_SYS_WAIT_H - found -- Looking for include files HAVE_SYS_TIME_H -- Looking for include files HAVE_SYS_TIME_H - found ----------------------------------------------------------------------------- -- The following external packages were located on your system. -- This installation will have the extra features provided by these packages. ----------------------------------------------------------------------------- * Soprano - Support for the Nepomuk semantic desktop system * Shared desktop ontologies - Desktop ontologies * Nepomuk - Nepomuk Libraries * Soprano Virtuoso Backend - Virtuoso storage backend for Soprano * Soprano Raptor Parser - RDF parser plugin for Soprano * Soprano Redland Backend - Redland storage backend for Soprano * libattica - A library to access Open Collaboration Service providers ----------------------------------------------------------------------------- -- The following OPTIONAL packages could NOT be located on your system. -- Consider installing them to enable more features from this software. ----------------------------------------------------------------------------- * OpenSLP SLP (Service Location Protocol) implementation Provides SLP support in the network:/ kioslave. ----------------------------------------------------------------------------- -- <<< Gentoo configuration >>> Build type Gentoo Install path /usr Compiler flags: C -O2 -pipe -march=amdfam10 -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common C++ -O2 -pipe -march=amdfam10 -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden Linker flags: Executable -Wl,--enable-new-dtags -Wl,-O1 -Wl,--as-needed Module -Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-O1 -Wl,--as-needed Shared -Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc -Wl,-O1 -Wl,--as-needed -- Configuring done -- Generating done -- Build files have been written to: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5_build >>> Source configured. >>> Compiling source in /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5 ... >>> Working in BUILD_DIR: "/var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5_build" make -j7 [ 1%] Scanning dependencies of target plasma_containment_newspaper_automoc Scanning dependencies of target plasma-kpart_automoc [ 2%] Scanning dependencies of target kcmremotewidgetshelper_automoc Generating linearlayout.moc Scanning dependencies of target actions for org.kde.kcontrol.kcmremotewidgets [ 3%] Generating declarativetabbar.moc Generating framesvgitem_p.moc [ 3%] Generating org.kde.kcontrol.kcmremotewidgets.policy [ 3%] Built target actions for org.kde.kcontrol.kcmremotewidgets [ 4%] Generating corebindingsplugin.moc Generating moc_remotewidgetshelper_p.cpp Generating plasmakpartcorona.moc Generating appletmovespacer.moc [ 5%] Generating applettitlebar.moc [ 5%] [ 5%] [ 6%] Built target kcmremotewidgetshelper_automoc Generating graphicslayoutsbindingsplugin.moc Generating graphicswidgetsbindingsplugin.moc [ 7%] Generating gridlayout.moc Generating dataengineconsumer_p.moc [ 8%] Scanning dependencies of target graphicswidgetsbindingsplugin Generating theme_p.moc Scanning dependencies of target plasma_appletscript_declarative_automoc Generating javascriptaddonpackagestructure.moc Scanning dependencies of target graphicslayoutsbindingsplugin Generating appletscontainer.moc Generating appletsview.moc [ 8%] Generating appletoverlay.moc Building CXX object plasma/declarativeimports/graphicslayouts/CMakeFiles/graphicslayoutsbindingsplugin.dir/graphicslayoutsbindingsplugin.o Generating dragcountdown.moc Generating newspaper.moc [ 9%] Building CXX object plasma/declarativeimports/graphicswidgets/CMakeFiles/graphicswidgetsbindingsplugin.dir/graphicswidgetsbindingsplugin.o Scanning dependencies of target plasma_appletscript_simple_javascript_automoc Generating engineaccess.moc Generating javascriptaddonpackagestructure.moc [ 10%] Generating datamodel.moc Generating animationgroup.moc Generating plasmakpart.moc Generating filedialogproxy.moc [ 10%] Built target plasma_containment_newspaper_automoc [ 11%] Generating datasource_p.moc Generating filedialogproxy.moc [ 12%] Building CXX object plasma/declarativeimports/graphicswidgets/CMakeFiles/graphicswidgetsbindingsplugin.dir/declarativetabbar.o [ 13%] Generating layouttemplatepackagestructure.moc Generating svgitem_p.moc [ 14%] Building CXX object plasma/declarativeimports/graphicslayouts/CMakeFiles/graphicslayoutsbindingsplugin.dir/gridlayout.o Generating widget.moc Scanning dependencies of target corebindingsplugin Generating dataenginereceiver.moc Generating dataenginereceiver.moc Generating plasmakpartview.moc Generating scriptenv.moc Generating scriptenv.moc [ 15%] Building CXX object plasma/declarativeimports/graphicslayouts/CMakeFiles/graphicslayoutsbindingsplugin.dir/linearlayout.o Generating declarativeappletscript.moc Generating themedsvg.moc Generating scriptengine.moc [ 15%] Built target plasma-kpart_automoc Scanning dependencies of target plasma_dataenginescript_javascript_automoc Generating appletinterface.moc Generating javascriptdataengine.moc Generating themedsvg.moc Scanning dependencies of target plasma_packagestructure_javascriptaddon_automoc Generating javascriptaddonpackagestructure.moc Generating javascriptaddonpackagestructure.moc [ 16%] Building CXX object plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/corebindingsplugin.o Generating moc_bytearrayprototype.cpp Generating javascriptservice.moc Generating appletinterface.moc Generating moc_simplejavascriptapplet.cpp [ 16%] Built target plasma_packagestructure_javascriptaddon_automoc [ 17%] Building CXX object plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/dataengineconsumer.o Generating moc_bytearrayprototype.cpp Generating scriptenv.moc Generating moc_abstractjsappletscript.cpp Generating moc_abstractjsappletscript.cpp Linking CXX shared library ../../../lib/libgraphicslayoutsbindingsplugin.so [ 17%] Built target plasma_dataenginescript_javascript_automoc [ 18%] Building CXX object plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/theme.o In file included from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/declarativeimports/core/corebindingsplugin.cpp:22: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/declarativeimports/core/corebindingsplugin.h:29: error: redefinition of 'struct QMetaTypeId' /usr/include/KDE/Plasma/../../plasma/service.h:321: error: previous definition of 'struct QMetaTypeId' [ 18%] Built target plasma_appletscript_simple_javascript_automoc [ 19%] [ 19%] Built target plasma_appletscript_declarative_automoc Building CXX object plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/datamodel.o Scanning dependencies of target plasma_runnerscript_javascript_automoc Generating javascriptaddonpackagestructure.moc Linking CXX shared library ../../../lib/libgraphicswidgetsbindingsplugin.so /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/declarativeimports/core/dataengineconsumer.cpp:107: warning: unused parameter 'location' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/declarativeimports/core/dataengineconsumer.cpp:107: warning: unused parameter 'name' Generating javascriptrunner.moc [ 19%] Built target graphicslayoutsbindingsplugin [ 20%] Building CXX object plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/datasource.o make[2]: *** [plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/corebindingsplugin.o] Error 1 make[2]: *** Waiting for unfinished jobs.... Generating scriptenv.moc Scanning dependencies of target plasmapkg_automoc [ 20%] Built target plasmapkg_automoc Scanning dependencies of target plasma_containment_newspaper Scanning dependencies of target plasma-kpart [ 20%] Built target plasma_runnerscript_javascript_automoc Scanning dependencies of target kcmremotewidgetshelper Scanning dependencies of target plasma_appletscript_declarative [ 20%] Built target graphicswidgetsbindingsplugin Scanning dependencies of target plasma_appletscript_simple_javascript [ 21%] Building CXX object plasma/remotewidgetshelper/CMakeFiles/kcmremotewidgetshelper.dir/kcmremotewidgetshelper_automoc.o [ 22%] Building CXX object plasma/remotewidgetshelper/CMakeFiles/kcmremotewidgetshelper.dir/remotewidgetshelper.o Linking CXX executable kcmremotewidgetshelper [ 23%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/plasma-kpart_automoc.o [ 24%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/scripting/layouttemplatepackagestructure.o [ 25%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/plasma_containment_newspaper_automoc.o [ 26%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/newspaper.o [ 27%] [ 27%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/scripting/rect.o Built target kcmremotewidgetshelper [ 28%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/appletoverlay.o make[1]: *** [plasma/declarativeimports/core/CMakeFiles/corebindingsplugin.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 28%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/appletmovespacer.o [ 28%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/scripting/scriptengine.o [ 29%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/scripting/widget.o [ 30%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/applettitlebar.o [ 31%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/plasmakpartcorona.o [ 32%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasma_appletscript_declarative_automoc.o /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/containments/newspaper/applettitlebar.cpp:48: warning: unused parameter 'widget' [ 33%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasma_appletscript_simple_javascript_automoc.o [ 34%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/common/javascriptaddonpackagestructure.o [ 35%] [ 36%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/appletscontainer.o Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/appletsview.o [ 37%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/common/javascriptaddonpackagestructure.o [ 38%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/common/declarativescriptenv.o [ 39%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/plasmakpartview.o [ 39%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/declarative/packageaccessmanager.o [ 40%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/common/jsscriptenv.o /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/containments/newspaper/appletsview.cpp:479: warning: unused parameter 'event' [ 41%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/abstractjsappletscript.o [ 42%] Building CXX object plasma/kpart/CMakeFiles/plasma-kpart.dir/plasmakpart.o /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/declarative/packageaccessmanager.cpp:40: warning: unused parameter 'data' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/declarative/packageaccessmanager.cpp:40: warning: unused parameter 'maxSize' [ 43%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/appletauthorization.o [ 44%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/jsappletinterface.o [ 45%] Building CXX object plasma/containments/newspaper/CMakeFiles/plasma_containment_newspaper.dir/dragcountdown.o [ 46%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/declarative/packageaccessmanagerfactory.o [ 47%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/abstractjsappletscript.o /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/containments/newspaper/dragcountdown.cpp:79: warning: unused parameter 'option' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/containments/newspaper/dragcountdown.cpp:79: warning: unused parameter 'widget' Linking CXX shared module ../../../lib/plasma_containment_newspaper.so Linking CXX shared module ../../lib/plasma-kpart.so [ 47%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/simplejavascriptapplet.o [ 48%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/themedsvg.o [ 49%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/appletauthorization.o [ 50%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/appletinterface.o [ 50%] Built target plasma_containment_newspaper [ 51%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/declarativeappletscript.o [ 52%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/simplebindings/animationgroup.o [ 52%] Built target plasma-kpart [ 53%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/simplebindings/anchorlayout.o [ 54%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/engineaccess.o In file included from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/plasmoid/simplejavascriptapplet.cpp:65: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:33: error: redefinition of 'struct QMetaTypeId' /usr/include/plasma/service.h:321: error: previous definition of 'struct QMetaTypeId' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:34: error: redefinition of 'struct QMetaTypeId' /usr/include/KDE/Plasma/../../plasma/servicejob.h:136: error: previous definition of 'struct QMetaTypeId' [ 55%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/plasmoid/themedsvg.o make[2]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/plasmoid/simplejavascriptapplet.o] Error 1 make[2]: *** Waiting for unfinished jobs.... [ 55%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/bytearrayclass.o [ 56%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/bytearrayprototype.o make[1]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_simple_javascript.dir/all] Error 2 [ 57%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/dataengine.o [ 58%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/dataenginereceiver.o [ 59%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/filedialogproxy.o [ 60%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/i18n.o [ 61%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/icon.o [ 61%] Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/qscriptbookkeeping.o [ 62%] In file included from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.cpp:19: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:33: error: redefinition of 'struct QMetaTypeId' /usr/include/plasma/service.h:321: error: previous definition of 'struct QMetaTypeId' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:34: error: redefinition of 'struct QMetaTypeId' /usr/include/KDE/Plasma/../../plasma/servicejob.h:136: error: previous definition of 'struct QMetaTypeId' Building CXX object plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/url.o make[2]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/dataengine.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataenginereceiver.cpp:23: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:33: error: redefinition of 'struct QMetaTypeId' /usr/include/plasma/service.h:321: error: previous definition of 'struct QMetaTypeId' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:34: error: redefinition of 'struct QMetaTypeId' /usr/include/KDE/Plasma/../../plasma/servicejob.h:136: error: previous definition of 'struct QMetaTypeId' make[2]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/dataenginereceiver.o] Error 1 In file included from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/qscriptnonguibookkeeping.cpp:26, from /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/qscriptbookkeeping.cpp:144: /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:33: error: redefinition of 'struct QMetaTypeId' /usr/include/plasma/service.h:321: error: previous definition of 'struct QMetaTypeId' /var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5/plasma/scriptengines/javascript/simplebindings/dataengine.h:34: error: redefinition of 'struct QMetaTypeId' /usr/include/KDE/Plasma/../../plasma/servicejob.h:136: error: previous definition of 'struct QMetaTypeId' make[2]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/simplebindings/qscriptbookkeeping.o] Error 1 make[1]: *** [plasma/scriptengines/javascript/CMakeFiles/plasma_appletscript_declarative.dir/all] Error 2 make: *** [all] Error 2 * ERROR: kde-base/plasma-runtime-4.6.5 failed (compile phase): * emake failed * * If you need support, post the output of 'emerge --info =kde-base/plasma-runtime-4.6.5', * the complete build log and the output of 'emerge -pqv =kde-base/plasma-runtime-4.6.5'. * The complete build log is located at '/var/tmp/portage/kde-base/plasma-runtime-4.6.5/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/kde-base/plasma-runtime-4.6.5/temp/environment'. * S: '/var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-runtime-4.6.5' --=-PYe+5/N6FzmAqvcuIsJ3 Content-Disposition: attachment; filename="plasma-runtime-4.6.5-environment" Content-Type: text/plain; name="plasma-runtime-4.6.5-environment"; charset="UTF-8" Content-Transfer-Encoding: quoted-printable declare -x ABI=3D"amd64" declare -x ALSA_CARDS=3D"" declare -x ALSA_PCM_PLUGINS=3D"adpcm alaw asym copy dmix dshare dsnoop empt= y extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mul= aw multi null plug rate route share shm softvol" declare -x ANT_HOME=3D"/usr/share/ant" declare -x APACHE2_MODULES=3D"actions alias auth_basic authn_alias authn_an= on authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfi= le authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs da= v_lock deflate dir disk_cache env expires ext_filter file_cache filter head= ers include info log_config logio mem_cache mime mime_magic negotiation rew= rite setenvif speling status unique_id userdir usertrack vhost_alias" declare -x ARCH=3D"amd64" declare -x ASFLAGS_x86=3D"--32" declare -- BASE_EXPF=3D"src_unpack src_compile src_install src_prepare src_= configure" declare -x BUILD_TYPE=3D"release" declare -x CALLIGRA_FEATURES=3D"braindump flow karbon kexi kpresenter krita= tables words" declare -x CAMERAS=3D"ptp2" declare -x CBUILD=3D"x86_64-pc-linux-gnu" declare -x CFLAGS=3D"-O2 -pipe -march=3Damdfam10" declare -x CFLAGS_default declare -x CFLAGS_x86=3D"-m32" declare -x CHOST=3D"x86_64-pc-linux-gnu" declare -x CHOST_amd64=3D"x86_64-pc-linux-gnu" declare -x CHOST_default=3D"x86_64-pc-linux-gnu" declare -x CHOST_x86=3D"i686-pc-linux-gnu" declare -- CMAKE_BINARY=3D"cmake" declare -- CMAKE_BUILD_DIR=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.= 5/work/plasma-runtime-4.6.5_build" declare -- CMAKE_BUILD_TYPE=3D"Gentoo" declare -- CMAKE_EXPF=3D"src_compile src_test src_install src_configure" declare -- CMAKE_MIN_VERSION=3D"2.8.1" declare -- CMAKE_REMOVE_MODULES=3D"yes" declare -- CMAKE_REMOVE_MODULES_LIST=3D"FindBLAS FindLAPACK" declare -- CMAKE_REQUIRED=3D"always" declare -- CMAKE_USE_DIR=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.5/= work/plasma-runtime-4.6.5" declare -x COLLECTD_PLUGINS=3D"df interface irq load memory rrdtool swap sy= slog" declare -x CPPFLAGS=3D" -DQT_NO_DEBUG -DNDEBUG" declare -- CPPUNIT_REQUIRED=3D"never" declare -x CROSSCOMPILE_OPTS=3D"" declare -x CTARGET_default=3D"x86_64-pc-linux-gnu" declare -x CXXFLAGS=3D"-O2 -pipe -march=3Damdfam10" declare -- DECLARATIVE_REQUIRED=3D"always" declare -x DEFAULT_ABI=3D"amd64" declare -x DEFINED_PHASES=3D" compile configure install postinst postrm pre= inst prepare setup test unpack" declare DEPEND=3D" >=3Dsys-apps/sed-4 >=3Ddev-util/cmake-2.8.1 userland_GN= U? ( >=3Dsys-apps/findutils-4.4.0 ) =20 dev-util/automoc dev-util/pkgconfig !aqua? ( >=3Dx11-libs/libXtst-1.1.0 x11-proto/xf86vidmodeproto ) =20 >=3Dx11-libs/qt-declarative-4.7.0:4 =20 dev-lang/perl >=3Dx11-libs/qt-core-4.7.0:4[qt3support,ssl] >=3Dx11-libs/qt-gui-4.7.0:4[accessibility,dbus] >=3Dx11-libs/qt-qt3support-4.7.0:4[accessibility,kde] >=3Dx11-libs/qt-script-4.7.0:4 >=3Dx11-libs/qt-sql-4.7.0:4[qt3support] >=3Dx11-libs/qt-svg-4.7.0:4 >=3Dx11-libs/qt-test-4.7.0:4 >=3Dx11-libs/qt-webkit-4.7.0:4[kde] !aqua? ( x11-libs/libXext x11-libs/libXt x11-libs/libXxf86vm x11-libs/libXcomposite ) >=3Dkde-base/kdelibs-4.6.5:4[aqua=3D] >=3Dmedia-libs/qimageblitz-0.0.4" declare DESCRIPTION=3D"Script engine and package tool for plasma" declare -x DESTTREE=3D"/usr" declare -x DIROPTIONS=3D"-m0755" declare -x EAPI=3D"4" declare -- EKDEDIR=3D"/usr" declare -x ELIBC=3D"glibc" declare -- EPATCH_EXCLUDE=3D"" declare -- EPATCH_FORCE=3D"no" declare -- EPATCH_MULTI_MSG=3D"Applying various patches (bugfixes/updates) = ..." declare -- EPATCH_OPTS=3D"-g0 -E --no-backup-if-mismatch" declare -- EPATCH_SINGLE_MSG=3D"" declare -- EPATCH_SOURCE=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.5/= work/patch" declare -- EPATCH_SUFFIX=3D"patch.bz2" declare -x EXEOPTIONS=3D"-m0755" declare -x FCFLAGS=3D"" declare -x FETCHCOMMAND_SSH=3D"bash -c \"x=3D\\\${2#ssh://} ; host=3D\\\${x= %%/*} ; port=3D\\\${host##*:} ; host=3D\\\${host%:*} ; [[ \\\${host} =3D \\= \${port} ]] && port=3D22 ; exec rsync --rsh=3D\\\"ssh -p\\\${port}\\\" -avP= \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE= }\" \"\${URI}\"" declare -x FFLAGS=3D"" declare -x GCC_SPECS=3D"" declare -- GCONFTOOL_BIN=3D"/usr/bin/gconftool-2" declare -x GDK_USE_XFT=3D"1" declare -- GLIB_COMPILE_SCHEMAS=3D"/usr/bin/glib-compile-schemas" declare -x GPSD_PROTOCOLS=3D"ashtech aivdm earthmate evermore fv18 garmin g= armintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle onco= re rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" declare -x GRUB_PLATFORMS=3D"" declare -x GSETTINGS_BACKEND=3D"gconf" declare -- GTK_UPDATE_ICON_CACHE=3D"/usr/bin/gtk-update-icon-cache" declare HOMEPAGE=3D"http://www.kde.org/" declare -x INHERITED=3D" toolchain-funcs multilib portability eutils versio= nator kde4-functions fdo-mime gnome2-utils base virtualx flag-o-matic cmake= -utils kde4-base kde4-meta" declare -x INPUT_DEVICES=3D"evdev synaptics" declare -x INSDESTTREE=3D"" declare -x INSOPTIONS=3D"-m0644" declare IUSE=3D"debug aqua kdeenablefinal" declare -x JAVAC=3D"/etc/java-config-2/current-system-vm/bin/javac" declare -x JAVA_HOME=3D"/etc/java-config-2/current-system-vm" declare -x JDK_HOME=3D"/etc/java-config-2/current-system-vm" declare -- KDEBASE=3D"kde-base" declare -- KDEDIR=3D"/usr" declare -- KDEMETA_EXPF=3D"pkg_setup src_unpack src_prepare src_configure s= rc_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm" declare -- KDE_HANDBOOK=3D"never" declare -- KDE_MINIMAL=3D"4.6.5" declare -- KDE_REQUIRED=3D"always" declare -- KDE_SCM=3D"svn" declare -x KERNEL=3D"linux" declare -x KERNEL_ABI=3D"amd64" declare -x KEYWORDS=3D"amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd ~amd64-linux ~= x86-linux" declare -- KMCOMPILEONLY=3D" cmake/modules/" declare -- KMEXTRACTONLY=3D" config-runtime.h.cmake" declare -- KMMODULE=3D"plasma" declare -- KMNAME=3D"kdebase-runtime" declare -- KMTARPARAMS=3D" --bzip2" declare -x LCD_DEVICES=3D"" declare -x LDFLAGS=3D"-Wl,-O1 -Wl,--as-needed" declare -x LDFLAGS_default declare -x LDFLAGS_x86=3D"-m elf_i386" declare -x LIBDIR_amd64=3D"lib64" declare -x LIBDIR_amd64_fbsd=3D"lib64" declare -x LIBDIR_default=3D"lib" declare -x LIBDIR_ppc=3D"lib32" declare -x LIBDIR_ppc64=3D"lib64" declare -x LIBDIR_s390=3D"lib32" declare -x LIBDIR_s390x=3D"lib64" declare -x LIBDIR_sparc32=3D"lib32" declare -x LIBDIR_sparc64=3D"lib64" declare -x LIBDIR_x86=3D"lib32" declare -x LIBDIR_x86_fbsd=3D"lib32" declare -x LIBOPTIONS=3D"-m0644" declare -x LICENSE=3D"GPL-2" declare -x LIRC_DEVICES=3D"mceusb" declare -x MAKEOPTS=3D"-j7" declare -x MULTILIB_ABIS=3D"amd64 x86" declare -x MULTILIB_STRICT_DENY=3D"64-bit.*shared object" declare -x MULTILIB_STRICT_DIRS=3D"/lib32 /lib /usr/lib32 /usr/lib /usr/kde= /*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr= /X11R6/lib" declare -x MULTILIB_STRICT_EXEMPT=3D"(perl5|gcc|gcc-lib|binutils|eclipse-3|= debug|portage|udev)" declare -- MULTIMEDIA_REQUIRED=3D"never" declare -x NETBEANS=3D"apisupport cnd groovy gsf harness ide identity j2ee = java mobility nb php profiler soa visualweb webcommon websvccommon xml" declare -x OPENGL_PROFILE=3D"nvidia" declare -- OPENGL_REQUIRED=3D"never" declare -x PATH=3D"/usr/lib64/portage/bin/ebuild-helpers/4:/usr/lib64/porta= ge/bin/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb= in:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.4.5" declare PDEPEND=3D" " declare -x PHP_TARGETS=3D"" declare -x PKG_CONFIG_PATH=3D"/usr/lib64/pkgconfig" declare -x PORTAGE_COMPRESS_EXCLUDE_SUFFIXES=3D"css gif htm[l]? jp[e]?g js = pdf png" declare -a PORTAGE_DOCOMPRESS=3D'([0]=3D"/usr/share/doc" [1]=3D"/usr/share/= info" [2]=3D"/usr/share/man")' declare -a PORTAGE_DOCOMPRESS_SKIP=3D'([0]=3D"/usr/share/doc/plasma-runtime= -4.6.5/html")' declare -- PREFIX=3D"/usr" declare -x PRELINK_PATH_MASK=3D"/usr/lib64/libfreebl3.so:/usr/lib64/libnssd= bm3.so:/usr/lib64/libsoftokn3.so" declare -x PROFILE_ONLY_VARIABLES=3D"ARCH ELIBC KERNEL USERLAND" declare -x PROPERTIES=3D"" declare -x PROVIDE=3D"" declare -x PYTHONDONTWRITEBYTECODE=3D"1" declare -- QTEST_COLORED=3D"1" declare -- QTHELP_REQUIRED=3D"never" declare -- QT_MINIMAL=3D"4.7.0" declare -x QT_PLUGIN_PATH=3D"/usr/lib64/kde4/plugins/" declare RDEPEND=3D" !=3Dkde-base/oxygen-icons-4.6.5:4[aqua=3D] =20 >=3Dx11-libs/qt-declarative-4.7.0:4 =20 dev-lang/perl >=3Dx11-libs/qt-core-4.7.0:4[qt3support,ssl] >=3Dx11-libs/qt-gui-4.7.0:4[accessibility,dbus] >=3Dx11-libs/qt-qt3support-4.7.0:4[accessibility,kde] >=3Dx11-libs/qt-script-4.7.0:4 >=3Dx11-libs/qt-sql-4.7.0:4[qt3support] >=3Dx11-libs/qt-svg-4.7.0:4 >=3Dx11-libs/qt-test-4.7.0:4 >=3Dx11-libs/qt-webkit-4.7.0:4[kde] !aqua? ( x11-libs/libXext x11-libs/libXt x11-libs/libXxf86vm x11-libs/libXcomposite ) >=3Dkde-base/kdelibs-4.6.5:4[aqua=3D] >=3Dmedia-libs/qimageblitz-0.0.4" declare REQUIRED_USE=3D" " declare -x RESTRICT=3D"" declare -x RESUMECOMMAND_SSH=3D"bash -c \"x=3D\\\${2#ssh://} ; host=3D\\\${= x%%/*} ; port=3D\\\${host##*:} ; host=3D\\\${host%:*} ; [[ \\\${host} =3D \= \\${port} ]] && port=3D22 ; exec rsync --rsh=3D\\\"ssh -p\\\${port}\\\" -av= P \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FIL= E}\" \"\${URI}\"" declare -x RUBY_TARGETS=3D"" declare -x S=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.5/work/plasma-= runtime-4.6.5" declare -x SANDBOX_DEBUG=3D"0" declare -x SANDBOX_DENY=3D"" declare -x SANDBOX_PID=3D"5533" declare -x SANDBOX_PREDICT=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.= 5/homedir:/dev/crypto:/var/cache/fontconfig" declare -x SANDBOX_READ=3D"/:/dev/stdin:/var/tmp" declare -x SANDBOX_VERBOSE=3D"1" declare -x SANDBOX_WRITE=3D":/dev/console:/dev/fd:/dev/full:/dev/null:/dev/= pts/:/dev/pty:/dev/shm:/dev/stderr:/dev/stdout:/dev/tts:/dev/tty:/dev/vc/:/= dev/zero:/proc/self/fd:/tmp/:/usr/lib/cf:/usr/lib/conftest:/usr/lib32/cf:/u= sr/lib32/conftest:/usr/lib64/cf:/usr/lib64/conftest:/usr/tmp/cf:/usr/tmp/co= nftest:/var/tmp:/var/tmp/:/var/tmp/portage/kde-base/plasma-runtime-4.6.5/ho= medir/.bash_history" declare -- SCROLLKEEPER_DIR=3D"/var/lib/scrollkeeper" declare -- SCROLLKEEPER_UPDATE_BIN=3D"/usr/bin/scrollkeeper-update" declare -x SLOT=3D"4" declare SRC_URI=3D"mirror://kde/stable/4.6.5/src/kdebase-runtime-4.6.5.tar.= bz2" declare -x STAGE1_USE=3D"multilib nptl nptlonly unicode" declare -x SYMLINK_LIB=3D"yes" declare -x USE=3D"amd64 elibc_glibc kernel_linux multilib userland_GNU" declare -x USERLAND=3D"GNU" declare -x VIDEO_CARDS=3D"" declare -- VIRTUALX_COMMAND=3D"emake" declare -- VIRTUALX_DEPEND=3D" !prefix? ( x11-base/xorg-server[xvfb] ) x11-apps/xhost " declare -- VIRTUALX_REQUIRED=3D"manual" declare -- WANT_CMAKE=3D"always" declare -x XDG_CONFIG_DIRS=3D"/etc/xdg" declare -x XDG_CONFIG_HOME=3D"/var/tmp/portage/kde-base/plasma-runtime-4.6.= 5/temp" declare -x XDG_DATA_DIRS=3D"/usr/local/share:/usr/share:/usr/share/gdm" declare -x XSESSION=3D"KDE-4" declare -x XTABLES_ADDONS=3D"quota2 psd pknock lscan length2 ipv4options ip= set ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark= ipmark dhcpmac delude chaos account" declare -- _=3D"PKG_INSTALL_MASK" declare -x _E_DOCDESTTREE_=3D"" declare -x _E_EXEDESTTREE_=3D"" declare -a __ESHOPTS_SAVE__=3D'()' declare -- ___ECLASS_RECUR_MULTILIB=3D"yes" declare -- ___ECLASS_RECUR_TOOLCHAIN_FUNCS=3D"yes" declare -a mycmakeargs=3D'([0]=3D"-DKDE4_BUILD_TESTS=3DOFF" [1]=3D"-DCMAKE_= INSTALL_PREFIX=3D/usr" [2]=3D"-DSYSCONF_INSTALL_DIR=3D/etc")' declare -- qtwebkitusedeps=3D"[kde]" Xeconf ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; VIRTUALX_COMMAND=3D"econf" virtualmake "$@" } Xemake ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; VIRTUALX_COMMAND=3D"emake" virtualmake "$@" } Xmake ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; ewarn "QA: you should not execute make directly"; ewarn "QA: rather execute Xemake -j1 if you have issues with parallel m= ake"; VIRTUALX_COMMAND=3D"emake -j1" virtualmake "$@" } __list_needed_subdirectories ()=20 {=20 local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expa= nded extractlist; kmextra=3D"${KMEXTRA}"; [[ ${1} !=3D fatal ]] && kmextra+=3D" ${KMEXTRA_NONFATAL}"; for i in ${kmextra}; do kmextra_expanded+=3D" ${i}"; j=3D$(dirname ${i}); while [[ ${j} !=3D "." ]]; do kmextra_expanded+=3D" ${j}/CMakeLists.txt"; j=3D$(dirname ${j}); done; done; if [[ -n ${KMMODULE} ]]; then kmmodule_expanded=3D"${KMMODULE}"; j=3D$(dirname ${KMMODULE}); while [[ ${j} !=3D "." ]]; do kmmodule_expanded+=3D" ${j}/CMakeLists.txt"; j=3D$(dirname ${j}); done; fi; for i in ${KMCOMPILEONLY}; do kmcompileonly_expanded+=3D" ${i}"; j=3D$(dirname ${i}); while [[ ${j} !=3D "." ]]; do kmcompileonly_expanded+=3D" ${j}/CMakeLists.txt"; j=3D$(dirname ${j}); done; done; debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: $= {kmextra_expanded}"; debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: = ${kmmodule_expanded}"; debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expan= ded: ${kmcompileonly_expanded}"; for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expan= ded} ${KMEXTRACTONLY}; do extractlist+=3D" ${topdir}${i}"; done; echo ${extractlist} } __versionator__test_version_compare ()=20 {=20 eshopts_push -s extglob; local lt=3D1 eq=3D2 gt=3D3 p q; function __versionator__test_version_compare_t ()=20 {=20 version_compare "${1}" "${3}"; local r=3D$?; [[ ${r} -eq ${2} ]] || echo "FAIL: ${@} (got ${r} exp ${2})" }; echo " 0 $lt 1 1 $lt 2 2 $gt 1 2 $eq 2 0 $eq 0 10 $lt 20 68 $eq 068 068 $gt 67 068 $lt 69 1.0 $lt 2.0 2.0 $eq 2.0 2.0 $gt 1.0 1.0 $gt 0.0 0.0 $eq 0.0 0.0 $lt 1.0 0.1 $lt 0.2 0.2 $eq 0.2 0.3 $gt 0.2 1.2 $lt 2.1 2.1 $gt 1.2 1.2.3 $lt 1.2.4 1.2.4 $gt 1.2.3 1.2.0 $gt 1.2 1.2.1 $gt 1.2 1.2 $lt 1.2.1 1.2b $eq 1.2b 1.2b $lt 1.2c 1.2b $gt 1.2a 1.2b $gt 1.2 1.2 $lt 1.2a 1.3 $gt 1.2a 1.3 $lt 1.3a 1.0_alpha7 $lt 1.0_beta7 1.0_beta $lt 1.0_pre 1.0_pre5 $lt 1.0_rc2 1.0_rc2 $lt 1.0 1.0_p1 $gt 1.0 1.0_p1-r1 $gt 1.0_p1 1.0_alpha6-r1 $gt 1.0_alpha6 1.0_beta6-r1 $gt 1.0_alpha6-r2 1.0_pre1 $lt 1.0_p1 1.0p $gt 1.0_p1 1.0r $gt 1.0-r1 1.6.15 $gt 1.6.10-r2 1.6.10-r2 $lt 1.6.15 " | while read a b c; do [[ -z "${a}${b}${c}" ]] && continue; __versionator__test_version_compare_t "${a}" "${b}" "${c}"; done; for q in "alpha beta pre rc=3D${lt};${gt}" "p=3D${gt};${lt}"; do for p in ${q%%=3D*}; do local c=3D${q##*=3D}; local alt=3D${c%%;*} agt=3D${c##*;}; __versionator__test_version_compare_t "1.0" $agt "1.0_${p}"; __versionator__test_version_compare_t "1.0" $agt "1.0_${p}1"; __versionator__test_version_compare_t "1.0" $agt "1.0_${p}068"; __versionator__test_version_compare_t "2.0_${p}" $alt "2.0"; __versionator__test_version_compare_t "2.0_${p}1" $alt "2.0"; __versionator__test_version_compare_t "2.0_${p}068" $alt "2.0"; __versionator__test_version_compare_t "1.0_${p}" $eq "1.0_${p}"= ; __versionator__test_version_compare_t "0.0_${p}" $lt "0.0_${p}1= "; __versionator__test_version_compare_t "666_${p}3" $gt "666_${p}= "; __versionator__test_version_compare_t "1_${p}7" $lt "1_${p}8"; __versionator__test_version_compare_t "1_${p}7" $eq "1_${p}7"; __versionator__test_version_compare_t "1_${p}7" $gt "1_${p}6"; __versionator__test_version_compare_t "1_${p}09" $eq "1_${p}9"; __versionator__test_version_compare_t "1_${p}7-r0" $eq "1_${p}7= "; __versionator__test_version_compare_t "1_${p}7-r0" $lt "1_${p}7= -r1"; __versionator__test_version_compare_t "1_${p}7-r0" $lt "1_${p}7= -r01"; __versionator__test_version_compare_t "1_${p}7-r01" $eq "1_${p}= 7-r1"; __versionator__test_version_compare_t "1_${p}8-r1" $gt "1_${p}7= -r100"; __versionator__test_version_compare_t "1_${p}_alpha" $lt "1_${p= }_beta"; done; done; for p in "-r" "_p"; do __versionator__test_version_compare_t "7.2${p}1" $lt "7.2${p}2"; __versionator__test_version_compare_t "7.2${p}2" $gt "7.2${p}1"; __versionator__test_version_compare_t "7.2${p}3" $gt "7.2${p}2"; __versionator__test_version_compare_t "7.2${p}2" $lt "7.2${p}3"; done; __versionator__test_version_compare_t "6.0" $gt "5.0"; __versionator__test_version_compare_t "5.0" $gt "5"; __versionator__test_version_compare_t "1.0-r1" $gt "1.0-r0"; __versionator__test_version_compare_t "1.0-r1" $gt "1.0"; __versionator__test_version_compare_t "999999999999999999999999999999" = $gt "999999999999999999999999999998"; __versionator__test_version_compare_t "1.0.0" $gt "1.0"; __versionator__test_version_compare_t "1.0.0" $gt "1.0b"; __versionator__test_version_compare_t "1b" $gt "1"; __versionator__test_version_compare_t "1b_p1" $gt "1_p1"; __versionator__test_version_compare_t "1.1b" $gt "1.1"; __versionator__test_version_compare_t "12.2.5" $gt "12.2b"; __versionator__test_version_compare_t "4.0" $lt "5.0"; __versionator__test_version_compare_t "5" $lt "5.0"; __versionator__test_version_compare_t "1.0_pre2" $lt "1.0_p2"; __versionator__test_version_compare_t "1.0_alpha2" $lt "1.0_p2"; __versionator__test_version_compare_t "1.0_alpha1" $lt "1.0_beta1"; __versionator__test_version_compare_t "1.0_beta3" $lt "1.0_rc3"; __versionator__test_version_compare_t "1.001000000000000000001" $lt "1.= 001000000000000000002"; __versionator__test_version_compare_t "1.00100000000" $lt "1.0010000000= 000000001"; __versionator__test_version_compare_t "999999999999999999999999999998" = $lt "999999999999999999999999999999"; __versionator__test_version_compare_t "1.01" $lt "1.1"; __versionator__test_version_compare_t "1.0-r0" $lt "1.0-r1"; __versionator__test_version_compare_t "1.0" $lt "1.0-r1"; __versionator__test_version_compare_t "1.0" $lt "1.0.0"; __versionator__test_version_compare_t "1.0b" $lt "1.0.0"; __versionator__test_version_compare_t "1_p1" $lt "1b_p1"; __versionator__test_version_compare_t "1" $lt "1b"; __versionator__test_version_compare_t "1.1" $lt "1.1b"; __versionator__test_version_compare_t "12.2b" $lt "12.2.5"; __versionator__test_version_compare_t "4.0" $eq "4.0"; __versionator__test_version_compare_t "1.0" $eq "1.0"; __versionator__test_version_compare_t "1.0-r0" $eq "1.0"; __versionator__test_version_compare_t "1.0" $eq "1.0-r0"; __versionator__test_version_compare_t "1.0-r0" $eq "1.0-r0"; __versionator__test_version_compare_t "1.0-r1" $eq "1.0-r1"; __versionator__test_version_compare_t "1" $lt "2"; __versionator__test_version_compare_t "1.0_alpha" $lt "1.0_pre"; __versionator__test_version_compare_t "1.0_beta" $gt "1.0_alpha"; __versionator__test_version_compare_t "0" $lt "0.0"; __versionator__test_version_compare_t "1.0-r0" $lt "1.0-r1"; __versionator__test_version_compare_t "1.0-r1" $gt "1.0-r0"; __versionator__test_version_compare_t "1.0" $lt "1.0-r1"; __versionator__test_version_compare_t "1.0-r1" $gt "1.0"; __versionator__test_version_compare_t "1_p1" $lt "1b_p1"; __versionator__test_version_compare_t "1b" $gt "1"; __versionator__test_version_compare_t "1.1b" $gt "1.1"; __versionator__test_version_compare_t "12.2b" $gt "12.2"; __versionator__test_version_compare_t "1.0" $gt "1"; __versionator__test_version_compare_t "1" $lt "1.0"; __versionator__test_version_compare_t "1.0_alpha" $gt "1_alpha"; __versionator__test_version_compare_t "1.0_alpha" $gt "1"; __versionator__test_version_compare_t "1.0_alpha" $lt "1.0"; __versionator__test_version_compare_t "1.2.0.0_alpha7-r4" $gt "1.2_alph= a7-r4"; __versionator__test_version_compare_t "0001" $eq "1"; __versionator__test_version_compare_t "01" $eq "001"; __versionator__test_version_compare_t "0001.1" $eq "1.1"; __versionator__test_version_compare_t "01.01" $eq "1.01"; __versionator__test_version_compare_t "1.010" $eq "1.01"; __versionator__test_version_compare_t "1.00" $eq "1.0"; __versionator__test_version_compare_t "1.0100" $eq "1.010"; __versionator__test_version_compare_t "1" $eq "1-r0"; __versionator__test_version_compare_t "1-r00" $eq "1-r0"; eshopts_pop } _calculate_live_repo ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; SRC_URI=3D""; case ${KDE_SCM} in=20 svn) local branch_prefix; case ${PV} in=20 9999*) branch_prefix=3D"trunk/KDE" ;; *) branch_prefix=3D"branches/KDE/$(get_kde_version)"; ESVN_PROJECT_SUFFIX=3D"-${PV}" ;; esac; ESVN_MIRROR=3D${ESVN_MIRROR:=3Dsvn://anonsvn.kde.org/home/kde}; if [[ -n ${KMNAME} ]]; then ESVN_PROJECT=3D"${KMNAME}${ESVN_PROJECT_SUFFIX}"; if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then KMMODULE=3D"${PN}"; fi; case ${KMNAME} in=20 kdebase-*) ESVN_REPO_URI=3D"${ESVN_MIRROR}/${branch_prefix}/kd= ebase/${KMNAME#kdebase-}" ;; kdelibs-*) ESVN_REPO_URI=3D"${ESVN_MIRROR}/${branch_prefix}/kd= elibs/${KMNAME#kdelibs-}" ;; kdereview*) ESVN_REPO_URI=3D"${ESVN_MIRROR}/trunk/${KMNAME}/${K= MMODULE}" ;; kdesupport) ESVN_REPO_URI=3D"${ESVN_MIRROR}/trunk/${KMNAME}/${K= MMODULE}"; ESVN_PROJECT=3D"${PN}${ESVN_PROJECT_SUFFIX}" ;; kde*) ESVN_REPO_URI=3D"${ESVN_MIRROR}/${branch_prefix}/${= KMNAME}" ;; extragear* | playground*) ESVN_REPO_URI=3D"${ESVN_MIRROR}/trunk/${KMNAME}/${K= MMODULE}"; ESVN_PROJECT=3D"${PN}${ESVN_PROJECT_SUFFIX}" ;; koffice) ESVN_REPO_URI=3D"${ESVN_MIRROR}/trunk/${KMNAME}" ;; *) ESVN_REPO_URI=3D"${ESVN_MIRROR}/trunk/${KMNAME}/${K= MMODULE}" ;; esac; else ESVN_REPO_URI=3D"${ESVN_MIRROR}/${branch_prefix}/${PN}"; ESVN_PROJECT=3D"${PN}${ESVN_PROJECT_SUFFIX}"; fi; [[ ${KDEBASE} =3D kde-base || ${KDEBASE} =3D koffice ]] && ESVN= _UP_FREQ=3D${ESVN_UP_FREQ:-1} ;; git) local _kmname; EGIT_MIRROR=3D${EGIT_MIRROR:=3Dgit://anongit.kde.org}; if [[ -n ${EGIT_REPONAME} ]]; then _kmname=3D${EGIT_REPONAME}; else if [[ -n ${KMNAME} ]]; then _kmname=3D${KMNAME}; else _kmname=3D${PN}; fi; fi; case ${PV} in=20 9999*) ;; *) case ${_kmname} in=20 blinken | cantor | kalgebra | kalzium | kanagram | = kbruch | kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs | kgeograp= hy | khangman | kig | kiten | klettres | kmplot | kstars | ktouch | kturtle= | kwordquiz | libkdeedu | mobipocket | okular | parley | rocs | step) EGIT_BRANCH=3D"$(get_kde_version)" ;; marble) EGIT_BRANCH=3D"kde-$(get_kde_version)" ;; gwenview | kamera | kate | kcolorchooser | kde-base= apps | kde-runtime | kde-workspace | kgamma | kdegraphics-strigi-analyzer |= kdegraphics-thumbnailers | kdelibs | kimono | kolourpaint | konsole | koru= ndum | kross-interpreters | kruler | ksaneplugin | ksnapshot | libkdcraw | = libkexiv2 | libkipi | libksane | perlqt | perlkde | pykde4 | qtruby | qyoto= | smokegen | smokekde | smokeqt | svgpart) EGIT_BRANCH=3D"KDE/$(get_kde_version)" ;; *) ewarn "Unknown KMNAME ${_kmname}: Guessing bran= ch name 'KDE/$(get_kde_version)'"; EGIT_BRANCH=3D"KDE/$(get_kde_version)" ;; esac ;; esac; EGIT_REPO_URI=3D"${EGIT_MIRROR}/${_kmname}"; debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"; debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" ;; esac } _calculate_src_uri ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local _kmname _kmname_pv; [[ -n ${KDEBASE} ]] || return; if [[ -n ${KMNAME} ]]; then case ${KMNAME} in=20 kdebase-apps) _kmname=3D"kdebase" ;; *) _kmname=3D"${KMNAME}" ;; esac; else _kmname=3D${PN}; fi; _kmname_pv=3D"${_kmname}-${PV}"; case ${KDEBASE} in=20 kde-base) case ${PV} in=20 4.[456].8[05] | 4.[456].9[023568]) SRC_URI=3D"mirror://kde/unstable/${PV}/src/${_kmname_pv= }.tar.bz2"; if ! version_is_at_least 4.6.80 ${PV}; then [[ ${KMNAME} =3D=3D "kdepim" || ${KMNAME} =3D=3D "k= depim-runtime" ]] && SRC_URI=3D"mirror://kde/unstable/kdepim/${PV}/${_kmnam= e_pv}.tar.bz2"; fi ;; *) SRC_URI=3D"mirror://kde/stable/${PV}/src/${_kmname_pv}.= tar.bz2"; if ! version_is_at_least 4.6.80 ${PV}; then [[ ${KMNAME} =3D=3D "kdepim" || ${KMNAME} =3D=3D "k= depim-runtime" ]] && SRC_URI=3D"mirror://kde/stable/kdepim-${PV}/src/${_kmn= ame_pv}.tar.bz2"; fi ;; esac ;; koffice) case ${PV} in=20 2.[1234].[6-9]*) SRC_URI=3D"mirror://kde/unstable/${_kmname_pv}/${_kmnam= e_pv}.tar.bz2" ;; *) SRC_URI=3D"mirror://kde/stable/${_kmname_pv}/${_kmname_= pv}.tar.bz2" ;; esac ;; kdevelop) SRC_URI=3D"mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src= /${P}.tar.bz2" ;; esac } _cdrom_locate_file_on_cd ()=20 {=20 local mline=3D""; local showedmsg=3D0 showjolietmsg=3D0; while [[ -z ${CDROM_ROOT} ]]; do local i=3D0; local -a cdset=3D(${*//:/ }); if [[ -n ${CDROM_SET} ]]; then cdset=3D(${cdset[${CDROM_SET}]}); fi; while [[ -n ${cdset[${i}]} ]]; do local dir=3D$(dirname ${cdset[${i}]}); local file=3D$(basename ${cdset[${i}]}); local point=3D node=3D fs=3D foo=3D; while read point node fs foo; do [[ " cd9660 iso9660 udf " !=3D *" ${fs} "* ]] && ! [[ ${fs}= =3D=3D "subfs" && ",${opts}," =3D=3D *",fs=3Dcdfss,"* ]] && continue; point=3D${point//\040/ }; [[ ! -d ${point}/${dir} ]] && continue; [[ -z $(find "${point}/${dir}" -maxdepth 1 -iname "${file}"= ) ]] && continue; export CDROM_ROOT=3D${point}; export CDROM_SET=3D${i}; export CDROM_MATCH=3D${cdset[${i}]}; return; done <<< "$(get_mounts)"; ((++i)); done; echo; if [[ ${showedmsg} -eq 0 ]]; then if [[ ${CDROM_TOTAL_CDS} -eq 1 ]]; then if [[ -z ${CDROM_NAME} ]]; then einfo "Please insert+mount the cdrom for ${PN} now !"; else einfo "Please insert+mount the ${CDROM_NAME} cdrom now = !"; fi; else if [[ -z ${CDROM_NAME_1} ]]; then einfo "Please insert+mount cd #${CDROM_CURRENT_CD} for = ${PN} now !"; else local var=3D"CDROM_NAME_${CDROM_CURRENT_CD}"; einfo "Please insert+mount the ${!var} cdrom now !"; fi; fi; showedmsg=3D1; fi; einfo "Press return to scan for the cd again"; einfo "or hit CTRL+C to abort the emerge."; echo; if [[ ${showjolietmsg} -eq 0 ]]; then showjolietmsg=3D1; else ewarn "If you are having trouble with the detection"; ewarn "of your CD, it is possible that you do not have"; ewarn "Joliet support enabled in your kernel. Please"; ewarn "check that CONFIG_JOLIET is enabled in your kernel."; ebeep 5; fi; read || die "something is screwed with your system"; done } _change_cmakelists_parent_dirs ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local _olddir _dir; _dir=3D"${S}"/${1}; until [[ ${_dir} =3D=3D ${S} ]]; do _olddir=3D$(basename "${_dir}"); _dir=3D$(dirname "${_dir}"); debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching= for ${_olddir}"; if [[ -f ${_dir}/CMakeLists.txt ]]; then sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:= space:]]*)/s/#DONOTCOMPILE //g" -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:= ]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" -i ${_dir}/CMakeLists.txt |= | die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"; fi; done } _check_build_dir ()=20 {=20 : ${CMAKE_USE_DIR:=3D${S}}; if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then CMAKE_BUILD_DIR=3D"${CMAKE_USE_DIR}"; else : ${CMAKE_BUILD_DIR:=3D${WORKDIR}/${P}_build}; fi; echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\"" } _enable_selected_linguas_dir ()=20 {=20 local lingua linguas sr_mess wp; local dir=3D${1}; [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"; comment_all_add_subdirectory "${dir}"; pushd "${dir}" > /dev/null; sr_mess=3D"sr@latn sr@latin sr@Latin"; for wp in ${sr_mess}; do [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@Latn.po"; if [[ -d ${wp} ]]; then mv "${wp}" "sr@Latn"; sed -i -e "s:${wp}:sr@Latn:g" CMakeLists.txt; fi; done; for lingua in ${KDE_LINGUAS}; do if [[ -e ${lingua}.po ]]; then mv "${lingua}.po" "${lingua}.po.old"; fi; done; for lingua in ${KDE_LINGUAS}; do if use linguas_${lingua}; then if [[ -d ${lingua} ]]; then linguas=3D"${linguas} ${lingua}"; sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*= )[[:space:]]*$/ s/^#DONOTCOMPILE //" -e "/ADD_SUBDIRECTORY([[:space:]]*${li= ngua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" -i CMakeLists.txt || = die "Sed to uncomment linguas_${lingua} failed."; fi; if [[ -e ${lingua}.po.old ]]; then linguas=3D"${linguas} ${lingua}"; mv "${lingua}.po.old" "${lingua}.po"; fi; fi; done; [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"; popd > /dev/null } _execute_optionaly ()=20 {=20 local phase=3D"$1"; shift; if [[ ${WANT_CMAKE} =3D always ]]; then enable_cmake-utils_${phase} "$@"; else use ${WANT_CMAKE} && enable_cmake-utils_${phase} "$@"; fi } _filter-hardened ()=20 {=20 local f; for f in "$@"; do case "${f}" in=20 -fPIC | -fpic | -fPIE | -fpie | -Wl,pie | -pie) gcc-specs-pie || continue; is-flagq -nopie || append-flags -nopie ;; -fstack-protector) gcc-specs-ssp || continue; is-flagq -fno-stack-protector || append-flags $(test-flags = -fno-stack-protector) ;; -fstack-protector-all) gcc-specs-ssp-to-all || continue; is-flagq -fno-stack-protector-all || append-flags $(test-fl= ags -fno-stack-protector-all) ;; -fno-strict-overflow) gcc-specs-nostrict || continue; is-flagq -fstrict-overflow || append-flags $(test-flags -fs= trict-overflow) ;; esac; done } _filter-var ()=20 {=20 local f x VAR VAL; declare -a new; VAR=3D$1; shift; eval VAL=3D\${${VAR}}; for f in ${VAL}; do for x in "$@"; do [[ ${f} =3D=3D ${x} ]] && continue 2; done; eval new\[\${\#new\[@]}]=3D\${f}; done; eval export ${VAR}=3D\${new\[*]} } _gcc-install-dir ()=20 {=20 echo "$(LC_ALL=3DC $(tc-getCC) -print-search-dirs 2> /dev/null | awk '= $1=3D=3D"install:" {print $2}')" } _gcc-specs-directive_raw ()=20 {=20 local cc=3D$(tc-getCC); local specfiles=3D$(LC_ALL=3DC ${cc} -v 2>&1 | awk '$1=3D=3D"Reading" {= print $NF}'); ${cc} -dumpspecs 2> /dev/null | cat - ${specfiles} | awk -v directive= =3D$1 'BEGIN { pspec=3D""; spec=3D""; outside=3D1 } $1=3D=3D"*"directive":" { pspec=3Dspec; spec=3D""; outside=3D0; next } outside || NF=3D=3D0 || ( substr($1,1,1)=3D=3D"*" && substr($1,length($1),= 1)=3D=3D":" ) { outside=3D1; next } spec=3D=3D"" && substr($0,1,1)=3D=3D"+" { spec=3Dpspec " " substr($0,2); n= ext } { spec=3Dspec $0 } END { print spec }'; return 0 } _gcc-specs-exists ()=20 {=20 [[ -f $(_gcc-install-dir)/$1 ]] } _gcc_fullversion ()=20 {=20 local ver=3D"$1"; shift; set -- `$(tc-getCPP "$@") -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PA= TCHLEVEL__"`; eval echo "$ver" } _is_flagq ()=20 {=20 local x; for x in ${!1}; do [[ ${x} =3D=3D $2 ]] && return 0; done; return 1 } _modify-cmakelists ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; grep -qs "<<< Gentoo configuration >>>" CMakeLists.txt && return 0; find "${CMAKE_USE_DIR}" -name CMakeLists.txt -exec sed -i -e '/^[[:spac= e:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_BUILD_TYPE.*)/{s/^/#IGNORE = /g}' {} + -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:space:= ]]*CMAKE_COLOR_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + -exec sed -i -e '/^[[:spa= ce:]]*[sS][eE][tT][[:space:]]*([[:space:]]*CMAKE_INSTALL_PREFIX.*)/{s/^/#IG= NORE /g}' {} + -exec sed -i -e '/^[[:space:]]*[sS][eE][tT][[:space:]]*([[:s= pace:]]*CMAKE_VERBOSE_MAKEFILE.*)/{s/^/#IGNORE /g}' {} + || die "${LINENO}:= failed to disable hardcoded settings"; cat >> "${CMAKE_USE_DIR}"/CMakeLists.txt <<-_EOF_ MESSAGE(STATUS "<<< Gentoo configuration >>> Build type \${CMAKE_BUILD_TYPE} Install path \${CMAKE_INSTALL_PREFIX} Compiler flags: C \${CMAKE_C_FLAGS} C++ \${CMAKE_CXX_FLAGS} Linker flags: Executable \${CMAKE_EXE_LINKER_FLAGS} Module \${CMAKE_MODULE_LINKER_FLAGS} Shared \${CMAKE_SHARED_LINKER_FLAGS}\n") _EOF_ } _use_me_now ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local uper capitalised x; [[ -z $2 ]] && die "cmake-utils_use-$1 []"; if [[ ! -z $3 ]]; then echo "-D$1$3=3D$(use $2 && echo ON || echo OFF)"; else uper=3D$(echo ${2} | tr '[:lower:]' '[:upper:]'); capitalised=3D$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g'); for x in $2 $uper $capitalised; do echo "-D$1$x=3D$(use $2 && echo ON || echo OFF) "; done; fi } _use_me_now_inverted ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local uper capitalised x; [[ -z $2 ]] && die "cmake-utils_use-$1 []"; if [[ ! -z $3 ]]; then echo "-D$1$3=3D$(use $2 && echo OFF || echo ON)"; else uper=3D$(echo ${2} | tr '[:lower:]' '[:upper:]'); capitalised=3D$(echo ${2} | sed 's/\<\(.\)\([^ ]*\)/\u\1\L\2/g'); for x in $2 $uper $capitalised; do echo "-D$1$x=3D$(use $2 && echo OFF || echo ON) "; done; fi } add_blocker ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; [[ -z ${1} ]] && die "Missing parameter"; local pkg=3Dkde-base/$1 atom old_ver=3D"unset" use; if [[ $pkg =3D=3D *\[*\] ]]; then use=3D${pkg/#*\[/[}; pkg=3D${pkg%\[*\]}; fi; [[ "$3" =3D=3D *:3.5 ]] && old_ver=3D${3%:3.5}; if [[ ${2} !=3D 0 ]]; then if [[ -z ${2} ]]; then atom=3D${pkg}; else if [[ ${2::1} =3D=3D "<" ]]; then atom=3D"<${pkg}-${2:1}"; else atom=3D"<=3D${pkg}-${2}"; fi; fi; RDEPEND+=3D" !${atom}:4${use}"; fi; if [[ ${old_ver} !=3D "unset" ]]; then if [[ -z ${old_ver} ]]; then atom=3D${pkg}; else if [[ ${old_ver::1} =3D=3D "<" ]]; then atom=3D"<${pkg}-${old_ver:1}"; else atom=3D"<=3D${pkg}-${old_ver}"; fi; fi; RDEPEND+=3D" !${atom}:3.5${use}"; fi } add_kdebase_dep ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local ver; if [[ -n ${3} ]]; then ver=3D${3}; else if [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then ver=3D${KDE_OVERRIDE_MINIMAL}; else if [[ ${KDEBASE} !=3D kde-base ]]; then ver=3D${KDE_MINIMAL}; else if [[ ${PV} =3D=3D *.9999 ]]; then ver=3D$(get_kde_version); else ver=3D${PV}; fi; fi; fi; fi; [[ -z ${1} ]] && die "Missing parameter"; echo " >=3Dkde-base/${1}-${ver}:4[aqua=3D${2:+,${2}}]" } append-cflags ()=20 {=20 [[ -z $* ]] && return 0; export CFLAGS=3D"${CFLAGS} $*"; return 0 } append-cppflags ()=20 {=20 [[ -z $* ]] && return 0; export CPPFLAGS=3D"${CPPFLAGS} $*"; return 0 } append-cxxflags ()=20 {=20 [[ -z $* ]] && return 0; export CXXFLAGS=3D"${CXXFLAGS} $*"; return 0 } append-fflags ()=20 {=20 [[ -z $* ]] && return 0; export FFLAGS=3D"${FFLAGS} $*"; export FCFLAGS=3D"${FCFLAGS} $*"; return 0 } append-flags ()=20 {=20 [[ -z $* ]] && return 0; append-cflags "$@"; append-cxxflags "$@"; append-fflags "$@"; return 0 } append-ldflags ()=20 {=20 [[ -z $* ]] && return 0; local flag; for flag in "$@"; do [[ ${flag} =3D=3D -l* ]] && ewarn "Appending a library link instruc= tion (${flag}); libraries to link to should not be passed through LDFLAGS"; done; export LDFLAGS=3D"${LDFLAGS} $*"; return 0 } append-lfs-flags ()=20 {=20 [[ -n $@ ]] && die "append-lfs-flags takes no arguments"; append-cppflags -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -D_LARGEFI= LE64_SOURCE } append-libs ()=20 {=20 [[ -z $* ]] && return 0; local flag; for flag in "$@"; do [[ ${flag} =3D=3D -l* ]] && flag=3D${flag#-l}; export LIBS=3D"${LIBS} -l${flag}"; done; return 0 } base_src_compile ()=20 {=20 debug-print-function $FUNCNAME "$@"; has src_configure ${BASE_EXPF} || base_src_configure; base_src_make "$@" } base_src_configure ()=20 {=20 debug-print-function $FUNCNAME "$@"; [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf "$@" } base_src_install ()=20 {=20 debug-print-function $FUNCNAME "$@"; emake DESTDIR=3D"${D}" "$@" install || die "died running make install, = $FUNCNAME"; base_src_install_docs } base_src_install_docs ()=20 {=20 debug-print-function $FUNCNAME "$@"; local x; pushd "${S}" > /dev/null; if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" =3D=3D "declare -a"* ]]; th= en for x in "${DOCS[@]}"; do debug-print "$FUNCNAME: docs: creating document from ${x}"; dodoc "${x}" || die "dodoc failed"; done; fi; if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" =3D=3D "declare -a"* ]= ]; then for x in "${HTML_DOCS[@]}"; do debug-print "$FUNCNAME: docs: creating html document from ${x}"= ; dohtml -r "${x}" || die "dohtml failed"; done; fi; popd > /dev/null } base_src_make ()=20 {=20 debug-print-function $FUNCNAME "$@"; if [[ -f Makefile || -f GNUmakefile || -f makefile ]]; then emake "$@" || die "died running emake, $FUNCNAME"; fi } base_src_prepare ()=20 {=20 debug-print-function $FUNCNAME "$@"; debug-print "$FUNCNAME: PATCHES=3D$PATCHES"; local patches_failed=3D0; pushd "${S}" > /dev/null; if [[ "$(declare -p PATCHES 2>/dev/null 2>&1)" =3D=3D "declare -a"* ]];= then for x in "${PATCHES[@]}"; do debug-print "$FUNCNAME: applying patch from ${x}"; if [[ -d "${x}" ]]; then EPATCH_SUFFIX=3D${EPATCH_SUFFIX:=3Dpatch}; oldval=3D${EPATCH_SOURCE}; EPATCH_SOURCE=3D${x}; EPATCH_FORCE=3Dyes; epatch; EPATCH_SOURCE=3D${oldval}; else if [[ -f "${x}" ]]; then epatch "${x}"; else ewarn "QA: File or directory \"${x}\" does not exist."; ewarn "QA: Check your PATCHES array or add missing file= /directory."; patches_failed=3D1; fi; fi; done; [[ ${patches_failed} -eq 1 ]] && die "Some patches failed. See abov= e messages."; else for x in ${PATCHES}; do debug-print "$FUNCNAME: patching from ${x}"; epatch "${x}"; done; fi; debug-print "$FUNCNAME: applying user patches"; epatch_user; popd > /dev/null } base_src_unpack ()=20 {=20 debug-print-function $FUNCNAME "$@"; pushd "${WORKDIR}" > /dev/null; [[ -n "${A}" ]] && unpack ${A}; has src_prepare ${BASE_EXPF} || base_src_prepare; popd > /dev/null } buildsycoca ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; for x in usr/share/{config,kde4}; do DIRS=3D${EROOT}usr; [[ -d "${EROOT}${x}" ]] || break; if use userland_BSD; then [[ $(stat -f %p "${EROOT}${x}") !=3D 40755 ]]; local stat_rtn=3D"$?"; else [[ $(stat --format=3D%a "${EROOT}${x}") !=3D 755 ]]; local stat_rtn=3D$?; fi; if [[ $stat_rtn !=3D 1 ]]; then ewarn "QA Notice:"; ewarn "Package ${PN} is breaking ${EROOT}${x} permissions."; ewarn "Please report this issue to gentoo bugzilla."; einfo "Permissions will get adjusted automatically now."; find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755; fi; done } built_with_use ()=20 {=20 local hidden=3D"no"; if [[ $1 =3D=3D "--hidden" ]]; then hidden=3D"yes"; shift; fi; local missing_action=3D"die"; if [[ $1 =3D=3D "--missing" ]]; then missing_action=3D$2; shift; shift; case ${missing_action} in=20 true | false | die) ;; *) die "unknown action '${missing_action}'" ;; esac; fi; local opt=3D$1; [[ ${opt:0:1} =3D "-" ]] && shift || opt=3D"-a"; local PKG=3D$(best_version $1); [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"; shift; local USEFILE=3D${ROOT}/var/db/pkg/${PKG}/USE; local IUSEFILE=3D${ROOT}/var/db/pkg/${PKG}/IUSE; if [[ ! -e ${USEFILE} ]] || [[ ! -e ${IUSEFILE} && ${hidden} =3D=3D "no= " ]]; then case ${missing_action} in=20 true) return 0 ;; false) return 1 ;; die) die "Unable to determine what USE flags $PKG was built with= " ;; esac; fi; if [[ ${hidden} =3D=3D "no" ]]; then local IUSE_BUILT=3D($(<"${IUSEFILE}")); local expand; for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]'); do if [[ $1 =3D=3D ${expand}_* ]]; then expand=3D""; break; fi; done; if [[ -n ${expand} ]]; then if ! has $1 ${IUSE_BUILT[@]#[-+]}; then case ${missing_action} in=20 true) return 0 ;; false) return 1 ;; die) die "$PKG does not actually support the $1 USE flag= !" ;; esac; fi; fi; fi; local USE_BUILT=3D$(<${USEFILE}); while [[ $# -gt 0 ]]; do if [[ ${opt} =3D "-o" ]]; then has $1 ${USE_BUILT} && return 0; else has $1 ${USE_BUILT} || return 1; fi; shift; done; [[ ${opt} =3D "-a" ]] } cdrom_get_cds ()=20 {=20 local cdcnt=3D0; local f=3D; for f in "$@"; do ((++cdcnt)); export CDROM_CHECK_${cdcnt}=3D"$f"; done; export CDROM_TOTAL_CDS=3D${cdcnt}; export CDROM_CURRENT_CD=3D1; if [[ -n ${CD_ROOT}${CD_ROOT_1} ]]; then local var=3D; cdcnt=3D0; while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]]; do ((++cdcnt)); var=3D"CD_ROOT_${cdcnt}"; [[ -z ${!var} ]] && var=3D"CD_ROOT"; if [[ -z ${!var} ]]; then eerror "You must either use just the CD_ROOT"; eerror "or specify ALL the CD_ROOT_X variables."; eerror "In this case, you will need ${CDROM_TOTAL_CDS} CD_R= OOT_X variables."; die "could not locate CD_ROOT_${cdcnt}"; fi; done; export CDROM_ROOT=3D${CD_ROOT_1:-${CD_ROOT}}; einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}"; export CDROM_SET=3D-1; for f in ${CDROM_CHECK_1//:/ }; do ((++CDROM_SET)); [[ -e ${CDROM_ROOT}/${f} ]] && break; done; export CDROM_MATCH=3D${f}; return; fi; if [[ ${CDROM_TOTAL_CDS} -eq 1 ]]; then einfo "This ebuild will need the ${CDROM_NAME:-cdrom for ${PN}}"; echo; einfo "If you do not have the CD, but have the data files"; einfo "mounted somewhere on your filesystem, just export"; einfo "the variable CD_ROOT so that it points to the"; einfo "directory containing the files."; echo; einfo "For example:"; einfo "export CD_ROOT=3D/mnt/cdrom"; echo; else if [[ -n ${CDROM_NAME_SET} ]]; then cdcnt=3D0; while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]]; do ((++cdcnt)); export CDROM_NAME_${cdcnt}=3D"${CDROM_NAME_SET[$((${cdcnt}-= 1))]}"; done; fi; einfo "This package will need access to ${CDROM_TOTAL_CDS} cds."; cdcnt=3D0; while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]]; do ((++cdcnt)); var=3D"CDROM_NAME_${cdcnt}"; [[ ! -z ${!var} ]] && einfo " CD ${cdcnt}: ${!var}"; done; echo; einfo "If you do not have the CDs, but have the data files"; einfo "mounted somewhere on your filesystem, just export"; einfo "the following variables so they point to the right place:"; einfon ""; cdcnt=3D0; while [[ ${cdcnt} -lt ${CDROM_TOTAL_CDS} ]]; do ((++cdcnt)); echo -n " CD_ROOT_${cdcnt}"; done; echo; einfo "Or, if you have all the files in the same place, or"; einfo "you only have one cdrom, you can export CD_ROOT"; einfo "and that place will be used as the same data source"; einfo "for all the CDs."; echo; einfo "For example:"; einfo "export CD_ROOT_1=3D/mnt/cdrom"; echo; fi; export CDROM_SET=3D""; export CDROM_CURRENT_CD=3D0; cdrom_load_next_cd } cdrom_load_next_cd ()=20 {=20 local var; ((++CDROM_CURRENT_CD)); unset CDROM_ROOT; var=3DCD_ROOT_${CDROM_CURRENT_CD}; [[ -z ${!var} ]] && var=3D"CD_ROOT"; if [[ -z ${!var} ]]; then var=3D"CDROM_CHECK_${CDROM_CURRENT_CD}"; _cdrom_locate_file_on_cd ${!var}; else export CDROM_ROOT=3D${!var}; fi; einfo "Found CD #${CDROM_CURRENT_CD} root at ${CDROM_ROOT}" } check_license ()=20 {=20 local lic=3D$1; if [ -z "${lic}" ]; then lic=3D"${PORTDIR}/licenses/${LICENSE}"; else if [ -e "${PORTDIR}/licenses/${lic}" ]; then lic=3D"${PORTDIR}/licenses/${lic}"; else if [ -e "${PWD}/${lic}" ]; then lic=3D"${PWD}/${lic}"; else if [ -e "${lic}" ]; then lic=3D"${lic}"; fi; fi; fi; fi; local l=3D"`basename ${lic}`"; local alic; eshopts_push -o noglob; for alic in ${ACCEPT_LICENSE}; do if [[ ${alic} =3D=3D ${l} ]]; then eshopts_pop; return 0; fi; done; eshopts_pop; [ ! -f "${lic}" ] && die "Could not find requested license ${lic}"; local licmsg=3D$(emktemp); cat > ${licmsg} <<-EOF ********************************************************** The following license outlines the terms of use of this package. You MUST accept this license for installation to continue. When you are done viewing, hit 'q'. If you CTRL+C out of this, the install will not run! ********************************************************** EOF cat ${lic} >> ${licmsg}; ${PAGER:-less} ${licmsg} || die "Could not execute pager (${PAGER}) to = accept ${lic}"; einfon "Do you accept the terms of this license (${l})? [yes/no] "; read alic; case ${alic} in=20 yes | Yes | y | Y) return 0 ;; *) echo; echo; echo; eerror "You MUST accept the license to continue! Exiting!"; die "Failed to accept license" ;; esac } cmake-utils_src_compile ()=20 {=20 _execute_optionaly "src_compile" "$@" } cmake-utils_src_configure ()=20 {=20 _execute_optionaly "src_configure" "$@" } cmake-utils_src_install ()=20 {=20 _execute_optionaly "src_install" "$@" } cmake-utils_src_make ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; _check_build_dir; pushd "${CMAKE_BUILD_DIR}" > /dev/null; [[ -e Makefile ]] || die "Makefile not found. Error during configure st= age."; if [[ -n ${CMAKE_VERBOSE} ]]; then emake VERBOSE=3D1 "$@" || die "Make failed!"; else emake "$@" || die "Make failed!"; fi; popd > /dev/null } cmake-utils_src_test ()=20 {=20 _execute_optionaly "src_test" "$@" } cmake-utils_use ()=20 {=20 _use_me_now "" "$@" } cmake-utils_use_build ()=20 {=20 _use_me_now BUILD_ "$@" } cmake-utils_use_disable ()=20 {=20 _use_me_now_inverted DISABLE_ "$@" } cmake-utils_use_enable ()=20 {=20 _use_me_now ENABLE_ "$@" } cmake-utils_use_has ()=20 {=20 _use_me_now HAVE_ "$@" } cmake-utils_use_no ()=20 {=20 _use_me_now_inverted NO_ "$@" } cmake-utils_use_use ()=20 {=20 _use_me_now USE_ "$@" } cmake-utils_use_want ()=20 {=20 _use_me_now WANT_ "$@" } cmake-utils_use_with ()=20 {=20 _use_me_now WITH_ "$@" } comment_all_add_subdirectory ()=20 {=20 find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | xargs -= 0 sed -i -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' -e '/^[[:s= pace:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' -e '/^[[:space:]]*macro_optio= nal_add_subdirectory/s/^/#DONOTCOMPILE /' -e '/^[[:space:]]*MACRO_OPTIONAL_= ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' || die "${LINENO}: Initial sed died" } delete_all_version_separators ()=20 {=20 replace_all_version_separators "" "${1}" } delete_version_separator ()=20 {=20 replace_version_separator "${1}" "" "${2}" } dlopen_lib ()=20 {=20 case "${CHOST}" in=20 *-linux-gnu* | *-linux-uclibc | *-interix*) echo "-ldl" ;; esac } doicon ()=20 {=20 ( local i j ret; insinto /usr/share/pixmaps; for i in "$@"; do if [[ -f ${i} ]]; then doins "${i}"; ((ret+=3D$?)); else if [[ -d ${i} ]]; then for j in "${i}"/*.png; do doins "${j}"; ((ret+=3D$?)); done; else ((++ret)); fi; fi; done; exit ${ret} ) } domenu ()=20 {=20 ( local i j ret=3D0; insinto /usr/share/applications; for i in "$@"; do if [[ -f ${i} ]]; then doins "${i}"; ((ret+=3D$?)); else if [[ -d ${i} ]]; then for j in "${i}"/*.desktop; do doins "${j}"; ((ret+=3D$?)); done; else ((++ret)); fi; fi; done; exit ${ret} ) } dyn_pretend ()=20 {=20 if [[ -e $PORTAGE_BUILDDIR/.pretended ]]; then vecho ">>> It appears that '$PF' is already pretended; skipping."; vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."= ; return 0; fi; ebuild_phase pre_pkg_pretend; ebuild_phase pkg_pretend; >> "$PORTAGE_BUILDDIR/.pretended" || die "Failed to create $PORTAGE_BU= ILDDIR/.pretended"; ebuild_phase post_pkg_pretend } ebeep ()=20 {=20 ewarn "QA Notice: ebeep is not defined in EAPI=3D${EAPI}, please file a= bug at http://bugs.gentoo.org" } ecvs_clean ()=20 {=20 [[ -z $* ]] && set -- .; find "$@" -type d -name 'CVS' -prune -print0 | xargs -0 rm -rf; find "$@" -type f -name '.cvs*' -print0 | xargs -0 rm -rf } edos2unix ()=20 {=20 echo "$@" | xargs sed -i 's/\r$//' } egetent ()=20 {=20 case ${CHOST} in=20 *-darwin[678]) case "$2" in=20 *[!0-9]*) nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2\$/) {print \$= 0;exit;} }" ;; *) nidump $1 . | awk -F":" "{ if (\$3 =3D=3D $2) {print \$= 0;exit;} }" ;; esac ;; *-darwin*) local mytype=3D$1; [[ "passwd" =3D=3D $mytype ]] && mytype=3D"Users"; [[ "group" =3D=3D $mytype ]] && mytype=3D"Groups"; case "$2" in=20 *[!0-9]*) dscl . -read /$mytype/$2 2> /dev/null | grep RecordName ;; *) local mykey=3D"UniqueID"; [[ $mytype =3D=3D "Groups" ]] && mykey=3D"PrimaryGroupI= D"; dscl . -search /$mytype $mykey $2 2> /dev/null ;; esac ;; *-freebsd* | *-dragonfly*) local opts action=3D"user"; [[ $1 =3D=3D "passwd" ]] || action=3D"group"; if [[ $2 =3D=3D [[:digit:]]* ]]; then [[ ${action} =3D=3D "user" ]] && opts=3D"-u" || opts=3D"-g"= ; fi; pw show ${action} ${opts} "$2" -q ;; *-netbsd* | *-openbsd*) grep "$2:\*:" /etc/$1 ;; *) type -p nscd &>/dev/null && nscd -i "$1"; getent "$1" "$2" ;; esac } egethome ()=20 {=20 ent=3D$(egetent passwd $1); case ${CHOST} in=20 *-darwin* | *-freebsd* | *-dragonfly*) echo ${ent} | cut -d: -f9 ;; *) echo ${ent} | cut -d: -f6 ;; esac } egetshell ()=20 {=20 ent=3D$(egetent passwd "$1"); case ${CHOST} in=20 *-darwin* | *-freebsd* | *-dragonfly*) echo ${ent} | cut -d: -f10 ;; *) echo ${ent} cut -d: -f7 ;; esac } emktemp ()=20 {=20 local exe=3D"touch"; [[ $1 =3D=3D -d ]] && exe=3D"mkdir" && shift; local topdir=3D$1; if [[ -z ${topdir} ]]; then [[ -z ${T} ]] && topdir=3D"/tmp" || topdir=3D${T}; fi; if ! type -P mktemp > /dev/null; then local tmp=3D/; while [[ -e ${tmp} ]]; do tmp=3D${topdir}/tmp.${RANDOM}.${RANDOM}.${RANDOM}; done; ${exe} "${tmp}" || ${exe} -p "${tmp}"; echo "${tmp}"; else if [[ ${exe} =3D=3D "touch" ]]; then TMPDIR=3D"${topdir}" mktemp -t tmp.XXXXXXXXXX; else TMPDIR=3D"${topdir}" mktemp -dt tmp.XXXXXXXXXX; fi; fi } enable_cmake-utils_src_compile ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure; cmake-utils_src_make "$@" } enable_cmake-utils_src_configure ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; [[ "${CMAKE_REMOVE_MODULES}" =3D=3D "yes" ]] && {=20 local name; for name in ${CMAKE_REMOVE_MODULES_LIST}; do find "${S}" -name ${name}.cmake -exec rm -v {} +; done }; _check_build_dir; 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; _modify-cmakelists; export XDG_CONFIG_HOME=3D"${T}"; if [[ ${CMAKE_BUILD_TYPE} =3D Gentoo ]]; then if ! has debug ${IUSE//+} || ! use debug; then append-cppflags -DNDEBUG; fi; fi; local build_rules=3D${T}/gentoo_rules.cmake; cat > "${build_rules}" <<-_EOF_ SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FO= RCE) SET (CMAKE_C_COMPILE_OBJECT " ${CPPFLAGS} -o -c " CACHE STRING "C compile command" FORCE) SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compile= r" FORCE) SET (CMAKE_CXX_COMPILE_OBJECT " ${CPPFLAGS} <= FLAGS> -o -c " CACHE STRING "C++ compile command" FORCE) _EOF_ if use prefix; then cat >> "${build_rules}"; fi <<-_EOF_ # in Prefix we need rpath and must ensure cmake gets our default linker pat= h # right ... except for Darwin hosts IF (NOT APPLE) SET (CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE) SET (CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH "${EPREFIX}/usr/${CHOST}/lib/gcc;= ${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPREFIX}/$(get_l= ibdir)" CACHE STRING "" FORCE) ELSE () SET(CMAKE_PREFIX_PATH "${EPREFIX}${PREFIX:-/usr}" CACHE STRING ""FORCE) SET(CMAKE_SKIP_BUILD_RPATH OFF CACHE BOOL "" FORCE) SET(CMAKE_SKIP_RPATH OFF CACHE BOOL "" FORCE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE CACHE BOOL "" FORCE)=20 SET(CMAKE_INSTALL_RPATH "${EPREFIX}${PREFIX:-/usr}/lib;${EPREFIX}/usr/${CHO= ST}/lib/gcc;${EPREFIX}/usr/${CHOST}/lib;${EPREFIX}/usr/$(get_libdir);${EPRE= FIX}/$(get_libdir)" CACHE STRING "" FORCE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE BOOL "" FORCE) SET(CMAKE_INSTALL_NAME_DIR "${EPREFIX}${PREFIX:-/usr}/lib" CACHE STRING "" = FORCE) ENDIF (NOT APPLE) _EOF_ local common_config=3D${T}/gentoo_common_config.cmake; local libdir=3D$(get_libdir); cat > "${common_config}" <<-_EOF_ SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE) SET (CMAKE_INSTALL_LIBDIR ${libdir} CACHE PATH "Output directory for librar= ies") _EOF_ [[ "${NOCOLOR}" =3D true || "${NOCOLOR}" =3D yes ]] && echo 'SET (CMAKE= _COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${co= mmon_config}"; if [[ $(declare -p mycmakeargs 2>&-) !=3D "declare -a mycmakeargs=3D"* = ]]; then local mycmakeargs_local=3D(${mycmakeargs}); else local mycmakeargs_local=3D("${mycmakeargs[@]}"); fi; has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=3D; local cmakeargs=3D(--no-warn-unused-cli -C "${common_config}" -DCMAKE_I= NSTALL_PREFIX=3D"${EPREFIX}${PREFIX:-/usr}" "${mycmakeargs_local[@]}" -DCMA= KE_BUILD_TYPE=3D"${CMAKE_BUILD_TYPE}" -DCMAKE_INSTALL_DO_STRIP=3DOFF -DCMAK= E_USER_MAKE_RULES_OVERRIDE=3D"${build_rules}" "${MYCMAKEARGS}"); mkdir -p "${CMAKE_BUILD_DIR}"; pushd "${CMAKE_BUILD_DIR}" > /dev/null; debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakea= rgs_local[*]}"; echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"; "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake fa= iled"; popd > /dev/null } enable_cmake-utils_src_install ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; _check_build_dir; pushd "${CMAKE_BUILD_DIR}" > /dev/null; base_src_install "$@"; popd > /dev/null; if [[ -n "${DOCS}" ]] && [[ "$(declare -p DOCS 2>/dev/null 2>&1)" !=3D = "declare -a"* ]]; then dodoc ${DOCS} || die "dodoc failed"; fi; if [[ -n "${HTML_DOCS}" ]] && [[ "$(declare -p HTML_DOCS 2>/dev/null 2>= &1)" !=3D "declare -a"* ]]; then dohtml -r ${HTML_DOCS} || die "dohtml failed"; fi } enable_cmake-utils_src_test ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local ctestargs; _check_build_dir; pushd "${CMAKE_BUILD_DIR}" > /dev/null; [[ -e CTestTestfile.cmake ]] || {=20 echo "No tests found. Skipping."; return 0 }; [[ -n ${TEST_VERBOSE} ]] && ctestargs=3D"--extra-verbose --output-on-fa= ilure"; ctest ${ctestargs} "$@" || die "Tests failed."; popd > /dev/null } enable_selected_doc_linguas ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if ! $(env | grep -q "^LINGUAS=3D"); then return 0; fi; KDE_DOC_DIRS=3D${KDE_DOC_DIRS:=3D'doc/%lingua'}; local linguas; for pattern in ${KDE_DOC_DIRS}; do local handbookdir=3D`dirname ${pattern}`; local translationdir=3D`basename ${pattern}`; [[ ${handbookdir} =3D '.' ]] && handbookdir=3D${translationdir} && = translationdir=3D; [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'; if ! use handbook; then sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir= }[[:space:]]*)/s/^/#DONOTCOMPILE /" -e "/ADD_SUBDIRECTORY[[:space:]]*([[:sp= ace:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" -i CMakeLists.txt |= | die 'failed to comment out all handbooks'; else comment_all_add_subdirectory "${handbookdir}"; local lingua; for lingua in en ${KDE_LINGUAS}; do if [[ ${lingua} =3D en ]] || use linguas_${lingua}; then if [[ -d ${handbookdir}/${translationdir//%lingua/${lin= gua}} ]]; then sed -e "/add_subdirectory[[:space:]]*([[:space:]]*$= {translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" -e "/ADD_SUBDIRECT= ORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTC= OMPILE //" -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas}= && linguas=3D"${linguas} ${lingua}"; fi; fi; done; fi; done; [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${lingua= s}" } enable_selected_linguas ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local x; if ! $(env | grep -q "^LINGUAS=3D"); then return 0; fi; if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" =3D=3D "declare = -a"* ]]; then debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LIN= GUAS_DIR}"; for x in ${KDE_LINGUAS_DIR[@]}; do _enable_selected_linguas_dir ${x}; done; else KDE_LINGUAS_DIR=3D${KDE_LINGUAS_DIR:=3D"po"}; _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}; fi } enewgroup ()=20 {=20 case ${EBUILD_PHASE} in=20 unpack | compile | test | install) eerror "'enewgroup()' called from '${EBUILD_PHASE}()' which is = not a pkg_* function."; eerror "Package fails at QA and at life. Please file a bug."; die "Bad package! enewgroup is only for use in pkg_* functions= !" ;; esac; local egroup=3D"$1"; shift; if [ -z "${egroup}" ]; then eerror "No group specified !"; die "Cannot call enewgroup without a group"; fi; if [[ -n $(egetent group "${egroup}") ]]; then return 0; fi; einfo "Adding group '${egroup}' to your system ..."; local opts=3D; local egid=3D"$1"; shift; if [ ! -z "${egid}" ]; then if [ "${egid}" -gt 0 ]; then if [ -z "`egetent group ${egid}`" ]; then if [[ "${CHOST}" =3D=3D *-darwin* ]]; then opts=3D"${opts} ${egid}"; else opts=3D"${opts} -g ${egid}"; fi; else egid=3D"next available; requested gid taken"; fi; else eerror "Groupid given but is not greater than 0 !"; die "${egid} is not a valid GID"; fi; else egid=3D"next available"; fi; einfo " - Groupid: ${egid}"; local eextra=3D"$@"; opts=3D"${opts} ${eextra}"; local oldsandbox=3D"${SANDBOX_ON}"; export SANDBOX_ON=3D"0"; case ${CHOST} in=20 *-darwin*) if [ ! -z "${eextra}" ]; then einfo "Extra options are not supported on Darwin/OS X yet"; einfo "Please report the ebuild along with the info below"; einfo "eextra: ${eextra}"; die "Required function missing"; fi; case ${egid} in=20 *[!0-9]*) for ((egid =3D 101; egid <=3D 999; egid++)) do [[ -z $(egetent group ${egid}) ]] && break; done ;; esac; dscl . create /groups/${egroup} gid ${egid}; dscl . create /groups/${egroup} passwd '*' ;; *-freebsd* | *-dragonfly*) case ${egid} in=20 *[!0-9]*) for ((egid =3D 101; egid <=3D 999; egid++)) do [[ -z $(egetent group ${egid}) ]] && break; done ;; esac; pw groupadd ${egroup} -g ${egid} || die "enewgroup failed" ;; *-netbsd*) case ${egid} in=20 *[!0-9]*) for ((egid =3D 101; egid <=3D 999; egid++)) do [[ -z $(egetent group ${egid}) ]] && break; done ;; esac; groupadd -g ${egid} ${egroup} || die "enewgroup failed" ;; *) groupadd -r ${opts} ${egroup} || die "enewgroup failed" ;; esac; export SANDBOX_ON=3D"${oldsandbox}" } enewuser ()=20 {=20 case ${EBUILD_PHASE} in=20 unpack | compile | test | install) eerror "'enewuser()' called from '${EBUILD_PHASE}()' which is n= ot a pkg_* function."; eerror "Package fails at QA and at life. Please file a bug."; die "Bad package! enewuser is only for use in pkg_* functions!= " ;; esac; local euser=3D$1; shift; if [[ -z ${euser} ]]; then eerror "No username specified !"; die "Cannot call enewuser without a username"; fi; if [[ -n $(egetent passwd "${euser}") ]]; then return 0; fi; einfo "Adding user '${euser}' to your system ..."; local opts=3D; local euid=3D$1; shift; if [[ -n ${euid} && ${euid} !=3D -1 ]]; then if [[ ${euid} -gt 0 ]]; then if [[ -n $(egetent passwd ${euid}) ]]; then euid=3D"next"; fi; else eerror "Userid given but is not greater than 0 !"; die "${euid} is not a valid UID"; fi; else euid=3D"next"; fi; if [[ ${euid} =3D=3D "next" ]]; then for ((euid =3D 101; euid <=3D 999; euid++)) do [[ -z $(egetent passwd ${euid}) ]] && break; done; fi; opts=3D"${opts} -u ${euid}"; einfo " - Userid: ${euid}"; local eshell=3D$1; shift; if [[ ! -z ${eshell} ]] && [[ ${eshell} !=3D "-1" ]]; then if [[ ! -e ${ROOT}${eshell} ]]; then eerror "A shell was specified but it does not exist !"; die "${eshell} does not exist in ${ROOT}"; fi; if [[ ${eshell} =3D=3D */false || ${eshell} =3D=3D */nologin ]]; th= en eerror "Do not specify ${eshell} yourself, use -1"; die "Pass '-1' as the shell parameter"; fi; else for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/fa= lse /dev/null; do [[ -x ${ROOT}${shell} ]] && break; done; if [[ ${shell} =3D=3D "/dev/null" ]]; then eerror "Unable to identify the shell to use, proceeding with us= erland default."; case ${USERLAND} in=20 GNU) shell=3D"/bin/false" ;; BSD) shell=3D"/sbin/nologin" ;; Darwin) shell=3D"/usr/sbin/nologin" ;; *) die "Unable to identify the default shell for userland = ${USERLAND}" ;; esac; fi; eshell=3D${shell}; fi; einfo " - Shell: ${eshell}"; opts=3D"${opts} -s ${eshell}"; local ehome=3D$1; shift; if [[ -z ${ehome} ]] || [[ ${ehome} =3D=3D "-1" ]]; then ehome=3D"/dev/null"; fi; einfo " - Home: ${ehome}"; opts=3D"${opts} -d ${ehome}"; local egroups=3D$1; shift; if [[ ! -z ${egroups} ]]; then local oldifs=3D${IFS}; local defgroup=3D"" exgroups=3D""; export IFS=3D","; for g in ${egroups}; do export IFS=3D${oldifs}; if [[ -z $(egetent group "${g}") ]]; then eerror "You must add group ${g} to the system first"; die "${g} is not a valid GID"; fi; if [[ -z ${defgroup} ]]; then defgroup=3D${g}; else exgroups=3D"${exgroups},${g}"; fi; export IFS=3D","; done; export IFS=3D${oldifs}; opts=3D"${opts} -g ${defgroup}"; if [[ ! -z ${exgroups} ]]; then opts=3D"${opts} -G ${exgroups:1}"; fi; else egroups=3D"(none)"; fi; einfo " - Groups: ${egroups}"; local oldsandbox=3D${SANDBOX_ON}; export SANDBOX_ON=3D"0"; case ${CHOST} in=20 *-darwin*) if [[ -z $@ ]]; then dscl . create /users/${euser} uid ${euid}; dscl . create /users/${euser} shell ${eshell}; dscl . create /users/${euser} home ${ehome}; dscl . create /users/${euser} realname "added by portage fo= r ${PN}"; local oldifs=3D${IFS}; export IFS=3D","; for g in ${egroups}; do dscl . merge /groups/${g} users ${euser}; done; export IFS=3D${oldifs}; else einfo "Extra options are not supported on Darwin yet"; einfo "Please report the ebuild along with the info below"; einfo "eextra: $@"; die "Required function missing"; fi ;; *-freebsd* | *-dragonfly*) if [[ -z $@ ]]; then pw useradd ${euser} ${opts} -c "added by portage for ${PN}"= die "enewuser failed"; else einfo " - Extra: $@"; pw useradd ${euser} ${opts} "$@" || die "enewuser failed"; fi ;; *-netbsd*) if [[ -z $@ ]]; then useradd ${opts} ${euser} || die "enewuser failed"; else einfo " - Extra: $@"; useradd ${opts} ${euser} "$@" || die "enewuser failed"; fi ;; *-openbsd*) if [[ -z $@ ]]; then useradd -u ${euid} -s ${eshell} -d ${ehome} -c "Added by po= rtage for ${PN}" -g ${egroups} ${euser} || die "enewuser failed"; else einfo " - Extra: $@"; useradd -u ${euid} -s ${eshell} -d ${ehome} -c "Added by po= rtage for ${PN}" -g ${egroups} ${euser} "$@" || die "enewuser failed"; fi ;; *) if [[ -z $@ ]]; then useradd -r ${opts} -c "added by portage for ${PN}" ${euser}= || die "enewuser failed"; else einfo " - Extra: $@"; useradd -r ${opts} "$@" ${euser} || die "enewuser failed"; fi ;; esac; if [[ ! -e ${ROOT}/${ehome} ]]; then einfo " - Creating ${ehome} in ${ROOT}"; mkdir -p "${ROOT}/${ehome}"; chown ${euser} "${ROOT}/${ehome}"; chmod 755 "${ROOT}/${ehome}"; fi; export SANDBOX_ON=3D${oldsandbox} } epatch ()=20 {=20 function _epatch_draw_line ()=20 {=20 [[ -z $1 ]] && set "$(printf "%65s" '')"; echo "${1//?/=3D}" }; unset P4CONFIG P4PORT P4USER; if [[ $# -gt 1 ]]; then local m; for m in "$@"; do epatch "${m}"; done; return 0; fi; local SINGLE_PATCH=3D"no"; [[ $# -eq 0 ]] && set -- "${EPATCH_SOURCE}"; if [[ -f $1 ]]; then SINGLE_PATCH=3D"yes"; set -- "$1"; local EPATCH_SUFFIX=3D$1; else if [[ -d $1 ]]; then set -- "$1"/*${EPATCH_SUFFIX:+."${EPATCH_SUFFIX}"}; else if [[ -f ${EPATCH_SOURCE}/$1 ]]; then epatch "${EPATCH_SOURCE}/$1"; return $?; else [[ $# -ne 0 ]] && EPATCH_SOURCE=3D$1; echo; eerror "Cannot find \$EPATCH_SOURCE! Value for \$EPATCH_SO= URCE is:"; eerror; eerror " ${EPATCH_SOURCE}"; eerror " ( ${EPATCH_SOURCE##*/} )"; echo; die "Cannot find \$EPATCH_SOURCE!"; fi; fi; fi; local PIPE_CMD; case ${EPATCH_SUFFIX##*\.} in=20 xz) PIPE_CMD=3D"xz -dc" ;; lzma) PIPE_CMD=3D"lzma -dc" ;; bz2) PIPE_CMD=3D"bzip2 -dc" ;; gz | Z | z) PIPE_CMD=3D"gzip -dc" ;; ZIP | zip) PIPE_CMD=3D"unzip -p" ;; *) ;; esac; [[ ${SINGLE_PATCH} =3D=3D "no" ]] && einfo "${EPATCH_MULTI_MSG}"; local x; for x in "$@"; do [[ ! -f ${x} ]] && continue; local patchname=3D${x##*/}; local a=3D${patchname#*_}; a=3D${a%%_*}; if ! [[ ${SINGLE_PATCH} =3D=3D "yes" || ${EPATCH_FORCE} =3D=3D "yes= " || ${a} =3D=3D all || ${a} =3D=3D ${ARCH} ]]; then continue; fi; if [[ -n ${EPATCH_EXCLUDE} ]]; then eshopts_push -o noglob; local ex; for ex in ${EPATCH_EXCLUDE}; do if [[ ${patchname} =3D=3D ${ex} ]]; then eshopts_pop; continue 2; fi; done; eshopts_pop; fi; if [[ ${SINGLE_PATCH} =3D=3D "yes" ]]; then if [[ -n ${EPATCH_SINGLE_MSG} ]]; then einfo "${EPATCH_SINGLE_MSG}"; else einfo "Applying ${patchname} ..."; fi; else einfo " ${patchname} ..."; fi; local STDERR_TARGET=3D"${T}/${patchname}.out"; if [[ -e ${STDERR_TARGET} ]]; then STDERR_TARGET=3D"${T}/${patchname}-$$.out"; fi; printf "***** %s *****\n\n" "${patchname}" > "${STDERR_TARGET}"; local count=3D0; local PATCH_TARGET; if [[ -n ${PIPE_CMD} ]]; then PATCH_TARGET=3D"${T}/$$.patch"; echo "PIPE_COMMAND: ${PIPE_CMD} ${x} > ${PATCH_TARGET}" >> "${= STDERR_TARGET}"; if ! ( ${PIPE_CMD} "${x}" > "${PATCH_TARGET}" ) >> "${STDERR_TA= RGET}" 2>&1; then echo; eerror "Could not extract patch!"; count=3D5; break; fi; else PATCH_TARGET=3D${x}; fi; local abs_paths=3D$(egrep -n '^[-+]{3} /' "${PATCH_TARGET}" | awk '= $2 !=3D "/dev/null" { print }'); if [[ -n ${abs_paths} ]]; then count=3D1; printf "NOTE: skipping -p0 due to absolute paths in patch:\n%s\= n" "${abs_paths}" >> "${STDERR_TARGET}"; fi; local rel_paths=3D$(egrep -n '^[-+]{3} [^ ]*[.][.]/' "${PATCH_TARGE= T}"); if [[ -n ${rel_paths} ]]; then eqawarn "QA Notice: Your patch uses relative paths '../'."; eqawarn " In the future this will cause a failure."; eqawarn "${rel_paths}"; fi; while [[ ${count} -lt 5 ]]; do ( _epatch_draw_line "***** ${patchname} *****"; echo; echo "PATCH COMMAND: patch -p${count} ${EPATCH_OPTS} < '${PATC= H_TARGET}'"; echo; _epatch_draw_line "***** ${patchname} *****"; patch -p${count} ${EPATCH_OPTS} --dry-run -f < "${PATCH_TARGET}= " 2>&1; ret=3D$?; echo; echo "patch program exited with status ${ret}"; exit ${ret} ) >> "${STDERR_TARGET}"; if [ $? -eq 0 ]; then ( _epatch_draw_line "***** ${patchname} *****"; echo; echo "ACTUALLY APPLYING ${patchname} ..."; echo; _epatch_draw_line "***** ${patchname} *****"; patch -p${count} ${EPATCH_OPTS} < "${PATCH_TARGET}" 2>&1; ret=3D$?; echo; echo "patch program exited with status ${ret}"; exit ${ret} ) >> "${STDERR_TARGET}"; if [ $? -ne 0 ]; then echo; eerror "A dry-run of patch command succeeded, but actua= lly"; eerror "applying the patch failed!"; count=3D5; fi; break; fi; : $(( count++ )); done; if [[ -n ${PIPE_CMD} ]]; then rm -f "${PATCH_TARGET}"; fi; if [[ ${count} -ge 5 ]]; then echo; eerror "Failed Patch: ${patchname} !"; eerror " ( ${PATCH_TARGET} )"; eerror; eerror "Include in your bugreport the contents of:"; eerror; eerror " ${STDERR_TARGET}"; echo; die "Failed Patch: ${patchname}!"; fi; rm -f "${STDERR_TARGET}"; eend 0; done; [[ ${SINGLE_PATCH} =3D=3D "no" ]] && einfo "Done with patching"; : } epatch_user ()=20 {=20 [[ $# -ne 0 ]] && die "epatch_user takes no options"; local applied=3D"${T}/epatch_user.applied"; [[ -e ${applied} ]] && return 2; local EPATCH_SOURCE check base=3D${PORTAGE_CONFIGROOT%/}/etc/portage/pa= tches; for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do EPATCH_SOURCE=3D${base}/${CTARGET}/${check}; [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=3D${base}/${CHOST}/${che= ck}; [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=3D${base}/${check}; if [[ -d ${EPATCH_SOURCE} ]]; then EPATCH_SOURCE=3D${EPATCH_SOURCE} EPATCH_SUFFIX=3D"patch" EPATCH= _FORCE=3D"yes" EPATCH_MULTI_MSG=3D"Applying user patches from ${EPATCH_SOUR= CE} ..." epatch; echo "${EPATCH_SOURCE}" > "${applied}"; return 0; fi; done; echo "none" > "${applied}"; return 1 } epause ()=20 {=20 ewarn "QA Notice: epause is not defined in EAPI=3D${EAPI}, please file = a bug at http://bugs.gentoo.org" } epunt_cxx ()=20 {=20 local dir=3D$1; [[ -z ${dir} ]] && dir=3D${S}; ebegin "Removing useless C++ checks"; local f; find "${dir}" -name configure | while read f; do patch --no-backup-if-mismatch -p0 "${f}" "${PORTDIR}/eclass/ELT-pat= ches/nocxx/nocxx.patch" > /dev/null; done; eend 0 } eshopts_pop ()=20 {=20 [[ $# -ne 0 ]] && die "eshopts_pop takes no arguments"; local i=3D$(( ${#__ESHOPTS_SAVE__[@]} - 1 )); [[ ${i} -eq -1 ]] && die "eshopts_{push,pop}: unbalanced pair"; local s=3D${__ESHOPTS_SAVE__[$i]}; unset __ESHOPTS_SAVE__[$i]; if [[ ${s} =3D=3D "shopt -"* ]]; then eval "${s}" || die "eshopts_pop: sanity: invalid shopt options: ${s= }"; else set +$- || die "eshopts_pop: sanity: invalid shell settings: $-"; set -${s} || die "eshopts_pop: sanity: unable to restore saved shel= l settings: ${s}"; fi } eshopts_push ()=20 {=20 local i=3D${#__ESHOPTS_SAVE__[@]}; if [[ $1 =3D=3D -[su] ]]; then __ESHOPTS_SAVE__[$i]=3D$(shopt -p); [[ $# -eq 0 ]] && return 0; shopt "$@" || die "eshopts_push: bad options to shopt: $*"; else __ESHOPTS_SAVE__[$i]=3D$-; [[ $# -eq 0 ]] && return 0; set "$@" || die "eshopts_push: bad options to set: $*"; fi } esvn_clean ()=20 {=20 [[ -z $* ]] && set -- .; find "$@" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf } fdo-mime_desktop_database_update ()=20 {=20 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=3D; has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; if [ -x "${EPREFIX}/usr/bin/update-desktop-database" ]; then einfo "Updating desktop mime database ..."; "${EPREFIX}/usr/bin/update-desktop-database" -q "${EROOT}usr/share/= applications"; fi } fdo-mime_mime_database_update ()=20 {=20 has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=3D; has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; if [ -x "${EPREFIX}/usr/bin/update-mime-database" ]; then einfo "Updating shared mime info database ..."; "${EPREFIX}/usr/bin/update-mime-database" "${EROOT}usr/share/mime"; fi } filter-flags ()=20 {=20 _filter-hardened "$@"; _filter-var CFLAGS "$@"; _filter-var CPPFLAGS "$@"; _filter-var CXXFLAGS "$@"; _filter-var FFLAGS "$@"; _filter-var FCFLAGS "$@"; return 0 } filter-ldflags ()=20 {=20 _filter-var LDFLAGS "$@"; return 0 } filter-lfs-flags ()=20 {=20 [[ -n $@ ]] && die "filter-lfs-flags takes no arguments"; filter-flags -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -D_LARGEFILE6= 4_SOURCE } filter-mfpmath ()=20 {=20 local orig_mfpmath new_math prune_math; orig_mfpmath=3D$(get-flag -mfpmath); new_math=3D$(get-flag mfpmath); new_math=3D" ${new_math//,/ } "; prune_math=3D""; for prune_math in "$@"; do new_math=3D${new_math/ ${prune_math} / }; done; new_math=3D$(echo ${new_math}); new_math=3D${new_math// /,}; if [[ -z ${new_math} ]]; then filter-flags ${orig_mfpmath}; else replace-flags ${orig_mfpmath} -mfpmath=3D${new_math}; fi; return 0 } find_unpackable_file ()=20 {=20 local src=3D$1; if [[ -z ${src} ]]; then src=3D${DISTDIR}/${A}; else if [[ -e ${DISTDIR}/${src} ]]; then src=3D${DISTDIR}/${src}; else if [[ -e ${PWD}/${src} ]]; then src=3D${PWD}/${src}; else if [[ -e ${src} ]]; then src=3D${src}; fi; fi; fi; fi; [[ ! -e ${src} ]] && return 1; echo "${src}" } gcc-fullversion ()=20 {=20 _gcc_fullversion '$1.$2.$3' "$@" } gcc-major-version ()=20 {=20 _gcc_fullversion '$1' "$@" } gcc-micro-version ()=20 {=20 _gcc_fullversion '$3' "$@" } gcc-minor-version ()=20 {=20 _gcc_fullversion '$2' "$@" } gcc-specs-directive ()=20 {=20 local directive subdname subdirective; directive=3D"$(_gcc-specs-directive_raw $1)"; while [[ ${directive} =3D=3D *%\(*\)* ]]; do subdname=3D${directive/*%\(}; subdname=3D${subdname/\)*}; subdirective=3D"$(_gcc-specs-directive_raw ${subdname})"; directive=3D"${directive//\%(${subdname})/${subdirective}}"; done; echo "${directive}"; return 0 } gcc-specs-nostrict ()=20 {=20 local directive; directive=3D$(gcc-specs-directive cc1); return $([[ "${directive/\{!fstrict-overflow:}" !=3D "${directive}" ]]) } gcc-specs-now ()=20 {=20 local directive; directive=3D$(gcc-specs-directive link_command); return $([[ "${directive/\{!nonow:}" !=3D "${directive}" ]]) } gcc-specs-pie ()=20 {=20 local directive; directive=3D$(gcc-specs-directive cc1); return $([[ "${directive/\{!nopie:}" !=3D "${directive}" ]]) } gcc-specs-relro ()=20 {=20 local directive; directive=3D$(gcc-specs-directive link_command); return $([[ "${directive/\{!norelro:}" !=3D "${directive}" ]]) } gcc-specs-ssp ()=20 {=20 local directive; directive=3D$(gcc-specs-directive cc1); return $([[ "${directive/\{!fno-stack-protector:}" !=3D "${directive}" = ]]) } gcc-specs-ssp-to-all ()=20 {=20 local directive; directive=3D$(gcc-specs-directive cc1); return $([[ "${directive/\{!fno-stack-protector-all:}" !=3D "${directiv= e}" ]]) } gcc-version ()=20 {=20 _gcc_fullversion '$1.$2' "$@" } gen_usr_ldscript ()=20 {=20 local lib libdir=3D$(get_libdir) output_format=3D"" auto=3Dfalse suffix= =3D$(get_libname); [[ -z ${ED+set} ]] && local ED=3D${D%/}${EPREFIX}/; tc-is-static-only && return; dodir /usr/${libdir}; if [[ $1 =3D=3D "-a" ]]; then auto=3Dtrue; shift; dodir /${libdir}; fi; output_format=3D$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 |= sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p'); [[ -n ${output_format} ]] && output_format=3D"OUTPUT_FORMAT ( ${output_= format} )"; for lib in "$@"; do local tlib; if ${auto}; then lib=3D"lib${lib}${suffix}"; else [[ -r ${ED}/${libdir}/${lib} ]] || continue; fi; case ${CTARGET:-${CHOST}} in=20 *-darwin*) if ${auto}; then tlib=3D$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${li= b}); else tlib=3D$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib}); fi; [[ -z ${tlib} ]] && die "unable to read install_name from $= {lib}"; tlib=3D${tlib##*/}; if ${auto}; then mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} = "${ED}"/${libdir}/ || die; if [[ ${tlib} !=3D ${lib%${suffix}}.*${suffix#.} ]]; th= en mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffi= x#.} "${ED}"/${libdir}/ || die; fi; rm -f "${ED}"/${libdir}/${lib}; fi; if [[ ! -w "${ED}/${libdir}/${tlib}" ]]; then chmod u+w "${ED}${libdir}/${tlib}"; local nowrite=3Dyes; fi; install_name_tool -id "${EPREFIX}"/${libdir}/${tlib} "${ED}= "/${libdir}/${tlib} || die "install_name_tool failed"; [[ -n ${nowrite} ]] && chmod u-w "${ED}${libdir}/${tlib}"; pushd "${ED}/usr/${libdir}" > /dev/null; ln -snf "../../${libdir}/${tlib}" "${lib}"; popd > /dev/null ;; *-aix* | *-irix* | *64*-hpux* | *-interix* | *-winnt*) if ${auto}; then mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || = die; tlib=3D$(readlink "${ED}"/${libdir}/${lib}); tlib=3D${tlib##*/}; if [[ -z ${tlib} ]]; then tlib=3D${lib}; else rm -f "${ED}"/${libdir}/${lib}; fi; else tlib=3D${lib}; fi; pushd "${ED}/usr/${libdir}" > /dev/null; ln -snf "../../${libdir}/${tlib}" "${lib}"; popd > /dev/null ;; hppa*-hpux*) if ${auto}; then tlib=3D$(chatr "${ED}"/usr/${libdir}/${lib} | sed -n '/= internal name:/{n;s/^ *//;p;q}'); [[ -z ${tlib} ]] && tlib=3D${lib}; tlib=3D${tlib##*/}; mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || = die; if [[ ${tlib} !=3D ${lib}* ]]; then mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}= / || die; fi; [[ ${tlib} !=3D ${lib} ]] && rm -f "${ED}"/${libdir}/${= lib}; else tlib=3D$(chatr "${ED}"/${libdir}/${lib} | sed -n '/inte= rnal name:/{n;s/^ *//;p;q}'); [[ -z ${tlib} ]] && tlib=3D${lib}; tlib=3D${tlib##*/}; fi; pushd "${ED}"/usr/${libdir} > /dev/null; ln -snf "../../${libdir}/${tlib}" "${lib}"; [[ ${tlib} !=3D ${lib} ]] && ln -snf "../../${libdir}/${tli= b}" "${tlib}"; popd > /dev/null ;; *) if ${auto}; then tlib=3D$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}= ); [[ -z ${tlib} ]] && die "unable to read SONAME from ${l= ib}"; mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || = die; if [[ ${tlib} !=3D ${lib}* ]]; then mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}= / || die; fi; rm -f "${ED}"/${libdir}/${lib}; else tlib=3D${lib}; fi; cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT /* GNU ld script Since Gentoo has critical dynamic libraries in /lib, and the static vers= ions in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise= we run into linking problems. This "fake" dynamic lib is a linker script t= hat redirects the linker to the real lib. And yes, this works in the cross- compiling scenario as the sysroot-ed linker will prepend the real path. See bug http://bugs.gentoo.org/4411 for more info. */ ${output_format} GROUP ( ${EPREFIX}/${libdir}/${tlib} ) END_LDSCRIPT ;; esac fperms a+x "/usr/${libdir}/${lib}" || die "could not change perms o= n ${lib}"; done } get-flag ()=20 {=20 local f findflag=3D"$1"; for f in ${CFLAGS} ${CXXFLAGS} ${FFLAGS} ${FCFLAGS}; do if [ "${f/${findflag}}" !=3D "${f}" ]; then printf "%s\n" "${f/-${findflag}=3D}"; return 0; fi; done; return 1 } get_abi_ASFLAGS ()=20 {=20 get_abi_var ASFLAGS "$@" } get_abi_CFLAGS ()=20 {=20 get_abi_var CFLAGS "$@" } get_abi_CHOST ()=20 {=20 get_abi_var CHOST "$@" } get_abi_CTARGET ()=20 {=20 get_abi_var CTARGET "$@" } get_abi_FAKE_TARGETS ()=20 {=20 get_abi_var FAKE_TARGETS "$@" } get_abi_LDFLAGS ()=20 {=20 get_abi_var LDFLAGS "$@" } get_abi_LIBDIR ()=20 {=20 get_abi_var LIBDIR "$@" } get_abi_var ()=20 {=20 local flag=3D$1; local abi; if [ $# -gt 1 ]; then abi=3D${2}; else if [ -n "${ABI}" ]; then abi=3D${ABI}; else if [ -n "${DEFAULT_ABI}" ]; then abi=3D${DEFAULT_ABI}; else abi=3D"default"; fi; fi; fi; local var=3D"${flag}_${abi}"; echo ${!var} } get_after_major_version ()=20 {=20 echo $(get_version_component_range 2- "${1:-${PV}}") } get_all_abis ()=20 {=20 local order=3D""; if [[ -z ${MULTILIB_ABIS} ]]; then echo "default"; return 0; fi; for x in ${MULTILIB_ABIS}; do if [[ ${x} !=3D ${DEFAULT_ABI} ]]; then order=3D"${order:+${order} }${x}"; fi; done; order=3D"${order:+${order} }${DEFAULT_ABI}"; echo ${order}; return 0 } get_all_libdirs ()=20 {=20 local libdirs; local abi; local dir; for abi in ${MULTILIB_ABIS}; do libdirs+=3D" $(get_abi_LIBDIR ${abi})"; done; [[ " ${libdirs} " !=3D *" lib "* ]] && libdirs+=3D" lib"; echo "${libdirs}" } get_all_version_components ()=20 {=20 eshopts_push -s extglob; local ver_str=3D${1:-${PV}} result; result=3D(); if [[ ${VERSIONATOR_CACHE_VER_STR} =3D=3D ${ver_str} ]]; then echo ${VERSIONATOR_CACHE_RESULT}; eshopts_pop; return; fi; export VERSIONATOR_CACHE_VER_STR=3D${ver_str}; while [[ -n $ver_str ]]; do case "${ver_str::1}" in=20 [[:digit:]]) result+=3D("${ver_str%%[^[:digit:]]*}"); ver_str=3D${ver_str##+([[:digit:]])} ;; [-_.]) result+=3D("${ver_str::1}"); ver_str=3D${ver_str:1} ;; [[:alpha:]]) local not_match=3D${ver_str##+([[:alpha:]])*([[:digit:]])}; result+=3D("${ver_str::${#ver_str} - ${#not_match}}"); ver_str=3D${not_match} ;; *) result+=3D("${ver_str::1}"); ver_str=3D${ver_str:1} ;; esac; done; export VERSIONATOR_CACHE_RESULT=3D${result[*]}; echo ${result[@]}; eshopts_pop } get_bmake ()=20 {=20 if [[ ${USERLAND} =3D=3D *BSD ]]; then echo make; else if [[ ${USERLAND} =3D=3D "Darwin" ]]; then echo bsdmake; else echo pmake; fi; fi } get_install_abis ()=20 {=20 local order=3D""; if [[ -z ${MULTILIB_ABIS} ]]; then echo "default"; return 0; fi; if [[ ${EMULTILIB_PKG} =3D=3D "true" ]]; then for x in ${MULTILIB_ABIS}; do if [[ ${x} !=3D "${DEFAULT_ABI}" ]]; then has ${x} ${ABI_DENY} || order=3D"${order} ${x}"; fi; done; has ${DEFAULT_ABI} ${ABI_DENY} || order=3D"${order} ${DEFAULT_ABI}"= ; if [[ -n ${ABI_ALLOW} ]]; then local ordera=3D""; for x in ${order}; do if has ${x} ${ABI_ALLOW}; then ordera=3D"${ordera} ${x}"; fi; done; order=3D${ordera}; fi; else order=3D${DEFAULT_ABI}; fi; if [[ -z ${order} ]]; then die "The ABI list is empty. Are you using a proper multilib profil= e? Perhaps your USE flags or MULTILIB_ABIS are too restrictive for this pa= ckage."; fi; echo ${order}; return 0 } get_kde_version ()=20 {=20 local ver=3D${1:-${PV}}; local major=3D$(get_major_version ${ver}); local minor=3D$(get_version_component_range 2 ${ver}); local micro=3D$(get_version_component_range 3 ${ver}); if [[ ${ver} =3D=3D 9999 ]]; then echo live; else (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((mino= r + 1)); fi } get_last_version_component_index ()=20 {=20 echo $(($(get_version_component_count "${1:-${PV}}" ) - 1)) } get_libdir ()=20 {=20 local CONF_LIBDIR; if [ -n "${CONF_LIBDIR_OVERRIDE}" ]; then echo ${CONF_LIBDIR_OVERRIDE}; else get_abi_LIBDIR; fi } get_libdir_override ()=20 {=20 if has_multilib_profile; then eerror "get_libdir_override called, but it shouldn't be needed with= the new multilib approach. Please file a bug at http://bugs.gentoo.org an= d assign it to eradicator@gentoo.org"; exit 1; fi; CONF_LIBDIR=3D"$1"; CONF_LIBDIR_OVERRIDE=3D"$1"; LIBDIR_default=3D"$1" } get_libname ()=20 {=20 local libname; local ver=3D$1; case ${CHOST} in=20 *-cygwin | mingw* | *-mingw*) libname=3D"dll" ;; *-darwin*) libname=3D"dylib" ;; *-mint*) libname=3D"irrelevant" ;; hppa*-hpux*) libname=3D"sl" ;; *) libname=3D"so" ;; esac; if [[ -z $* ]]; then echo ".${libname}"; else for ver in "$@"; do case ${CHOST} in=20 *-darwin*) echo ".${ver}.${libname}" ;; *-mint*) echo ".${libname}" ;; *) echo ".${libname}.${ver}" ;; esac; done; fi } get_major_version ()=20 {=20 local c=3D($(get_all_version_components "${1:-${PV}}")); echo ${c[0]} } get_modname ()=20 {=20 local modname; local ver=3D$1; case ${CHOST} in=20 *-darwin*) modname=3D"bundle" ;; *) modname=3D"so" ;; esac; echo ".${modname}" } get_mounts ()=20 {=20 local point=3D node=3D fs=3D opts=3D foo=3D; if [[ $(uname -s) =3D=3D "Linux" ]]; then while read node point fs opts foo; do echo "${point} ${node} ${fs} ${opts}"; done < /proc/mounts; return; fi; local IFS=3D' '; LC_ALL=3DC mount -p | while read node point fs foo; do opts=3D${fs#* }; fs=3D${fs%% *}; echo "${point// /\040} ${node// /\040} ${fs%% *} ${opts// /\040}"; done } get_multilibdir ()=20 {=20 if has_multilib_profile; then eerror "get_multilibdir called, but it shouldn't be needed with the= new multilib approach. Please file a bug at http://bugs.gentoo.org and as= sign it to eradicator@gentoo.org"; exit 1; fi; echo ${CONF_MULTILIBDIR:=3Dlib32} } get_version_component_count ()=20 {=20 local a=3D($(get_version_components "${1:-${PV}}")); echo ${#a[@]} } get_version_component_range ()=20 {=20 eshopts_push -s extglob; local c v=3D"${2:-${PV}}" range=3D"${1}" range_start range_end; local -i i=3D-1 j=3D0; c=3D($(get_all_version_components "${v}")); range_start=3D${range%-*}; range_start=3D${range_start:-1}; range_end=3D${range#*-}; range_end=3D${range_end:-${#c[@]}}; while ((j < range_start)); do i+=3D1; ((i > ${#c[@]})) && eshopts_pop && return; [[ -n "${c[i]//[-._]}" ]] && j+=3D1; done; while ((j <=3D range_end)); do echo -n ${c[i]}; ((i > ${#c[@]})) && eshopts_pop && return; [[ -n "${c[i]//[-._]}" ]] && j+=3D1; i+=3D1; done; eshopts_pop } get_version_components ()=20 {=20 local c=3D$(get_all_version_components "${1:-${PV}}"); echo ${c//[-._]/ } } gnome2_gconf_install ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; local updater=3D"${EROOT}${GCONFTOOL_BIN}"; if [[ ! -x "${updater}" ]]; then debug-print "${updater} is not executable"; return; fi; if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then debug-print "No GNOME 2 GConf schemas found"; return; fi; unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL; export GCONF_CONFIG_SOURCE=3D"$("${updater}" --get-default-source | sed= "s;:/;:${ROOT};")"; einfo "Installing GNOME 2 GConf schemas"; local F; for F in ${GNOME2_ECLASS_SCHEMAS}; do if [[ -e "${EROOT}${F}" ]]; then debug-print "Installing schema: ${F}"; "${updater}" --makefile-install-rule "${EROOT}${F}" > /dev/null= ; fi; done; pids=3D$(pgrep -x gconfd-2); if [[ $? =3D=3D 0 ]]; then ebegin "Reloading GConf schemas"; kill -HUP ${pids}; eend $?; fi } gnome2_gconf_savelist ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && ED=3D"${D}"; pushd "${ED}" &>/dev/null; export GNOME2_ECLASS_SCHEMAS=3D$(find 'etc/gconf/schemas/' -name '*.sch= emas' 2> /dev/null); popd &>/dev/null } gnome2_gconf_uninstall ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; local updater=3D"${EROOT}${GCONFTOOL_BIN}"; if [[ ! -x "${updater}" ]]; then debug-print "${updater} is not executable"; return; fi; if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then debug-print "No GNOME 2 GConf schemas found"; return; fi; unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL; export GCONF_CONFIG_SOURCE=3D"$("${updater}" --get-default-source | sed= "s;:/;:${ROOT};")"; einfo "Uninstalling GNOME 2 GConf schemas"; local F; for F in ${GNOME2_ECLASS_SCHEMAS}; do if [[ -e "${EROOT}${F}" ]]; then debug-print "Uninstalling gconf schema: ${F}"; "${updater}" --makefile-uninstall-rule "${EROOT}${F}" > /dev/nu= ll; fi; done; pids=3D$(pgrep -x gconfd-2); if [[ $? =3D=3D 0 ]]; then ebegin "Reloading GConf schemas"; kill -HUP ${pids}; eend $?; fi } gnome2_icon_cache_update ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; local updater=3D"${EROOT}${GTK_UPDATE_ICON_CACHE}"; if [[ ! -x "${updater}" ]]; then debug-print "${updater} is not executable"; return; fi; if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then debug-print "No icon cache to update"; return; fi; ebegin "Updating icons cache"; local retval=3D0; local fails=3D(); for dir in ${GNOME2_ECLASS_ICONS}; do if [[ -f "${EROOT}${dir}/index.theme" ]]; then local rv=3D0; "${updater}" -qf "${EROOT}${dir}"; rv=3D$?; if [[ ! $rv -eq 0 ]]; then debug-print "Updating cache failed on ${EROOT}${dir}"; fails[$(( ${#fails[@]} + 1 ))]=3D"${EROOT}${dir}"; retval=3D2; fi; fi; done; eend ${retval}; for f in "${fails[@]}"; do eerror "Failed to update cache with icon $f"; done } gnome2_icon_savelist ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && ED=3D"${D}"; pushd "${ED}" &>/dev/null; export GNOME2_ECLASS_ICONS=3D$(find 'usr/share/icons' -maxdepth 1 -mind= epth 1 -type d 2> /dev/null); popd &>/dev/null } gnome2_omf_fix ()=20 {=20 local omf_makefiles filename; omf_makefiles=3D"$@"; if [[ -f ${S}/omf.make ]]; then omf_makefiles=3D"${omf_makefiles} ${S}/omf.make"; fi; for filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am" |s= ort); do omf_makefiles=3D"${omf_makefiles} ${filename}"; done; ebegin "Fixing OMF Makefiles"; local retval=3D0; local fails=3D(); for omf in ${omf_makefiles}; do local rv=3D0; sed -i -e 's:scrollkeeper-update:true:' "${omf}"; retval=3D$?; if [[ ! $rv -eq 0 ]]; then debug-print "updating of ${omf} failed"; fails[$(( ${#fails[@]} + 1 ))]=3D$omf; retval=3D2; fi; done; eend $retval; for f in "${fails[@]}"; do eerror "Failed to update OMF Makefile $f"; done } gnome2_schemas_savelist ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && ED=3D"${D}"; pushd "${ED}" &>/dev/null; export GNOME2_ECLASS_GLIB_SCHEMAS=3D$(find 'usr/share/glib-2.0/schemas'= -name '*.gschema.xml' 2>/dev/null); popd &>/dev/null } gnome2_schemas_update ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; local updater=3D"${EROOT}${GLIB_COMPILE_SCHEMAS}"; if [[ ! -x ${updater} ]]; then debug-print "${updater} is not executable"; return; fi; if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then debug-print "No GSettings schemas to update"; return; fi; ebegin "Updating GSettings schemas"; ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas= " &>/dev/null; eend $? } gnome2_scrollkeeper_update ()=20 {=20 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT=3D"${ROOT}"; if [[ -x "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" ]]; then einfo "Updating scrollkeeper database ..."; "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" -q -p "${EROOT}${SCROLLKEEPER_= DIR}"; fi } has_hardened ()=20 {=20 die "$0: deprecated, please use gcc-specs-{relro,now}()!" } has_m32 ()=20 {=20 [ "$(tc-arch)" =3D "amd64" ] && has_multilib_profile && return 0; local temp=3D$(emktemp); echo "int main() { return(0); }" > "${temp}".c; MY_CC=3D$(tc-getCC); ${MY_CC/ .*/} -m32 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1; local ret=3D$?; rm -f "${temp}".c; [[ ${ret} !=3D 1 ]] && return 0; return 1 } has_m64 ()=20 {=20 local temp=3D"$(emktemp)"; echo "int main() { return(0); }" > "${temp}".c; MY_CC=3D$(tc-getCC); ${MY_CC/ .*/} -m64 -o "$(emktemp)" "${temp}".c > /dev/null 2>&1; local ret=3D$?; rm -f "${temp}".c; [[ ${ret} !=3D 1 ]] && return 0; return 1 } has_multilib_profile ()=20 {=20 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" !=3D "${MULTILIB_ABIS/ /}= " ] } has_pic ()=20 {=20 die "$0: deprecated, please use gcc-specs-pie()!" } has_pie ()=20 {=20 die "$0: deprecated, please use gcc-specs-pie()!" } has_ssp ()=20 {=20 die "$0: deprecated, please use gcc-specs-ssp()!" } has_ssp_all ()=20 {=20 die "$0: deprecated, please use gcc-specs-ssp()!" } helpers_die ()=20 {=20 case "${EAPI:-0}" in=20 0 | 1 | 2 | 3) echo -e "$@" 1>&2 ;; *) die "$@" ;; esac } install_library_dependencies ()=20 {=20 local depsfile=3D"${T}/${PN}"; ebegin "Installing library dependencies as ${depsfile##*/}"; insinto /var/lib/kde; doins "${depsfile}" || die "Failed to install library dependencies."; eend $? } is-flag ()=20 {=20 is-flagq "$@" && echo true } is-flagq ()=20 {=20 [[ -n $2 ]] && die "Usage: is-flag "; _is_flagq CFLAGS $1 || _is_flagq CXXFLAGS $1 || _is_flagq FFLAGS $1 || = _is_flagq FCFLAGS $1 } is-ldflag ()=20 {=20 is-ldflagq "$@" && echo true } is-ldflagq ()=20 {=20 [[ -n $2 ]] && die "Usage: is-ldflag "; _is_flagq LDFLAGS $1 } is-login-disabled ()=20 {=20 shell=3D$(egetshell "$1"); case ${shell} in=20 /bin/false | /usr/bin/false | /sbin/nologin | /usr/sbin/nologin) return 0 ;; *) return 1 ;; esac } is_final_abi ()=20 {=20 has_multilib_profile || return 0; set -- $(get_install_abis); local LAST_ABI=3D$#; [[ ${!LAST_ABI} =3D=3D ${ABI} ]] } kde4-base_pkg_postinst ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; gnome2_icon_cache_update; fdo-mime_desktop_database_update; fdo-mime_mime_database_update; buildsycoca; if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then echo; ewarn "WARNING! you have kdeenable final useflag enabled."; ewarn "This useflag needs to be enabled on ALL kde using packag= es and"; ewarn "is known to cause issues."; ewarn "You are using this setup at your own risk and the kde te= am does not"; ewarn "take responsibilities for dead kittens."; echo; fi; if [[ ${BUILD_TYPE} =3D live ]]; then echo; einfo "WARNING! This is an experimental live ebuild of ${CATEGO= RY}/${PN}"; einfo "Use it at your own risk."; einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this eb= uild!"; echo; fi; if [[ ${KDEBASE} !=3D kde-base ]] && ! has_version 'kde-base/kdebas= e-runtime-meta' && ! has_version 'kde-base/kdebase-startkde'; then if [[ ${KDE_REQUIRED} =3D=3D always ]] || ( [[ ${KDE_REQUIRED} = =3D=3D optional ]] && use kde ); then echo; ewarn "WARNING! Your system configuration contains neither = \"kde-base/kdebase-runtime-meta\""; ewarn "nor \"kde-base/kdebase-startkde\". You need one of a= bove."; ewarn "With this setting you are unsupported by KDE team."; ewarn "All missing features you report for misc packages wi= ll be probably ignored or closed as INVALID."; fi; fi; fi } kde4-base_pkg_postrm ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; gnome2_icon_cache_update; fdo-mime_desktop_database_update; fdo-mime_mime_database_update; buildsycoca } kde4-base_pkg_preinst ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; gnome2_icon_savelist } kde4-base_pkg_setup ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if has kdeprefix ${IUSE//+} && use kdeprefix; then eerror "Sorry, kdeprefix support has been removed."; eerror "Please remove kdeprefix from your USE variable."; die "kdeprefix support has been removed"; fi; if [[ ${CATEGORY}/${PN} !=3D kde-base/kdelibs && ${CATEGORY}/${PN} !=3D= kde-base/kde-env ]] && {=20 [[ ${KDE_REQUIRED} =3D=3D always ]] || {=20 [[ ${KDE_REQUIRED} =3D=3D optional ]] && use kde } } && has_version kde-base/kdelibs[kdeprefix]; then eerror "Sorry, kdeprefix support has been removed."; eerror "Please rebuild kdelibs without kdeprefix support."; die "kdeprefix support has been removed"; fi; unset KDEHOME; if [[ ${MERGE_TYPE} !=3D binary ]]; then [[ $(gcc-major-version) -lt 4 ]] || ( [[ $(gcc-major-version) -eq 4= && $(gcc-minor-version) -le 3 ]] ) && die "Sorry, but gcc-4.3 and earlier = wont work for KDE (see bug 354837)."; fi; KDEDIR=3D/usr; : ${PREFIX:=3D/usr}; EKDEDIR=3D${EPREFIX}/usr; QT_PLUGIN_PATH=3D"${EPREFIX}/usr/$(get_libdir)/kde4/plugins/"; export XDG_CONFIG_HOME=3D"${T}" } kde4-base_src_compile ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; cmake-utils_src_compile "$@" } kde4-base_src_configure ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local cmakeargs=3D(-DKDE4_BUILD_TESTS=3DOFF); if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then cmakeargs+=3D(-DKDE4_ENABLE_FINAL=3DON); fi; if has debug ${IUSE//+} && use debug; then CMAKE_BUILD_TYPE=3D"Debugfull"; else append-cppflags -DQT_NO_DEBUG; fi; [[ ${PN} =3D kdelibs ]] && cmakeargs+=3D(-DKDE_DISTRIBUTION_TEXT=3DGent= oo); tc-is-cross-compiler || cmakeargs+=3D(-DCMAKE_INSTALL_PREFIX=3D"${EPREF= IX}${PREFIX}"); QTEST_COLORED=3D1; unset KDEDIRS; tc-is-cross-compiler && cmakeargs+=3D(-DQT_LIBRARY_DIR=3D${ROOT}/usr/$(= get_libdir)/qt4); tc-is-cross-compiler && cmakeargs+=3D(-DKDE4_DATA_DIR=3D${ROOT}/usr/sha= re/apps/); cmakeargs+=3D(-DSYSCONF_INSTALL_DIR=3D"${EPREFIX}"/etc); if [[ $(declare -p mycmakeargs 2>&-) !=3D "declare -a mycmakeargs=3D"* = ]]; then mycmakeargs=3D(${mycmakeargs}); fi; mycmakeargs=3D("${cmakeargs[@]}" "${mycmakeargs[@]}"); cmake-utils_src_configure } kde4-base_src_install ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ -n ${KMSAVELIBS} ]]; then install_library_dependencies; fi; local doc; if ! has kde4-meta ${INHERITED}; then for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,H= ACKING}; do [[ -f ${doc} && -s ${doc} ]] && dodoc "${doc}"; done; for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO= ,HACKING}; do [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(d= irname ${doc})).$(basename ${doc})"; done; fi; cmake-utils_src_install; [[ ${EAPI:-0} !=3D 3 && -d ${ED}/${PREFIX}/share/doc/HTML ]] && docompr= ess -x ${PREFIX}/share/doc/HTML } kde4-base_src_prepare ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ -n ${KDE_LINGUAS} ]]; then enable_selected_linguas; fi; if ! has kde4-meta ${INHERITED} && has handbook ${IUSE//+}; then if [[ ${KDEBASE} =3D=3D kde-base ]]; then if [[ ${PN} !=3D kde-l10n && ${PN} !=3D kdepim-l10n && ${PN} != =3D kdelibs ]] && use !handbook; then : ${KDE_DOC_DIRS:=3Ddoc}; local dir; for dir in ${KDE_DOC_DIRS}; do sed -e "\!^[[:space:]]*add_subdirectory[[:space:]]*([[:= space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" -e "\!^[[:space:]]*ADD_SU= BDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /"= -e "\!^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]= *${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" -e "\!^[[:space:]]*MACRO_OPTIONAL= _ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOM= PILE /" -i CMakeLists.txt || die "failed to comment out handbook"; done; fi; else enable_selected_doc_linguas; fi; fi; if [[ ${BUILD_TYPE} =3D live ]]; then case ${KDE_SCM} in=20 svn) subversion_src_prepare ;; esac; fi; base_src_prepare; if [[ -n ${KMSAVELIBS} ]]; then save_library_dependencies; fi; if [[ -n ${KMLOADLIBS} ]]; then load_library_dependencies; fi; find "${S}" -name CMakeLists.txt -exec sed -i -r -e 's/\$\{KDE4WORKSPAC= E_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + -exec sed -i -r -e 's/\$= \{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + -exec sed -i= -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontro= lifaces/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRA= RY|LIBS)\}/solidcontrol/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PRO= CESSUI_(LIBRARY|LIBS)\}/processui/g' {} + -exec sed -i -r -e 's/\$\{KDE4WOR= KSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + -exec sed -i -r -e 's/\$\{KDE= 4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + -exec sed -i -r= -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukquerycl= ient/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|= LIBS)\}/nepomukquery/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREE= NSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + -exec sed -i -r -e 's/\$\{KDE4= WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + -exec sed -i -r -= e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + -ex= ec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorat= ions/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}= /ksgrd/g' {} + -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS= )\}/kephal/g' {} + || die 'failed to replace KDE4Workspace library targets'= ; if [[ -z ${KDEBASE} ]]; then find "${S}" -name "*.docbook" -exec sed -i -r -e 's:-//KDE//DTD Doc= Book XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.= 2-Based Variant V1.1//EN:g' {} + || die 'failed to fix DocBook variant vers= ion'; fi } kde4-base_src_test ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; mycmakeargs+=3D(-DKDE4_BUILD_TESTS=3DON); cmake-utils_src_configure; kde4-base_src_compile; unset DBUS_SESSION_BUS_ADDRESS; if [[ ${VIRTUALX_REQUIRED} =3D=3D always || ${VIRTUALX_REQUIRED} =3D=3D= test ]]; then if [[ ${VIRTUALX_COMMAND} !=3D emake ]]; then debug-print "QA Notice: This version of kde4-base.eclass includ= es the virtualx functionality."; debug-print " You may NOT set VIRTUALX_COMMAND or cal= l virtualmake from the ebuild."; debug-print " Setting VIRTUALX_REQUIRED is completely= sufficient. See the"; debug-print " kde4-base.eclass docs for details... Ap= plying workaround."; cmake-utils_src_test; else VIRTUALX_COMMAND=3D"cmake-utils_src_test" virtualmake; fi; else cmake-utils_src_test; fi } kde4-base_src_unpack ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ ${BUILD_TYPE} =3D live ]]; then case ${KDE_SCM} in=20 svn) migrate_store_dir; subversion_src_unpack ;; git) git-2_src_unpack ;; esac; else unpack ${A}; fi } kde4-meta_change_cmakelists ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; pushd "${S}" > /dev/null; comment_all_add_subdirectory ./; if [[ -f CMakeLists.txt ]]; then sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*= )/s/^#DONOTCOMPILE //' -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[= [:space:]]*)/s/^#DONOTCOMPILE //' -i CMakeLists.txt || die "${LINENO}: cmak= e sed died"; fi; if [[ -z ${KMNOMODULE} ]]; then find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed= -i -e 's/^#DONOTCOMPILE //g' || die "${LINENO}: died in KMMODULE section"; _change_cmakelists_parent_dirs ${KMMODULE}; fi; local i; for i in ${KMEXTRACTONLY}; do if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOM= PILE /" -i ${i}/../CMakeLists.txt || die "${LINENO}: sed died while working= in the KMEXTRACTONLY section while processing ${i}"; fi; done; for i in ${KMCOMPILEONLY}; do debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"; find "${S}"/${i} -name CMakeLists.txt -print0 | xargs -0 sed -i -e = 's/^#DONOTCOMPILE //g' -e '/install(.*)/{s/^/#DONOTINSTALL /;}' -e '/^insta= ll(/,/)/{s/^/#DONOTINSTALL /;}' -e '/kde4_install_icons(.*)/{s/^/#DONOTINST= ALL /;}' || die "${LINENO}: sed died in the KMCOMPILEONLY section while pro= cessing ${i}"; _change_cmakelists_parent_dirs ${i}; done; for i in ${KMEXTRA}; do debug-print "${LINENO}: KMEXTRA section, processing ${i}"; find "${S}"/${i} -name CMakeLists.txt -print0 | xargs -0 sed -i -e = 's/^#DONOTCOMPILE //g' || die "${LINENO}: sed died uncommenting add_subdire= ctory instructions in KMEXTRA section while processing ${i}"; _change_cmakelists_parent_dirs ${i}; done; for i in ${KMEXTRA_NONFATAL}; do if [[ -d "${S}"/${i} ]]; then find "${S}"/${i} -name CMakeLists.txt -print0 | xargs -0 sed -i= -e 's/^#DONOTCOMPILE //g' || die "${LINENO}: sed died uncommenting add_sub= directory instructions in KMEXTRA section while processing ${i}"; _change_cmakelists_parent_dirs ${i}; fi; done; case ${KMNAME} in=20 kdebase-workspace | kde-workspace) if [[ ${PN} !=3D kdebase-startkde && -f CMakeLists.txt ]]; then sed -e '/startkde/s/^/#DONOTINSTALL /' -i CMakeLists.txt ||= die "${LINENO}: sed died in the kdebase-startkde collision prevention sect= ion"; fi; if [[ ${PN} !=3D libkworkspace ]]; then sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4Wor= kspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[= [:space:]]*^/d' -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-wo= rkspace strip config install and fix EXPORT section"; fi ;; kdebase-runtime | kde-runtime) if [[ ${PN} !=3D kdebase-data && -f CMakeLists.txt ]]; then sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[= :space:]]/s/^/#DONOTINSTALL /' -i CMakeLists.txt || die "Sed to exclude bin= /kde4 failed"; fi ;; kdenetwork) sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find= _package(KdepimLibs)/' -i CMakeLists.txt || die "failed to disable hardcode= d checks" ;; kdepim) sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' -e '/find_pa= ckage\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies= |Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' -e '/macro_= log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Sopr= ano|Nepomuk)_FOUND/s/ TRUE / FALSE /' -e '/if[[:space:]]*([[:space:]]*BUILD= _.*)/s/^/#OVERRIDE /' -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:= space:]]*)/s/^/#OVERRIDE /' -i CMakeLists.txt || die "failed to disable har= dcoded checks"; if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} =3D ko= ntact ]]; then sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE= /' -e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OV= ERRIDE /' -i kontact/plugins/CMakeLists.txt || die 'failed to override buil= d logic'; fi; if [[ $(get_kde_version) < 4.5 ]]; then case ${PN} in=20 kalarm | kmailcvt | kontact | korganizer | korn) sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\= .kmail\.\(kmail\|mailcomposer\)\.xml/p' -e '/add_custom_target(kmail_xml /,= /)/p' -i kmail/CMakeLists.txt || die "uncommenting xml failed"; _change_cmakelists_parent_dirs kmail ;; esac; fi ;; kdewebdev) sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find= _package(KdepimLibs)/' -e 's/find_package(LibXml2 REQUIRED)/macro_optional_= find_package(LibXml2)/' -e 's/find_package(LibXslt REQUIRED)/macro_optional= _find_package(LibXslt)/' -e 's/find_package(Boost REQUIRED)/macro_optional_= find_package(Boost)/' -i CMakeLists.txt || die "failed to disable hardcoded= checks" ;; koffice) if [[ ${PN} !=3D koffice-data ]]; then sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' -i cmake/m= odules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention s= ection"; sed -e '/install(.\+config-openexr\.h.\+)/d' -i CMakeLists.= txt || die "${LINENO}: sed died in collision prevention section"; fi ;; esac; popd > /dev/null } kde4-meta_create_extractlists ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ $(get_kde_version) < 4.5 ]] && has handbook ${IUSE//+} && use han= dbook && [[ -z ${KMNOMODULE} ]]; then KMEXTRA_NONFATAL+=3D" doc/${KMMODULE##*/}"; fi; if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} =3D=3D always ]] || (= [[ ${KDE_HANDBOOK} =3D=3D optional ]] && use handbook ) ); then KMEXTRA_NONFATAL+=3D" doc/${KMMODULE##*/}"; fi; case ${KMNAME} in=20 kdebase | kdebase-apps | kde-baseapps) KMEXTRACTONLY+=3D" config-apps.h.cmake ConfigureChecks.cmake" ;; kdebase-runtime | kde-runtime) KMEXTRACTONLY+=3D" config-runtime.h.cmake" ;; kdebase-workspace | kde-workspace) KMEXTRACTONLY+=3D" config-unix.h.cmake ConfigureChecks.cmake config-workspace.h.cmake config-X11.h.cmake startkde.cmake KDE4WorkspaceConfig.cmake.in" ;; kdegames) if [[ ${PN} !=3D libkdegames ]]; then KMEXTRACTONLY+=3D" libkdegames/"; KMLOADLIBS=3D"${KMLOADLIBS} libkdegames"; fi ;; kdepim) if [[ ${PN} !=3D libkdepim ]]; then KMEXTRACTONLY+=3D" libkdepim/"; fi; KMEXTRACTONLY+=3D" config-enterprise.h.cmake kleopatra/ConfigureChecks.cmake"; if ! [[ $(get_kde_version) < 4.5 ]]; then KMEXTRACTONLY+=3D" CTestCustom.cmake kdepim-version.h.cmake"; else KMEXTRACTONLY+=3D" kdepim-version.h"; fi; if has kontact ${IUSE//+} && use kontact; then KMEXTRA+=3D" kontact/plugins/${PLUGINNAME:-${PN}}/"; fi ;; kdeutils) KMEXTRACTONLY+=3D" kdeutils-version.h" ;; koffice) KMEXTRACTONLY+=3D" filters/config-filters.h.cmake "; case ${PV} in=20 2.[12].*) KMEXTRACTONLY+=3D" config-endian.h.cmake config-openexr.h.cmake config-opengl.h.cmake config-prefix.h.cmake" ;; esac ;; esac; if [[ ${KMNAME} !=3D kdegraphics || ( ( $(get_kde_version) !=3D 4.6 || = ${PV} < 4.6.2 ) && $(get_kde_version) < 4.7 ) ]] && ! [[ ${KMNAME} =3D=3D k= deedu && ( ${PV} =3D=3D 4.6.4 || ${PV} =3D=3D 4.6.5 ) ]]; then case ${KMNAME} in=20 kdebase-runtime | kde-runtime | kdebase-workspace | kde-workspa= ce | kdeedu | kdegames | kdegraphics) case ${PN} in=20 libkdegames | libkdeedu | libkworkspace) KMEXTRA+=3D" cmake/modules/" ;; *) KMCOMPILEONLY+=3D" cmake/modules/" ;; esac ;; esac; fi; debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEX= TRACTONLY}" } kde4-meta_pkg_postinst ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-base_pkg_postinst } kde4-meta_pkg_postrm ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-base_pkg_postrm } kde4-meta_pkg_preinst ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-base_pkg_preinst } kde4-meta_pkg_setup ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-base_pkg_setup } kde4-meta_src_compile ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-base_src_compile "$@" } kde4-meta_src_configure ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ $(declare -p mycmakeargs 2>&-) !=3D "declare -a mycmakeargs=3D"* = ]]; then mycmakeargs=3D(${mycmakeargs}); fi; case ${KMNAME} in=20 kdewebdev) mycmakeargs=3D(-DWITH_KdepimLibs=3DOFF -DWITH_LibXml2=3DOFF -DW= ITH_LibXslt=3DOFF -DWITH_Boost=3DOFF -DWITH_LibTidy=3DOFF "${mycmakeargs[@]= }") ;; esac; kde4-base_src_configure } kde4-meta_src_extract ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ ${BUILD_TYPE} =3D live ]]; then einfo "Exporting parts of working copy to ${S}"; kde4-meta_create_extractlists; case ${KDE_SCM} in=20 svn) local rsync_options subdir targetdir wc_path escm; rsync_options=3D"--group --links --owner --perms --quiet --= exclude=3D.svn/ --exclude=3D.git/"; wc_path=3D"${ESVN_WC_PATH}"; escm=3D"{ESVN}"; rsync ${rsync_options} "${wc_path}"/* "${S}" || die "${escm= }: can't export toplevel files to '${S}'."; if [[ -d "${wc_path}/cmake" ]]; then rsync --recursive ${rsync_options} "${wc_path}/cmake" "= ${S}" || die "${escm}: can't export cmake files to '${S}'."; fi; for subdir in $(__list_needed_subdirectories); do targetdir=3D""; if [[ $subdir =3D doc/* && ! -e "$wc_path/$subdir" ]]; = then continue; fi; [[ ${subdir%/} =3D */* ]] && targetdir=3D${subdir%/} &&= targetdir=3D${targetdir%/*} && mkdir -p "${S}/${targetdir}"; rsync --recursive ${rsync_options} "${wc_path}/${subdir= %/}" "${S}/${targetdir}" || die "${escm}: can't export subdirectory '${subd= ir}' to '${S}/${targetdir}'."; done ;; esac; else local abort tarball tarfile f extractlist postfix; KMTARPARAMS+=3D" --bzip2"; postfix=3D"bz2"; case ${KMNAME} in=20 kdebase-apps) tarball=3D"kdebase-${PV}.tar.${postfix}" ;; *) tarball=3D"${KMNAME}-${PV}.tar.${postfix}" ;; esac; tarfile=3D"${DISTDIR}/${tarball}"; topdir=3D"${tarball%.tar.*}/"; ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"; kde4-meta_create_extractlists; for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake= ; do extractlist+=3D" ${topdir}${f}"; done; extractlist+=3D" $(__list_needed_subdirectories)"; pushd "${WORKDIR}" > /dev/null; [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPAR= AMS} ${extractlist}'; if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "t= ar extract command failed at least partially - continuing anyway"; else tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/nul= l || echo "tar extract command failed at least partially - continuing anywa= y"; fi; if [[ ${KMNAME} !=3D ${PN} ]]; then mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"= ${P}\""; fi; popd > /dev/null; eend $?; if [[ -n ${KDE4_STRICTER} ]]; then for f in $(__list_needed_subdirectories fatal); do if [[ ! -e ${S}/${f#*/} ]]; then eerror "'${f#*/}' is missing"; abort=3Dtrue; fi; done; [[ -n ${abort} ]] && die "There were missing files."; fi; unset topdir; fi } kde4-meta_src_install ()=20 {=20 debug-print-function $FUNCNAME "$@"; local doc; for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEW= S,TODO,HACKING}; do [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"; done; kde4-base_src_install } kde4-meta_src_prepare ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; kde4-meta_change_cmakelists; kde4-base_src_prepare } kde4-meta_src_test ()=20 {=20 debug-print-function $FUNCNAME "$@"; if [[ -n $I_KNOW_WHAT_I_AM_DOING ]]; then kde4-base_src_test; else einfo "Tests disabled"; fi } kde4-meta_src_unpack ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; if [[ ${BUILD_TYPE} =3D live ]]; then case "${KDE_SCM}" in=20 svn) migrate_store_dir; S=3D"${WORKDIR}/${P}"; mkdir -p "${S}"; ESVN_RESTRICT=3D"export" subversion_src_unpack; subversion_wc_info; subversion_bootstrap ;; git) git-2_src_unpack ;; esac; fi; kde4-meta_src_extract } load_library_dependencies ()=20 {=20 local pn i depsfile; ebegin "Injecting library dependencies from '${KMLOADLIBS}'"; i=3D0; for pn in ${KMLOADLIBS}; do ((i++)); depsfile=3D"${EPREFIX}/var/lib/kde/${pn}"; [[ -r ${depsfile} ]] || depsfile=3D"${EPREFIX}/var/lib/kde/${pn}:$(= get_kde_version)"; [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible.= You probably need to reinstall ${pn}."; sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || = die "Failed to include library dependencies for ${pn}"; done; eend $? } make_desktop_entry ()=20 {=20 [[ -z $1 ]] && die "make_desktop_entry: You must specify the executable= "; local exec=3D${1}; local name=3D${2:-${PN}}; local icon=3D${3:-${PN}}; local type=3D${4}; local fields=3D${5}; if [[ -z ${type} ]]; then local catmaj=3D${CATEGORY%%-*}; local catmin=3D${CATEGORY##*-}; case ${catmaj} in=20 app) case ${catmin} in=20 accessibility) type=3DAccessibility ;; admin) type=3DSystem ;; antivirus) type=3DSystem ;; arch) type=3DArchiving ;; backup) type=3DArchiving ;; cdr) type=3DDiscBurning ;; dicts) type=3DDictionary ;; doc) type=3DDocumentation ;; editors) type=3DTextEditor ;; emacs) type=3DTextEditor ;; emulation) type=3DEmulator ;; laptop) type=3DHardwareSettings ;; office) type=3DOffice ;; pda) type=3DPDA ;; vim) type=3DTextEditor ;; xemacs) type=3DTextEditor ;; esac ;; dev) type=3D"Development" ;; games) case ${catmin} in=20 action | fps) type=3DActionGame ;; arcade) type=3DArcadeGame ;; board) type=3DBoardGame ;; emulation) type=3DEmulator ;; kids) type=3DKidsGame ;; puzzle) type=3DLogicGame ;; roguelike) type=3DRolePlaying ;; rpg) type=3DRolePlaying ;; simulation) type=3DSimulation ;; sports) type=3DSportsGame ;; strategy) type=3DStrategyGame ;; esac; type=3D"Game;${type}" ;; gnome) type=3D"Gnome;GTK" ;; kde) type=3D"KDE;Qt" ;; mail) type=3D"Network;Email" ;; media) case ${catmin} in=20 gfx) type=3DGraphics ;; *) case ${catmin} in=20 radio) type=3DTuner ;; sound) type=3DAudio ;; tv) type=3DTV ;; video) type=3DVideo ;; esac; type=3D"AudioVideo;${type}" ;; esac ;; net) case ${catmin} in=20 dialup) type=3DDialup ;; ftp) type=3DFileTransfer ;; im) type=3DInstantMessaging ;; irc) type=3DIRCClient ;; mail) type=3DEmail ;; news) type=3DNews ;; nntp) type=3DNews ;; p2p) type=3DFileTransfer ;; voip) type=3DTelephony ;; esac; type=3D"Network;${type}" ;; sci) case ${catmin} in=20 astro*) type=3DAstronomy ;; bio*) type=3DBiology ;; calc*) type=3DCalculator ;; chem*) type=3DChemistry ;; elec*) type=3DElectronics ;; geo*) type=3DGeology ;; math*) type=3DMath ;; physics) type=3DPhysics ;; visual*) type=3DDataVisualization ;; esac; type=3D"Education;Science;${type}" ;; sys) type=3D"System" ;; www) case ${catmin} in=20 client) type=3DWebBrowser ;; esac; type=3D"Network;${type}" ;; *) type=3D ;; esac; fi; if [ "${SLOT}" =3D=3D "0" ]; then local desktop_name=3D"${PN}"; else local desktop_name=3D"${PN}-${SLOT}"; fi; local desktop=3D"${T}/$(echo ${exec} | sed 's:[[:space:]/:]:_:g')-${des= ktop_name}.desktop"; type=3D${type%;}${type:+;}; eshopts_push -s extglob; if [[ -n ${icon} && ${icon} !=3D /* ]] && [[ ${icon} =3D=3D *.xpm || ${= icon} =3D=3D *.png || ${icon} =3D=3D *.svg ]]; then ewarn "As described in the Icon Theme Specification, icon file exte= nsions are not"; ewarn "allowed in .desktop files if the value is not an absolute pa= th."; icon=3D${icon%.@(xpm|png|svg)}; fi; eshopts_pop; cat > "${desktop}" <<-EOF [Desktop Entry] Name=3D${name} Type=3DApplication Comment=3D${DESCRIPTION} Exec=3D${exec} TryExec=3D${exec%% *} Icon=3D${icon} Categories=3D${type} EOF if [[ ${fields:-=3D} !=3D *=3D* ]]; then ewarn "make_desktop_entry: update your 5th arg to read Path=3D${fie= lds}"; fields=3D"Path=3D${fields}"; fi; [[ -n ${fields} ]] && printf '%b\n' "${fields}" >> "${desktop}"; ( insinto /usr/share/applications; doins "${desktop}" ) || die "installing desktop file failed" } make_session_desktop ()=20 {=20 [[ -z $1 ]] && eerror "$0: You must specify the title" && return 1; [[ -z $2 ]] && eerror "$0: You must specify the command" && return 1; local title=3D$1; local command=3D$2; local desktop=3D${T}/${wm:-${PN}}.desktop; shift 2; cat > "${desktop}" <<-EOF [Desktop Entry] Name=3D${title} Comment=3DThis session logs you into ${title} Exec=3D${command} $* TryExec=3D${command} Type=3DXSession EOF ( insinto /usr/share/xsessions; doins "${desktop}" ) } make_wrapper ()=20 {=20 local wrapper=3D$1 bin=3D$2 chdir=3D$3 libdir=3D$4 path=3D$5; local tmpwrapper=3D$(emktemp); cat > "${tmpwrapper}" < /dev/null; then for module in `find . -maxdepth 1 -type d -name [a-z0-9]\*`; do module=3D"${module#./}"; mkdir -p "${ESVN_STORE_DIR}/kdebase-${module}" && mv -f "${= module}" "${ESVN_STORE_DIR}/kdebase-${module}" || die "Failed to move to '$= {ESVN_STORE_DIR}/kdebase-${module}'."; done; popd > /dev/null; rm -fr "${cleandir}/kdebase" || die "Failed to remove ${cleandi= r}/kdebase. You need to remove it manually."; fi; local pkg; for pkg in "${cleandir}"/*; do mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '= ${pkg}'"; done; rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. = Please move '${cleandir}' contents to appropriate location (possibly ${ESV= N_STORE_DIR}) and manually remove '${cleandir}' in order to continue."; fi; if ! has kde4-meta ${INHERITED}; then case ${KMNAME} in=20 extragear* | playground*) local scmlocalpath=3D"${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}= "; if [[ -d "${scmlocalpath}" ]]; then local destdir=3D"${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"= `basename "${ESVN_REPO_URI}"`"; ewarn "'${scmlocalpath}' has been found."; ewarn "Moving contents to new location: ${destdir}"; addwrite "${ESVN_STORE_DIR}"; mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f= "${scmlocalpath}" "${destdir}" || die "Failed to move to '${scmlocalpath}'= "; rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null; fi ;; esac; fi } multilib_env ()=20 {=20 local CTARGET=3D${1:-${CTARGET}}; case ${CTARGET} in=20 x86_64*) export CFLAGS_x86=3D${CFLAGS_x86--m32}; export CHOST_x86=3D${CTARGET/x86_64/i686}; export CTARGET_x86=3D${CHOST_x86}; if [[ ${SYMLINK_LIB} =3D=3D "yes" ]]; then export LIBDIR_x86=3D"lib32"; else export LIBDIR_x86=3D"lib"; fi; export CFLAGS_amd64=3D${CFLAGS_amd64--m64}; export CHOST_amd64=3D${CTARGET}; export CTARGET_amd64=3D${CHOST_amd64}; export LIBDIR_amd64=3D"lib64"; export CFLAGS_x32=3D${CFLAGS_x32--mx32}; export CHOST_x32=3D${CTARGET}; export CTARGET_x32=3D${CHOST_x32}; export LIBDIR_x32=3D"libx32"; : ${MULTILIB_ABIS=3Damd64 x86}; : ${DEFAULT_ABI=3Damd64} ;; mips64*) export CFLAGS_o32=3D${CFLAGS_o32--mabi=3D32}; export CHOST_o32=3D${CTARGET/mips64/mips}; export CTARGET_o32=3D${CHOST_o32}; export LIBDIR_o32=3D"lib"; export CFLAGS_n32=3D${CFLAGS_n32--mabi=3Dn32}; export CHOST_n32=3D${CTARGET}; export CTARGET_n32=3D${CHOST_n32}; export LIBDIR_n32=3D"lib32"; export CFLAGS_n64=3D${CFLAGS_n64--mabi=3D64}; export CHOST_n64=3D${CTARGET}; export CTARGET_n64=3D${CHOST_n64}; export LIBDIR_n64=3D"lib64"; : ${MULTILIB_ABIS=3Dn64 n32 o32}; : ${DEFAULT_ABI=3Dn32} ;; powerpc64*) export CFLAGS_ppc=3D${CFLAGS_ppc--m32}; export CHOST_ppc=3D${CTARGET/powerpc64/powerpc}; export CTARGET_ppc=3D${CHOST_ppc}; export LIBDIR_ppc=3D"lib"; export CFLAGS_ppc64=3D${CFLAGS_ppc64--m64}; export CHOST_ppc64=3D${CTARGET}; export CTARGET_ppc64=3D${CHOST_ppc64}; export LIBDIR_ppc64=3D"lib64"; : ${MULTILIB_ABIS=3Dppc64 ppc}; : ${DEFAULT_ABI=3Dppc64} ;; s390x*) export CFLAGS_s390=3D${CFLAGS_s390--m31}; export CHOST_s390=3D${CTARGET/s390x/s390}; export CTARGET_s390=3D${CHOST_s390}; export LIBDIR_s390=3D"lib"; export CFLAGS_s390x=3D${CFLAGS_s390x--m64}; export CHOST_s390x=3D${CTARGET}; export CTARGET_s390x=3D${CHOST_s390x}; export LIBDIR_s390x=3D"lib64"; : ${MULTILIB_ABIS=3Ds390x s390}; : ${DEFAULT_ABI=3Ds390x} ;; sparc*) export CFLAGS_sparc32=3D${CFLAGS_sparc32}; export CHOST_sparc32=3D${CTARGET/sparc64/sparc}; export CTARGET_sparc32=3D${CHOST_sparc32}; export LIBDIR_sparc32=3D"lib"; export CFLAGS_sparc64=3D${CFLAGS_sparc64--m64}; export CHOST_sparc64=3D${CTARGET}; export CTARGET_sparc64=3D${CHOST_sparc64}; export LIBDIR_sparc64=3D"lib64"; : ${MULTILIB_ABIS=3Dsparc64 sparc32}; : ${DEFAULT_ABI=3Dsparc64} ;; *) : ${MULTILIB_ABIS=3Ddefault}; : ${DEFAULT_ABI=3Ddefault} ;; esac; export MULTILIB_ABIS DEFAULT_ABI } multilib_toolchain_setup ()=20 {=20 local v vv; export ABI=3D$1; if [[ ${__DEFAULT_ABI_SAVED} =3D=3D "true" ]]; then for v in CHOST CBUILD AS CC CXX LD; do vv=3D"__abi_saved_${v}"; export ${v}=3D"${!vv}"; unset ${vv}; done; unset __DEFAULT_ABI_SAVED; fi; if [[ ${ABI} !=3D ${DEFAULT_ABI} ]]; then for v in CHOST CBUILD AS CC CXX LD; do export __abi_saved_${v}=3D"${!v}"; done; export __DEFAULT_ABI_SAVED=3D"true"; export CHOST=3D$(get_abi_CHOST ${DEFAULT_ABI}); export AS=3D"$(tc-getAS) $(get_abi_ASFLAGS)"; export CC=3D"$(tc-getCC) $(get_abi_CFLAGS)"; export CXX=3D"$(tc-getCXX) $(get_abi_CFLAGS)"; export LD=3D"$(tc-getLD) $(get_abi_LDFLAGS)"; export CHOST=3D$(get_abi_CHOST $1); export CBUILD=3D$(get_abi_CHOST $1); fi } newicon ()=20 {=20 ( insinto /usr/share/pixmaps; newins "$@" ) } newmenu ()=20 {=20 ( insinto /usr/share/applications; newins "$@" ) } no-as-needed ()=20 {=20 case $($(tc-getLD) -v 2>&1 [more= libraries to preserve]"; has preserve-libs ${FEATURES} && return 0; local lib dir; for lib in "$@"; do [[ -e ${ROOT}/${lib} ]] || continue; dir=3D${lib%/*}; dodir ${dir} || die "dodir ${dir} failed"; cp "${ROOT}"/${lib} "${D}"/${lib} || die "cp ${lib} failed"; touch "${D}"/${lib}; done } preserve_old_lib_notify ()=20 {=20 if [[ ${EBUILD_PHASE} !=3D "postinst" ]]; then eerror "preserve_old_lib_notify() must be called from pkg_postinst(= ) only"; die "Invalid preserve_old_lib_notify() usage"; fi; has preserve-libs ${FEATURES} && return 0; local lib notice=3D0; for lib in "$@"; do [[ -e ${ROOT}/${lib} ]] || continue; if [[ ${notice} -eq 0 ]]; then notice=3D1; ewarn "Old versions of installed libraries were detected on you= r system."; ewarn "In order to avoid breaking packages that depend on these= old libs,"; ewarn "the libraries are not being removed. You need to run re= vdep-rebuild"; ewarn "in order to remove these old dependencies. If you do no= t have this"; ewarn "helper program, simply emerge the 'gentoolkit' package."= ; ewarn; fi; [[ ${PN} =3D=3D "mpfr" ]] && lib=3D${lib##*/}; ewarn " # revdep-rebuild --library '${lib}'"; done; if [[ ${notice} -eq 1 ]]; then ewarn; ewarn "Once you've finished running revdep-rebuild, it should be sa= fe to"; ewarn "delete the old libraries. Here is a copy & paste for the la= zy:"; for lib in "$@"; do ewarn " # rm '${lib}'"; done; fi } raw-ldflags ()=20 {=20 local x input=3D"$@"; [[ -z ${input} ]] && input=3D${LDFLAGS}; set --; for x in ${input}; do x=3D${x#-Wl,}; set -- "$@" ${x//,/ }; done; echo "$@" } register_success_hook ()=20 {=20 local x; for x in $*; do hasq $x $EBUILD_SUCCESS_HOOKS || export EBUILD_SUCCESS_HOOKS=3D"$EB= UILD_SUCCESS_HOOKS $x"; done } replace-cpu-flags ()=20 {=20 local newcpu=3D"$#"; newcpu=3D"${!newcpu}"; while [ $# -gt 1 ]; do replace-flags "-march=3D${1}" "-march=3D${newcpu}"; replace-flags "-mcpu=3D${1}" "-mcpu=3D${newcpu}"; replace-flags "-mtune=3D${1}" "-mtune=3D${newcpu}"; shift; done; return 0 } replace-flags ()=20 {=20 [[ $# !=3D 2 ]] && echo && eerror "Usage: replace-flags " && die "replace-flags takes 2 arguments, not $#"; local f fset; declare -a new_CFLAGS new_CXXFLAGS new_FFLAGS new_FCFLAGS; for fset in CFLAGS CXXFLAGS FFLAGS FCFLAGS; do for f in ${!fset}; do [[ ${f} =3D=3D ${1} ]] && f=3D${2}; eval new_${fset}\[\${\#new_${fset}\[@]}]=3D\${f}; done; eval export ${fset}=3D\${new_${fset}\[*]}; done; return 0 } replace-sparc64-flags ()=20 {=20 local SPARC64_CPUS=3D"ultrasparc3 ultrasparc v9"; if [ "${CFLAGS/mtune}" !=3D "${CFLAGS}" ]; then for x in ${SPARC64_CPUS}; do CFLAGS=3D"${CFLAGS/-mcpu=3D${x}/-mcpu=3Dv8}"; done; else for x in ${SPARC64_CPUS}; do CFLAGS=3D"${CFLAGS/-mcpu=3D${x}/-mcpu=3Dv8 -mtune=3D${x}}"; done; fi; if [ "${CXXFLAGS/mtune}" !=3D "${CXXFLAGS}" ]; then for x in ${SPARC64_CPUS}; do CXXFLAGS=3D"${CXXFLAGS/-mcpu=3D${x}/-mcpu=3Dv8}"; done; else for x in ${SPARC64_CPUS}; do CXXFLAGS=3D"${CXXFLAGS/-mcpu=3D${x}/-mcpu=3Dv8 -mtune=3D${x}}"; done; fi; export CFLAGS CXXFLAGS } replace_all_version_separators ()=20 {=20 local c=3D($(get_all_version_components "${2:-${PV}}")); c=3D${c[@]//[-._]/$1}; echo ${c// } } replace_version_separator ()=20 {=20 eshopts_push -s extglob; local w c v=3D"${3:-${PV}}"; declare -i i found=3D0; w=3D${1:-1}; c=3D($(get_all_version_components ${v})); if [[ ${w} !=3D *[[:digit:]]* ]]; then for ((i =3D 0; i < ${#c[@]}; i++)) do if [[ ${c[i]} =3D=3D ${w} ]]; then c[i]=3D${2}; break; fi; done; else for ((i =3D 0; i < ${#c[@]}; i++)) do if [[ -n "${c[i]//[^-._]}" ]]; then found+=3D1; if ((found =3D=3D w)); then c[i]=3D${2}; break; fi; fi; done; fi; c=3D${c[*]}; echo ${c// }; eshopts_pop } save_library_dependencies ()=20 {=20 local depsfile=3D"${T}/${PN}"; ebegin "Saving library dependencies in ${depsfile##*/}"; echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists= .txt" || die "Failed to save the library dependencies."; eend $? } seq ()=20 {=20 local p=3D$(type -P seq); if [[ -n ${p} ]]; then "${p}" "$@"; return $?; fi; case $# in=20 1) min=3D1 max=3D$1 step=3D1 ;; 2) min=3D$1 max=3D$2 step=3D1 ;; 3) min=3D$1 max=3D$3 step=3D$2 ;; *) die "seq called with wrong number of arguments" ;; esac; p=3D$(type -P jot); if [[ -n ${p} ]]; then local reps; if [[ ${step} !=3D 0 ]]; then reps=3D$(( (max - min) / step + 1 )); else reps=3D0; fi; jot $reps $min $max $step; return $?; fi; while :; do [[ $max < $min && $step > 0 ]] && break; [[ $min < $max && $step < 0 ]] && break; echo $min; : $(( min +=3D step )); done; return 0 } setup-allowed-flags ()=20 {=20 if [[ -z ${ALLOWED_FLAGS} ]]; then export ALLOWED_FLAGS=3D"-pipe"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -O -O0 -O1 -O2 -mcpu -marc= h -mtune"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -fstack-protector -fstack-= protector-all"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -fbounds-checking -fno-str= ict-overflow"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -fno-PIE -fno-pie -fno-uni= t-at-a-time"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -g -g[0-9] -ggdb -ggdb[0-9= ] -gstabs -gstabs+"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -fno-ident -fpermissive"; export ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -W* -w"; fi; ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -fno-stack-protector -fno-stack-prote= ctor-all -fno-strict-aliasing -fno-bounds-checking -fstrict-overflow -fno= -omit-frame-pointer"; ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -mregparm -mno-app-regs -mapp-regs = -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -m= no-sse4.2 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt= -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt -ms= oft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu -mieee -miee= e-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe -mtls-direct-seg-re= fs -mno-tls-direct-seg-refs -mflat -mno-flat -mno-faster-structs -mfaster= -structs -m32 -m64 -mabi -mlittle-endian -mbig-endian -EL -EB -fPIC -ml= ive-g0 -mcmodel -mstack-bias -mno-stack-bias -msecure-plt -m*-toc -D* -U*= "; ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -mno-fma4 -mno-movbe -mno-xop -mno-lw= p"; ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} -mno-fsgsbase -mno-rdrnd -mno-f16c = -mno-bmi -mno-tbm"; export UNSTABLE_FLAGS=3D"-Os -O3 -freorder-blocks"; return 0 } src_compile ()=20 {=20 kde4-meta_src_compile "$@" } src_configure ()=20 {=20 kde4-meta_src_configure "$@" } src_install ()=20 {=20 kde4-meta_src_install "$@" } src_prepare ()=20 {=20 kde4-meta_src_prepare "$@" } src_test ()=20 {=20 kde4-meta_src_test "$@" } src_unpack ()=20 {=20 kde4-meta_src_unpack "$@" } strip-flags ()=20 {=20 local x y flag NEW_CFLAGS NEW_CXXFLAGS NEW_FFLAGS NEW_FCFLAGS; setup-allowed-flags; local NEW_CFLAGS=3D""; local NEW_CXXFLAGS=3D""; local NEW_FFLAGS=3D""; local NEW_FCFLAGS=3D""; if has "~$(tc-arch)" ${ACCEPT_KEYWORDS}; then ALLOWED_FLAGS=3D"${ALLOWED_FLAGS} ${UNSTABLE_FLAGS}"; fi; set -f; for x in ${CFLAGS}; do for y in ${ALLOWED_FLAGS}; do flag=3D${x%%=3D*}; if [ "${flag%%${y}}" =3D "" ]; then NEW_CFLAGS=3D"${NEW_CFLAGS} ${x}"; break; fi; done; done; for x in ${CXXFLAGS}; do for y in ${ALLOWED_FLAGS}; do flag=3D${x%%=3D*}; if [ "${flag%%${y}}" =3D "" ]; then NEW_CXXFLAGS=3D"${NEW_CXXFLAGS} ${x}"; break; fi; done; done; for x in ${FFLAGS}; do for y in ${ALLOWED_FLAGS}; do flag=3D${x%%=3D*}; if [ "${flag%%${y}}" =3D "" ]; then NEW_FFLAGS=3D"${NEW_FFLAGS} ${x}"; break; fi; done; done; for x in ${FCFLAGS}; do for y in ${ALLOWED_FLAGS}; do flag=3D${x%%=3D*}; if [ "${flag%%${y}}" =3D "" ]; then NEW_FCFLAGS=3D"${NEW_FCFLAGS} ${x}"; break; fi; done; done; if [ "${CFLAGS/-O}" !=3D "${CFLAGS}" -a "${NEW_CFLAGS/-O}" =3D "${NEW_C= FLAGS}" ]; then NEW_CFLAGS=3D"${NEW_CFLAGS} -O2"; fi; if [ "${CXXFLAGS/-O}" !=3D "${CXXFLAGS}" -a "${NEW_CXXFLAGS/-O}" =3D "$= {NEW_CXXFLAGS}" ]; then NEW_CXXFLAGS=3D"${NEW_CXXFLAGS} -O2"; fi; if [ "${FFLAGS/-O}" !=3D "${FFLAGS}" -a "${NEW_FFLAGS/-O}" =3D "${NEW_F= FLAGS}" ]; then NEW_FFLAGS=3D"${NEW_FFLAGS} -O2"; fi; if [ "${FCFLAGS/-O}" !=3D "${FCFLAGS}" -a "${NEW_FCFLAGS/-O}" =3D "${NE= W_FCFLAGS}" ]; then NEW_FCFLAGS=3D"${NEW_FCFLAGS} -O2"; fi; set +f; export CFLAGS=3D"${NEW_CFLAGS}"; export CXXFLAGS=3D"${NEW_CXXFLAGS}"; export FFLAGS=3D"${NEW_FFLAGS}"; export FCFLAGS=3D"${NEW_FCFLAGS}"; return 0 } strip-linguas ()=20 {=20 local ls newls nols; if [[ $1 =3D=3D "-i" ]] || [[ $1 =3D=3D "-u" ]]; then local op=3D$1; shift; ls=3D$(find "$1" -name '*.po' -exec basename {} .po ';'); shift; local d f; for d in "$@"; do if [[ ${op} =3D=3D "-u" ]]; then newls=3D${ls}; else newls=3D""; fi; for f in $(find "$d" -name '*.po' -exec basename {} .po ';'); do if [[ ${op} =3D=3D "-i" ]]; then has ${f} ${ls} && newls=3D"${newls} ${f}"; else has ${f} ${ls} || newls=3D"${newls} ${f}"; fi; done; ls=3D${newls}; done; else ls=3D"$@"; fi; nols=3D""; newls=3D""; for f in ${LINGUAS}; do if has ${f} ${ls}; then newls=3D"${newls} ${f}"; else nols=3D"${nols} ${f}"; fi; done; [[ -n ${nols} ]] && ewarn "Sorry, but ${PN} does not support the LINGUA= S:" ${nols}; export LINGUAS=3D${newls:1} } strip-unsupported-flags ()=20 {=20 export CFLAGS=3D$(test-flags-CC ${CFLAGS}); export CXXFLAGS=3D$(test-flags-CXX ${CXXFLAGS}); export FFLAGS=3D$(test-flags-F77 ${FFLAGS}); export FCFLAGS=3D$(test-flags-FC ${FCFLAGS}) } tc-arch ()=20 {=20 tc-ninja_magic_to_arch portage "$@" } tc-arch-kernel ()=20 {=20 tc-ninja_magic_to_arch kern "$@" } tc-endian ()=20 {=20 local host=3D$1; [[ -z ${host} ]] && host=3D${CTARGET:-${CHOST}}; host=3D${host%%-*}; case ${host} in=20 alpha*) echo big ;; arm*b*) echo big ;; arm*) echo little ;; cris*) echo little ;; hppa*) echo big ;; i?86*) echo little ;; ia64*) echo little ;; m68*) echo big ;; mips*l*) echo little ;; mips*) echo big ;; powerpc*) echo big ;; s390*) echo big ;; sh*b*) echo big ;; sh*) echo little ;; sparc*) echo big ;; x86_64*) echo little ;; *) echo wtf ;; esac } tc-export ()=20 {=20 local var; for var in "$@"; do [[ $(type -t tc-get${var}) !=3D "function" ]] && die "tc-export: in= valid export variable '${var}'"; eval tc-get${var} > /dev/null; done } tc-getAR ()=20 {=20 tc-getPROG AR ar "$@" } tc-getAS ()=20 {=20 tc-getPROG AS as "$@" } tc-getBUILD_CC ()=20 {=20 local v; for v in CC_FOR_BUILD BUILD_CC HOSTCC; do if [[ -n ${!v} ]]; then export BUILD_CC=3D${!v}; echo "${!v}"; return 0; fi; done; local search=3D; if [[ -n ${CBUILD} ]]; then search=3D$(type -p ${CBUILD}-gcc); search=3D${search##*/}; fi; search=3D${search:-gcc}; export BUILD_CC=3D${search}; echo "${search}" } tc-getCC ()=20 {=20 tc-getPROG CC gcc "$@" } tc-getCPP ()=20 {=20 tc-getPROG CPP cpp "$@" } tc-getCXX ()=20 {=20 tc-getPROG CXX g++ "$@" } tc-getDLLWRAP ()=20 {=20 tc-getPROG DLLWRAP dllwrap "$@" } tc-getF77 ()=20 {=20 tc-getPROG F77 gfortran "$@" } tc-getFC ()=20 {=20 tc-getPROG FC gfortran "$@" } tc-getGCJ ()=20 {=20 tc-getPROG GCJ gcj "$@" } tc-getLD ()=20 {=20 tc-getPROG LD ld "$@" } tc-getNM ()=20 {=20 tc-getPROG NM nm "$@" } tc-getOBJCOPY ()=20 {=20 tc-getPROG OBJCOPY objcopy "$@" } tc-getPKG_CONFIG ()=20 {=20 tc-getPROG PKG_CONFIG pkg-config "$@" } tc-getPROG ()=20 {=20 local var=3D$1; local prog=3D$2; if [[ -n ${!var} ]]; then echo "${!var}"; return 0; fi; local search=3D; [[ -n $3 ]] && search=3D$(type -p "$3-${prog}"); [[ -z ${search} && -n ${CHOST} ]] && search=3D$(type -p "${CHOST}-${pro= g}"); [[ -n ${search} ]] && prog=3D${search##*/}; export ${var}=3D${prog}; echo "${!var}" } tc-getRANLIB ()=20 {=20 tc-getPROG RANLIB ranlib "$@" } tc-getRC ()=20 {=20 tc-getPROG RC windres "$@" } tc-getSTRIP ()=20 {=20 tc-getPROG STRIP strip "$@" } tc-has-openmp ()=20 {=20 local base=3D"${T}/test-tc-openmp"; cat > "${base}.c" <<-EOF #include int main() { int nthreads, tid, ret =3D 0; #pragma omp parallel private(nthreads, tid) { tid =3D omp_get_thread_num(); nthreads =3D omp_get_num_threads(); ret +=3D tid + nthreads; } return ret; } EOF $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" &>/dev/null; local ret=3D$?; rm -f "${base}"*; return ${ret} } tc-has-tls ()=20 {=20 local base=3D"${T}/test-tc-tls"; cat > "${base}.c" <<-EOF int foo(int *i) { static __thread int j =3D 0; return *i ? j : *i; } EOF local flags; case $1 in=20 -s) flags=3D"-S" ;; -c) flags=3D"-c" ;; -l) ;; -*) die "Usage: tc-has-tls [-c|-l] [toolchain prefix]" ;; esac; : ${flags:=3D-fPIC -shared -Wl,-z,defs}; [[ $1 =3D=3D -* ]] && shift; $(tc-getCC "$@") ${flags} "${base}.c" -o "${base}" &>/dev/null; local ret=3D$?; rm -f "${base}"*; return ${ret} } tc-is-cross-compiler ()=20 {=20 return $([[ ${CBUILD:-${CHOST}} !=3D ${CHOST} ]]) } tc-is-hardfloat ()=20 {=20 [[ ${CTARGET//_/-} =3D=3D *-hardfloat-* ]] && echo "yes" || echo "no" } tc-is-softfloat ()=20 {=20 case ${CTARGET} in=20 bfin* | h8300*) echo "only" ;; *) [[ ${CTARGET//_/-} =3D=3D *-softfloat-* ]] && echo "yes" || ech= o "no" ;; esac } tc-is-static-only ()=20 {=20 local host=3D${CTARGET:-${CHOST}}; return $([[ ${host} =3D=3D *-mint* ]]) } tc-ninja_magic_to_arch ()=20 {=20 function ninj ()=20 {=20 [[ ${type} =3D=3D "kern" ]] && echo $1 || echo $2 }; local type=3D$1; local host=3D$2; [[ -z ${host} ]] && host=3D${CTARGET:-${CHOST}}; case ${host} in=20 alpha*) echo alpha ;; arm*) echo arm ;; avr*) ninj avr32 avr ;; bfin*) ninj blackfin bfin ;; cris*) echo cris ;; hppa*) ninj parisc hppa ;; i?86*) if [[ ${type} =3D=3D "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(K= V_to_int 2.6.24) || ${host} =3D=3D *freebsd* ]]; then echo i386; else echo x86; fi ;; ia64*) echo ia64 ;; m68*) echo m68k ;; mips*) echo mips ;; nios2*) echo nios2 ;; nios*) echo nios ;; powerpc*) if [[ ${type} =3D=3D "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(K= V_to_int 2.6.16) ]]; then echo powerpc; else if [[ ${type} =3D=3D "kern" ]] && [[ $(KV_to_int ${KV}) -eq= $(KV_to_int 2.6.15) ]]; then if [[ ${host} =3D=3D powerpc64* ]] || [[ ${PROFILE_ARCH= } =3D=3D "ppc64" ]]; then echo powerpc; else echo ppc; fi; else if [[ ${host} =3D=3D powerpc64* ]]; then echo ppc64; else if [[ ${PROFILE_ARCH} =3D=3D "ppc64" ]]; then ninj ppc64 ppc; else echo ppc; fi; fi; fi; fi ;; s390*) echo s390 ;; sh64*) ninj sh64 sh ;; sh*) echo sh ;; sparc64*) ninj sparc64 sparc ;; sparc*) [[ ${PROFILE_ARCH} =3D=3D "sparc64" ]] && ninj sparc64 sparc ||= echo sparc ;; vax*) echo vax ;; x86_64*freebsd*) echo amd64 ;; x86_64*) if [[ ${type} =3D=3D "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(K= V_to_int 2.6.24) ]]; then echo x86; else ninj x86_64 amd64; fi ;; *) echo unknown ;; esac } test-flag-CC ()=20 {=20 test-flag-PROG "CC" "$1" } test-flag-CXX ()=20 {=20 test-flag-PROG "CXX" "$1" } test-flag-F77 ()=20 {=20 test-flag-PROG "F77" "$1" } test-flag-FC ()=20 {=20 test-flag-PROG "FC" "$1" } test-flag-PROG ()=20 {=20 local comp=3D$1; local flags=3D"$2"; [[ -z ${comp} || -z ${flags} ]] && return 1; local PROG=3D$(tc-get${comp}); ${PROG} ${flags} -c -o /dev/null -xc /dev/null > /dev/null 2>&1 } test-flags ()=20 {=20 test-flags-CC "$@" } test-flags-CC ()=20 {=20 test-flags-PROG "CC" "$@" } test-flags-CXX ()=20 {=20 test-flags-PROG "CXX" "$@" } test-flags-F77 ()=20 {=20 test-flags-PROG "F77" "$@" } test-flags-FC ()=20 {=20 test-flags-PROG "FC" "$@" } test-flags-PROG ()=20 {=20 local comp=3D$1; local flags; local x; shift; [[ -z ${comp} ]] && return 1; x=3D""; for x in "$@"; do test-flag-${comp} "${x}" && flags=3D"${flags}${flags:+ }${x}"; done; echo "${flags}"; [[ -n ${flags} ]] } test_flag ()=20 {=20 die "$0: deprecated, please use test-flags()!" } test_version_info ()=20 {=20 if [[ $($(tc-getCC) --version 2>&1) =3D=3D *$1* ]]; then return 0; else return 1; fi } treecopy ()=20 {=20 dest=3D${!#}; files_count=3D$#; while (( $# > 1 )); do dirstruct=3D$(dirname "$1"); mkdir -p "${dest}/${dirstruct}"; cp -pPR "$1" "${dest}/${dirstruct}"; shift; done } unpack_makeself ()=20 {=20 local src_input=3D${1:-${A}}; local src=3D$(find_unpackable_file "${src_input}"); local skip=3D$2; local exe=3D$3; [[ -z ${src} ]] && die "Could not locate source for '${src_input}'"; local shrtsrc=3D$(basename "${src}"); echo ">>> Unpacking ${shrtsrc} to ${PWD}"; if [[ -z ${skip} ]]; then local ver=3D$(grep -m1 -a '#.*Makeself' "${src}" | awk '{print $NF}= '); local skip=3D0; exe=3Dtail; case ${ver} in=20 1.5.* | 1.6.0-nv) skip=3D$(grep -a ^skip=3D "${src}" | cut -d=3D -f2) ;; 2.0 | 2.0.1) skip=3D$(grep -a ^' 'tail "${src}" | awk '{print $2}' | cut= -b2-) ;; 2.1.1) skip=3D$(grep -a ^offset=3D "${src}" | awk '{print $2}' | c= ut -b2-); (( skip++ )) ;; 2.1.2) skip=3D$(grep -a ^offset=3D "${src}" | awk '{print $3}' | h= ead -n 1); (( skip++ )) ;; 2.1.3) skip=3D`grep -a ^offset=3D "${src}" | awk '{print $3}'`; (( skip++ )) ;; 2.1.4 | 2.1.5) skip=3D$(grep -a offset=3D.*head.*wc "${src}" | awk '{print= $3}' | head -n 1); skip=3D$(head -n ${skip} "${src}" | wc -c); exe=3D"dd" ;; *) eerror "I'm sorry, but I was unable to support the Makeself= file."; eerror "The version I detected was '${ver}'."; eerror "Please file a bug about the file ${shrtsrc} at"; eerror "http://bugs.gentoo.org/ so that support can be adde= d."; die "makeself version '${ver}' not supported" ;; esac; debug-print "Detected Makeself version ${ver} ... using ${skip} as = offset"; fi; case ${exe} in=20 tail) exe=3D"tail -n +${skip} '${src}'" ;; dd) exe=3D"dd ibs=3D${skip} skip=3D1 if=3D'${src}'" ;; *) die "makeself cant handle exe '${exe}'" ;; esac; local filetype tmpfile=3D$(emktemp); eval ${exe} 2> /dev/null | head -c 512 > "${tmpfile}"; filetype=3D$(file -b "${tmpfile}") || die; case ${filetype} in=20 *tar\ archive*) eval ${exe} | tar --no-same-owner -xf - ;; bzip2*) eval ${exe} | bzip2 -dc | tar --no-same-owner -xf - ;; gzip*) eval ${exe} | tar --no-same-owner -xzf - ;; compress*) eval ${exe} | gunzip | tar --no-same-owner -xf - ;; *) eerror "Unknown filetype \"${filetype}\" ?"; false ;; esac; assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' += ${skip})" } unpack_pdv ()=20 {=20 local src=3D$(find_unpackable_file "$1"); local sizeoff_t=3D$2; [[ -z ${src} ]] && die "Could not locate source for '$1'"; [[ -z ${sizeoff_t} ]] && die "No idea what off_t size was used for this= pdv :("; local shrtsrc=3D$(basename "${src}"); echo ">>> Unpacking ${shrtsrc} to ${PWD}"; local metaskip=3D$(tail -c ${sizeoff_t} "${src}" | hexdump -e \"%i\"); local tailskip=3D$(tail -c $((${sizeoff_t}*2)) "${src}" | head -c ${siz= eoff_t} | hexdump -e \"%i\"); local metafile=3D$(emktemp); tail -c +$((${metaskip}+1)) "${src}" > "${metafile}"; local datafile=3D$(tail -c +$((${metaskip}+1)) "${src}" | strings | hea= d -n 1); datafile=3D$(basename "${datafile}"); local tmpfile=3D$(emktemp); tail -c +$((${tailskip}+1)) ${src} 2> /dev/null | head -c 512 > ${tmpfi= le}; local iscompressed=3D$(file -b "${tmpfile}"); if [[ ${iscompressed:0:8} =3D=3D "compress" ]]; then iscompressed=3D1; mv ${tmpfile}{,.Z}; gunzip ${tmpfile}; else iscompressed=3D0; fi; local istar=3D$(file -b "${tmpfile}"); if [[ ${istar:0:9} =3D=3D "POSIX tar" ]]; then istar=3D1; else istar=3D0; fi; if [ ${iscompressed} -eq 1 ]; then if [ ${istar} -eq 1 ]; then tail -c +$((${tailskip}+1)) ${src} 2> /dev/null | head -c $((${= metaskip}-${tailskip})) | tar -xzf -; else tail -c +$((${tailskip}+1)) ${src} 2> /dev/null | head -c $((${= metaskip}-${tailskip})) | gzip -dc > ${datafile}; fi; else if [ ${istar} -eq 1 ]; then tail -c +$((${tailskip}+1)) ${src} 2> /dev/null | head -c $((${= metaskip}-${tailskip})) | tar --no-same-owner -xf -; else tail -c +$((${tailskip}+1)) ${src} 2> /dev/null | head -c $((${= metaskip}-${tailskip})) > ${datafile}; fi; fi; true } validate_desktop_entries ()=20 {=20 if [[ -x /usr/bin/desktop-file-validate ]]; then einfo "Checking desktop entry validity"; local directories=3D""; for d in /usr/share/applications $@; do [[ -d ${D}${d} ]] && directories=3D"${directories} ${D}${d}"; done; if [[ -n ${directories} ]]; then for FILE in $(find ${directories} -name "*\.desktop" -no= t -path '*.hidden*' | sort -u 2>/dev/null); do local temp=3D$(desktop-file-validate ${FILE} | grep -v "war= ning:" | sed -e "s|error: ||" -e "s|${FILE}:|--|g" ); [[ -n $temp ]] && elog ${temp/--/${FILE/${D}/}:}; done; fi; echo ""; else einfo "Passing desktop entry validity check. Install dev-util/deskt= op-file-utils, if you want to help to improve Gentoo."; fi } version_compare ()=20 {=20 eshopts_push -s extglob; local ver_a=3D${1} ver_b=3D${2} parts_a parts_b; local cur_tok_a cur_tok_b num_part_a num_part_b; local -i cur_idx_a=3D0 cur_idx_b=3D0 prev_idx_a prev_idx_b; parts_a=3D($(get_all_version_components "${ver_a}" )); parts_b=3D($(get_all_version_components "${ver_b}" )); local -i inf_loop=3D0; while true; do inf_loop+=3D1; ((inf_loop > 20)) && die "versionator compare bug [numbers, ${ver_a= }, ${ver_b}]"; prev_idx_a=3Dcur_idx_a; prev_idx_b=3Dcur_idx_b; cur_tok_a=3D${parts_a[cur_idx_a]}; cur_tok_b=3D${parts_b[cur_idx_b]}; if [[ -n ${cur_tok_a} ]] && [[ -z ${cur_tok_a//[[:digit:]]} ]]; the= n cur_idx_a+=3D1; [[ ${parts_a[cur_idx_a]} =3D=3D . ]] && cur_idx_a+=3D1; else cur_tok_a=3D; fi; if [[ -n ${cur_tok_b} ]] && [[ -z ${cur_tok_b//[[:digit:]]} ]]; the= n cur_idx_b+=3D1; [[ ${parts_b[cur_idx_b]} =3D=3D . ]] && cur_idx_b+=3D1; else cur_tok_b=3D; fi; [[ -z ${cur_tok_a} && -z ${cur_tok_b} ]] && break; [[ -z ${cur_tok_a} ]] && eshopts_pop && return 1; [[ -z ${cur_tok_b} ]] && eshopts_pop && return 3; if (( prev_idx_a !=3D 0 && prev_idx_b !=3D 0 )) && [[ ${cur_tok_a} = =3D=3D 0* || ${cur_tok_b} =3D=3D 0* ]]; then cur_tok_a=3D${cur_tok_a%%+(0)}; cur_tok_b=3D${cur_tok_b%%+(0)}; [[ ${cur_tok_a} < ${cur_tok_b} ]] && eshopts_pop && return 1; [[ ${cur_tok_a} > ${cur_tok_b} ]] && eshopts_pop && return 3; else cur_tok_a=3D${cur_tok_a##+(0)}; cur_tok_b=3D${cur_tok_b##+(0)}; : ${cur_tok_a:=3D0}; : ${cur_tok_b:=3D0}; ((cur_tok_a < cur_tok_b)) && eshopts_pop && return 1; ((cur_tok_a > cur_tok_b)) && eshopts_pop && return 3; fi; done; local letter_a=3D; letter_a=3D${parts_a[cur_idx_a]}; if [[ ${#letter_a} -eq 1 && -z ${letter_a/[a-z]} ]]; then cur_idx_a+=3D1; else letter_a=3D@; fi; local letter_b=3D; letter_b=3D${parts_b[cur_idx_b]}; if [[ ${#letter_b} -eq 1 && -z ${letter_b/[a-z]} ]]; then cur_idx_b+=3D1; else letter_b=3D@; fi; [[ ${letter_a} < ${letter_b} ]] && eshopts_pop && return 1; [[ ${letter_a} > ${letter_b} ]] && eshopts_pop && return 3; inf_loop=3D0; while true; do inf_loop+=3D1; ((inf_loop > 20)) && die "versionator compare bug [numbers, ${ver_a= }, ${ver_b}]"; [[ ${parts_a[cur_idx_a]} =3D=3D _ ]] && ((cur_idx_a++)); [[ ${parts_b[cur_idx_b]} =3D=3D _ ]] && ((cur_idx_b++)); cur_tok_a=3D${parts_a[cur_idx_a]}; cur_tok_b=3D${parts_b[cur_idx_b]}; num_part_a=3D0; num_part_b=3D0; if has ${cur_tok_a%%+([0-9])} "alpha" "beta" "pre" "rc" "p"; then cur_idx_a+=3D1; num_part_a=3D${cur_tok_a##+([a-z])}; num_part_a=3D${num_part_a##+(0)}; : ${num_part_a:=3D0}; cur_tok_a=3D${cur_tok_a%%+([0-9])}; else cur_tok_a=3D; fi; if has ${cur_tok_b%%+([0-9])} alpha beta pre rc p; then cur_idx_b+=3D1; num_part_b=3D${cur_tok_b##+([a-z])}; num_part_b=3D${num_part_b##+(0)}; : ${num_part_b:=3D0}; cur_tok_b=3D${cur_tok_b%%+([0-9])}; else cur_tok_b=3D; fi; if [[ ${cur_tok_a} !=3D ${cur_tok_b} ]]; then local suffix; for suffix in alpha beta pre rc "" p; do [[ ${cur_tok_a} =3D=3D ${suffix} ]] && eshopts_pop && retur= n 1; [[ ${cur_tok_b} =3D=3D ${suffix} ]] && eshopts_pop && retur= n 3; done; else if [[ -z ${cur_tok_a} && -z ${cur_tok_b} ]]; then break; else ((num_part_a < num_part_b)) && eshopts_pop && return 1; ((num_part_a > num_part_b)) && eshopts_pop && return 3; fi; fi; done; [[ ${parts_a[cur_idx_a]} =3D=3D - ]] && ((cur_idx_a++)); [[ ${parts_b[cur_idx_b]} =3D=3D - ]] && ((cur_idx_b++)); if [[ -n ${parts_a[cur_idx_a]/r+([0-9])} || -n ${parts_b[cur_idx_b]/r+(= [0-9])} ]]; then die "versionator compare bug [revisions, ${ver_a}, ${ver_b}]"; fi; num_part_a=3D${parts_a[cur_idx_a]#r}; num_part_a=3D${num_part_a##+(0)}; : ${num_part_a:=3D0}; num_part_b=3D${parts_b[cur_idx_b]#r}; num_part_b=3D${num_part_b##+(0)}; : ${num_part_b:=3D0}; ((num_part_a < num_part_b)) && eshopts_pop && return 1; ((num_part_a > num_part_b)) && eshopts_pop && return 3; eshopts_pop; return 2 } version_format_string ()=20 {=20 local fstr=3D$1; shift; set -- $(get_version_components "$@"); eval echo "${fstr}" } version_is_at_least ()=20 {=20 local want_s=3D"$1" have_s=3D"${2:-${PVR}}" r; version_compare "${want_s}" "${have_s}"; r=3D$?; case $r in=20 1 | 2) return 0 ;; 3) return 1 ;; *) die "versionator compare bug [atleast, ${want_s}, ${have_s}, ${= r}]" ;; esac } version_sort ()=20 {=20 eshopts_push -s extglob; local items=3D; local -i left=3D0; items=3D("$@"); while ((left < ${#items[@]})); do local -i lowest_idx=3Dleft; local -i idx=3Dlowest_idx+1; while ((idx < ${#items[@]})); do version_compare "${items[lowest_idx]}" "${items[idx]}"; [[ $? -eq 3 ]] && lowest_idx=3Didx; idx+=3D1; done; local tmp=3D${items[lowest_idx]}; items[lowest_idx]=3D${items[left]}; items[left]=3D${tmp}; left+=3D1; done; echo ${items[@]}; eshopts_pop } virtualmake ()=20 {=20 debug-print-function ${FUNCNAME} "$@"; local i=3D0; local retval=3D0; local OLD_SANDBOX_ON=3D"${SANDBOX_ON}"; local XVFB=3D$(type -p Xvfb); local XHOST=3D$(type -p xhost); local xvfbargs=3D"-screen 0 800x600x24"; if [[ -n ${maketype} ]]; then ewarn "QA: ebuild is exporting \$maketype=3D${maketype}"; ewarn "QA: Ebuild should be migrated to use VIRTUALX_COMMAND=3D${ma= ketype} instead."; ewarn "QA: Setting VIRTUALX_COMMAND to \$maketype conveniently for = now."; VIRTUALX_COMMAND=3D${maketype}; fi; if [[ -n ${XVFB} && -n ${XHOST} ]] && ( [[ -z ${DISPLAY} ]] || ! ( ${XH= OST} &>/dev/null ) ); then debug-print "${FUNCNAME}: running Xvfb hack"; export XAUTHORITY=3D; einfo "Scanning for an open DISPLAY to start Xvfb ..."; XDISPLAY=3D$(i=3D0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));do= ne; echo ${i}); debug-print "${FUNCNAME}: XDISPLAY=3D${XDISPLAY}"; export SANDBOX_ON=3D"0"; debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}"; ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null & sleep 2; local start=3D${XDISPLAY}; while [[ ! -f /tmp/.X${XDISPLAY}-lock ]]; do 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 e= merge again."; die "Unable to start Xvfb"; fi; ((XDISPLAY++)); debug-print "${FUNCNAME}: ${XVFB} :${XDISPLAY} ${xvfbargs}"; ${XVFB} :${XDISPLAY} ${xvfbargs} &>/dev/null & sleep 2; done; export SANDBOX_ON=3D"${OLD_SANDBOX_ON}"; einfo "Starting Xvfb on \$DISPLAY=3D${XDISPLAY} ..."; export DISPLAY=3D:${XDISPLAY}; debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""; ${VIRTUALX_COMMAND} "$@"; retval=3D$?; kill $(cat /tmp/.X${XDISPLAY}-lock); else debug-print "${FUNCNAME}: attaching to running X display"; debug-print "${FUNCNAME}: ${VIRTUALX_COMMAND} \"$@\""; ${VIRTUALX_COMMAND} "$@"; retval=3D$?; fi; [[ ${retval} -ne 0 ]] && die "${FUNCNAME}: the ${VIRTUALX_COMMAND} fail= ed."; return 0 } --=-PYe+5/N6FzmAqvcuIsJ3--