-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathgnome2.cygclass
255 lines (224 loc) · 7.37 KB
/
gnome2.cygclass
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
################################################################################
#
# gnome2.cygclass - functions for building GNOME 2.x packages
#
# Part of cygport - Cygwin packaging application
# Copyright (C) 2006-2020 Cygport authors
# Provided by the Cygwin project <https://cygwin.com/>
#
# cygport is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# cygport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with cygport. If not, see <https://www.gnu.org/licenses/>.
#
################################################################################
#****h* Cygclasses/gnome2.cygclass
# SYNOPSIS
# inherit gnome2
# DESCRIPTION
# The GNOME project provides a full-featured X desktop with a wide variety
# of applications, built on an object-oriented library stack based on GLib
# and the GTK+ toolkit. Most packages are written in C and are built with
# an autotools-based system with some additional tools.
#
# This cygclass manages the building of most GNOME-based packages.
# INHERITS
# autotools.cygclass, gnome.org.cygclass
#****
inherit gnome.org
#****C* gnome2.cygclass/gnome2_autoreconf
# SYNOPSIS
# gnome2_autoreconf
# DESCRIPTION
# Updates the build system with gnome-autogen.sh. gnome2_autoreconf must be
# run in the directory containing the top-level configure.ac or configure.in
# (usually $S).
# WARNING
# Skipping this step is strongly discouraged. Patches to configure.ac, aclocal
# macros, or Makefile.am files will not take effect until their tools have been
# regenerated. Also, Cygwin's libtool package often includes patches which
# are not yet available in the latest upstream release, so libraries may not
# be built optimally, or even correctly, without this step having been run.
# The same applies for some of the GNOME build tools as well.
# REQUIRES
# autoconf, automake, gettext-devel, gnome-common, gnome-doc-utils, gtk-doc,
# intltool, libglib2.0-devel, libtool, pkg-config.
# SEE ALSO
# cygautoreconf
#****
gnome2_autoreconf() {
local auxdir
local configure_ac
local skip_d
if [ -e configure.ac ]
then
configure_ac="configure.ac"
elif [ -e configure.in ]
then
configure_ac="configure.in"
else
error "gnome2: configure.ac or configure.in not found"
fi
check_prog_req gnome-autogen.sh gnome-common
if [ -f omf-install/Makefile.am -o -f omf.make -o -f xmldocs.make ]
then
USE_COMMON_DOC_BUILD=yes
fi
if defined WANT_AUTOMAKE
then
export ACLOCAL=aclocal-${WANT_AUTOMAKE}
export AUTOMAKE=automake-${WANT_AUTOMAKE}
else
export ACLOCAL=aclocal-$(automake --version | head -n 1 | sed 's/^.*[ ]\([0-9]*\.[0-9]*\).*$/\1/')
export AUTOMAKE=${ACLOCAL/aclocal/automake}
fi
export ACLOCAL_FLAGS
export NOCONFIGURE=1
export PKG_NAME=${ORIG_PN:-${PN}}
export REQUIRED_LIBTOOL_VERSION=2.2.2
export USE_COMMON_DOC_BUILD
if cross_compiling
then
local ccsysroot=$(${CC} -print-sysroot)
local sysrootltize=${ccsysroot}$(__target_prefix)/bin/libtoolize
local sysrootaclocaldir=${ccsysroot}$(__target_prefix)/share/aclocal
if [ -x ${sysrootltize} ]
then
export LIBTOOLIZE=${sysrootltize}
fi
if [ -d ${sysrootaclocaldir} ]
then
ACLOCAL_FLAGS+=" -I ${sysrootaclocaldir}"
fi
fi
#****v* gnome2.cygclass/GNOME2_NO_AUTOGEN
# DESCRIPTION
# By default, gnome-autogen.sh will retool the working directory's and any
# subdirectories containing a configure.ac/configure.in which may be configured
# separately with an AC_CONFIG_SUBDIRS. If a subdirectory need not be
# retooled (e.g. it will not built for whatever reason), or it does not use
# autotools (e.g. the libdb included in evolution), define this variable to
# the subdirectories to skip, relative to the directory where gnome2_autoreconf
# will be run (usually $S).
#****
for skip_d in ${GNOME2_NO_AUTOGEN//,/ }
do
if [ ! -d ${skip_d} ]
then
warning "GNOME2_NO_AUTOGEN: directory not found: ${skip_d}"
continue
fi
touch ${skip_d}/NO-AUTO-GEN
done
# sometimes ACLOCAL_AMFLAGS is defined but the given directory
# exists only in VCS (or is created by an autogen.sh) and is
# not shipped in the tarball
if [ -f Makefile.am ]
then
__parse_aclocal_amflags $(grep '^ACLOCAL_AMFLAGS' Makefile.am | sed 's/=/ = /') | xargs -r mkdir -p
fi
__config_set with_autoconf 1
if [ ! -f aclocal.m4 ] || $(head -n 1 aclocal.m4 | grep -q 'generated.* by aclocal')
then
__config_set with_aclocal 1
fi
if $(grep -q A[CM]_CONFIG_HEADER ${configure_ac})
then
__config_set with_autoheader 1
fi
if $(grep -q AM_INIT_AUTOMAKE ${configure_ac})
then
__config_set with_automake 1
fi
if $(grep -Eq '(A[CM]_PROG_LIBTOOL|LT_INIT)' ${configure_ac})
then
__config_set with_libtool 1
fi
# FIXME: does not detect sublevel configures
if $(grep -Eq 'AM_(GNU_GETTEXT|ICONV)' ${configure_ac})
then
__config_set with_gnu_gettext 1
cp -f /usr/share/gettext/config.rpath .
elif $(grep -Eq 'AM_GLIB_GNU_GETTEXT' ${configure_ac})
then
__config_set with_glib_gettext 1
fi
if $(grep -Eq '(AC|IT)_PROG_INTLTOOL' ${configure_ac})
then
__config_set with_intltool 1
fi
if $(grep -q '\./libtool -' ${configure_ac}) && ! $(grep -q 'LT_OUTPUT' ${configure_ac})
then
warning "${configure_ac} may require LT_OUTPUT macro"
fi
# aclocal requires that its directories exist
sed -n -e 's|^AC_CONFIG_MACRO_DIRS*(\[*\([^]]*\)\]*).*|\1|p' ${configure_ac} | xargs -r mkdir -p
# Automake will exit if these are not present
# dodoc won't install these, however, if they are empty
touch AUTHORS COPYING ChangeLog INSTALL NEWS README
gnome-autogen.sh || error "gnome2: autoreconf failed"
auxdir="$(grep '^[^\#]*AC_CONFIG_AUX_DIR' ${configure_ac} | sed -e 's!.*AC_CONFIG_AUX_DIR(\[*\(.*\))!\1!g' -e 's!\]*!!g')"
if [ -f ${auxdir:-.}/config.guess ]
then
gnuconfigize ${auxdir:-.}
fi
}
#****C* gnome2.cygclass/gnome2_configure
# SYNOPSIS
# cd $B
# gnome2_configure [CONFIGURE_FLAGS]
# DESCRIPTION
# Calls cygconf with the following options:
# * --enable-gtk-doc: create and install API docs (native builds only)
# * --disable-schemas-install: GConf schemas are still installed, but are
# registered with postinstall and preremove scripts
# * --disable-scrollkeeper: Scrollkeeper is obsolete
# All arguments to gnome2_configure are passed to cygconf as configure flags.
#****
gnome2_configure() {
local gtk_doc
# packages that use intltool w/o glib-gettext get this wrong
export DATADIRNAME="share"
if cross_compiling
then
gtk_doc="--disable-gtk-doc"
else
gtk_doc="--enable-gtk-doc"
fi
cygconf \
${gtk_doc} \
--disable-schemas-install \
--disable-scrollkeeper \
"${@}"
}
#****C* gnome2.cygclass/gnome2_compile
# SYNOPSIS
# cd $B
# gnome2_compile [CONFIGURE_FLAGS]
# DESCRIPTION
# Calls gnome2_configure followed by cygmake. All arguments to gnome2_compile
# are passed as configure flags.
#****
gnome2_compile() {
gnome2_configure "${@}"
cygmake
}
#****o* gnome2.cygclass/src_compile (gnome2)
# DEFINITION
src_compile() {
cd ${S}
gnome2_autoreconf
cd ${B}
gnome2_configure
cygmake
}
#****
readonly -f gnome2_autoreconf gnome2_configure gnome2_compile