/[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.2 Revision 1.7
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.2 2008/11/26 00:54:41 loki_val Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gtk-sharp-module.eclass,v 1.7 2008/12/03 20:44:04 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
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}* 38DEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*
39 >=sys-apps/sed-4" 39 >=sys-apps/sed-4
40 >=dev-util/pkgconfig-0.23"
40RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*" 41RDEPEND="=dev-dotnet/gtk-sharp-${GTK_SHARP_REQUIRED_VERSION}*"
41 42
42RESTRICT="test" 43RESTRICT="test"
43 44
44# The GtkSharp modules are currently divided into three seperate tarball 45# The GtkSharp modules are currently divided into three seperate tarball
45# 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
46# 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
47# 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}
48# obsolete. 49# obsolete.
49gtk_sharp_module_list="glade"
50gnome_sharp_module_list="art gnome gnomevfs" 50gnome_sharp_module_list="art gnome gnomevfs"
51gnome_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"
52 52
53if [[ " ${gtk_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
54 my_module_list="${gtk_sharp_module_list}"
55 my_tarball="gtk-sharp"
56elif [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then 53if [[ " ${gnome_sharp_module_list} " == *" ${GTK_SHARP_MODULE} "* ]] ; then
57 my_module_list="${gnome_sharp_module_list}" 54 my_module_list="${gnome_sharp_module_list}"
58 my_tarball="gnome-sharp" 55 my_tarball="gnome-sharp"
59 56
60# 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
61# 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.
79 76
80 77
81### Public functions. 78### Public functions.
82 79
83gtk-sharp-module_fix_files() { 80gtk-sharp-module_fix_files() {
84 # Change references like "/r:../glib/glib-sharp.dll" -> 81 # Change references like "/r:../art/art-sharp.dll" ->
85 # "/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
86 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" -> 83 # "../glib/glib-sharp.xml" or "$(top_srcdir)/glib/glib-sharp.xml" ->
87 # "${GAPI_DIR}/glib-sharp.xml". 84 # "${gapi_dir}/glib-sharp.xml".
88 # 85 #
89 # 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
90 # not the ones that would be built locally. 87 # not the ones that would be built locally.
91 local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}" 88 local gapi_dir="${ROOT}/usr/share/gapi${GTK_SHARP_SLOT_DEC}"
92 local gapi_fixup="gapi${GTK_SHARP_SLOT}-fixup"
93 local gapi_codegen="gapi${GTK_SHARP_SLOT}-codegen"
94 89
95 # This is very likely to be of use outside of this function as well, so make 90 local makefiles=( $(find "${S}" -name Makefile.in) )
96 # it public. 91 sed -i \
97 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}
98 99
99 local makefiles="$(find ${S} -name Makefile.in)" 100get_sharp_lib() {
100 sed -i -e "s;\(\.\.\|\$(top_srcdir)\)/[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).xml;${gapi_dir}/\2.xml;g" \ 101 S="$(pkg-config --libs ${1})"
101 -e "s;/r:\(\.\./\)*[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;/r:${GTK_SHARP_LIB_DIR}/\2.dll;g" \ 102 S=${S%% *}
102 -e "s;\.\./[[:alpha:]]*/\([[:alpha:]]*\(-[[:alpha:]]*\)*\).dll;${GTK_SHARP_LIB_DIR}/\1.dll;g" \ 103 printf ${S#-r:}
103 -e "s:\$(SYMBOLS) \$(top_builddir)/parser/gapi-fixup.exe:\$(SYMBOLS):" \
104 -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"
108
109 # Oh GtkSharp, why do your pkgconfig entries suck donkey ass? Why do
110 # gnome-desktop-sharp modules use ${assemblies_dir} for Libs: instead of
111 # the convention you yourself introduced for gnome-sharp, which just uses
112 # @PACKAGE_VERSION@? Are you just trying to annoy me?
113 local pcins="$(find ${S} -name *.pc.in)"
114 sed -i -e 's:^libdir.*:libdir=@libdir@:' \
115 -e "s:\${assemblies_dir}:\${libdir}/mono/gtk-sharp${GTK_SHARP_SLOT_DEC}:" \
116 ${pcins} || die "failed to fix GtkSharp pkgconfig entries"
117} 104}
118 105
119gtk-sharp-module_src_prepare() { 106gtk-sharp-module_src_prepare() {
120 # Make selecting components configurable. 107 # Make selecting components configurable.
121 epatch ${WORKDIR}/${MY_P}-configurable.diff 108 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
131 sed -i -e 's/^install-hook/install-data-hook/' \
132 ${S}/sample/gconf/Makefile.am || die
133 fi
134 109
135 # Disable building samples, #16015. 110 # Disable building samples, #16015.
136 sed -i -e "s:sample::" ${S}/Makefile.am || die 111 sed -i -e "s:sample::" "${S}/Makefile.am" || die
137 112
138 eautoreconf 113 eautoreconf
139 114
140 cd ${S}/${GTK_SHARP_MODULE_DIR} 115 cd "${S}/${GTK_SHARP_MODULE_DIR}"
141 116
142 gtk-sharp-module_fix_files 117 gtk-sharp-module_fix_files &> /dev/null
143} 118}
144 119
145gtk-sharp-module_src_configure() { 120gtk-sharp-module_src_configure() {
146 # Disable any module besides one(s) we want. 121 # Disable any module besides one(s) we want.
147 local module gtk_sharp_conf 122 local module gtk_sharp_conf
159 done 134 done
160 for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do 135 for module in ${GTK_SHARP_MODULE} ${GTK_SHARP_MODULE_DEPS} ; do
161 gtk_sharp_conf="${gtk_sharp_conf} --enable-${module} " 136 gtk_sharp_conf="${gtk_sharp_conf} --enable-${module} "
162 done 137 done
163 138
164 cd ${S} 139 cd "${S}"
165 econf ${@} ${gtk_sharp_conf} || die "econf failed" 140 econf ${@} ${gtk_sharp_conf} || die "econf failed"
166} 141}
167 142
168gtk-sharp-module_src_compile() { 143gtk-sharp-module_src_compile() {
169 144
170 cd ${S}/${GTK_SHARP_MODULE_DIR} 145 cd "${S}/${GTK_SHARP_MODULE_DIR}"
171 LANG=C emake -j1 || die "emake failed" 146 LANG=C emake || die "emake failed"
172} 147}
173 148
174gtk-sharp-module_src_install() { 149gtk-sharp-module_src_install() {
175 cd ${GTK_SHARP_MODULE_DIR} 150 cd "${GTK_SHARP_MODULE_DIR}"
176 LANG=C emake 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" 151 LANG=C emake DESTDIR=${D} install || die "emake install failed"
178} 152}
179 153
180EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install 154EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install

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

  ViewVC Help
Powered by ViewVC 1.1.20