/[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.4 Revision 1.9
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.4 2008/11/26 14:03:05 loki_val Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gtk-sharp-module.eclass,v 1.9 2009/01/05 20:49:10 loki_val Exp $
4 4
5# Author : Peter Johanson <latexer@gentoo.org>, butchered by ikelos, then loki_val. 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> 6# Based off of original work in gst-plugins.eclass by <foser@gentoo.org>
7 7
8# Note that this breaks compatibility with the original gtk-sharp-component 8# Note that this breaks compatibility with the original gtk-sharp-component
9# eclass. 9# eclass.
10 10
11inherit eutils mono multilib autotools 11inherit eutils mono multilib autotools base versionator
12 12
13# Get the name of the component to build and the build dir; by default, 13# Get the name of the component to build and the build dir; by default,
14# extract it from the ebuild's name. 14# extract it from the ebuild's name.
15GTK_SHARP_MODULE=${GTK_SHARP_MODULE:=${PN/-sharp/}} 15GTK_SHARP_MODULE=${GTK_SHARP_MODULE:=${PN/-sharp/}}
16GTK_SHARP_MODULE_DIR=${GTK_SHARP_MODULE_DIR:=${PN/-sharp/}} 16GTK_SHARP_MODULE_DIR=${GTK_SHARP_MODULE_DIR:=${PN/-sharp/}}
17 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.
20GTK_SHARP_MODULE_DEPS="${GTK_SHARP_MODULE_DEPS}"
21
22# Allow ebuilds to set a value for the required GtkSharp version; default to 18# Allow ebuilds to set a value for the required GtkSharp version.
23# ${PV}.
24GTK_SHARP_REQUIRED_VERSION=${GTK_SHARP_REQUIRED_VERSION:=${PV%.*}} 19GTK_SHARP_REQUIRED_VERSION=${GTK_SHARP_REQUIRED_VERSION}
25 20
26# Version number used to differentiate between unversioned 1.0 series and the 21# 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 22# versioned 2.0 series (2.0 series has 2 or 2.0 appended to various paths and
28# scripts). Default to ${SLOT}. 23# scripts). Default to ${SLOT}.
29GTK_SHARP_SLOT="${GTK_SHARP_SLOT:=${SLOT}}" 24GTK_SHARP_SLOT="${GTK_SHARP_SLOT:=${SLOT}}"
30GTK_SHARP_SLOT_DEC="${GTK_SHARP_SLOT_DEC:=-${GTK_SHARP_SLOT}.0}" 25GTK_SHARP_SLOT_DEC="${GTK_SHARP_SLOT_DEC:=-${GTK_SHARP_SLOT}.0}"
31 26
27#Handy little var
28PV_MAJOR=$(get_version_component_range 1-2)
29
32# Set some defaults. 30# Set some defaults.
33DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module" 31DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module"
34HOMEPAGE="http://www.mono-project.com/GtkSharp" 32HOMEPAGE="http://www.mono-project.com/GtkSharp"
35 33
36LICENSE="LGPL-2.1" 34LICENSE="LGPL-2.1"
37 35DEPEND="
38DEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}* 36 >=dev-lang/mono-2.0.1
39 >=sys-apps/sed-4" 37 >=sys-apps/sed-4
40RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*" 38 >=dev-util/pkgconfig-0.23
39 "
40RDEPEND="
41 >=dev-lang/mono-2.0.1
42 "
41 43
42RESTRICT="test" 44IUSE="debug"
45
43 46
44# The GtkSharp modules are currently divided into three seperate tarball 47# The GtkSharp modules are currently divided into three seperate tarball
45# distributions. Figure out which of these our component belongs to. This is 48# distributions. Figure out which of these our component belongs to.
46# done to avoid passing bogus configure parameters, as well as to return the 49
47# correct tarball to download. Note that this makes ${GTK_SHARP_TARBALL_PREFIX} 50gtk_sharp_module_list="glib glade gtk gdk atk pango gtk-dotnet gtk-gapi"
48# obsolete.
49gtk_sharp_module_list="glade"
50gnome_sharp_module_list="art gnome gnomevfs" 51gnome_sharp_module_list="art gnome gnomevfs gconf"
51gnome_desktop_sharp_module_list="gnome-print gnome-panel gtkhtml gtksourceview nautilusburn rsvg vte wnck" 52gnome_desktop_sharp_module_list="gnome-desktop gnome-print gnome-panel gtkhtml gtksourceview nautilusburn rsvg vte wnck"
52 53
53if [[ " ${gtk_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then 54has "${GTK_SHARP_MODULE}" ${gtk_sharp_module_list} && GTK_SHARP_REQUIRED_VERSION=${PV}
54 my_module_list="${gtk_sharp_module_list}"
55 my_tarball="gtk-sharp"
56elif [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
57 my_module_list="${gnome_sharp_module_list}"
58 my_tarball="gnome-sharp"
59 55
60# While gnome-desktop-sharp is a part of gnome-desktop-sharp (0_o) it is not a 56
61# configurable component, so we don't want to put it into the module list. 57add_bdepend() {
62# Result is that we have to check for it manually here and in src_configure. 58 DEPEND="${DEPEND} $@"
63elif [[ " ${gnome_desktop_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* || 59}
64 "${GTK_SHARP_MODULE}" == "gnome-desktop" ]] ; then 60
65 my_module_list="${gnome_desktop_sharp_module_list}" 61add_rdepend() {
66 my_tarball="gnome-desktop-sharp" 62 RDEPEND="${RDEPEND} $@"
67else 63}
64
65add_depend() {
66 DEPEND="${DEPEND} $@"
67 RDEPEND="${RDEPEND} $@"
68}
69
70gsm_get_tarball() {
71 has "${GTK_SHARP_MODULE}" ${gtk_sharp_module_list} \
72 && echo "gtk-sharp" && return 0
73 has "${GTK_SHARP_MODULE}" ${gnome_sharp_module_list} \
74 && echo "gnome-sharp" && return 0
75 has "${GTK_SHARP_MODULE}" ${gnome_desktop_sharp_module_list} \
76 && echo "gnome-desktop-sharp" && return 0
68 die "unknown GtkSharp module: ${GTK_SHARP_MODULE}" 77 die "unknown GtkSharp module: ${GTK_SHARP_MODULE}"
78}
79
80[[ "${PN}" != "gtk-sharp-gapi" ]] && add_bdepend "=dev-dotnet/gtk-sharp-gapi-${GTK_SHARP_REQUIRED_VERSION}*"
81has "${GTK_SHARP_MODULE}" ${gnome_sharp_module_list} ${gnome_desktop_sharp_module_list} gtk-dotnet glade \
82 && add_depend "=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
83has "${GTK_SHARP_MODULE}" gtk gdk atk pango gtk-dotnet parser \
84 && add_depend "=dev-dotnet/glib-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
85has "${GTK_SHARP_MODULE}" ${gnome_desktop_sharp_module_list} \
86 && add_depend ">=dev-dotnet/gnome-sharp-${PV_MAJOR}"
87
88case ${PF} in
89 #gtk-sharp tarball
90 gtk-sharp-gapi*)
91 add_depend "dev-perl/XML-LibXML"
92 ;;
93 gtk-sharp-*)
94 add_depend "~dev-dotnet/atk-sharp-${PV}"
95 add_depend "~dev-dotnet/gdk-sharp-${PV}"
96 add_depend "~dev-dotnet/pango-sharp-${PV}"
97 ;;
98 gdk-sharp-*)
99 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
100 add_depend "x11-libs/gtk+:2"
101 add_depend "~dev-dotnet/pango-sharp-${PV}"
102 ;;
103 atk-sharp-*)
104 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
105 add_depend "dev-libs/atk"
106 ;;
107 glib-sharp-*)
108 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
109 add_depend "dev-libs/glib:2"
110 ;;
111 pango-sharp-*)
112 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
113 add_depend "x11-libs/pango"
114 ;;
115 gtk-dotnet-*)
116 add_rdepend "!<=dev-dotnet/gtk-sharp-2.12.7:2"
117 add_depend "~dev-dotnet/gdk-sharp-${PV}"
118 add_depend "~dev-dotnet/pango-sharp-${PV}"
119 add_depend "!dev-lang/mono[minimal]"
120 ;;
121 glade-sharp-*)
122 add_depend "~dev-dotnet/atk-sharp-${PV}"
123 add_depend "~dev-dotnet/gdk-sharp-${PV}"
124 add_depend "~dev-dotnet/pango-sharp-${PV}"
125 add_depend ">=gnome-base/libglade-2.3.6"
126 ;;
127 #gnome-sharp tarball
128 art-sharp-*)
129 add_depend ">=media-libs/libart_lgpl-2.3.20"
130 ;;
131 gnome-sharp-*)
132 add_depend ">=gnome-base/libgnomeui-${PV_MAJOR}"
133 add_depend ">=gnome-base/gnome-panel-${PV_MAJOR}"
134 add_depend "~dev-dotnet/gnomevfs-sharp-${PV}"
135 add_depend "~dev-dotnet/art-sharp-${PV}"
136 add_depend ">=gnome-base/libgnomecanvas-${GNOMECANVAS_REQUIRED_VERSION}"
137 ;;
138 gconf-sharp-*)
139 add_depend ">=gnome-base/gconf-${PV_MAJOR}"
140 add_depend ">=dev-dotnet/glade-sharp-${GTK_SHARP_REQUIRED_VERSION}"
141 add_depend "~dev-dotnet/gnome-sharp-${PV}"
142 add_depend "~dev-dotnet/art-sharp-${PV}"
143 ;;
144 gnomevfs-sharp-*)
145 add_depend ">=gnome-base/gnome-vfs-${PV_MAJOR}"
146 ;;
147 #gnome-desktop-sharp tarball
148 gnome-desktop-sharp-*)
149 add_depend "=gnome-base/gnome-desktop-${PV_MAJOR}*"
150 ;;
151 gnome-panel-sharp-*)
152 add_depend "=gnome-base/gnome-panel-${PV_MAJOR}*"
153 ;;
154 gnome-print-sharp-*)
155 add_depend ">=gnome-base/libgnomeprint-${API_VERSION}"
156 ;;
157 gtkhtml-sharp-*)
158 #NOTE: gtkhtml dependency must follow gtkhtml-sharp version.
159 #i.e. gtkhtml-sharp-2.24.0 >=gtkhtml-3.24
160 # gtkhtml-sharp-2.16.0 >=gtkhtml-3.16
161 # See bug 249540 for unpleasant side effects.
162 add_depend ">=gnome-extra/gtkhtml-$(($(get_version_component_range 1) + 1 )).$(get_version_component_range 2)"
163 ;;
164 gtksourceview-sharp-*)
165 add_depend ">=x11-libs/gtksourceview-${GTKSOURCEVIEW_REQUIRED_VERSION}:2.0"
166 ;;
167 nautilusburn-sharp-*)
168 add_depend ">=gnome-extra/nautilus-cd-burner-${PV_MAJOR}"
169 ;;
170 rsvg-sharp-*)
171 add_depend ">=gnome-base/librsvg-${RSVG_REQUIRED_VERSION}"
172 ;;
173 vte-sharp-*)
174 add_depend ">=x11-libs/vte-${VTE_REQUIRED_VERSION}"
175 ;;
176 wnck-sharp-*)
177 add_depend ">=x11-libs/libwnck-${PV_MAJOR}"
178 ;;
179esac
180
181
182
183GSM_P=$(gsm_get_tarball)-${PV}
184S=${WORKDIR}/${GSM_P}
185SRC_URI="mirror://gnome/sources/$(gsm_get_tarball)/${PV%.*}/${GSM_P}.tar.bz2"
186
187if [[ "${GSM_P%.*}" = "gtk-sharp-2.12" ]]
188then
189 SRC_URI="${SRC_URI}
190 mirror://gentoo/gtk-sharp-2.12.0-patches.tar.bz2"
191 #Upstream: https://bugzilla.novell.com/show_bug.cgi?id=$bugno
192 #Upstream bug #421063
193 PATCHES=( "${WORKDIR}/patches/$(gsm_get_tarball)-2.12.0-parallelmake.patch"
194 "${WORKDIR}/patches/$(gsm_get_tarball)-2.12.0-doc-parallelmake.patch" )
195 EAUTORECONF="YES"
69fi 196fi
70 197
71MY_P=${my_tarball}-${PV}
72S=${WORKDIR}/${MY_P}
73
74# Since all interesting versions are hosted on the GNOME server anyway it's the
75# only one we support, for now.
76SRC_URI="mirror://gnome/sources/${my_tarball}/${PV%.*}/${MY_P}.tar.bz2
77 mirror://gentoo/${MY_P}-configurable.diff.gz
78 http://dev.gentoo.org/~ikelos/devoverlay-distfiles/${MY_P}-configurable.diff.gz"
79
80 198
81### Public functions. 199### Public functions.
82 200
83gtk-sharp-module_fix_files() { 201gtk-sharp-module_fix_files() {
84 # Change references like "/r:../glib/glib-sharp.dll" -> 202 # Change references like "/r:../art/art-sharp.dll" ->
85 # "/r:${GTK_SHARP_LIB_DIR}/glib-sharp.dll" and references like 203 # "/r:/usr/lib/pkgconfig/../../lib/mono/gtk-sharp-2.0/art-sharp.dll" and references like
86 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" -> 204 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" ->
87 # "${GAPI_DIR}/glib-sharp.xml". 205 # "${gapi_dir}/glib-sharp.xml".
88 # 206 #
89 # We also make sure to call the installed gapi-fixup and gapi-codegen and 207 # We also make sure to call the installed gapi-fixup and gapi-codegen and
90 # not the ones that would be built locally. 208 # not the ones that would be built locally.
91 local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}" 209 local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}"
92 local gapi_fixup="gapi${GTK_SHARP_SLOT}-fixup" 210 local GAPI_FIXUP="gapi2-fixup"
93 local gapi_codegen="gapi${GTK_SHARP_SLOT}-codegen" 211 local GAPI_CODEGEN="gapi2-codegen"
94 212
95 # This is very likely to be of use outside of this function as well, so make
96 # it public.
97 GTK_SHARP_LIB_DIR="${ROOT}/usr/$(get_libdir)/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}"
98
99 local makefiles="$(find ${S} -name Makefile.in)" 213 local makefiles=( $(find "${S}" -name Makefile.in) )
214 sed -i \
100 sed -i -e "s;\(\.\.\|\$(top_srcdir)\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \ 215 -e "s;\(\.\.\|\$(top_srcdir)\|\$(srcdir)/\.\.\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \
101 -e "s;/r:\(\.\./\)*[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;/r:${GTK_SHARP_LIB_DIR}/\2.dll;g" \ 216 -e "s; \.\./glib/glib-sharp.dll; $(get_sharp_lib glib-sharp-2.0);g" \
102 -e "s;\.\./[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;${GTK_SHARP_LIB_DIR}/\1.dll;g" \ 217 -e "s; \.\./pango/pango-sharp.dll; $(get_sharp_lib pango-sharp-2.0);g" \
218 -e "s; \.\./art/art-sharp.dll; $(get_sharp_lib art-sharp-2.0);g" \
219 -e "s; \.\./atk/atk-sharp.dll; $(get_sharp_lib atk-sharp-2.0);g" \
220 -e "s; \.\./gdk/gdk-sharp.dll; $(get_sharp_lib gdk-sharp-2.0);g" \
221 -e "s; \.\./gtk/gtk-sharp.dll; $(get_sharp_lib gtk-sharp-2.0);g" \
222 -e "s;\.\./gnomevfs/gnome-vfs-sharp.dll;$(get_sharp_lib gnome-vfs-sharp-2.0);g" \
223 -e "s;\$(top_builddir)/art/art-sharp.dll;$(get_sharp_lib art-sharp-2.0);" \
224 -e "s;\$(top_builddir)/gnome/gnome-sharp.dll;$(get_sharp_lib gnome-sharp-2.0);" \
225 -e "s;\$(RUNTIME) \$(top_builddir)/parser/gapi-fixup.exe;${GAPI_FIXUP};" \
226 -e "s;\$(RUNTIME) \$(top_builddir)/generator/gapi_codegen.exe;${GAPI_CODEGEN};" \
103 -e "s:\$(SYMBOLS) \$(top_builddir)/parser/gapi-fixup.exe:\$(SYMBOLS):" \ 227 -e "s:\$(SYMBOLS) \$(top_builddir)/parser/gapi-fixup.exe:\$(SYMBOLS):" \
104 -e "s:\$(INCLUDE_API) \$(top_builddir)/generator/gapi_codegen.exe:\$(INCLUDE_API):" \ 228 -e "s:\$(INCLUDE_API) \$(top_builddir)/generator/gapi_codegen.exe:\$(INCLUDE_API):" \
105 -e "s:\$(RUNTIME) \$(top_builddir)/parser/gapi-fixup.exe:${gapi_fixup}:" \
106 -e "s:\$(RUNTIME) \$(top_builddir)/generator/gapi_codegen.exe:${gapi_codegen}:" \
107 ${makefiles} || die "failed to fix GtkSharp makefiles" 229 "${makefiles[@]}" || die "failed to fix GtkSharp makefiles"
230}
108 231
109 # Oh GtkSharp, why do your pkgconfig entries suck donkey ass? Why do 232get_sharp_lib() {
110 # gnome-desktop-sharp modules use ${assemblies_dir} for Libs: instead of 233 S="$(pkg-config --libs ${1})"
111 # the convention you yourself introduced for gnome-sharp, which just uses 234 S=${S%% *}
112 # @PACKAGE_VERSION@? Are you just trying to annoy me? 235 printf ${S#-r:}
113 local pcins="$(find ${S} -name *.pc.in)" 236}
114 sed -i -e 's:^libdir.*:libdir=@libdir@:' \ 237
115 -e "s:\${assemblies_dir}:\${libdir}/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}:" \ 238gtk-sharp_tarball_src_prepare() {
116 ${pcins} || die "failed to fix GtkSharp pkgconfig entries" 239 local package
240 sed -i -e '/SUBDIRS/s/ glib / /' \
241 -e '/SUBDIRS/s/ glade / /' \
242 -e '/SUBDIRS/s/ sample / /' \
243 -e '/SUBDIRS/s/ doc/ /' \
244 Makefile.am || die "failed sedding sense into gtk-sharp's Makefile.am"
245 for package in GLIB PANGO ATK GTK
246 do
247 sed -r -i -e "s:(PKG_CHECK_MODULES\(${package}.*)\):\1,[foo=bar],[bar=foo]):" \
248 configure.in || die "failed sedding sense into gnome-sharp's configure.in"
249 done
250 EAUTORECONF=YES
251}
252
253gnome-sharp_tarball_src_prepare() {
254 if ! [[ "${PN}" = "gconf-sharp" ]]
255 then
256 sed -r -i -e "s:(PKG_CHECK_MODULES\(GLADESHARP.*)\):\1,[foo=bar],[bar=foo]):" \
257 configure.in || die "failed sedding sense into gnome-sharp's configure.in"
258 EAUTORECONF=YES
259 fi
117} 260}
118 261
119gtk-sharp-module_src_prepare() { 262gtk-sharp-module_src_prepare() {
120 # Make selecting components configurable. 263 if [[ "$(type -t $(gsm_get_tarball)_tarball_src_prepare)" = "function" ]]
121 epatch ${WORKDIR}/${MY_P}-configurable.diff
122
123 # Fixes support with pkgconfig-0.17, #92503.
124 sed -i -e 's/\<PKG_PATH\>/GTK_SHARP_PKG_PATH/g' \
125 -e ':^CFLAGS=:d' \
126 "${S}"/configure.in
127
128 # Fix install data hook, #161093.
129 if [ -f "${S}/sample/gconf/Makefile.am" ]
130 then 264 then
131 sed -i -e 's/^install-hook/install-data-hook/' \ 265 ebegin "Running $(gsm_get_tarball)_tarball_src_prepare"
132 "${S}"/sample/gconf/Makefile.am || die 266 $(gsm_get_tarball)_tarball_src_prepare
267 eend $?
133 fi 268 fi
269 base_src_util autopatch
134 270
135 # Disable building samples, #16015. 271 [[ ${EAUTORECONF} ]] && eautoreconf
136 sed -i -e "s:sample::" "${S}"/Makefile.am || die
137 272
138 eautoreconf
139
140 cd "${S}"/${GTK_SHARP_MODULE_DIR} 273 cd "${S}/${GTK_SHARP_MODULE_DIR}"
141 274
142 gtk-sharp-module_fix_files 275 gtk-sharp-module_fix_files &> /dev/null
143} 276}
144 277
145gtk-sharp-module_src_configure() { 278gtk-sharp-module_src_configure() {
146 # Disable any module besides one(s) we want. 279 econf --disable-static \
147 local module gtk_sharp_conf 280 --disable-dependency-tracking \
281 --disable-maintainer-mode \
282 $(use debug &&echo "--enable-debug" ) \
283 ${gtk_sharp_conf} \
284 ${@} || die "econf failed"
285}
148 286
149 einfo "Configuring to build ${PN} module ..." 287gtk-sharp-module_src_compile() {
288 cd "${S}/${GTK_SHARP_MODULE_DIR}"
289 emake || die "emake failed"
290}
150 291
151 # No bogus configure parameters please. 292gtk-sharp-module_src_install() {
152 [[ ${GTK_SHARP_MODULE} == "gnome-desktop" ]] && GTK_SHARP_MODULE=
153 293
154 for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do 294 cd "${GTK_SHARP_MODULE_DIR}"
155 my_module_list=${my_module_list/${module}/} 295 emake DESTDIR=${D} install || die "emake install failed"
296 mono_multilib_comply
297 find "${D}" -name '*.la' -exec rm -rf '{}' '+' || die "la removal failed"
298 if has "${GTK_SHARP_MODULE}" gtk gdk atk pango
299 then
300 find "${D}" -name '*.pc' -exec rm -rf '{}' '+' || die "la removal failed"
301 pkgconfig_filename="${PN}${GTK_SHARP_SLOT_DEC}"
302 pkgconfig_pkgname="${GTK_SHARP_MODULE}#"
303 pkgconfig_description=".NET/Mono bindings for ${GTK_SHARP_MODULE}"
304 pkgconfig_monodir="$(gsm_get_tarball)${GTK_SHARP_SLOT_DEC}"
305 case ${GTK_SHARP_MODULE} in
306 gtk)
307 pkgconfig_requires="glib-sharp${GTK_SHARP_SLOT_DEC} atk-sharp${GTK_SHARP_SLOT_DEC} gdk-sharp${GTK_SHARP_SLOT_DEC} pango-sharp${GTK_SHARP_SLOT_DEC}"
308 ;;
309 gdk)
310 pkgconfig_requires="glib-sharp${GTK_SHARP_SLOT_DEC} pango-sharp${GTK_SHARP_SLOT_DEC}"
311 ;;
312 atk)
313 pkgconfig_requires="glib-sharp${GTK_SHARP_SLOT_DEC}"
314 ;;
315 pango)
316 pkgconfig_requires="glib-sharp${GTK_SHARP_SLOT_DEC}"
317 ;;
318 *)
319 die "unhandled gtk_sharp_module"
320 ;;
321 esac
322 generate_pkgconfig
323 fi
324}
325
326EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install
327
328generate_pkgconfig() {
329 ebegin "Generating .pc file for ${P}"
330 local dll \
331 gfile \
332 pkgconfig_gapidir \
333 apifile \
334 LSTRING='Libs:' \
335 CSTRING='Cflags:' \
336 pkgconfig_filename="${1:-${pkgconfig_filename:-${PN}}}" \
337 pkgconfig_monodir="${2:-${pkgconfig_monodir:-${pkgconfig_filename}}}" \
338 pkgconfig_pkgname="${3:-${pkgconfig_pkgname:-${pkgconfig_filename}}}" \
339 pkgconfig_version="${4:-${pkgconfig_version:-${PV}}}" \
340 pkgconfig_description="${5:-${pkgconfig_description:-${DESCRIPTION}}}" \
341 pkgconfig_requires="${6:-${pkgconfig_requires}}" \
342
343 pushd "${D}/usr/" &> /dev/null
344 apifile=$(find share -name '*-api.xml' 2>/dev/null)
345 popd &> /dev/null
346
347 pkgconfig_gapidir=${apifile:+\$\{prefix\}/${apifile%/*}}
348
349 dodir "/usr/$(get_libdir)/pkgconfig"
350 cat <<- EOF -> "${D}/usr/$(get_libdir)/pkgconfig/${pkgconfig_filename}.pc"
351 prefix=\${pcfiledir}/../..
352 exec_prefix=\${prefix}
353 libdir=\${prefix}/$(get_libdir)
354 gapidir=${pkgconfig_gapidir}
355 Name: ${pkgconfig_pkgname}
356 Description: ${pkgconfig_description}
357 Version: ${pkgconfig_version}
358 EOF
359
360 for gfile in "${D}"/usr/${apifile%/*}/*-api.xml
361 do
362 CSTRING="${CSTRING} -I:"'${gapidir}'"/${gfile##*/}"
363 done
364 echo "${CSTRING}" >> "${D}/usr/$(get_libdir)/pkgconfig/${pkgconfig_filename}.pc"
365
366
367 for dll in "${D}"/usr/$(get_libdir)/mono/${pkgconfig_monodir}/*.dll
368 do
369 if ! [[ "${dll##*/}" == "policy."*".dll" ]]
370 then
371 LSTRING="${LSTRING} -r:"'${libdir}'"/mono/${pkgconfig_monodir}/${dll##*/}"
372 fi
156 done 373 done
157 for module in ${my_module_list} ; do 374 echo "${LSTRING}" >> "${D}/usr/$(get_libdir)/pkgconfig/${pkgconfig_filename}.pc"
158 gtk_sharp_conf="${gtk_sharp_conf} --disable-${module} "
159 done
160 for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do
161 gtk_sharp_conf="${gtk_sharp_conf} --enable-${module} "
162 done
163 375
164 cd "${S}" 376 if [[ "${pkgconfig_requires}" ]]
165 econf ${@} ${gtk_sharp_conf} || die "econf failed" 377 then
378 printf "Requires: ${pkgconfig_requires}" >> "${D}/usr/$(get_libdir)/pkgconfig/${pkgconfig_filename}.pc"
379 fi
380 PKG_CONFIG_PATH="${D}/usr/$(get_libdir)/pkgconfig/" pkg-config --silence-errors --libs ${pkgconfig_filename} &> /dev/null
381 eend $?
166} 382}
167 383
168gtk-sharp-module_src_compile() {
169
170 cd "${S}"/${GTK_SHARP_MODULE_DIR}
171 LANG=C emake ${OVERRIDEJOBS} || die "emake failed"
172}
173
174gtk-sharp-module_src_install() {
175 cd ${GTK_SHARP_MODULE_DIR}
176 LANG=C emake ${OVERRIDEJOBS} GACUTIL_FLAGS="/root ${D}/usr/$(get_libdir) /gacdir /usr/$(get_libdir) /package gtk-sharp${GTK_SHARP_SLOT_DEC}" \
177 DESTDIR="${D}" install || die "emake install failed"
178}
179
180EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20