1 ################################################################################
3 # qt5.cygclass - functions for building Qt5-dependent 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/qt5.cygclass
28 # Qt is a C++ cross-platform application framework for writing desktop GUI
29 # applications. Qt is the underlying toolkit used by the KDE desktop
32 # This cygclass provides definitions and install functions which can be used
33 # by all Qt5-based packages, regardless of the build system being used.
35 # * Packages based on the previous 3.x or 4.x versions of Qt must use
36 # qt3.cygclass or qt4.cygclass, respectively.
41 #****d* qt5.cygclass/QT5_QTDIR
43 # Root directory for the Qt5 installation.
45 #****d* qt5.cygclass/QT5_BINDIR
47 # Directory containing the Qt5 build tools.
49 #****d* qt5.cygclass/QT5_INCLUDEDIR
51 # Directory containing the Qt5 library headers.
53 #****d* qt5.cygclass/QT5_LIBDIR
55 # Directory containing the Qt5 link libraries.
57 #****d* qt5.cygclass/QT5_PLUGINSDIR
59 # Installation path for Qt5 plugins.
61 #****d* qt5.cygclass/QT5_IMPORTSDIR
63 # Installation path for Qt5 Quick 1 extensions.
65 #****d* qt5.cygclass/QT5_QMLDIR
67 # Installation path for Qt5 Quick 2 extensions.
69 #****d* qt5.cygclass/QT5_DATADIR
71 # Directory containing Qt5 documentation, and translation data.
73 #****d* qt5.cygclass/QT5_MKSPECSDIR
75 # Installation path for Qt5 QMake specs files.
77 #****d* qt5.cygclass/QT5_QMAKE
79 # Absolute path to the Qt5 project and Makefile generator
81 #****d* qt5.cygclass/QT5_MOC
83 # Absolute path to the Qt5 Meta-Object Compiler
85 #****d* qt5.cygclass/QT5_RCC
87 # Absolute path to the Qt5 resource compiler
89 #****d* qt5.cygclass/QT5_UIC
91 # Absolute path to the Qt5 User Interface Compiler
93 #****d* qt5.cygclass/QT5_LRELEASE
95 # Absolute path to the Qt5 Linguist translation compiler
100 QT5_QTDIR=${CROSS_PREFIX}
101 QT5_QMAKE=/usr/bin/${CROSS_HOST}-qmake-qt5
102 elif inherited toolchain
104 QT5_QTDIR=${TOOLCHAIN_PREFIX}
105 QT5_QMAKE=/usr/bin/${TOOLCHAIN_TARGET}-qmake-qt5
107 QT5_QTDIR=/usr/lib/qt5
108 QT5_QMAKE=/usr/bin/qmake-qt5
111 QT5_BINDIR=$(${QT5_QMAKE} -query QT_HOST_BINS)
112 QT5_INCLUDEDIR=$(${QT5_QMAKE} -query QT_INSTALL_HEADERS)
113 QT5_LIBDIR=$(${QT5_QMAKE} -query QT_INSTALL_LIBS)
114 QT5_PLUGINSDIR=$(${QT5_QMAKE} -query QT_INSTALL_PLUGINS)
115 QT5_IMPORTSDIR=$(${QT5_QMAKE} -query QT_INSTALL_IMPORTS)
116 QT5_QMLDIR=$(${QT5_QMAKE} -query QT_INSTALL_QML)
117 QT5_DATADIR=$(${QT5_QMAKE} -query QT_INSTALL_DATA)
118 QT5_MKSPECSDIR=$(${QT5_QMAKE} -query QT_HOST_DATA)/mkspecs
119 QT5_MOC=${QT5_BINDIR}/moc
120 QT5_RCC=${QT5_BINDIR}/rcc
121 QT5_UIC=${QT5_BINDIR}/uic
122 QT5_LRELEASE=${QT5_BINDIR}/lrelease
128 # FIXME: -64 varieties, qws/*
130 *-ibm-aix*) spec="aix-g++" ;;
131 *-linux-android*) spec="android-g++" ;;
132 *-*-cygwin*) spec="cygwin-g++" ;;
133 *-*-darwin*) spec="darwin-g++" ;;
134 *-*-freebsd*) spec="freebsd-g++" ;;
135 *-*-hpux) spec="hpux-g++" ;;
136 *-*-irix) spec="irix-g++" ;;
137 *-*-linux*) spec="linux-g++" ;;
138 *-*-lynxos*) spec="lynxos-g++" ;;
139 *-*-netbsd*) spec="netbsd-g++" ;;
140 *-*-openbsd*) spec="openbsd-g++" ;;
141 *-*-sco*) spec="sco-g++" ;;
142 *-*-solaris*) spec="solaris-g++" ;;
143 *-*-osf*) spec="tru64-g++" ;;
144 *-*-sysv4.2uw*) spec="unixware-g++" ;;
145 *-*-mingw*) spec="win32-g++" ;;
146 # must be last to avoid false positives from *-*-KERNEL-gnu
147 *-*-gnu*) spec="hurd-g++" ;;
148 *) error "Host ${CHOST} is not supported by Qt5" ;;
154 QMAKESPEC=$(__qt5_qmakespec ${CBUILD})
155 if inherited toolchain
157 XQMAKESPEC=$(__qt5_qmakespec ${CTARGET})
160 XQMAKESPEC=$(__qt5_qmakespec ${CHOST})
163 export PATH="${QT5_BINDIR}:${PATH}"
165 #****I* qt5.cygclass/doqt5inc
169 # Installs headers into QT5_INCLUDEDIR under $D.
172 insinto ${QT5_INCLUDEDIR}
176 #****I* qt5.cygclass/qt5pluginto
178 # qt5pluginto SUBDIRECTORY
180 # Sets the subdirectory of QT5_PLUGINDIR in which doqt5plugin should install.
181 # Supported subdirectories include:
182 # * designer: Qt Designer widgets
183 # * imageformats: image format handlers
184 # * platformthemes: GUI style engines
185 # * sqldrivers: SQL datbase backends
188 if [ -z "${1}" -o -n "${2}" ]
190 error "qt5pluginto requires exactly one argument"
193 __QT5_PLUGIN_SUBDIR=${1}
196 #****I* qt5.cygclass/doqt5plugin
198 # qt5pluginto SUBDIRECTORY
199 # doqt5plugin PLUGINS
201 # Installs the given plugins into the subdirectory of QT5_PLUGINDIR passed
202 # to the previous call to qt5pluginto.
205 if ! defined __QT5_PLUGIN_SUBDIR
207 error "qt5pluginto must be called before doqt5plugin"
210 exeinto ${QT5_PLUGINSDIR}/${__QT5_PLUGIN_SUBDIR}
214 readonly -f __qt5_qmakespec doqt5inc qt5pluginto doqt5plugin