Bump version to 0.36.9
[cygport.git] / cygclass / kf5.cygclass
blob634f1abffda7ca92ddf1d75a107a0f8d30e7357c
1 ################################################################################
3 # kf5.cygclass - functions for building KDE Frameworks 5.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/kf5.cygclass
25 #  SYNOPSIS
26 #  inherit kf5
27 #  DESCRIPTION
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 KF5-based packages.
33 #  INHERITS
34 #  cmake.cygclass, kde.org.cygclass, qt5.cygclass
35 #****
37 inherit cmake qt5 kde.org
39 export QTDIR=${QT5_QTDIR}
40 export QT_PLUGIN_PATH=${QT5_PLUGINSDIR}
42 #****C* kf5.cygclass/kf5_cmake
43 #  SYNOPSIS
44 #  kf5_cmake [OPTIONS]
45 #  DESCRIPTION
46 #  Runs cygcmake to configure the package with several Cygwin- and KF5-specific
47 #  options.  Additional options, in the form of -DVARIABLE=VALUE,
48 #  are passed on to cygcmake.
49 #  REQUIRES
50 #  cmake, extra-cmake-modules, libQt5Core-devel, libQt5Gui-devel
51 #****
52 kf5_cmake() {
53         cygcmake \
54                 -DPLUGIN_INSTALL_DIR=${QT5_PLUGINSDIR} \
55                 -DQT_PLUGIN_INSTALL_DIR=${QT5_PLUGINSDIR} \
56                 -DIMPORTS_INSTALL_DIR=${QT5_IMPORTSDIR} \
57                 -DQML_INSTALL_DIR=${QT5_QMLDIR} \
58                 -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \
59                 -DKDE_INSTALL_LIBEXECDIR=$(__host_prefix)/libexec \
60                 -DKDE_INSTALL_SYSCONFDIR=$(__host_sysconfdir) \
61                 -DKDE_INSTALL_LOCALSTATEDIR=$(__host_localstatedir) \
62                 -DECM_MKSPECS_INSTALL_DIR=${QT5_MKSPECSDIR}/modules \
63                 "${@}"
66 #****C* kf5.cygclass/kf5_compile
67 #  SYNOPSIS
68 #  kf5_compile [OPTIONS]
69 #  DESCRIPTION
70 #  Runs kf5_cmake, followed by cygmake or cygninja to compile.  Options, in the
71 #  form of -DVARIABLE=VALUE, are passed on to kf5_cmake.
72 #****
73 kf5_compile() {
74         : ${CYGCMAKE_GENERATOR=Ninja}
75         kf5_cmake "${@}"
76         if [ -f build.ninja ]
77         then
78                 cygninja
79         else
80                 cygmake
81         fi
84 #****I* kf5.cygclass/kf5_install
85 #  SYNOPSIS
86 #  kf5_install [OPTIONS]
87 #  DESCRIPTION
88 #  Installs a KF5 package with cyginstall into $D, with the following addition:
89 #  * Import libraries for plugins and libkdeinit5_* libraries are removed.
90 #  Options, if any, are passed on to cyginstall.
91 #****
92 kf5_install() {
93         if [ -f build.ninja ]
94         then
95                 ninja_install
96         else
97                 cyginstall "${@}"
98         fi
100         rm -f ${D}/usr/lib/libkdeinit5_*
102         # QML plugins are built as SHARED, *not* MODULE because ECM sets
103         # CMAKE_SHARED_MODULE_PREFIX to empty (for full-fledged KDE plugins).
104         # QML/Quick plugins still need the prefix however, but that results
105         # in the installation of import libraries which we don't need.
106         if [ -d ${D}${QT5_QMLDIR} ]
107         then
108                 find ${D}${QT5_QMLDIR} -type f -name '*.dll.a' -delete
109         fi
112 #****o* kf5.cygclass/src_compile (kf5)
113 #  DEFINITION
114 src_compile() {
115         cd ${B}
116         : ${CYGCMAKE_GENERATOR=Ninja}
117         kf5_cmake
118         if [ -f build.ninja ]
119         then
120                 cygninja
121         else
122                 cygmake
123         fi
125 #****
127 #****o* kf5.cygclass/src_install (kf5)
128 #  DEFINITION
129 src_install() {
130         cd ${B}
131         kf5_install
133 #****
135 readonly -f kf5_cmake kf5_compile kf5_install