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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.20