# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="GTK+ version of wxWidgets, a cross-platform C++ GUI toolkit" HOMEPAGE="http://wxwidgets.org/" inherit eutils versionator flag-o-matic BASE_PV="$(get_version_component_range 1-3)" BASE_P="${PN}-${BASE_PV}" SRC_URI="mirror://sourceforge/wxpython/wxPython-src-${PV}.tar.bz2 doc? ( mirror://sourceforge/wxwindows/wxWidgets-${BASE_PV}-HTML.tar.gz )" KEYWORDS="~amd64 ~x86" IUSE="X doc debug gnome joystick odbc opengl sdl unicode" DEPEND=" dev-libs/expat odbc? ( dev-db/unixODBC ) sdl? ( media-libs/libsdl ) X? ( >=x11-libs/gtk+-2.0 >=dev-libs/glib-2.0 media-libs/jpeg media-libs/tiff x11-libs/libSM x11-libs/libXinerama x11-libs/libXxf86vm gnome? ( gnome-base/libgnomeprintui ) opengl? ( virtual/opengl ) )" SLOT="2.6" LICENSE="wxWinLL-3 GPL-2 odbc? ( LGPL-2 ) doc? ( wxWinFDL )" S="${WORKDIR}/wxPython-src-${PV}" HTML_S="${WORKDIR}/wxWidgets-${BASE_PV}" pkg_setup() { # TODO: Every build we do requires ~1.0GiB of disk space. # We should warn the user to make sure they have enough free room in # ${PORTAGE_TMPDIR}. I just ran out using a 5.0GiB /var partition # with a 1.5GiB ccache. # # FYI when you run out of room the build just dies; there is no error # message that hints at what the problem might be. If you happen to get # a bug report where the compile inexplicably fails at different # points every time, this could be the cause. : } src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${BASE_P}-versionated.patch epatch "${FILESDIR}"/${BASE_P}-unicode-odbc.patch epatch "${FILESDIR}"/${P}-wxrc_build_fix.patch epatch "${FILESDIR}"/${P}-wxrc_link_fix.patch epatch "${FILESDIR}"/${P}-dialog_focus.patch epatch "${FILESDIR}"/${P}-slider_linesize.patch # Reverse apply patch in wxPython tarball that breaks ABI EPATCH_SINGLE_MSG="Reversing listctrl-ongetitemcolumnimage.patch ..." \ EPATCH_OPTS="-R" epatch "${S}"/patches/listctrl-ongetitemcolumnimage.patch # wxBase has an automagic sdl dependency. short circuit it here. # http://bugs.gentoo.org/show_bug.cgi?id=91574 use sdl || sed -i -e 's:$wxUSE_LIBSDL" != "no":$wxUSE_LIBSDL" = "yes":' configure } src_compile() { local myconf append-flags -fno-strict-aliasing # X independent options myconf="--enable-shared --disable-optimise --disable-rpath --enable-compat24 --with-regex=builtin --with-zlib=sys --with-expat $(use_enable joystick) $(use_with sdl) $(use_with odbc)" # wxGTK only use X && \ myconf="${myconf} --enable-gui --with-libpng --with-libxpm --with-libjpeg --with-libtiff $(use_enable opengl) $(use_with opengl) $(use_with gnome gnomeprint)" # wxBase only use X || \ myconf="${myconf} --disable-gui" # Here is our build logic. # # USE flags that trigger multiple builds are currently debug and unicode. # # USE="" ansi # USE="debug" ansi ansi-debug # USE="unicode" ansi unicode # USE="debug unicode" ansi ansi-debug unicode unicode-debug # # total number of builds = 2^flags # (ie. Adding another flag would require eight different builds.) build_wx ansi # (we always build ansi) use debug && build_wx ansi-debug use unicode && build_wx unicode use debug && use unicode && build_wx unicode-debug } src_install() { install_wx ansi use debug && install_wx ansi-debug use unicode && install_wx unicode use debug && use unicode && install_wx unicode-debug if use doc; then # FIXME Yes this is freekin lazy. Will be fixed before commited. mkdir -p "${D}"usr/share/doc/${PF}/ cp -R "${S}"/docs/* "${D}"usr/share/doc/${PF}/ fi # I don't know what this is, but it's causing a collision. rm ${D}/usr/share/locale/it/LC_MESSAGES/wxmsw.mo } build_wx() { local build_wx_conf case "$1" in ansi) build_wx_conf="${build_wx_conf} --disable-unicode" ;; ansi-debug) build_wx_conf="${build_wx_conf} --disable-unicode --enable-debug_flag" ;; unicode) build_wx_conf="${build_wx_conf} --enable-unicode" ;; unicode-debug) build_wx_conf="${build_wx_conf} --enable-unicode --enable-debug_flag" ;; *) eerror "wxlib.class: build_wx called with invalid argument(s)." die "wxlib.class: build_wx called with invalid argument(s)." ;; esac mkdir -p build_$1 cd build_$1 ECONF_SOURCE="${S}" \ econf ${myconf} ${build_wx_conf} || die "Failed to configure $1." emake || die "Failed to make $1." if [[ -e contrib/src ]]; then cd contrib/src emake || die "Failed to make $1 contrib." fi cd "${S}" } install_wx() { if [[ -d build_$1 ]]; then cd build_$1 emake DESTDIR="${D}" install || die "Failed to install $1." if [[ -e contrib/src ]]; then cd contrib/src emake DESTDIR="${D}" install || die "Failed to install $1 contrib." fi else eerror "wxlib.eclass: install_wx called with invalid argument(s)." die "wxlib.class: build_wx called with invalid argument(s)." fi cd "${S}" }