1 ################################################################################
3 # kde4.cygclass - functions for building KDE 4.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/kde4.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++ libraries.
30 # Most packages are written in C++ and are built with CMake.
32 # This cygclass manages the building of most KDE4-based packages.
34 # cmake.cygclass, kde.org.cygclass, qt4.cygclass
37 inherit cmake qt4 kde.org
39 #****v* kde4.cygclass/KDE4_EXTRAGEAR_VERSION
41 # KDE Extragear is a collection of software which is part of the KDE project
42 # but which is not included in the main KDE Software Compilation modules.
43 # Some of these applications are released in tandem with a KDE SC release but
44 # use their own versioning system. Such packages should use their own version
45 # number as PV and define KDE4_EXTRAGEAR_VERSION to indicate with which
46 # version of KDE SC they were released.
48 # If needed, this must be defined before inherit()ing kde4.cygclass.
50 if defined KDE4_EXTRAGEAR_VERSION
52 HOMEPAGE="https://apps.kde.org/${PN}/"
53 SRC_URI="mirror://kde/stable/${KDE4_EXTRAGEAR_VERSION}/src/extragear/${P}-kde${KDE4_EXTRAGEAR_VERSION}.tar.bz2"
54 SRC_DIR="${P}-kde${KDE4_EXTRAGEAR_VERSION}"
59 CYGPORT_USE_UNSTABLE_API=1
61 rm -fv messages/calligra/{braindump,kexi,krita}*
62 if [ -e docs/calligra/CMakeLists.txt ]; then
63 sed -i -e 's/add_subdirectory( *kexi *)/#add_subdirectory(kexi)/g' docs/calligra/CMakeLists.txt
68 CYGPORT_USE_UNSTABLE_API=1
70 local i=${PN#kde-l10n-}
71 # ca@valencia: setup cannot handle '@' in PN
74 for jj in 4/. 4/${i}/${i}@* ; do
76 if [ -d 4/${i}/${j} ] ; then
77 # drop: kmouth, keep: jovie
78 if [ -e 4/$i/$j/docs/kdeaccessibility/CMakeLists.txt ] ; then
79 sed -i -e 's/add_subdirectory( *kmouth *)/#add_subdirectory(kmouth)/g' 4/$i/$j/docs/kdeaccessibility/CMakeLists.txt
81 # drop: kimagemapeditor, keep: kfilereplace, klinkstatus
82 if [ -e 4/$i/$j/docs/kdewebdev/CMakeLists.txt ] ; then
83 sed -i -e 's/add_subdirectory( *kimagemapeditor *)/#add_subdirectory(kimagemapeditor)/g' 4/$i/$j/docs/kdeaccessibility/CMakeLists.txt
85 # drop: all of kdegames, kdegraphics, kdemultimedia, kdenetwork, kdesdk, kdeutils
87 -e 's/add_subdirectory( *kdegames *)/#add_subdirectory(kdegames)/g' \
88 -e 's/add_subdirectory( *kdegraphics *)/#add_subdirectory(kdegraphics)/g' \
89 -e 's/add_subdirectory( *kdemultimedia *)/#add_subdirectory(kdemultimedia)/g' \
90 -e 's/add_subdirectory( *kdenetwork *)/#add_subdirectory(kdenetwork)/g' \
91 -e 's/add_subdirectory( *kdepim *)/#add_subdirectory(kdepim)/g' \
92 -e 's/add_subdirectory( *kdesdk *)/#add_subdirectory(kdesdk)/g' \
93 -e 's/add_subdirectory( *kdeutils *)/#add_subdirectory(kdeutils)/g' \
94 4/$i/$j/docs/CMakeLists.txt
95 rm -fv 4/$i/$j/messages/kdeaccessibility/kmouth*.po
96 rm -fv 4/$i/$j/messages/kdewebdev/kimagemapeditor*.po
97 rm -fv 4/$i/$j/messages/kde{games,graphics,multimedia,network,pim,sdk,utils}/*.po
99 # Remove translations shipped by Plasma 5 and KDE Frameworks 5
100 # Each Plasma 5 and KF5 app/library ship their own translations in their tarballs, so they
101 # often conflict with kde-l10n, since most of the catalogs still have the same name
103 # Provided by plasma-workspace and plasma-desktop
104 rm -fv 4/$i/$j/messages/kde-runtime/{attica_kde,knetattach,drkonqi,phonon_kde,soliduiserver}.po
105 rm -fv 4/$i/$j/messages/kde-runtime/kcm{_device_automounter,_emoticons,_phonon,componentchooser,icons,kded,notify}.po
106 rm -fv 4/$i/$j/messages/kde-runtime/kio_{applications,remote}.po
107 rm -fv 4/$i/$j/messages/kdelibs/{kcm_baloofile,plasma_runner_baloosearchrunner}.po
108 rm -fv 4/$i/$j/messages/applications/useraccount.po
109 if [ -e 4/$i/$j/docs/kde-runtime/CMakeLists.txt ]; then
110 sed -i -e 's/add_subdirectory( *documentationnotfound *)/#add_subdirectory(documentationnotfound)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
111 sed -i -e 's/add_subdirectory( *fundamentals *)/#add_subdirectory(fundamentals)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
112 sed -i -e 's/add_subdirectory( *glossary *)/#add_subdirectory(glossary)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
113 sed -i -e 's/add_subdirectory( *kcontrol *)/#add_subdirectory(kcontrol)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
114 sed -i -e 's/add_subdirectory( *kdesu *)/#add_subdirectory(kdesu)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
115 sed -i -e 's/add_subdirectory( *khelpcenter *)/#add_subdirectory(khelpcenter)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
116 sed -i -e 's/add_subdirectory( *knetattach *)/#add_subdirectory(knetattach)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
117 sed -i -e 's/add_subdirectory( *nepomuk *)/#add_subdirectory(nepomuk)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
118 sed -i -e 's/add_subdirectory( *onlinehelp *)/#add_subdirectory(onlinehelp)/g' 4/$i/$j/docs/kde-runtime/CMakeLists.txt
120 # Provided by kdeplasma-addons
121 sed -i -e 's/add_subdirectory( *kdeplasma-addons *)/#add_subdirectory(kdeplasma-addons)/g' 4/$i/$j/messages/CMakeLists.txt
122 # Provided by kde-cli-tools
123 rm -fv 4/$i/$j/messages/kde-runtime/{filetypes,kcmshell,kdesu,kioclient,kmimetypefinder,kstart,ktraderclient}.po
124 # Provided by khelpcenter
125 rm -fv 4/$i/$j/messages/kde-runtime/{htmlsearch,kcmhtmlsearch,khelpcenter}.po
127 # Programs which we do not build on Cygwin
128 rm -fv 4/$i/$j/messages/kdelibs/nepomuk*
129 rm -fv 4/$i/$j/messages/kdegraphics/ksaneplugin.po
130 rm -fv 4/$i/$j/messages/kdemultimedia/kscd.po
131 rm -fv 4/$i/$j/messages/kdenetwork/kppp*.po
132 if [ -e 4/$i/$j/docs/kdenetwork/CMakeLists.txt ] ; then
133 sed -e 's/add_subdirectory( *kppp *)/#add_subdirectory(kppp)/g' \
134 -i 4/$i/$j/docs/kdenetwork/CMakeLists.txt
142 export QTDIR=${QT4_QTDIR}
143 export QT_PLUGIN_PATH=${QT4_PLUGINSDIR}
145 #****C* kde4.cygclass/kde4_cmake
147 # kde4_cmake [OPTIONS]
149 # Runs cygcmake to configure the package with several Cygwin- and KDE-specific
150 # options. Options, in the form of -DVARIABLE=VALUE,
151 # are passed on to cygcmake.
153 # Source subdirectories which are declared with macro_optional_add_subdirectory()
154 # in CMakeLists.txt can be disabled with '-DBUILD_foo=OFF' arguments.
156 # automoc4, cmake, libQtCore4-devel, libQtGui4-devel
161 # for backwards compatibility with KDE3
162 for skip in ${DO_NOT_COMPILE}
164 skipargs+=" -DBUILD_${skip}=OFF"
168 -DKDE4_BUILD_TESTS=OFF \
169 -DKDE4_ENABLE_FINAL=OFF \
170 -DKDE4_ENABLE_FPIE=OFF \
171 -DKDE4_INCLUDE_DIR=${CROSS_INCLUDEDIR-/usr/include}/kde4 \
172 -DKDE4_USE_ALWAYS_FULL_RPATH=OFF \
173 -DKDE_DISTRIBUTION_TEXT=Cygwin \
174 -DQT_QMAKE_EXECUTABLE=${QT4_QMAKE} \
175 -DQT_MOC_EXECUTABLE=${QT4_MOC} \
176 -DQT_INCLUDE_DIR=${QT4_INCLUDEDIR} \
177 -DQT_LIBRARY_DIR=${QT4_LIBDIR} \
178 -DQT_MKSPECS_DIR=${QT4_MKSPECSDIR} \
179 -DQT_UIC_EXECUTABLE=${QT4_UIC} \
180 -DQT_UIC3_EXECUTABLE=${QT4_UIC3} \
181 -DQT_RCC_EXECUTABLE=${QT4_RCC} \
182 -DQT_DBUSCPP2XML_EXECUTABLE=${QT4_BINDIR}/qdbuscpp2xml \
183 -DQT_DBUSXML2CPP_EXECUTABLE=${QT4_BINDIR}/qdbusxml2cpp \
184 -DQT_LRELEASE_EXECUTABLE=${QT4_LRELEASE} \
185 -DQT_LUPDATE_EXECUTABLE=${QT4_BINDIR}/lupdate \
186 -D__KDE_HAVE_GCC_VISIBILITY=NO \
191 #****C* kde4.cygclass/kde4_compile
193 # kde4_compile [OPTIONS]
195 # Runs kde4_cmake, followed by cygmake to compile. Options, in the form of
196 # -DVARIABLE=VALUE, are passed on to kde4_cmake.
199 : ${CYGCMAKE_GENERATOR=Ninja}
201 if [ -f build.ninja ]
209 #****I* kde4.cygclass/kde4_install
211 # kde4_install [OPTIONS]
213 # Installs a KDE4 package with cyginstall into $D with some additional steps:
214 # * Import libraries for libkdeinit4_* libraries are removed, as they are never used.
215 # * README docs for subpackages in PKG_NAMES are installed into their own
216 # subdirectories of /usr/share/doc/ under $D.
217 # Options, if any, are passed on to cyginstall.
222 if [ -f build.ninja ]
229 rm -f ${D}/usr/lib/libkdeinit4_* ${D}/usr/lib/kde4/lib/libkdeinit4_*
231 for kdepkg in ${PKG_NAMES:-${PN}}
233 if [ -d ${S}/${kdepkg} ]
236 dodoc ${S}/${kdepkg}/{AUTHORS,BUGS,ChangeLog,NEWS,README,TODO}
237 elif [ -d ${S}/${kdepkg#${PN}-} ]
240 dodoc ${S}/${kdepkg#${PN}-}/{AUTHORS,BUGS,ChangeLog,NEWS,README,TODO}
245 #****o* kde4.cygclass/src_compile (kde4)
249 : ${CYGCMAKE_GENERATOR=Ninja}
251 if [ -f build.ninja ]
260 #****o* kde4.cygclass/src_install (kde4)
268 readonly -f kde4_cmake kde4_compile kde4_install