1 ################################################################################
3 # mate.cygclass - functions for building MATE Desktop packages
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****h* Cygclasses/mate.cygclass
28 # The MATE project provides a fork of the GNOME 2 libraries, desktop and
29 # core applications. Most packages are written in C and are built with
30 # an autotools-based system with some additional tools.
32 # This cygclass manages the building of most MATE packages.
37 #****o* mate.cygclass/HOMEPAGE (mate)
39 HOMEPAGE="https://mate-desktop.org/"
42 #****o* mate.cygclass/SRC_URI (mate)
47 1.1.*) SRC_URI="https://pub.mate-desktop.org/releases/${PV[1]}.${PV[2]}/${ORIG_PN:-${PN}}-${PV}.tar.bz2" ;;
48 *) SRC_URI="https://pub.mate-desktop.org/releases/${PV[1]}.${PV[2]}/${ORIG_PN:-${PN}}-${PV}.tar.xz" ;;
53 #****o* mate.cygclass/GIT_URI (mate)
55 # git.cygclass should be inherit()ed last for this to be of use.
57 GIT_URI="git://github.com/mate-desktop/${ORIG_PN:-${PN}}.git"
61 #****C* mate.cygclass/mate_autoreconf
65 # Updates the build system with mate-autogen. mate_autoreconf must be
66 # run in the directory containing the top-level configure.ac or configure.in
69 # Skipping this step is strongly discouraged. Patches to configure.ac, aclocal
70 # macros, or Makefile.am files will not take effect until their tools have been
71 # regenerated. Also, Cygwin's libtool package often includes patches which
72 # are not yet available in the latest upstream release, so libraries may not
73 # be built optimally, or even correctly, without this step having been run.
74 # The same applies for some of the MATE build tools as well.
76 # autoconf, automake, gettext-devel, mate-common, mate-doc-utils, gtk-doc,
77 # intltool, libglib2.0-devel, libtool, pkg-config.
86 if [ -e configure.ac ]
88 configure_ac="configure.ac"
89 elif [ -e configure.in ]
91 configure_ac="configure.in"
93 error "mate: configure.ac or configure.in not found"
96 check_prog_req mate-autogen mate-common
98 if [ -f omf-install/Makefile.am -o -f omf.make -o -f xmldocs.make ] || $(grep -Eq 'MATE_DOC_INIT' ${configure_ac})
100 USE_COMMON_DOC_BUILD=yes
103 if defined WANT_AUTOMAKE
105 export ACLOCAL=aclocal-${WANT_AUTOMAKE}
106 export AUTOMAKE=automake-${WANT_AUTOMAKE}
108 export ACLOCAL=aclocal-$(automake --version | head -n 1 | sed 's/^.*[ ]\([0-9]*\.[0-9]*\).*$/\1/')
109 export AUTOMAKE=${ACLOCAL/aclocal/automake}
114 export PKG_NAME=${ORIG_PN:-${PN}}
115 export REQUIRED_LIBTOOL_VERSION=2.2.2
116 export USE_COMMON_DOC_BUILD
120 local ccsysroot=$(${CC} -print-sysroot)
121 local sysrootltize=${ccsysroot}$(__target_prefix)/bin/libtoolize
122 local sysrootaclocaldir=${ccsysroot}$(__target_prefix)/share/aclocal
123 if [ -x ${sysrootltize} ]
125 export LIBTOOLIZE=${sysrootltize}
127 if [ -d ${sysrootaclocaldir} ]
129 ACLOCAL_FLAGS+=" -I ${sysrootaclocaldir}"
133 #****v* mate.cygclass/MATE_NO_AUTOGEN
135 # By default, mate-autogen will retool the working directory's and any
136 # subdirectories containing a configure.ac/configure.in which may be configured
137 # separately with an AC_CONFIG_SUBDIRS. If a subdirectory need not be
138 # retooled (e.g. it will not built for whatever reason), or it does not use
139 # autotools (e.g. the libdb included in evolution), define this variable to
140 # the subdirectories to skip, relative to the directory where mate_autoreconf
141 # will be run (usually $S).
143 for skip_d in ${MATE_NO_AUTOGEN//,/ }
145 if [ ! -d ${skip_d} ]
147 warning "MATE_NO_AUTOGEN: directory not found: ${skip_d}"
151 touch ${skip_d}/NO-AUTO-GEN
154 # sometimes ACLOCAL_AMFLAGS is defined but the given directory
155 # exists only in VCS (or is created by an autogen.sh) and is
156 # not shipped in the tarball
157 if [ -f Makefile.am ]
159 __parse_aclocal_amflags $(grep '^ACLOCAL_AMFLAGS' Makefile.am | sed 's/=/ = /') | xargs -r mkdir -p
162 __config_set with_autoconf 1
164 if [ ! -f aclocal.m4 ] || $(head -n 1 aclocal.m4 | grep -q 'generated.* by aclocal')
166 __config_set with_aclocal 1
169 if $(grep -q A[CM]_CONFIG_HEADER ${configure_ac})
171 __config_set with_autoheader 1
174 if $(grep -q AM_INIT_AUTOMAKE ${configure_ac})
176 __config_set with_automake 1
179 if $(grep -Eq '(A[CM]_PROG_LIBTOOL|LT_INIT)' ${configure_ac})
181 __config_set with_libtool 1
184 # FIXME: does not detect sublevel configures
185 if $(grep -Eq 'AM_(GNU_GETTEXT|ICONV)' ${configure_ac})
187 __config_set with_gnu_gettext 1
188 cp -f /usr/share/gettext/config.rpath .
189 elif $(grep -Eq 'AM_GLIB_GNU_GETTEXT' ${configure_ac})
191 __config_set with_glib_gettext 1
194 if $(grep -Eq '(AC|IT)_PROG_INTLTOOL' ${configure_ac})
196 __config_set with_intltool 1
199 if $(grep -q '\./libtool -' ${configure_ac}) && ! $(grep -q 'LT_OUTPUT' ${configure_ac})
201 warning "${configure_ac} may require LT_OUTPUT macro"
204 # aclocal requires that its directories exist
205 sed -n -e 's|^AC_CONFIG_MACRO_DIR*(\[*\([^]]*\)\]*).*|\1|p' ${configure_ac} | xargs -r mkdir -p
207 # Automake will exit if these are not present
208 # dodoc won't install these, however, if they are empty
209 touch AUTHORS COPYING ChangeLog INSTALL NEWS README
211 mate-autogen || error "mate: autoreconf failed"
213 auxdir="$(grep '^[^\#]*AC_CONFIG_AUX_DIR' ${configure_ac} | sed -e 's!.*AC_CONFIG_AUX_DIR(\[*\(.*\))!\1!g' -e 's!\]*!!g')"
214 if [ -f ${auxdir:-.}/config.guess ]
216 gnuconfigize ${auxdir:-.}
220 #****C* mate.cygclass/mate_configure
223 # mate_configure [CONFIGURE_FLAGS]
225 # Calls cygconf with the following options:
226 # * --enable-gtk-doc: create and install API docs (native builds only)
227 # * --disable-scrollkeeper: Scrollkeeper is obsolete
228 # All arguments to mate_configure are passed to cygconf as configure flags.
233 # packages that use intltool w/o glib-gettext get this wrong
234 export DATADIRNAME="share"
238 gtk_doc="--disable-gtk-doc"
240 gtk_doc="--enable-gtk-doc"
245 --disable-scrollkeeper \
249 #****C* mate.cygclass/mate_compile
252 # mate_compile [CONFIGURE_FLAGS]
254 # Calls mate_configure followed by cygmake. All arguments to mate_compile
255 # are passed as configure flags.
258 mate_configure "${@}"
262 #****o* mate.cygclass/src_compile (mate)
273 readonly -f mate_autoreconf mate_configure mate_compile