public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Carsten Lohrke <carlo@gentoo.org>
To: kde@gentoo.org, portage@gentoo.org
Cc: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] problems with need-kde/qt and possible solutions
Date: Sat, 31 Jul 2004 02:22:19 +0200	[thread overview]
Message-ID: <200407310222.28132.carlo@gentoo.org> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 2070 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I played with the kde.eclass today, to be sure what can/has to be done, to 
remove the problematic need-kde/qt functions from ebuilds. For reasons see 
Bug 25013 (comment 50 ff.) and Bug 58819.


Solution A (the quick and dirty one): 

Introducing a NEED_KDE variable and calling need-kde ${NEED_KDE} inside of the 
kde.eclass.

advantage: 
- - that simple, that it is "implemented" already

disadvantages: 
- - NEED_KDE has to be set before the ebuild inherits its eclass, which is not 
better than having to put need-kde/qt after R/DEPEND
- - need-kde is still called outside of "portage functions"
- - disadvantages of need-kde remain; It always adds a >=kdelibs-x.y dependency, 
even though it may be implied by <=kde-base/kdegraphics-x.z. This behaviour 
can be overridden by setting NEED_KDE_DONT_ADD_KDELIBS_DEP, but it's hard to 
find an ebuild which is using it (not even the kde-base/* ebuilds). So the 
dependencies are often not "clean".


Solution B (my favorite):

Parsing simplified (w/o conditionals) ebuild R/DEPEND variables, which have to 
be provided by Portage, inside of kde.eclass in a function 
"set_dependencies()" that has to be executed, before Portage evaluates eclass 
R/DEPEND variables.

advantages:
- - no extra NEED_KDE varible needed
- - all disadvantages of solution A do not apply

disadvantages:
- - need simplified ebuild variables provided by portage
- - need another function provided by portage


Both solutions are simply backwards compatible by setting a flag, if need-kde 
is called.


Attachments:
- - modified kde{,functions}2.eclass which implement solution A, only renamed to 
make sure not to interfere with the eclasses in cvs
- - eclasses.diff - for your convenience ;)
- - knemo-0.2.0.ebuild, which makes use of the change
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBCuZEVwbzmvGLSW8RAo6+AKCeB3VxVyQB9hltzYnqM9m+5UmLNgCcCpMW
y9Hc9ddzrmkchlemZGZu/rk=
=79gS
-----END PGP SIGNATURE-----

[-- Attachment #2: eclasses.diff --]
[-- Type: text/x-diff, Size: 1600 bytes --]

--- /usr/portage/eclass/kde-functions.eclass	2004-06-25 03:13:00.000000000 +0200
+++ kde-functions2.eclass	2004-07-31 02:06:24.000000000 +0200
@@ -10,6 +10,9 @@
 ECLASS=kde-functions
 INHERITED="$INHERITED $ECLASS"
 # convinience functions for requesting autotools versions
+
+NEED_CALLED=0
+
 need-automake() {
 
 	debug-print-function $FUNCNAME $*
@@ -50,7 +53,8 @@
 # ---------------------------------------------------------------
 
 need-kde() {
-
+	# set this variable for backwards compatibility
+	NEED_CALLED=1
 	debug-print-function $FUNCNAME $*
 	KDEVER="$1"
 
@@ -207,7 +211,7 @@
 }
 
 need-qt() {
-
+	NEED_CALLED=1
 	debug-print-function $FUNCNAME $*
 	QTVER="$1"
 
--- /usr/portage/eclass/kde.eclass	2004-07-27 18:12:06.000000000 +0200
+++ kde2.eclass	2004-07-31 02:11:04.000000000 +0200
@@ -7,7 +7,7 @@
 # Revisions Caleb Tennis <caleb@gentoo.org>
 # The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.
 
-inherit base kde-functions
+inherit base kde-functions2
 ECLASS=kde
 INHERITED="$INHERITED $ECLASS"
 DESCRIPTION="Based on the $ECLASS eclass"
@@ -26,6 +26,25 @@
 # overridden in other places like kde-dist, kde-source and some individual ebuilds
 SLOT="0"
 
+
+# Solution A
+if [ ${NEED_CALLED} == 0 ] ; then 
+		need-kde ${NEED_KDE}
+fi
+
+# Solution B (can't be written without changes in portage)
+
+#kde_set_dependencies()() {
+#	resolve_kde_ver() {
+#	#	local PREFIX_OPS="~ < > <= => = ! !="
+#	#	
+#	#}
+#	if [ ${NEED_CALLED} == 0 ] ; then 
+#		do some parsing
+#	fi
+#	
+#}
+
 kde_src_unpack() {
 
 	debug-print-function $FUNCNAME $*

[-- Attachment #3: kde2.eclass --]
[-- Type: text/plain, Size: 5498 bytes --]

# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.101 2004/07/27 15:52:25 caleb Exp $
#
# Author Dan Armak <danarmak@gentoo.org>
#
# Revisions Caleb Tennis <caleb@gentoo.org>
# The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.

inherit base kde-functions2
ECLASS=kde
INHERITED="$INHERITED $ECLASS"
DESCRIPTION="Based on the $ECLASS eclass"
HOMEPAGE="http://www.kde.org/"
IUSE="${IUSE} debug arts"

DEPEND=">=sys-devel/automake-1.7.0
	sys-devel/autoconf
	sys-devel/make
	dev-util/pkgconfig
	dev-lang/perl
	~kde-base/kde-env-3"

RDEPEND="~kde-base/kde-env-3"

# overridden in other places like kde-dist, kde-source and some individual ebuilds
SLOT="0"


# Solution A
if [ ${NEED_CALLED} == 0 ] ; then 
		need-kde ${NEED_KDE}
fi

# Solution B (can't be written without changes in portage)

#kde_set_dependencies()() {
#	resolve_kde_ver() {
#	#	local PREFIX_OPS="~ < > <= => = ! !="
#	#	
#	#}
#	if [ ${NEED_CALLED} == 0 ] ; then 
#		do some parsing
#	fi
#	
#}

kde_src_unpack() {

	debug-print-function $FUNCNAME $*
	
	# call base_src_unpack, which implements most of the functionality and has sections,
	# unlike this function. The change from base_src_unpack to kde_src_unpack is thus
	# wholly transparent for ebuilds.
	base_src_unpack $*
	
	# kde-specific stuff stars here
	
	# fix the 'languageChange undeclared' bug group: touch all .ui files, so that the
	# makefile regenerate any .cpp and .h files depending on them.
	cd $S
	debug-print "$FUNCNAME: Searching for .ui files in $PWD"
	UIFILES="`find . -name '*.ui' -print`"
	debug-print "$FUNCNAME: .ui files found:"
	debug-print "$UIFILES"
	# done in two stages, because touch doens't have a silent/force mode
	if [ -n "$UIFILES" ]; then
		debug-print "$FUNCNAME: touching .ui files..."
		touch $UIFILES
	fi

	# shorthand for removing specified subdirectories fom the build process
	[ -n "$KDE_REMOVE_DIR" ] && kde_remove_dir $KDE_REMOVE_DIR

}

kde_src_compile() {

	debug-print-function $FUNCNAME $*
	[ -z "$1" ] && kde_src_compile all

	cd ${S}
	export kde_widgetdir="$KDEDIR/lib/kde3/plugins/designer"

	# fix the sandbox errors "can't writ to .kde or .qt" problems.
	# this is a fake homedir that is writeable under the sandbox, so that the build process
	# can do anything it wants with it.
	REALHOME="$HOME"
	mkdir -p $T/fakehome/.kde
	mkdir -p $T/fakehome/.qt
	export HOME="$T/fakehome"
	addwrite "${QTDIR}/etc/settings"
	# things that should access the real homedir
	[ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/"	
	[ -n "$UNSERMAKE" ] && addwrite "/usr/kde/unsermake"
	
	while [ "$1" ]; do

		case $1 in
			myconf)
				debug-print-section myconf
				myconf="$myconf --host=${CHOST} --prefix=${PREFIX} --with-x --enable-mitshm --with-xinerama --with-qt-dir=${QTDIR} --enable-mt"
				# calculate dependencies separately from compiling, enables ccache to work on kde compiles
				[ -z "$UNSERMAKE" ] && myconf="$myconf --disable-dependency-tracking"
				if use debug ; then
					myconf="$myconf --enable-debug=full --with-debug"
				else
					myconf="$myconf --disable-debug --without-debug"
				fi
				[ "$KDEMINORVER" -ge 3 ] && myconf="$myconf `use_with arts`"
				debug-print "$FUNCNAME: myconf: set to ${myconf}"
				;;
			configure)
				debug-print-section configure
				debug-print "$FUNCNAME::configure: myconf=$myconf"

				# rebuild configure script, etc
				# This can happen with e.g. a cvs snapshot			
				if [ ! -f "./configure" ] || [ -n "$UNSERMAKE" ]; then
					for x in Makefile.cvs admin/Makefile.common; do
						if [ -f "$x" ] && [ -z "$makefile" ]; then makefile="$x"; fi
					done
					if [ -f "$makefile" ]; then
						debug-print "$FUNCNAME: configure: generating configure script, running make -f $makefile"
						make -f $makefile
					fi
					[ -f "./configure" ] || die "no configure script found, generation unsuccessful"
				fi

				export PATH="${KDEDIR}/bin:${PATH}"
				
				# configure doesn't need to know about the other KDEs installed.
				# in fact, if it does, it sometimes tries to use the wrong dcopidl, etc.
				# due to the messed up way configure searches for things
				export KDEDIRS="${PREFIX}:${KDEDIR}"

				cd $S
				./configure ${myconf} || die "died running ./configure, $FUNCNAME:configure"
				# Seems ./configure add -O2 by default but hppa don't want that but we need -ffunction-sections
				if [ "${ARCH}" = "hppa" ]
				then
					einfo Fixating Makefiles
					find ${S} -name Makefile | while read a; do sed -e s/-O2/-ffunction-sections/ -i "${a}" ; done
				fi
				;;
			make)
				export PATH="${KDEDIR}/bin:${PATH}"
				debug-print-section make
				emake || die "died running emake, $FUNCNAME:make"
				;;
			all)
				debug-print-section all
				kde_src_compile myconf configure make
				;;
		esac

	shift
	done

}

kde_src_install() {

	debug-print-function $FUNCNAME $*
	[ -z "$1" ] && kde_src_install all

	cd ${S}

	while [ "$1" ]; do

		case $1 in
			make)
				debug-print-section make
				make install DESTDIR=${D} destdir=${D} || die "died running make install, $FUNCNAME:make"
				;;
	    	dodoc)
				debug-print-section dodoc
				for doc in AUTHORS ChangeLog* README* COPYING NEWS TODO; do
					[ -s "$doc" ] && dodoc $doc
				done
				;;
	    	all)
				debug-print-section all
				kde_src_install make dodoc
				;;
		esac

	shift
	done

}

EXPORT_FUNCTIONS src_unpack src_compile src_install

[-- Attachment #4: kde-functions2.eclass --]
[-- Type: text/plain, Size: 11489 bytes --]

# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.71 2004/06/25 00:39:48 vapier Exp $
#
# Author Dan Armak <danarmak@gentoo.org>
#
# This contains everything except things that modify ebuild variables
# and functions (e.g. $P, src_compile() etc.)

ECLASS=kde-functions
INHERITED="$INHERITED $ECLASS"
# convinience functions for requesting autotools versions

NEED_CALLED=0

need-automake() {

	debug-print-function $FUNCNAME $*

	unset WANT_AUTOMAKE_1_4
	unset WANT_AUTOMAKE_1_5
	unset WANT_AUTOMAKE_1_6
	unset WANT_AUTOMAKE

	case $1 in
		1.4)	export WANT_AUTOMAKE_1_4=1;;
		1.5)	export WANT_AUTOMAKE_1_5=1;;
		1.6)	export WANT_AUTOMAKE_1_6=1;;
		1.7)	export WANT_AUTOMAKE='1.7';;
		*)		echo "!!! $FUNCNAME: Error: unrecognized automake version $1 requested";;
	esac

}

need-autoconf() {

	debug-print-function $FUNCNAME $*

	unset WANT_AUTOCONF_2_1
	unset WANT_AUTOCONF_2_5

	case $1 in
		2.1)	export WANT_AUTOCONF_2_1=1;;
		2.5)	export WANT_AUTOCONF_2_5=1;;
		*)		echo "!!! $FUNCNAME: Error: unrecognized autoconf version $1 requested";;
	esac

}


# ---------------------------------------------------------------
# kde/qt directory management etc. functions, was kde-dirs.ebuild
# ---------------------------------------------------------------

need-kde() {
	# set this variable for backwards compatibility
	NEED_CALLED=1
	debug-print-function $FUNCNAME $*
	KDEVER="$1"

	# determine install locations
	set-kdedir $KDEVER

	# ask for autotools
	case "$KDEVER" in
		3.1.[234])	# Newer 3.1.x versions are built with automake 1.7, and have errors when using 1.6
			need-automake 1.7
			need-autoconf 2.5
			;;
		3.1*)	# actually, newer 3.0.x stuff uses this too, but i want to make a clean switch
			need-automake 1.6
			need-autoconf 2.5
			;;
		3.2*)
			need-autoconf 2.5
			need-automake 1.7
			;;
		3*)	# a generic call for need-kde 3 - automake 1.4 works most often
			need-autoconf 2.5
			need-automake 1.4
			;;
		5*)
			need-autoconf 2.5
			need-automake 1.7
			;;
	esac

	# Things that need more special handling can just set NEED_KDE_DONT_ADD_KDELIBS_DEP
	# and add one of their own manually.
	if [ -n "$NEED_KDE_DONT_ADD_KDELIBS_DEP" ]; then
		# do nothing
		debug-print "$FUNCNAME: NEED_KDE_DONT_ADD_KDELIBS_DEP set, complying with request"
	elif [ "${INHERITED//kde-dist}" != "$INHERITED" ]; then
		# if we're a kde-base package, we need an exact version of kdelibs
		# to compile correctly.
		# all kinds of special cases live here.
		# goes to show this code is awfully inflexible, i guess.
		# maybe i should look at relocating it...

		RDEPEND="${RDEPEND} ~kde-base/kdelibs-${KDEVER}"
		DEPEND="${DEPEND} ~kde-base/kdelibs-${KDEVER}"

	else
		# everything else only needs a minimum version
		min-kde-ver $KDEVER
		RDEPEND="${RDEPEND} >=kde-base/kdelibs-${selected_version}"
		DEPEND="${DEPEND} >=kde-base/kdelibs-${selected_version}"
	fi

	qtver-from-kdever $KDEVER
	need-qt $selected_version

	if [ -n "$KDEBASE" ]; then
		SLOT="$KDEMAJORVER.$KDEMINORVER"
	else
		SLOT="0"
	fi
}

set-kdedir() {

	debug-print-function $FUNCNAME $*


	# set install location:
	# - 3rd party apps go into /usr, and have SLOT="0".
	# - kde-base category ebuilds go into /usr/kde/$MAJORVER.$MINORVER,
	# and have SLOT="$MAJORVER.$MINORVER".
	# - kde-base category cvs ebuilds have major version 5 and go into
	# /usr/kde/cvs; they have SLOT="cvs".
	# - Backward-compatibility exceptions: all kde2 packages (kde-base or otherwise)
	# go into /usr/kde/2. kde 3.0.x goes into /usr/kde/3 (and not 3.0).
	# - kde-base category ebuilds always depend on their exact matching version of
	# kdelibs and link against it. Other ebuilds link aginst the latest one found.
	# - This function exports $PREFIX (location to install to) and $KDEDIR
	# (location of kdelibs to link against) for all ebuilds.
	#
	# -- Overrides - deprecated but working for now: --
	# - If $KDEPREFIX is defined (in the profile or env), it overrides everything
	# and both base and 3rd party kde stuff goes in there.
	# - If $KDELIBSDIR is defined, the kdelibs installed in that location will be
	# used, even by kde-base packages.

	# get version elements
	IFSBACKUP="$IFS"
	IFS=".-_"
	for x in $1; do
		if [ -z "$KDEMAJORVER" ]; then KDEMAJORVER=$x
		else if [ -z "$KDEMINORVER" ]; then KDEMINORVER=$x
		else if [ -z "$KDEREVISION" ]; then KDEREVISION=$x
		fi; fi; fi
	done
	[ -z "$KDEMINORVER" ] && KDEMINORVER="0"
	[ -z "$KDEREVISION" ] && KDEREVISION="0"
	IFS="$IFSBACKUP"
	debug-print "$FUNCNAME: version breakup: KDEMAJORVER=$KDEMAJORVER KDEMINORVER=$KDEMINORVER KDEREVISION=$KDEREVISION"

	# install prefix
	if [ -n "$KDEPREFIX" ]; then
		export PREFIX="$KDEPREFIX"
	elif [ "$KDEMAJORVER" == "2" ]; then
		export PREFIX="/usr/kde/2"
	else
		if [ -z "$KDEBASE" ]; then
			export PREFIX="/usr"
		else
			case $KDEMAJORVER.$KDEMINORVER in
				3.0) export PREFIX="/usr/kde/3";;
				3.1) export PREFIX="/usr/kde/3.1";;
				3.2) export PREFIX="/usr/kde/3.2";;
				3.3) export PREFIX="/usr/kde/3.3";;
				5.0) export PREFIX="/usr/kde/cvs";;
			esac
		fi
	fi

	# kdelibs location
	if [ -n "$KDELIBSDIR" ]; then
		export KDEDIR="$KDELIBSDIR"
	elif [ "$KDEMAJORVER" == "2" ]; then
		export KDEDIR="/usr/kde/2"
	else
		if [ -z "$KDEBASE" ]; then
			# find the latest kdelibs installed
			for x in /usr/kde/{cvs,3.3,3.2,3.1,3.0,3} $PREFIX $KDE3LIBSDIR $KDELIBSDIR $KDE3DIR $KDEDIR /usr/kde/*; do
				if [ -f "${x}/include/kwin.h" ]; then
					debug-print found
					export KDEDIR="$x"
					break
				fi
			done
		else
			# kde-base ebuilds msut always use the exact version of kdelibs they came with
			case $KDEMAJORVER.$KDEMINORVER in
				3.0) export KDEDIR="/usr/kde/3";;
				3.1) export KDEDIR="/usr/kde/3.1";;
				3.2) export KDEDIR="/usr/kde/3.2";;
				3.3) export KDEDIR="/usr/kde/3.3";;
				5.0) export KDEDIR="/usr/kde/cvs";;
			esac
		fi
	fi


	# check that we've set everything
	[ -z "$PREFIX" ] && debug-print "$FUNCNAME: ERROR: could not set install prefix"
	[ -z "$KDEDIR" ] && debug-print "$FUNCNAME: ERROR: couldn't set kdelibs location"

	debug-print "$FUNCNAME: Will use the kdelibs installed in $KDEDIR, and install into $PREFIX."

}

need-qt() {
	NEED_CALLED=1
	debug-print-function $FUNCNAME $*
	QTVER="$1"

	QT=qt

	case $QTVER in
	    2*)
			RDEPEND="${RDEPEND} =x11-libs/${QT}-2.3*"
			DEPEND="${DEPEND} =x11-libs/${QT}-2.3*"
			;;
	    3*)
			RDEPEND="${RDEPEND} >=x11-libs/${QT}-${QTVER}"
			DEPEND="${DEPEND} >=x11-libs/${QT}-${QTVER}"
			;;
	    *)	echo "!!! error: $FUNCNAME() called with invalid parameter: \"$QTVER\", please report bug" && exit 1;;
	esac

	set-qtdir $QTVER

}

set-qtdir() {

	debug-print-function $FUNCNAME $*


	# select 1st element in dot-separated string
	IFSBACKUP=$IFS
	IFS="."
	QTMAJORVER=""
	for x in $1; do
		[ -z "$QTMAJORVER" ] && QTMAJORVER=$x
	done
	IFS=$IFSBACKUP

	export QTDIR="/usr/qt/$QTMAJORVER"

	# i'm putting this here so that the maximum amount of qt/kde apps gets it -- danarmak
	# if $QTDIR/etc/settings/qtrc file exists, the qt build tools try to create
	# a .qtrc.lock file in that directory. It's easiest to allow them to do so.
	[ -d "$QTDIR/etc/settings" ] && addwrite "$QTDIR/etc/settings"
	addpredict "$QTDIR/etc/settings"
}

# returns minimal qt version needed for specified kde version
qtver-from-kdever() {

	debug-print-function $FUNCNAME $*

	local ver

	case $1 in
		2*)	ver=2.3.1;;
		3.1*)	ver=3.1;;
		3.2*)	ver=3.2;;
		3.3*)	ver=3.3;;
		3*)	ver=3.0.5;;
		5)	ver=3.2;; # cvs version
		*)	echo "!!! error: $FUNCNAME called with invalid parameter: \"$1\", please report bug" && exit 1;;
	esac

	selected_version="$ver"

}

# compat - not used anymore, but old ebuilds that once used this fail if it's not present
# when they are unmerged
need-kdelibs() {
	echo "WARNING: need-kdelibs() called, where need-kde() is correct.
If this happens at the unmerging of an old ebuild, disregard; otherwise report."
	need-kde $*
}

min-kde-ver() {

	debug-print-function $FUNCNAME $*

	case $1 in
		2*)			selected_version="2.2.2";;
		3.0*)			selected_version="3.0";;
		3.1*)			selected_version="3.1";;
		3.2*)			selected_version="3.2";;
		3*)			selected_version="3.0";;
		5)			selected_version="5";;
		*)			echo "!!! error: $FUNCNAME() called with invalid parameter: \"$1\", please report bug" && exit 1;;
	esac

}

# This function should fix the broken automake detection in the detect-autoconf file
# This is only in use in arts-1.1.5.
kde_fix_autodetect() {
	cd ${S}/admin
	patch -p0 <<EOF
--- arts-1.1.3/admin/detect-autoconf.sh	2003-05-07 13:50:14.000000000 +0200
+++ detect-autoconf.sh	2003-07-29 12:21:39.000000000 +0200
@@ -52,7 +52,10 @@
 checkAutomakeAclocal ()
 {
   if test -z "\$UNSERMAKE"; then
-    if test -x "\`\$WHICH automake-1.5\`" ; then
+    if test -x "\`\$WHICH automake\`" ; then
+      AUTOMAKE="\`\$WHICH automake\`"
+      ACLOCAL="\`\$WHICH aclocal\`"
+    elif test -x "\`\$WHICH automake-1.5\`" ; then
       AUTOMAKE="\`\$WHICH automake-1.5\`"
       ACLOCAL="\`\$WHICH aclocal-1.5\`"
     elif test -x "\`\$WHICH automake-1.6\`" ; then
EOF
	cd -
}

# generic makefile sed for sandbox compatibility. for some reason when the kde makefiles (of many packages
# and versions) try to chown root and chmod 4755 some binaries (after installing, target isntall-exec-local),
# they do it to the files in $(bindir), not $(DESTDIR)/$(bindir). Most of these have been fixed in latest cvs
# but a few remain here and there.
# Pass a list of dirs to sed, Makefile.{am,in} in these dirs will be sed'ed.
# This should be harmless if the makefile doesn't need fixing.
kde_sandbox_patch() {

	debug-print-function $FUNCNAME $*

	while [ -n "$1" ]; do
	# can't use dosed, because it only works for things in ${D}, not ${S}
	cd $1
	for x in Makefile.am Makefile.in Makefile
	do
		if [ -f "$x" ]; then
			echo Running sed on $x
			cp $x ${x}.orig
			sed -e 's: $(bindir): $(DESTDIR)/$(bindir):g' -e 's: $(kde_datadir): $(DESTDIR)/$(kde_datadir):g' -e 's: $(TIMID_DIR): $(DESTDIR)/$(TIMID_DIR):g' ${x}.orig > ${x}
			rm ${x}.orig
		fi
	done
	shift
	done

}

# remove an optimization flag from a specific subdirectory's makefiles.
# currently kdebase and koffice use it to compile certain subdirs without
# -fomit-frame-pointer which breaks some things.
# Parameters:
# $1: subdirectory
# $2: flag to remove
kde_remove_flag() {

	debug-print-function $FUNCNAME $*

	cd ${S}/${1} || die
	[ -n "$2" ] || die

	cp Makefile Makefile.orig
	sed -e "/CFLAGS/ s/${2}//g
/CXXFLAGS/ s/${2}//g" Makefile.orig > Makefile

	cd $OLDPWD

}

# disable a subdir of a module from building.
# used by kdemultimedia et al
# autorun from kde_src_compile:configure if $KDE_REMOVE_DIR is set;
# $KDE_REMOVE_DIR is then passed as parameter
kde_remove_dir(){

	debug-print-function $FUNCNAME $*

	cd ${S}

	while [ -n "$1" ]; do
		for dir in $1; do

			debug-print "$FUNCNAME: removing subdirectory $dir"

			rm -rf $dir

			if [ -f subdirs ]; then
				mv subdirs subdirs.orig
				grep -v $dir subdirs.orig > subdirs
			fi

			rm -f configure configure.in

			export DO_NOT_COMPILE="$DO_NOT_COMPILE $dir"

		done
	shift
	done

}


# is this a kde-base ebuid?
case $PN in kde-i18n|arts|kdeaccessibility|kdeaddons|kdeadmin|kdeartwork|kdebase|kdebindings|kdeedu|kdegames|kdegraphics|kdelibs|kdemultimedia|kdenetwork|kdepim|kdesdk|kdetoys|kdeutils|kdelibs-apidocs)
		debug-print "$ECLASS: KDEBASE ebuild recognized"
		export KDEBASE="true"
		;;
esac


[-- Attachment #5: knemo-0.2.0.ebuild --]
[-- Type: text/plain, Size: 651 bytes --]

# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

NEED_KDE=3.2

inherit kde2

DESCRIPTION="KNemo - the KDE Network Monitor"
SRC_URI="http://kde-apps.org/content/files/12956-${P}.tar.bz2"
HOMEPAGE="http://kde-apps.org/content/show.php?content=12956"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc"
IUSE="wifi"

RDEPEND="sys-apps/net-tools
	wifi? ( net-wireless/wireless-tools )"
#need-kde 3.2
pkg_postinst() {
	einfo ""
	einfo "KNemo is not an executable but an KDED service. Therefore it has to"
	einfo "be started using Control Center/KDE Components/Service Manager."
	einfo ""
}

[-- Attachment #6: Type: text/plain, Size: 37 bytes --]

--
gentoo-dev@gentoo.org mailing list

             reply	other threads:[~2004-07-31  0:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-31  0:22 Carsten Lohrke [this message]
2004-08-06 10:52 ` [gentoo-dev] problems with need-kde/qt and possible solutions Paul de Vrieze
2004-08-10 23:34   ` Carsten Lohrke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200407310222.28132.carlo@gentoo.org \
    --to=carlo@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=kde@gentoo.org \
    --cc=portage@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox