/[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.22 - (hide annotations) (download)
Tue Mar 17 16:33:28 2009 UTC (5 years, 5 months ago) by loki_val
Branch: MAIN
Changes since 1.21: +2 -2 lines
Fix depends for gnome-sharp. Gnome-panel bindings have been moved to gnome-panel-sharp (obviously). Gnome-sharp requires gtk+-2.14.

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.22 # $Header: /var/cvsroot/gentoo-x86/eclass/gtk-sharp-module.eclass,v 1.21 2009/03/17 13:39:25 loki_val Exp $
4 loki_val 1.1
5 loki_val 1.14 # @ECLASS: gtk-sharp-module.eclass
6     # @MAINTAINER:
7     # dotnet@gentoo.org
8     # @BLURB: Manages the modules of the gtk-, gnome-, and gnome-desktop-sharp tarballs
9     # @DESCRIPTION:
10     # This eclass provides phase functions and helper functions for the modules
11     # of the gtk-sharp, gnome-sharp and gnome-desktop-sharp tarballs.
12     # PLEASE TAKE NOTE: ONLY FOR EAPI-2 EBUILDS
13 loki_val 1.1
14 loki_val 1.14 WANT_AUTOMAKE=none
15     WANT_AUTOCONF=none
16 loki_val 1.1
17 loki_val 1.8 inherit eutils mono multilib autotools base versionator
18 loki_val 1.1
19 loki_val 1.14 # @ECLASS-VARIABLE: GTK_SHARP_MODULE
20     # @DESCRIPTION:
21     # The name of the Gtk# module.
22     # Default value: ${PN/-sharp/}
23 loki_val 1.1 GTK_SHARP_MODULE=${GTK_SHARP_MODULE:=${PN/-sharp/}}
24 loki_val 1.14
25     # @ECLASS-VARIABLE: GTK_SHARP_MODULE_DIR
26     # @DESCRIPTION:
27     # The subdirectory of S in which GTK_SHARP_MODULE is installed.
28     # Default value: ${PN/-sharp/}
29 loki_val 1.1 GTK_SHARP_MODULE_DIR=${GTK_SHARP_MODULE_DIR:=${PN/-sharp/}}
30    
31 loki_val 1.14 # @ECLASS-VARIABLE: GTK_SHARP_REQUIRED_VERSION
32     # @DESCRIPTION:
33     # The version of the gtk-sharp tarball this package requires.
34     # Optional.
35     GTK_SHARP_REQUIRED_VERSION="${GTK_SHARP_REQUIRED_VERSION}"
36    
37     # @ECLASS-VARIABLE: gapi_users_list
38     # @DESCRIPTION:
39     # List of modules that use one of gapi2-codegen, gapi2-fixup or gapi2-parser
40     # No ebuild-serviceable parts inside.
41     gapi_users_list="art gnome gnomevfs ${gnome_desktop_sharp_module_list} atk gtk gdk glade pango"
42    
43     # @ECLASS-VARIABLE: PV_MAJOR
44     # @DESCRIPTION:
45     # The first two components of the PV variable.
46 loki_val 1.8 PV_MAJOR=$(get_version_component_range 1-2)
47    
48 loki_val 1.21 # @FUNCTION: add_bdepend
49 loki_val 1.14 # @USAGE: <package atom>
50     # @DESCRIPTION:
51     # Adds to the DEPEND variable
52 loki_val 1.8 add_bdepend() {
53 loki_val 1.14 [[ ${#@} -eq 1 ]] || die "${FUNCNAME} needs ONE (1) argument"
54 loki_val 1.8 DEPEND="${DEPEND} $@"
55     }
56    
57 loki_val 1.21 # @FUNCTION: add_rdepend
58 loki_val 1.14 # @USAGE: <package atom>
59     # @DESCRIPTION:
60     # Adds to the RDEPEND variable
61 loki_val 1.8 add_rdepend() {
62 loki_val 1.14 [[ ${#@} -eq 1 ]] || die "${FUNCNAME} needs ONE (1) argument"
63 loki_val 1.8 RDEPEND="${RDEPEND} $@"
64     }
65    
66 loki_val 1.14 # @FUNCTION: add_depend
67     # @USAGE: <package atom>
68     # @DESCRIPTION:
69     # Adds to the DEPEND and RDEPEND variables
70 loki_val 1.8 add_depend() {
71 loki_val 1.14 [[ ${#@} -eq 1 ]] || die "${FUNCNAME} needs ONE (1) argument"
72 loki_val 1.8 DEPEND="${DEPEND} $@"
73     RDEPEND="${RDEPEND} $@"
74     }
75    
76 loki_val 1.14 # @ECLASS-VARIABLE: TARBALL
77     # @DESCRIPTION:
78     # The GtkSharp modules are currently divided into three seperate tarball
79     # distributions. The TARBALL variable holds the name of the tarball
80     # to which GTK_SHARP_MODULE belongs.
81     case ${GTK_SHARP_MODULE} in
82     glib|glade|gtk|gdk|atk|pango|gtk-dotnet|gtk-gapi|gtk-docs)
83     TARBALL="gtk-sharp"
84     case ${PVR} in
85 loki_val 1.15 2.12.*)
86 loki_val 1.19 SRC_URI="mirror://gentoo/${TARBALL}-2.12.7.patch.bz2"
87 loki_val 1.14 #Upstream: https://bugzilla.novell.com/show_bug.cgi?id=$bugno
88     #Upstream bug #470390 for the gtk-sharp-2.12.7.patch
89 loki_val 1.15 PATCHES=(
90     "${WORKDIR}/${TARBALL}-2.12.7.patch"
91     )
92 loki_val 1.14 EAUTORECONF="YES"
93     add_bdepend "=sys-devel/automake-1.10*"
94     add_bdepend ">=sys-devel/autoconf-2.61"
95     ;;
96     esac
97     ;;
98     art|gnome|gnomevfs|gconf)
99     TARBALL="gnome-sharp"
100     add_depend "=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
101     has "${GTK_SHARP_MODULE}" "${gapi_users_list}" && \
102     add_bdepend "=dev-dotnet/gtk-sharp-gapi-${GTK_SHARP_REQUIRED_VERSION}*"
103 loki_val 1.19 case ${PVR} in
104     2.24.1*)
105     SRC_URI="mirror://gentoo/${TARBALL}-2.24.1.patch.bz2"
106 loki_val 1.20 # Upstream bug: https://bugzilla.novell.com/show_bug.cgi?id=483251
107 loki_val 1.19 PATCHES=(
108     "${WORKDIR}/${TARBALL}-2.24.1.patch"
109     )
110     EAUTORECONF="YES"
111     add_bdepend "=sys-devel/automake-1.10*"
112     add_bdepend ">=sys-devel/autoconf-2.61"
113     ;;
114     esac
115 loki_val 1.14 ;;
116     gnome-desktop|gnome-print|gnome-panel|gtkhtml|gtksourceview|nautilusburn|rsvg|vte|wnck)
117     TARBALL="gnome-desktop-sharp"
118     add_depend "=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
119 loki_val 1.21 add_depend "=dev-dotnet/gnome-sharp-2.24*"
120 loki_val 1.14 add_bdepend "=dev-dotnet/gtk-sharp-gapi-${GTK_SHARP_REQUIRED_VERSION}*"
121     ;;
122     *)
123     eerror "Huh? Sonny boy, looks like your GTK_SHARP_MODULE is not on the approved list. BAILING!"
124     die "How did we get here!!?"
125     ;;
126     esac
127 loki_val 1.8
128     case ${PF} in
129     #gtk-sharp tarball
130 loki_val 1.14 gtk-sharp-docs*)
131     add_depend ">=virtual/monodoc-2.0"
132     ;;
133 loki_val 1.8 gtk-sharp-gapi*)
134 loki_val 1.10 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
135 loki_val 1.8 add_depend "dev-perl/XML-LibXML"
136     ;;
137     gtk-sharp-*)
138 loki_val 1.14 add_bdepend "~dev-dotnet/gtk-sharp-gapi-${PV}"
139     add_depend "~dev-dotnet/glib-sharp-${PV}"
140 loki_val 1.8 add_depend "~dev-dotnet/atk-sharp-${PV}"
141     add_depend "~dev-dotnet/gdk-sharp-${PV}"
142     add_depend "~dev-dotnet/pango-sharp-${PV}"
143     ;;
144     gdk-sharp-*)
145 loki_val 1.14 add_bdepend "~dev-dotnet/gtk-sharp-gapi-${PV}"
146     add_depend "~dev-dotnet/glib-sharp-${PV}"
147 loki_val 1.8 add_depend "x11-libs/gtk+:2"
148     add_depend "~dev-dotnet/pango-sharp-${PV}"
149 loki_val 1.14 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
150 loki_val 1.8 ;;
151     atk-sharp-*)
152 loki_val 1.14 add_bdepend "~dev-dotnet/gtk-sharp-gapi-${PV}"
153     add_depend "~dev-dotnet/glib-sharp-${PV}"
154     add_depend "dev-libs/atk"
155 loki_val 1.8 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
156     ;;
157     glib-sharp-*)
158     add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
159     add_depend "dev-libs/glib:2"
160     ;;
161     pango-sharp-*)
162 loki_val 1.14 add_bdepend "~dev-dotnet/gtk-sharp-gapi-${PV}"
163     add_depend "~dev-dotnet/glib-sharp-${PV}"
164     add_depend "x11-libs/pango"
165 loki_val 1.8 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
166     ;;
167     gtk-dotnet-*)
168 loki_val 1.14 add_depend "~dev-dotnet/glib-sharp-${PV}"
169 loki_val 1.8 add_depend "~dev-dotnet/gdk-sharp-${PV}"
170     add_depend "~dev-dotnet/pango-sharp-${PV}"
171 loki_val 1.14 add_depend "~dev-dotnet/gtk-sharp-${PV}"
172     add_depend "dev-lang/mono[-minimal]"
173     add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
174 loki_val 1.8 ;;
175     glade-sharp-*)
176 loki_val 1.14 add_bdepend "~dev-dotnet/gtk-sharp-gapi-${PV}"
177     add_depend "~dev-dotnet/glib-sharp-${PV}"
178 loki_val 1.8 add_depend "~dev-dotnet/atk-sharp-${PV}"
179     add_depend "~dev-dotnet/gdk-sharp-${PV}"
180 loki_val 1.14 add_depend "~dev-dotnet/gtk-sharp-${PV}"
181 loki_val 1.8 add_depend "~dev-dotnet/pango-sharp-${PV}"
182     add_depend ">=gnome-base/libglade-2.3.6"
183     ;;
184     #gnome-sharp tarball
185     art-sharp-*)
186     add_depend ">=media-libs/libart_lgpl-2.3.20"
187     ;;
188     gnome-sharp-*)
189     add_depend ">=gnome-base/libgnomeui-${PV_MAJOR}"
190     add_depend "~dev-dotnet/gnomevfs-sharp-${PV}"
191     add_depend "~dev-dotnet/art-sharp-${PV}"
192     add_depend ">=gnome-base/libgnomecanvas-${GNOMECANVAS_REQUIRED_VERSION}"
193 loki_val 1.22 add_depend ">=x11-libs/gtk+-2.14.0"
194 loki_val 1.8 ;;
195     gconf-sharp-*)
196     add_depend ">=gnome-base/gconf-${PV_MAJOR}"
197 loki_val 1.21 add_depend "=dev-dotnet/glade-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
198 loki_val 1.8 add_depend "~dev-dotnet/gnome-sharp-${PV}"
199     add_depend "~dev-dotnet/art-sharp-${PV}"
200     ;;
201     gnomevfs-sharp-*)
202     add_depend ">=gnome-base/gnome-vfs-${PV_MAJOR}"
203     ;;
204     #gnome-desktop-sharp tarball
205     gnome-desktop-sharp-*)
206 loki_val 1.18 # NOTE: This is REQUIRED to be locked to PV_MAJOR
207     # libgnome-desktop-2.so.INTEGER is hardcoded in gnomedesktop-sharp.dll.config
208     add_depend "=gnome-base/gnome-desktop-${PV_MAJOR}*"
209 loki_val 1.8 ;;
210     gnome-panel-sharp-*)
211 zmedico 1.17 add_depend ">=gnome-base/gnome-panel-${PV_MAJOR}"
212 loki_val 1.8 ;;
213     gnome-print-sharp-*)
214     add_depend ">=gnome-base/libgnomeprint-${API_VERSION}"
215     ;;
216     gtkhtml-sharp-*)
217     #NOTE: gtkhtml dependency must follow gtkhtml-sharp version.
218     #i.e. gtkhtml-sharp-2.24.0 >=gtkhtml-3.24
219     # gtkhtml-sharp-2.16.0 >=gtkhtml-3.16
220     # See bug 249540 for unpleasant side effects.
221     add_depend ">=gnome-extra/gtkhtml-$(($(get_version_component_range 1) + 1 )).$(get_version_component_range 2)"
222     ;;
223     gtksourceview-sharp-*)
224     add_depend ">=x11-libs/gtksourceview-${GTKSOURCEVIEW_REQUIRED_VERSION}:2.0"
225     ;;
226     nautilusburn-sharp-*)
227     add_depend ">=gnome-extra/nautilus-cd-burner-${PV_MAJOR}"
228     ;;
229     rsvg-sharp-*)
230     add_depend ">=gnome-base/librsvg-${RSVG_REQUIRED_VERSION}"
231     ;;
232     vte-sharp-*)
233     add_depend ">=x11-libs/vte-${VTE_REQUIRED_VERSION}"
234     ;;
235     wnck-sharp-*)
236     add_depend ">=x11-libs/libwnck-${PV_MAJOR}"
237     ;;
238     esac
239    
240 loki_val 1.14 # @ECLASS-VARIABLE: DESCRIPTION
241     # @DESCRIPTION:
242     # Default value: GtkSharp's ${GTK_SHARP_MODULE} module of the ${TARBALL} tarball
243     DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module of the ${TARBALL} tarball"
244     # @ECLASS-VARIABLE: HOMEPAGE
245     # @DESCRIPTION:
246     # Default value: http://www.mono-project.com/GtkSharp
247     HOMEPAGE="http://www.mono-project.com/GtkSharp"
248     # @ECLASS-VARIABLE: DESCRIPTION
249     # @DESCRIPTION:
250     # Default value: LGPL-2.1
251     LICENSE="LGPL-2.1"
252 loki_val 1.8
253 loki_val 1.14 add_depend ">=dev-lang/mono-2.0.1"
254     add_bdepend ">=sys-apps/sed-4"
255     add_bdepend ">=dev-util/pkgconfig-0.23"
256     add_bdepend ">=app-shells/bash-3.1"
257 loki_val 1.8
258 loki_val 1.14 IUSE="debug"
259 loki_val 1.19 # @ECLASS-VARIABLE: S
260 loki_val 1.14 # @DESCRIPTION:
261     # Default value: ${WORKDIR}/${TARBALL}-${PV}
262     S="${WORKDIR}/${TARBALL}-${PV}"
263     # @ECLASS-VARIABLE: SRC_URI
264     # @DESCRIPTION:
265     # Default value: mirror://gnome/sources/${TARBALL}/${PV_MAJOR}/${TARBALL}-${PV}.tar.bz2
266     SRC_URI="${SRC_URI}
267     mirror://gnome/sources/${TARBALL}/${PV_MAJOR}/${TARBALL}-${PV}.tar.bz2"
268    
269     # @FUNCTION: get_sharp_apis
270     # @USAGE: <type> <pkgconfig-package>
271     # @RETURN: .NET API files
272     # @DESCRIPTION:
273     # Given a valid pkg-config package, will return a list of API xml files.
274     # <type> can be either --prefixed or --bare. If prefixed, each API file
275     # will be prefixed with -I:
276     get_sharp_apis() {
277     [[ ${#@} -eq 2 ]] || die "${FUNCNAME} needs two arguments"
278     get_sharp_assemblies "$@"
279     }
280    
281     # @FUNCTION: get_sharp_assemblies
282     # @USAGE: <type> <pkgconfig-package>
283     # @RETURN: .NET .dll assemblies
284     # @DESCRIPTION:
285     # Given a valid pkg-config package, will return a list of .dll assemblies.
286     # <type> can be either --prefixed or --bare. If prefixed, each .dll file
287     # will be prefixed with -r:
288     get_sharp_assemblies() {
289     [[ ${#@} -eq 2 ]] || die "${FUNCNAME} needs two arguments"
290     local string config=libs prefix="-r:"
291     local -a rvalue
292     [[ "${FUNCNAME[1]}" = "get_sharp_apis" ]] && config=cflags && prefix="-I:"
293     for string in $(pkg-config --${config} ${2} 2> /dev/null)
294 loki_val 1.8 do
295 loki_val 1.14 rvalue+=( ${string#-?:} )
296 loki_val 1.8 done
297 loki_val 1.14
298     case $1 in
299     --bare)
300     :
301     ;;
302     --prefixed)
303     for (( i=0 ; i< ${#rvalue[@]} ; i++ ))
304     do
305     rvalue[$i]=${prefix}${rvalue[$i]}
306     done
307     ;;
308     *)
309     die "${FUNCNAME}: Unknown parameter"
310     ;;
311     esac
312     echo "${rvalue[@]}"
313     }
314    
315     # @FUNCTION: phase_hook
316     # @USAGE: <prefix>
317     # Looks for functions named <prefix>_caller_suffix and executes them.
318     # _caller_suffix is the calling function with the prefix
319     # gtk-sharp-module removed.
320     phase_hook() {
321     [[ ${#@} -eq 1 ]] || die "${FUNCNAME} needs one argument"
322     if [[ "$(type -t ${1}${FUNCNAME[1]#gtk-sharp-module})" = "function" ]]
323     then
324     ebegin "Phase-hook: Running ${1}${FUNCNAME[1]#gtk-sharp-module}"
325     ${1}${FUNCNAME[1]#gtk-sharp-module}
326     eend 0
327     fi
328 loki_val 1.8 }
329    
330 loki_val 1.14 # @FUNCTION: ac_path_prog_override
331     # @USAGE: <PROG> [path]
332     # @DESCRIPTION:
333     # Override AC_PATH_PROG() autoconf macros. Path will be set to " " if
334     # not specified.
335     ac_path_prog_override() {
336     if [[ ${#@} -lt 1 || ${#@} -gt 2 ]]
337 loki_val 1.8 then
338 loki_val 1.14 eerror "${FUNCNAME[0]} requires at least one parameter and takes at most two:"
339     eerror "AC_PATH_PROG(PARAM1, param2)"
340     die "${FUNCNAME[0]} requires at least one parameter and takes at most two:"
341 loki_val 1.8 fi
342 loki_val 1.14 export ac_cv_path_${1}="${2:- }"
343 loki_val 1.8 }
344    
345 loki_val 1.14
346     # @FUNCTION: pkg_check_modules_override
347     # @USAGE: <GROUP> [package1] [package2]
348     # @DESCRIPTION:
349     # Will export the appropriate variables to override PKG_CHECK_MODULES autoconf
350     # macros, with the string " " by default. If packages are specified, they will
351     # be looked up with pkg-config and the appropriate LIBS and CFLAGS substituted.
352     # LIBS and CFLAGS can also be specified per-package with the following syntax:
353     # @CODE
354     # package=LIBS%CFLAGS
355     # @CODE
356     # = and % have no effect unless both are specified.
357     # Here is an example:
358     # @CODE
359     # pkg_check_modules_override GASH "gtk+-2.0=-jule%" gobject-2.0
360     # @CODE
361     # The above example will do:
362     # export GASH_CFLAGS+=" -jule"
363     # export GASH_LIBS+=" "
364     # export GASH_CFLAGS+=" $(pkg-config --cflags gobject-2.0)"
365     # export GASH_LIBS+=" $(pkg-config --libs gobject-2.0)"
366     #
367     # NOTE: If a package is not found, the string " " will be inserted in place of
368     # <GROUP>_CFLAGS and <GROUP>_LIBS
369     pkg_check_modules_override() {
370     local package
371     local group="${1}"
372     local packages="${*:2}"
373     export ${group}_CFLAGS=" "
374     export ${group}_LIBS=" "
375    
376     if [[ ${#@} -lt 1 ]]
377 loki_val 1.8 then
378 loki_val 1.14 eerror "${FUNCNAME[0]} requires at least one parameter: GROUP"
379     eerror "PKG_CHECK_MODULES(GROUP, package1 package2 etc)"
380     die "${FUNCNAME[0]} requires at least one parameter: GROUP"
381 loki_val 1.8 fi
382 loki_val 1.1
383 loki_val 1.14 for package in $packages
384     do
385     if [[ ${package/=} != ${package} && ${package/\%} != ${package} ]]
386     then
387     package_cflag_libs=${package##*=}
388     export ${group}_CFLAGS+=" ${package_cflag_libs%%\%*}"
389     export ${group}_LIBS+=" ${package_cflag_libs##*\%}"
390     else
391     if pkg-config --exists $package
392     then
393     export ${group}_CFLAGS+=" $(pkg-config --cflags $package)"
394     export ${group}_LIBS+=" $(pkg-config --libs $package)"
395     else
396     export ${group}_CFLAGS+=" "
397     export ${group}_LIBS+=" "
398     fi
399     fi
400     done
401     }
402 loki_val 1.1
403 loki_val 1.14 # @FUNCTION: gtk-sharp-tarball-post_src_prepare
404     # @DESCRIPTION:
405     # Runs a M-m-m-monster sed on GTK_SHARP_MODULE_DIR to convert references to
406     # local assemblies to the installed ones. Is only called by src_prepare when
407     # $GTK_SHARP_MODULE is a member of $gtk_sharp_module_list.
408     gtk-sharp-tarball-post_src_prepare() {
409 loki_val 1.6 cd "${S}/${GTK_SHARP_MODULE_DIR}"
410 loki_val 1.14 sed -i \
411     -e "s; \$(srcdir)/../glib/glib-api.xml; $(get_sharp_apis --bare glib-sharp-2.0);" \
412     -e "s; ../pango/pango-api.xml; $(get_sharp_apis --bare pango-sharp-2.0);" \
413     -e "s; ../atk/atk-api.xml; $(get_sharp_apis --bare atk-sharp-2.0);" \
414     -e "s; ../gdk/gdk-api.xml; $(get_sharp_apis --bare gdk-sharp-2.0);" \
415     -e "s; ../gtk/gtk-api.xml; $(get_sharp_apis --bare gtk-sharp-2.0);" \
416     -e "s; \.\./glib/glib-sharp.dll; $(get_sharp_assemblies --bare glib-sharp-2.0);g" \
417     -e "s; \.\./pango/pango-sharp.dll; $(get_sharp_assemblies --bare pango-sharp-2.0);g" \
418     -e "s; \.\./atk/atk-sharp.dll; $(get_sharp_assemblies --bare atk-sharp-2.0);g" \
419     -e "s; \.\./gdk/gdk-sharp.dll; $(get_sharp_assemblies --bare gdk-sharp-2.0);g" \
420     -e "s; \.\./gtk/gtk-sharp.dll; $(get_sharp_assemblies --bare gtk-sharp-2.0);g" \
421     -e "s;\$(RUNTIME) \$(top_builddir)/parser/gapi-fixup.exe;/usr/bin/gapi2-fixup;" \
422     -e "s;\$(RUNTIME) \$(top_builddir)/generator/gapi_codegen.exe;/usr/bin/gapi2-codegen;" \
423     -e "s:\$(SYMBOLS) \$(top_builddir)/parser/gapi-fixup.exe:\$(SYMBOLS):" \
424     -e "s:\$(INCLUDE_API) \$(top_builddir)/generator/gapi_codegen.exe:\$(INCLUDE_API):" \
425     $(find . -name Makefile.in) || die "failed to fix ${TARBALL}-tarball makefiles"
426     }
427    
428     # @FUNCTION: gnome-sharp-tarball-post_src_prepare
429     # @DESCRIPTION:
430     # Runs a M-m-m-monster sed on GTK_SHARP_MODULE_DIR to convert references to
431     # local assemblies to the installed ones. Is only called by src_prepare when
432     # $GTK_SHARP_MODULE is a member of $gnome_sharp_module_list.
433     gnome-sharp-tarball-post_src_prepare() {
434     cd "${S}/${GTK_SHARP_MODULE_DIR}"
435     sed -i \
436     -e "s; ../gnomevfs/gnome-vfs-api.xml; $(get_sharp_apis --bare gnome-vfs-sharp-2.0);" \
437     -e "s; ../art/art-api.xml; $(get_sharp_apis --bare art-sharp-2.0);" \
438     -e "s; \.\./art/art-sharp.dll; $(get_sharp_assemblies --bare art-sharp-2.0);g" \
439     -e "s; \.\./gnomevfs/gnome-vfs-sharp.dll; $(get_sharp_assemblies --bare gnome-vfs-sharp-2.0);g" \
440     -e "s;/r:\$(top_builddir)/art/art-sharp.dll;$(get_sharp_assemblies --prefixed art-sharp-2.0);" \
441     -e "s;/r:\$(top_builddir)/gnome/gnome-sharp.dll;$(get_sharp_assemblies --prefixed gnome-sharp-2.0);" \
442     $(find . -name Makefile.in) || die "failed to fix ${TARBALL}-tarball makefiles"
443     }
444    
445     # @FUNCTION: gtk-sharp-module_src_prepare
446     # @DESCRIPTION:
447     # Runs autopatch from base.eclass, eautoreconf if EAUTORECONF is set to any
448     # value.
449     # Contains a phase_hook, runs very last.
450     # phase_hook prefix trigger: ${TARBALL}-tarball-post
451     # Is exported.
452     gtk-sharp-module_src_prepare() {
453     base_src_util autopatch
454     # @ECLASS-VARIABLE: EAUTORECONF
455     # @DESCRIPTION:
456     # If set, EAUTORECONF will be run during src_prepare.
457     [[ ${EAUTORECONF} ]] && eautoreconf
458     phase_hook ${TARBALL}-tarball-post
459 loki_val 1.1 }
460    
461 loki_val 1.14 # @FUNCTION: gtk-sharp-tarball_src_configure
462     # @DESCRIPTION:
463     # Sets some environment variables that will allow us to make the dependencies
464     # for each ebuild be only its own dependencies, without patching configure.
465     # Is only called by gtk-sharp-module_src_configure when $GTK_SHARP_MODULE
466     # is a member of $gtk_sharp_module_list.
467     gtk-sharp-tarball_src_configure() {
468     pkg_check_modules_override GLIB gobject-2.0
469     pkg_check_modules_override GIO gio-2.0
470     pkg_check_modules_override PANGO pango
471     pkg_check_modules_override ATK atk
472     pkg_check_modules_override GTK gtk+-2.0
473     pkg_check_modules_override GLADE libglade-2.0
474     }
475    
476     # @FUNCTION: gnome-sharp-tarball_src_configure
477     # @DESCRIPTION:
478     # Sets some environment variables that will allow us to make the dependencies
479     # for each ebuild be only its own dependencies. Without patching configure.
480     # Is only called by gtk-sharp-module_src_configure when $GTK_SHARP_MODULE
481     # is a member of $gnome_sharp_module_list.
482     gnome-sharp-tarball_src_configure() {
483     pkg_check_modules_override GLADESHARP glade-sharp-2.0
484     pkg_check_modules_override GAPI gapi-2.0
485     ac_path_prog_override GAPI_PARSER /usr/bin/gapi2-parser
486     ac_path_prog_override GAPI_CODEGEN /usr/bin/gapi2-codegen
487     ac_path_prog_override GAPI_FIXUP /usr/bin/gapi2-fixup
488     }
489    
490     # @FUNCTION: gtk-sharp-module_src_configure
491     # @USAGE: [econf-arguments]
492     # @DESCRIPTION:
493     # Calls econf with some default values.
494     # Contains a phase_hook, run before econf.
495     # phase_hook prefix trigger: ${TARBALL}-tarball
496     # Is exported.
497 loki_val 1.1 gtk-sharp-module_src_configure() {
498 loki_val 1.14 phase_hook ${TARBALL}-tarball
499 loki_val 1.8 econf --disable-static \
500     --disable-dependency-tracking \
501     --disable-maintainer-mode \
502     $(use debug &&echo "--enable-debug" ) \
503     ${@} || die "econf failed"
504 loki_val 1.1 }
505    
506 loki_val 1.14 # @FUNCTION: gtk-sharp-module_src_compile
507     # @DESCRIPTION:
508     # Calls emake in the subdir of the module.
509     # Sets CSC=/usr/bin/gmcs. Deletes top_srcdir Makefiles to prevent recursing in
510     # case we missed some dll references.
511     # Is exported.
512 loki_val 1.1 gtk-sharp-module_src_compile() {
513 loki_val 1.14 rm -f "${S}"/Makefile* &> /dev/null
514 loki_val 1.6 cd "${S}/${GTK_SHARP_MODULE_DIR}"
515 loki_val 1.14 emake CSC=/usr/bin/gmcs || die "emake failed"
516 loki_val 1.1 }
517    
518 loki_val 1.14 # @FUNCTION: gtk-sharp-module_src_install
519     # @DESCRIPTION:
520     # Installs the module. Fixes up lib paths so they're multilib-safe.
521     # Gets rid of .la files.
522     # Is exported.
523 loki_val 1.1 gtk-sharp-module_src_install() {
524 loki_val 1.12 cd "${S}/${GTK_SHARP_MODULE_DIR}"
525 loki_val 1.14 emake DESTDIR="${D}" install || die "emake install failed"
526 loki_val 1.8 mono_multilib_comply
527 loki_val 1.14 find "${D}" -type f -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
528     [[ $(find "${D}" -type f|wc -l) -lt 3 ]] && die "Too few files. This smells like a failed install."
529 loki_val 1.1 }
530    
531     EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20