# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils multilib subversion toolchain-funcs IS_SVN="YES" RESTRICT="nomirror" DESCRIPTION="Fast Light Toolkit - A C++ user inferface toolkit for X and OpenGL" HOMEPAGE="http://www.fltk.org" PV_MAJOR=${PV/.*/} PV_MINOR=${PV#${PV_MAJOR}.} PV_MINOR=${PV_MINOR/.*/} PV_MICRO=${PV#${PV_MAJOR}.${PV_MINOR}.} PV_MICRO=${PV_MICRO/.*/} PRE_REL=${PV/*_pre/} IS_PRE_REL=${PV/*_pre*/YES} if [[ ${IS_PRE_REL} != "YES" ]] then IS_PRE_REL="NO" fi if [[ ${IS_SVN} != "YES" ]] then IS_SVN="NO" fi if [[ ${IS_SVN} == "YES" ]] then ESVN_BOOTSTARP="" case "${PV_MAJOR}.${PV_MINOR}" in 2.0) ESVN_REPO_URI="http://svn.easysw.com/public/${PN}/${PN}/trunk" ESVN_PROJECT="${PN}" ;; 1.1) ESVN_REPO_URI="http://svn/easysw.com/public/${PN}/${PN}/branches/branch-1.1" ESVN_PROJECT="${PN}-1.1" ;; *) # FIXME: # What should I set ESVN_REPO_URI and ESVN_PROJECT in this case? # ESVN_REPO_URI="?" # ESVN_PROJECT="?" ;; esac fi if [[ ${IS_SVN} == "NO" ]] then if [[ ${IS_PRE_REL} == "YES" ]] then SRC_URI="http://ftp.easysw.com/pub/fltk/snapshots/${PN}-${PV_MAJOR}.${PV_MINOR}.x-r${PRE_REL}.tar.bz2" else SRC_URI="http://ftp.easysw.com/pub/fltk/snapshots/${PN}-${PV_MAJOR}.${PV_MINOR}.${PV_MICRO}.tar.bz2" fi fi LICENSE="FLTK LGPL-2" SLOT="${PV_MAJOR}.${PV_MINOR}" KEYWORDS="~ppc" IUSE="noxft opengl debug cairo x11multithreads xinerama" INCDIR=/usr/include/fltk-${SLOT} LIBDIR=/usr/$(get_libdir)/fltk-${SLOT} HTML_DOCDIR=/usr/share/doc/${PF}/html DEPEND="|| ( ( x11-libs/libXext x11-libs/libICE x11-libs/libSM x11-libs/libXt x11-proto/xextproto ) virtual/x11 ) !noxft? ( virtual/xft cairo? ( x11-libs/cairo ) ) media-libs/libpng media-libs/jpeg sys-libs/zlib opengl? ( virtual/opengl )" RDEPEND="${DEPEND}" if [[ ${IS_PRE_REL} == "YES" ]] then S="${WORKDIR}/${PN}-${PV_MAJOR}.${PV_MINOR}.x-r${PRE_REL}" fi src_unpack() { if [[ ${IS_SVN} == "YES" ]] then subversion_src_unpack einfo "Generating configure script by autoconf..." WANT_AUTOCONF=2.5 autoconf || die "autoconf failed. :(" else unpack ${A} fi # cd ${S} # epatch "${FILESDIR}/${PN}-${PV}-fix-blah.patch" \ # || die "epatch for fix blah failed. :(" } src_compile() { local myconf="" myconf="--enable-shared --enable-static \ --enable-threads \ --enable-jpeg \ --enable-zlib \ --enable-png \ --enable-xdbe \ --enable-exeptions \ --enable-rtti --with-x" use debug && myconf="${myconf} --enable-debug" use noxft && myconf="${myconf} --disable-xft" econf \ --includedir=${INCDIR} --libdir=${LIBDIR} \ $(use_enable opengl gl) \ $(use_enable cairo) \ $(use_enable x11multithreads) \ $(use_enable xinerama) \ ${myconf} \ || die "econf failed. :(" emake || die "emake failed. :(" } src_install() { make DESTDIR="${D}" \ incdir="${D}/${INCDIR}" \ libdir="${D}/${LIBDIR}" \ install \ || die "install failed. :(" $(tc-getRANLIB) "${D}/*.a" dodoc CHANGES COPYING CREDITS TODO dodoc README{,.bc5,.cygwin,.mingw32,.os2,.unix,.windows} echo "LDPATH=${LIBDIR}" > 99${PN}-${SLOT} echo "FLTK_DOCDIR=${HTML_DOCDIR}" >> 99${PN}-${SLOT} insinto /etc/env.d doins 99${PN}-${SLOT} dodir ${HTML_DOCDIR} mv "${D}/usr/share/doc/${PN}/*" "${HTML_DOCDIR}" rmdir "${D}/usr/share/doc/${PN}" #rm -rf "${D}/usr/share/man/cat{1,3}" # Un-needed? :9 } pkg_postinst() { ewarn "the xft USE flag has been changed to noxft. this was because most" ewarn "users want xft, but if you do not, be sure to change the flag" if [[ ${IS_SVN} == "YES" ]] then ewarn "This ebuild install ${P} from subversion repository," ewarn "so many bugs are, I guess." ewarn "Please, becarefull and poke upstream with your feedbacks, thanks. :)" fi }