diff options
author | Rob Cakebread <pythonhead@gentoo.org> | 2005-05-01 20:55:42 +0000 |
---|---|---|
committer | Rob Cakebread <pythonhead@gentoo.org> | 2005-05-01 20:55:42 +0000 |
commit | e7740c7df37dcb40271b53d0bd90d2ced92152b0 (patch) | |
tree | ee8b27745b0b2074df2ccc8be7fef5927df921d2 /eclass | |
parent | Version bump. (diff) | |
download | historical-e7740c7df37dcb40271b53d0bd90d2ced92152b0.tar.gz historical-e7740c7df37dcb40271b53d0bd90d2ced92152b0.tar.bz2 historical-e7740c7df37dcb40271b53d0bd90d2ced92152b0.zip |
New eclass for wx packages
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/wxlib.eclass | 139 | ||||
-rw-r--r-- | eclass/wxwidgets.eclass | 34 |
2 files changed, 160 insertions, 13 deletions
diff --git a/eclass/wxlib.eclass b/eclass/wxlib.eclass new file mode 100644 index 000000000000..0303b8c87ccb --- /dev/null +++ b/eclass/wxlib.eclass @@ -0,0 +1,139 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/wxlib.eclass,v 1.1 2005/05/01 20:55:42 pythonhead Exp $ + +# Author Diego Pettenò <flameeyes@gentoo.org> +# Maintained by wxwindows herd + +# This eclass is used by wxlib-based packages (wxGTK, wxMotif, wxBase, wxMac) to share code between +# them. + +inherit eutils gnuconfig + +ECLASS="wxlib" +INHERITED="${INHERITED} ${ECLASS}" + +IUSE="doc debug unicode dmalloc zlib" + +LICENSE="wxWinLL-3" + +# Note 1: Gettext is not runtime dependency even if nls? because wxWidgets +# has its own implementation of it +# Note 2: PCX support is enabled if the correct libraries are detected. +# There is no USE flag for this. +RDEPEND=" dmalloc? ( !amd64? ( !arm? ( !mips? ( dev-libs/dmalloc ) ) ) ) + zlib? ( sys-libs/zlib )" + +DEPEND="${RDEPEND} + sys-apps/sed" + +HOMEPAGE="http://www.wxwindows.org" +SRC_URI="mirror://sourceforge/wxwindows/wxWidgets-${PV}.tar.bz2 + doc? ( mirror://sourceforge/wxwindows/wxWidgets-${PV}-HTML.tar.gz )" +S=${WORKDIR}/wxWidgets-${PV} + +# Verify wxWidget-2.6 tarball still has this hardcoded: pythonhead aprl 24 2005 +# Removes hard-coded -O2 optimization from configure +wxlib_src_unpack() { + unpack ${A} + cd ${S} + sed -i "s/-O2//g" configure || die "sed configure failed" + gnuconfig_update +} + +# Configure a build. +# It takes three parameters; +# $1: prefix for the build directory (used for wxGTK which has two +# builds needed. +# $2: "unicode" if it must be build with else "" +# $3: all the extra parameters to pass to configure script +configure_build() { + export LANG='C' + + mkdir ${S}/$1_build + cd ${S}/$1_build + # odbc works with ansi only: + subconfigure $3 $(use_with odbc) || die "odbc does not work with unicode" + emake -j5 || die "emake failed" + #wxbase has no contrib: + if [[ -e contrib/src ]]; then + cd contrib/src + emake -j5 || die "emake contrib failed" + fi + + if [[ "$2" == "unicode" ]] && use unicode; then + mkdir ${S}/$1_build_unicode + cd ${S}/$1_build_unicode + subconfigure $3 --enable-unicode + emake -j5 || die "Unicode emake failed" + if [[ -e contrib/src ]]; then + cd contrib/src + emake -j5 || die "Unicode emake contrib failed" + fi + fi +} + +# This is a commodity function which calls configure script +# with the default parameters plus extra parameters. It's used +# as building the unicode version required redoing it. +# It takes all the params and pass them to the script +subconfigure() { + debug_conf="" + if use debug; then + debug_conf="--enable-debug --enable-debug_gdb" + debug_conf="${debug_conf} `use_with dmalloc`" + fi + ${S}/configure --enable-monolithic \ + --prefix=/usr \ + --infodir=/usr/share/info \ + --mandir=/usr/share/man \ + `use_with zlib` \ + ${debug_conf} \ + $* +} + +# Installs a build +# It takes only a parameter: the prefix for the build directory +# see configure_build function +install_build() { + cd ${S}/$1_build + einstall || die "Install failed" + cd contrib/src + einstall || die "Install contrib failed" + if [[ -e ${S}/$1_build_unicode ]]; then + cd ${S}/$1_build_unicode + einstall || die "Unicode install failed" + cd contrib/src + einstall || die "Unicode install contrib failed" + fi +} + +# To be called at the end of src_install to perform common cleanup tasks +wxlib_src_install() { + + # In 2.6 all wx-config*'s go in/usr/lib/wx/config not + # /usr/bin where 2.4 keeps theirs. + # Only install wx-config if 2.4 is not installed: + if [ -e "/usr/bin/wx-config" ]; then + if [ "$(/usr/bin/wx-config --release)" = "2.4" ]; then + rm ${D}/usr/bin/wx-config + fi + fi + + # Remove wxrc because SLOT'd versions will overwrite each other. + # There will be a /usr/bin/wxrc-2.6 installed: + rm ${D}/usr/bin/wxrc + + + if use doc; then + dohtml ${S}/contrib/docs/html/ogl/* + dohtml ${S}/docs/html/* + dodir /usr/share/doc/${PF}/demos + cp -R ${S}/demos/* ${D}/usr/share/doc/${PF}/demos/ + dodoc ${S}/*.txt + fi + +} + + +EXPORT_FUNCTIONS src_unpack src_install diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass index be0443036541..b548d997eab4 100644 --- a/eclass/wxwidgets.eclass +++ b/eclass/wxwidgets.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.5 2005/01/11 00:02:00 pythonhead Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.6 2005/05/01 20:55:42 pythonhead Exp $ # # Author Rob Cakebread <pythonhead@gentoo.org> @@ -9,12 +9,14 @@ # FUNCTIONS: # need-wxwidgets: -# Arguments: gtk, gtk2 or unicode +# Arguments: +# 2.4: gtk gtk2 unicode +# 2.6: gtk gtk2 gtk2-unicode base base-unicode mac mac-unicode # # # set-wxconfig # Arguments: (wxGTK 2.4) wxgtk, wxgtk2, or wxgtk2u -# Arguments: (wxGTK 2.5 and 2.6) gtk, gtk2, or unicode +# Arguments: (wxGTK 2.6) gtk-ansi gtk2-ansi gtk2-unicode base-ansi base-unicode mac-ansi mac-unicode # Note: Don't call this function directly from ebuilds ECLASS=wxwidgets @@ -22,13 +24,18 @@ INHERITED="$INHERITED $ECLASS" need-wxwidgets() { debug-print-function $FUNCNAME $* - #If you want to use wxGTK-2.5* export WX_GTK_VER in your ebuild: - if [ "${WX_GTK_VER}" = "2.5" ]; then + #If you want to use wxGTK-2.6* export WX_GTK_VER in your ebuild: + if [ "${WX_GTK_VER}" = "2.6" ]; then case $1 in gtk) set-wxconfig gtk-ansi;; gtk2) set-wxconfig gtk2-ansi;; - unicode) set-wxconfig gtk2-unicode;; - *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested" + gtk2-unicode) set-wxconfig gtk2-unicode;; + base) set-wxconfig base-ansi;; + base-unicode) set-wxconfig base-unicode;; + mac) set-wxconfig mac-ansi;; + mac-unicode) set-wxconfig mac-unicode;; + *) echo "!!! $FUNCNAME: Error: wxGTK was not comipled with $1." + echo "!!! Adjust your USE flags or re-emerge wxGTK with version you want." exit 1;; esac @@ -38,7 +45,8 @@ need-wxwidgets() { gtk) set-wxconfig wxgtk;; gtk2) set-wxconfig wxgtk2;; unicode) set-wxconfig wxgtk2u;; - *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested" + *) echo "!!! $FUNCNAME: Error: wxGTK was not comipled with $1." + echo "!!! Adjust your USE flags or re-emerge wxGTK with version you want." exit 1;; esac fi @@ -49,7 +57,7 @@ set-wxconfig() { debug-print-function $FUNCNAME $* - if [ "${WX_GTK_VER}" = "2.5" ] ; then + if [ "${WX_GTK_VER}" = "2.6" ] ; then wxconfig_prefix="/usr/lib/wx/config" wxconfig_name="${1}-release-${WX_GTK_VER}" wxconfig="${wxconfig_prefix}/${wxconfig_name}" @@ -79,10 +87,10 @@ set-wxconfig() { echo "!!! $FUNCNAME: ${wxconfig} not found" echo "!!! $FUNCNAME: ${wxconfig_debug} not found" case $1 in - wxgtk) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; - wxgtkd) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; - gtk-ansi) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; - gtkd-ansi) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; + wxgtk) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; + wxgtkd) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; + gtk-ansi) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; + gtkd-ansi) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; wxgtk2) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; wxgtk2d) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |