/[gentoo-x86]/eclass/gtk-sharp-module.eclass
Gentoo

Contents of /eclass/gtk-sharp-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Thu Nov 27 05:24:23 2008 UTC (5 years, 7 months ago) by loki_val
Branch: MAIN
Changes since 1.4: +4 -3 lines
It's handy to know these depend on mono if you're making a set.

1 loki_val 1.1 # Copyright 1999-2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 loki_val 1.5 # $Header: /var/cvsroot/gentoo-x86/eclass/gtk-sharp-module.eclass,v 1.4 2008/11/26 14:03:05 loki_val Exp $
4 loki_val 1.1
5     # Author : Peter Johanson <latexer@gentoo.org>, butchered by ikelos, then loki_val.
6     # Based off of original work in gst-plugins.eclass by <foser@gentoo.org>
7    
8     # Note that this breaks compatibility with the original gtk-sharp-component
9     # eclass.
10    
11     inherit eutils mono multilib autotools
12    
13     # Get the name of the component to build and the build dir; by default,
14     # extract it from the ebuild's name.
15     GTK_SHARP_MODULE=${GTK_SHARP_MODULE:=${PN/-sharp/}}
16     GTK_SHARP_MODULE_DIR=${GTK_SHARP_MODULE_DIR:=${PN/-sharp/}}
17    
18     # In some cases the desired module cannot be configured to be built on its own.
19     # This variable allows for the setting of additional configure-deps.
20     GTK_SHARP_MODULE_DEPS="${GTK_SHARP_MODULE_DEPS}"
21    
22     # Allow ebuilds to set a value for the required GtkSharp version; default to
23     # ${PV}.
24     GTK_SHARP_REQUIRED_VERSION=${GTK_SHARP_REQUIRED_VERSION:=${PV%.*}}
25    
26     # Version number used to differentiate between unversioned 1.0 series and the
27     # versioned 2.0 series (2.0 series has 2 or 2.0 appended to various paths and
28     # scripts). Default to ${SLOT}.
29     GTK_SHARP_SLOT="${GTK_SHARP_SLOT:=${SLOT}}"
30     GTK_SHARP_SLOT_DEC="${GTK_SHARP_SLOT_DEC:=-${GTK_SHARP_SLOT}.0}"
31    
32     # Set some defaults.
33     DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module"
34     HOMEPAGE="http://www.mono-project.com/GtkSharp"
35    
36     LICENSE="LGPL-2.1"
37    
38 loki_val 1.5 RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*
39     >=dev-lang/mono-2"
40     DEPEND="${RDEPEND}
41 loki_val 1.1 >=sys-apps/sed-4"
42    
43     RESTRICT="test"
44    
45     # The GtkSharp modules are currently divided into three seperate tarball
46     # distributions. Figure out which of these our component belongs to. This is
47     # done to avoid passing bogus configure parameters, as well as to return the
48     # correct tarball to download. Note that this makes ${GTK_SHARP_TARBALL_PREFIX}
49     # obsolete.
50     gtk_sharp_module_list="glade"
51     gnome_sharp_module_list="art gnome gnomevfs"
52     gnome_desktop_sharp_module_list="gnome-print gnome-panel gtkhtml gtksourceview nautilusburn rsvg vte wnck"
53    
54     if [[ " ${gtk_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
55     my_module_list="${gtk_sharp_module_list}"
56     my_tarball="gtk-sharp"
57     elif [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
58     my_module_list="${gnome_sharp_module_list}"
59     my_tarball="gnome-sharp"
60    
61     # While gnome-desktop-sharp is a part of gnome-desktop-sharp (0_o) it is not a
62     # configurable component, so we don't want to put it into the module list.
63     # Result is that we have to check for it manually here and in src_configure.
64     elif [[ " ${gnome_desktop_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ||
65     "${GTK_SHARP_MODULE}" == "gnome-desktop" ]] ; then
66     my_module_list="${gnome_desktop_sharp_module_list}"
67     my_tarball="gnome-desktop-sharp"
68     else
69     die "unknown GtkSharp module: ${GTK_SHARP_MODULE}"
70     fi
71    
72     MY_P=${my_tarball}-${PV}
73     S=${WORKDIR}/${MY_P}
74    
75     # Since all interesting versions are hosted on the GNOME server anyway it's the
76     # only one we support, for now.
77     SRC_URI="mirror://gnome/sources/${my_tarball}/${PV%.*}/${MY_P}.tar.bz2
78     mirror://gentoo/${MY_P}-configurable.diff.gz
79     http://dev.gentoo.org/~ikelos/devoverlay-distfiles/${MY_P}-configurable.diff.gz"
80    
81    
82     ### Public functions.
83    
84     gtk-sharp-module_fix_files() {
85     # Change references like "/r:../glib/glib-sharp.dll" ->
86     # "/r:${GTK_SHARP_LIB_DIR}/glib-sharp.dll" and references like
87     # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" ->
88     # "${GAPI_DIR}/glib-sharp.xml".
89     #
90     # We also make sure to call the installed gapi-fixup and gapi-codegen and
91     # not the ones that would be built locally.
92     local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}"
93     local gapi_fixup="gapi${GTK_SHARP_SLOT}-fixup"
94     local gapi_codegen="gapi${GTK_SHARP_SLOT}-codegen"
95    
96     # This is very likely to be of use outside of this function as well, so make
97     # it public.
98     GTK_SHARP_LIB_DIR="${ROOT}/usr/$(get_libdir)/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}"
99    
100     local makefiles="$(find ${S} -name Makefile.in)"
101     sed -i -e "s;\(\.\.\|\$(top_srcdir)\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \
102     -e "s;/r:\(\.\./\)*[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;/r:${GTK_SHARP_LIB_DIR}/\2.dll;g" \
103     -e "s;\.\./[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;${GTK_SHARP_LIB_DIR}/\1.dll;g" \
104     -e "s:\$(SYMBOLS) \$(top_builddir)/parser/gapi-fixup.exe:\$(SYMBOLS):" \
105     -e "s:\$(INCLUDE_API) \$(top_builddir)/generator/gapi_codegen.exe:\$(INCLUDE_API):" \
106     -e "s:\$(RUNTIME) \$(top_builddir)/parser/gapi-fixup.exe:${gapi_fixup}:" \
107     -e "s:\$(RUNTIME) \$(top_builddir)/generator/gapi_codegen.exe:${gapi_codegen}:" \
108     ${makefiles} || die "failed to fix GtkSharp makefiles"
109    
110     # Oh GtkSharp, why do your pkgconfig entries suck donkey ass? Why do
111     # gnome-desktop-sharp modules use ${assemblies_dir} for Libs: instead of
112     # the convention you yourself introduced for gnome-sharp, which just uses
113     # @PACKAGE_VERSION@? Are you just trying to annoy me?
114     local pcins="$(find ${S} -name *.pc.in)"
115     sed -i -e 's:^libdir.*:libdir=@libdir@:' \
116     -e "s:\${assemblies_dir}:\${libdir}/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}:" \
117     ${pcins} || die "failed to fix GtkSharp pkgconfig entries"
118     }
119    
120     gtk-sharp-module_src_prepare() {
121     # Make selecting components configurable.
122     epatch ${WORKDIR}/${MY_P}-configurable.diff
123    
124     # Fixes support with pkgconfig-0.17, #92503.
125     sed -i -e 's/\<PKG_PATH\>/GTK_SHARP_PKG_PATH/g' \
126     -e ':^CFLAGS=:d' \
127 loki_val 1.3 "${S}"/configure.in
128 loki_val 1.1
129     # Fix install data hook, #161093.
130     if [ -f "${S}/sample/gconf/Makefile.am" ]
131     then
132     sed -i -e 's/^install-hook/install-data-hook/' \
133 loki_val 1.3 "${S}"/sample/gconf/Makefile.am || die
134 loki_val 1.1 fi
135    
136     # Disable building samples, #16015.
137 loki_val 1.3 sed -i -e "s:sample::" "${S}"/Makefile.am || die
138 loki_val 1.1
139     eautoreconf
140    
141 loki_val 1.3 cd "${S}"/${GTK_SHARP_MODULE_DIR}
142 loki_val 1.1
143     gtk-sharp-module_fix_files
144     }
145    
146     gtk-sharp-module_src_configure() {
147     # Disable any module besides one(s) we want.
148     local module gtk_sharp_conf
149    
150     einfo "Configuring to build ${PN} module ..."
151    
152     # No bogus configure parameters please.
153     [[ ${GTK_SHARP_MODULE} == "gnome-desktop" ]] && GTK_SHARP_MODULE=
154    
155     for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do
156     my_module_list=${my_module_list/${module}/}
157     done
158     for module in ${my_module_list} ; do
159     gtk_sharp_conf="${gtk_sharp_conf} --disable-${module} "
160     done
161     for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do
162     gtk_sharp_conf="${gtk_sharp_conf} --enable-${module} "
163     done
164    
165 loki_val 1.3 cd "${S}"
166 loki_val 1.1 econf ${@} ${gtk_sharp_conf} || die "econf failed"
167     }
168    
169     gtk-sharp-module_src_compile() {
170    
171 loki_val 1.3 cd "${S}"/${GTK_SHARP_MODULE_DIR}
172 loki_val 1.4 LANG=C emake ${OVERRIDEJOBS} || die "emake failed"
173 loki_val 1.1 }
174    
175     gtk-sharp-module_src_install() {
176     cd ${GTK_SHARP_MODULE_DIR}
177 loki_val 1.4 LANG=C emake ${OVERRIDEJOBS} GACUTIL_FLAGS="/root ${D}/usr/$(get_libdir) /gacdir /usr/$(get_libdir) /package gtk-sharp${GTK_SHARP_SLOT_DEC}" \
178 loki_val 1.3 DESTDIR="${D}" install || die "emake install failed"
179 loki_val 1.1 }
180    
181     EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20