NAME=kdegraphics
VERSION=${VERSION:-3.5.6}
SOURCE=$MIRROR_KDE/stable/$VERSION/src/kdegraphics-$VERSION.tar.bz2
BUILD=${BUILD:-1}
OPTIMIZE=${OPTIMIZE:-"-Os -pipe"}
ROOT_REQUIRED=0
PREFIXTYPE=kde

build() {
	_explode 0
	cd kdegraphics*
	[ ! -e configure ] && sh admin/cvs.sh dist
	_configure \
		--with-xinerama \
		--enable-multithreaded-kpdf \
		--disable-kpdf-drm \
		--disable-debug \
		--enable-gcc-hidden-visibility

	# GCC 3.x.x creates incorrect code with -Os for kpdf. The exact
	# problem seems to be in kpdf/xpdf/splash/Splash.cc but best to
	# compile all of kpdf with -O2.
	# http://bugs.kde.org/show_bug.cgi?id=117458
	# GCC 4 seems to work fine.
#	find kpdf/xpdf -name Makefile | xargs -- sed -i 's| -Os| -O2|g'

	make -j$MAKEJOBS
	make install DESTDIR=$PKG
	_doc 0 kdegraphics-$VERSION  AUTHORS COPYING* README kdegraphics.lsm
	_chfix
}
