1 ################################################################################
3 # kde3.cygclass - functions for building KDE 3.x 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/kde3.cygclass
28 # The KDE project provides a full-featured X desktop with a wide variety
29 # of applications, built on a library stack all based on the Qt C++ library.
30 # Most packages are written in C++ and are built with a modified autotools
33 # This cygclass manages the building of most KDE3-based packages.
35 # * This is only for KDE 3.x packages; for KDE 4.x, use kde4.cygclass instead.
36 # * The KDE 3.x series is no longer maintained upstream. This should only
37 # be used for packages which have not been ported to KDE 4 or 5.
39 # autotools.cygclass, kde.org.cygclass, qt3.cygclass
44 if [ ${PV} = 3.5.10 ] || [ ${P} = arts-1.5.10 ]
46 #****o* kde3.cygclass/PATCH_URI (kde3)
48 # Several autotool compatibility patches are automatically applied to
49 # KDE 3.5.10 packages. If further patches are required, be sure to append,
50 # not replace, PATCH_URI.
51 # Other KDE3-based packages will need to backport these changes themselves.
54 https://src.fedoraproject.org/rpms/kdelibs3/raw/master/f/kde3-acinclude.patch
55 https://src.fedoraproject.org/rpms/kdelibs3/raw/master/f/kde3-automake-version.patch
56 https://src.fedoraproject.org/rpms/kdelibs3/raw/master/f/kde3-automake-add-missing.patch
61 #****o* kde3.cygclass/CXXFLAGS (kde3)
63 CXXFLAGS+=" -Wno-narrowing -std=gnu++98"
66 # KDE prefix, used by both autotools and FindKDE3.cmake
69 #****C* kde3.cygclass/kde3_autoreconf
74 # Updates the build system with the special files included in each package's
77 # Skipping this step is strongly discouraged. Patches to configure.ac, aclocal
78 # macros, or Makefile.am files will not take effect until their tools have been
79 # regenerated. Also, Cygwin's libtool package includes patches which were not
80 # yet available in the last release, so libraries may not be built optimally,
81 # or even correctly, without this step having been run, particularly on x86_64.
83 # autoconf, automake, libtool, perl
89 kde-i18n-*|koffice-l10n-*)
90 info "No need to autoreconf KDE i18n/l10n packages."
95 if [ ! -e admin/Makefile.common ]
97 error "No KDE source package detected"
100 find . -name '*.ui' -exec touch '{}' +
102 __config_set with_aclocal 1
103 __config_set with_autoconf 1
104 __config_set with_autoheader 1
105 __config_set with_automake 1
106 __config_set with_libtool 1
109 check_prog_req libtoolize libtool
111 # rely on libtool macro(s) in system aclocal path
112 echo -n > admin/libtool.m4.in
114 libtoolize --copy --force --install || error "kde3: libtoolize failed"
117 make -f admin/Makefile.common || error "KDE autoreconf failed"
120 #****C* kde3.cygclass/kde3_compile
122 # kde3_compile [OPTIONS]
124 # Runs cygconf to configure the package with several Cygwin- and KDE-specific
125 # options, then runs cygmake to compile. Options, in the form of configure
126 # flags, are passed on to cygconf.
128 # Select source subdirectories can be not built by defining DO_NOT_COMPILE.
131 #****v* kde3_compile/DO_NOT_COMPILE
133 # DO_NOT_COMPILE="DIRECTORY1 [DIRECTORY2] ..."
135 # String list of source subdirectories that should not be built, usually
136 # because they have been ported to KDE 4 or 5, or are Linux-specific.
138 export DO_NOT_COMPILE
141 --includedir=/usr/include/kde3 \
142 --disable-debug --without-debug \
143 --disable-dependency-tracking \
146 --disable-new-ldflags \
154 --with-qt-dir=${QT3_QTDIR} \
155 --with-qt-includes=${QT3_INCLUDEDIR} \
156 --with-qt-libraries=${QT3_LIBDIR} --enable-mt \
157 --with-arts --enable-arts \
158 --with-distribution=Cygwin \
159 --with-ssl-dir=/usr \
163 kde_cv_prog_cxx_fvisibility_hidden=no \
169 #****I* kde3.cygclass/kde3_install
171 # kde3_install [OPTIONS]
173 # Installs a KDE3 package with cyginstall into $D with some additional steps:
174 # * Import libraries for libkdeinit_* libraries are removed, as they are never used.
175 # * Import libraries are rearranged to avoid conflicting with KDE 4.
176 # * Help documentation for components listed in DO_NOT_COMPILE is removed.
177 # * README docs for subpackages in PKG_NAMES are installed into their own
178 # subdirectories of /usr/share/doc/ under $D.
179 # Options, if any, are passed on to cyginstall.
182 local doc kdepkg la nopkg
184 cyginstall destdir=${D}
186 for kdepkg in ${PKG_NAMES:-${PN}}
188 if [ -d ${S}/${kdepkg} ]
191 dodoc ${S}/${kdepkg}/{AUTHORS,BUGS,ChangeLog,NEWS,README,TODO}
192 elif [ -d ${S}/${kdepkg#${PN}-} ]
195 dodoc ${S}/${kdepkg#${PN}-}/{AUTHORS,BUGS,ChangeLog,NEWS,README,TODO}
199 # except for kded in kdelibs, libkdeinit_* implibs are unnecessary
200 if [ -d ${D}/usr/lib ]
202 find ${D}/usr/lib -name 'libkdeinit_*.la' ! -name 'libkdeinit_kded.la' -exec sed -i -e 's/link=no/link=yes/' '{}' +
204 dodir /usr/lib/kde3/devel
205 for la in ${D}/usr/lib/*.la
207 if grep -q '^shouldnotlink=no$' ${la} 2>/dev/null
209 mv ${la%.la}.dll.a ${D}/usr/lib/kde3/devel/
210 sed -e "\|^library_names=|s|'lib|'kde3/devel/lib|" \
211 -e "/^dependency_libs=/s/ -l[^qX][^ ']*//g" \
217 for nopkg in ${DO_NOT_COMPILE}
219 rm -fr ${D}/usr/share/doc/HTML/en/${nopkg}
223 #****o* kde3.cygclass/KEEP_LA_FILES (kde3)
225 # KDE 3 uses a custom libltdl to load modules, and the build system
226 # generally links with only the highest level libraries, e.g. just -lkdeui,
227 # without specifying -lkdecore or -lqt-mt. This only works as-is if all
228 # libtool library files are present.
233 #****o* kde3.cygclass/src_compile (kde3)
238 kde-i18n-*|koffice-l10n-*) ;;
239 *) kde3_autoreconf ;;
247 #****o* kde3.cygclass/src_install (kde3)
255 readonly -f kde3_autoreconf kde3_compile kde3_install