/[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.5 Revision 1.6
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.5 2008/11/27 05:24:23 loki_val Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gtk-sharp-module.eclass,v 1.6 2008/11/28 00:20:08 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
33DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module" 33DESCRIPTION="GtkSharp's ${GTK_SHARP_MODULE} module"
34HOMEPAGE="http://www.mono-project.com/GtkSharp" 34HOMEPAGE="http://www.mono-project.com/GtkSharp"
35 35
36LICENSE="LGPL-2.1" 36LICENSE="LGPL-2.1"
37 37
38DEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*
39 >=sys-apps/sed-4
40 >=dev-util/pkgconfig-0.23"
38RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}* 41RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
39 >=dev-lang/mono-2"
40DEPEND="${RDEPEND}
41 >=sys-apps/sed-4"
42 42
43RESTRICT="test" 43RESTRICT="test"
44 44
45# The GtkSharp modules are currently divided into three seperate tarball 45# The GtkSharp modules are currently divided into three seperate tarball
46# distributions. Figure out which of these our component belongs to. This is 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 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} 48# correct tarball to download. Note that this makes ${GTK_SHARP_TARBALL_PREFIX}
49# obsolete. 49# obsolete.
50gtk_sharp_module_list="glade"
51gnome_sharp_module_list="art gnome gnomevfs" 50gnome_sharp_module_list="art gnome gnomevfs"
52gnome_desktop_sharp_module_list="gnome-print gnome-panel gtkhtml gtksourceview nautilusburn rsvg vte wnck" 51gnome_desktop_sharp_module_list="gnome-print gnome-panel gtkhtml gtksourceview nautilusburn rsvg vte wnck"
53 52
54if [[ " ${gtk_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
55 my_module_list="${gtk_sharp_module_list}"
56 my_tarball="gtk-sharp"
57elif [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then 53if [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
58 my_module_list="${gnome_sharp_module_list}" 54 my_module_list="${gnome_sharp_module_list}"
59 my_tarball="gnome-sharp" 55 my_tarball="gnome-sharp"
60 56
61# While gnome-desktop-sharp is a part of gnome-desktop-sharp (0_o) it is not a 57# 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. 58# configurable component, so we don't want to put it into the module list.
80 76
81 77
82### Public functions. 78### Public functions.
83 79
84gtk-sharp-module_fix_files() { 80gtk-sharp-module_fix_files() {
85 # Change references like "/r:../glib/glib-sharp.dll" -> 81 # Change references like "/r:../art/art-sharp.dll" ->
86 # "/r:${GTK_SHARP_LIB_DIR}/glib-sharp.dll" and references like 82 # "/r:/usr/lib/pkgconfig/../../lib/mono/gtk-sharp-2.0/art-sharp.dll" and references like
87 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" -> 83 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" ->
88 # "${GAPI_DIR}/glib-sharp.xml". 84 # "${gapi_dir}/glib-sharp.xml".
89 # 85 #
90 # We also make sure to call the installed gapi-fixup and gapi-codegen and 86 # We also make sure to call the installed gapi-fixup and gapi-codegen and
91 # not the ones that would be built locally. 87 # not the ones that would be built locally.
92 local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}" 88 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 89
96 # This is very likely to be of use outside of this function as well, so make 90 local makefiles=( $(find "${S}" -name Makefile.in) )
97 # it public. 91 sed -i \
98 GTK_SHARP_LIB_DIR="${ROOT}/usr/$(get_libdir)/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}" 92 -e "s;\(\.\.\|\$(top_srcdir)\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \
93 -e "s; \.\./art/art-sharp.dll; $(get_sharp_lib art-sharp-2.0);g" \
94 -e "s;\.\./gnomevfs/gnome-vfs-sharp.dll;$(get_sharp_lib gnome-vfs-sharp-2.0);g" \
95 -e "s;\$(top_builddir)/art/art-sharp.dll;$(get_sharp_lib art-sharp-2.0);" \
96 -e "s;\$(top_builddir)/gnome/gnome-sharp.dll;$(get_sharp_lib gnome-sharp-2.0);" \
97 "${makefiles[@]}" || die "failed to fix GtkSharp makefiles"
98}
99 99
100 local makefiles="$(find ${S} -name Makefile.in)" 100get_sharp_lib() {
101 sed -i -e "s;\(\.\.\|\$(top_srcdir)\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \ 101 S="$(pkg-config --libs ${1})"
102 -e "s;/r:\(\.\./\)*[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;/r:${GTK_SHARP_LIB_DIR}/\2.dll;g" \ 102 S=${S%% *}
103 -e "s;\.\./[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;${GTK_SHARP_LIB_DIR}/\1.dll;g" \ 103 printf ${S#-r:}
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} 104}
119 105
120gtk-sharp-module_src_prepare() { 106gtk-sharp-module_src_prepare() {
121 # Make selecting components configurable. 107 # Make selecting components configurable.
122 epatch ${WORKDIR}/${MY_P}-configurable.diff 108 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 "${S}"/configure.in
128
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 "${S}"/sample/gconf/Makefile.am || die
134 fi
135 109
136 # Disable building samples, #16015. 110 # Disable building samples, #16015.
137 sed -i -e "s:sample::" "${S}"/Makefile.am || die 111 sed -i -e "s:sample::" "${S}/Makefile.am" || die
138 112
139 eautoreconf 113 eautoreconf
140 114
141 cd "${S}"/${GTK_SHARP_MODULE_DIR} 115 cd "${S}/${GTK_SHARP_MODULE_DIR}"
142 116
143 gtk-sharp-module_fix_files 117 gtk-sharp-module_fix_files
144} 118}
145 119
146gtk-sharp-module_src_configure() { 120gtk-sharp-module_src_configure() {
166 econf ${@} ${gtk_sharp_conf} || die "econf failed" 140 econf ${@} ${gtk_sharp_conf} || die "econf failed"
167} 141}
168 142
169gtk-sharp-module_src_compile() { 143gtk-sharp-module_src_compile() {
170 144
171 cd "${S}"/${GTK_SHARP_MODULE_DIR} 145 cd "${S}/${GTK_SHARP_MODULE_DIR}"
172 LANG=C emake ${OVERRIDEJOBS} || die "emake failed" 146 LANG=C emake || die "emake failed"
173} 147}
174 148
175gtk-sharp-module_src_install() { 149gtk-sharp-module_src_install() {
176 cd ${GTK_SHARP_MODULE_DIR} 150 cd "${GTK_SHARP_MODULE_DIR}"
177 LANG=C emake ${OVERRIDEJOBS} GACUTIL_FLAGS="/root ${D}/usr/$(get_libdir) /gacdir /usr/$(get_libdir) /package gtk-sharp${GTK_SHARP_SLOT_DEC}" \
178 DESTDIR="${D}" install || die "emake install failed" 151 LANG=C emake DESTDIR=${D} install || die "emake install failed"
179} 152}
180 153
181EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install 154EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20