Bump version to 0.36.9
[cygport.git] / cygclass / qt3.cygclass
blobffd1313b34f98bf74032b1bd1195a035358ec7ce
1 ################################################################################
3 # qt3.cygclass - functions for building Qt3-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/qt3.cygclass
25 #  SYNOPSIS
26 #  inherit qt3
27 #  DESCRIPTION
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
30 #  environment.
32 #  This cygclass provides definitions and install functions which can be used
33 #  by all Qt3-based packages, regardless of the build system being used.
34 #  NOTES
35 #  * Packages based on the newer 4.x or 5.x versions of Qt must use
36 #    qt4.cygclass or qt5.cygclass, respectively.
37 #  * The 3.x version of Qt is deprecated.  Support for Qt3 may be dropped in
38 #    the near future.
39 #  INHERITED BY
40 #  kde3.cygclass, qt3-qmake.cygclass
41 #****
43 #****d* qt3.cygclass/QTDIR
44 #  DESCRIPTION
45 #  Root directory of the Qt3 installation.  This variable is exported to the
46 #  build environment.
47 #****
48 #****d* qt3.cygclass/QT3_BINDIR
49 #  DESCRIPTION
50 #  Directory containing the Qt3 development tools.
51 #****
52 #****d* qt3.cygclass/QT3_INCLUDEDIR
53 #  DESCRIPTION
54 #  Directory containing the Qt3 library headers.
55 #****
56 #****d* qt3.cygclass/QT3_LIBDIR
57 #  DESCRIPTION
58 #  Directory containing the Qt3 link libraries.
59 #****
60 #****d* qt3.cygclass/QT3_PLUGINSDIR
61 #  DESCRIPTION
62 #  Installation path for Qt3 plugins.
63 #****
64 #****d* qt3.cygclass/QT3_DATADIR
65 #  DESCRIPTION
66 #  Directory containing the Qt3 documentation and translation data.
67 #****
69 if inherited cross
70 then
71         export QTDIR=${CROSS_PREFIX}
72         QT3_BINDIR=${CROSS_BINDIR}
73         QT3_INCLUDEDIR=${CROSS_INCLUDEDIR}/qt3
74         QT3_LIBDIR=${CROSS_LIBDIR}
75         QT3_PLUGINSDIR=${CROSS_LIBDIR}/qt3/plugins
76         QT3_DATADIR=${CROSS_DATADIR}/qt3
77 else
78         export QTDIR=/usr/lib/qt3
79         QT3_BINDIR=${QTDIR}/bin
80         QT3_INCLUDEDIR=/usr/include/qt3
81         QT3_LIBDIR=/usr/lib
82         QT3_PLUGINSDIR=${QTDIR}/plugins
83         QT3_DATADIR=/usr/share/qt3
86 #****d* qt3.cygclass/QT3_QMAKE
87 #  DESCRIPTION
88 #  Absolute path to the Qt3 project and Makefile generator.
89 #****
90 QT3_QMAKE=/usr/lib/qt3/bin/qmake
92 #****d* qt3.cygclass/QT3_MOC
93 #  DESCRIPTION
94 #  Absolute path to the Qt3 Meta-Object Compiler.
95 #****
96 QT3_MOC=/usr/lib/qt3/bin/moc
98 #****d* qt3.cygclass/QT3_UIC
99 #  DESCRIPTION
100 #  Absolute path to the Qt3 User Interface Compiler.
101 #****
102 QT3_UIC=/usr/lib/qt3/bin/uic
104 __qt3_qmakespec() {
105         local spec
107         # FIXME: -64 varieties
108         case ${CHOST} in
109         *-ibm-aix*)        spec="aix-g++" ;;
110         *-*-bsdi*)         spec="bsdi-g++" ;;
111         *-*-cygwin*)       spec="cygwin-g++" ;;
112         *-*-darwin*)       spec="darwin-g++" ;;
113         *-*-dgux*)         spec="dgux-g++" ;;
114         *-*-freebsd*)      spec="freebsd-g++" ;;
115         *-*-hpux)          spec="hpux-g++" ;;
116         *-*-irix)          spec="irix-g++" ;;
117         *-*-linux*)        spec="linux-g++" ;;
118         *-*-lynxos*)       spec="lynxos-g++" ;;
119         *-*-netbsd*)       spec="netbsd-g++" ;;
120         *-*-openbsd*)      spec="openbsd-g++" ;;
121         *-*-qnx*)          spec="qnx-g++" ;;
122         *-*-sco*)          spec="sco-g++" ;;
123         *-*-solaris*)      spec="solaris-g++" ;;
124         *-*-osf*)          spec="tru64-g++" ;;
125         *-*-sysv4.2uw*)    spec="unixware-g++" ;;
126         *-*-mingw*)        spec="win32-g++" ;;
127         # must be last to avoid false positives from *-*-KERNEL-gnu
128         *-*-gnu*)          spec="hurd-g++" ;;
129         *)      error "Host ${CHOST} is not supported by Qt3" ;;
130         esac
132         echo -n ${spec}
135 QMAKESPEC=$(__qt3_qmakespec)
137 export PATH="/usr/lib/qt3/bin:${PATH}"
139 #****I* qt3.cygclass/doqt3inc
140 #  SYNOPSIS
141 #  doqt3inc HEADERS
142 #  DESCRIPTION
143 #  Installs headers into QT3_INCLUDEDIR under $D.
144 #****
145 doqt3inc() {
146         insinto ${QT3_INCLUDEDIR}
147         doins ${@}
150 #****I* qt3.cygclass/doqt3lib
151 #  SYNOPSIS
152 #  doqt3lib LIBRARIES
153 #  DESCRIPTION
154 #  Installs link libraries into QT3_LIBDIR under $D.
155 #****
156 doqt3lib() {
157         insinto ${QT3_LIBDIR}
158         doins ${@}
161 #****I* qt3.cygclass/qt3pluginto
162 #  SYNOPSIS
163 #  qt3pluginto SUBDIRECTORY
164 #  DESCRIPTION
165 #  Sets the subdirectory of QT3_PLUGINDIR in which doqt3plugin should install.
166 #  Supported subdirectores include:
167 #  * crypto: Qt Cryptographic Architecture backends
168 #  * designer: Qt Designer widgets
169 #  * imageformats: image format handlers
170 #  * sqldrivers: SQL datbase backends
171 #  * styles: GUI style engines
172 #****
173 qt3pluginto() {
174         if [ -z "${1}" -o -n "${2}" ]
175         then
176                 error "qt3pluginto requires exactly one argument"
177         fi
179         __QT3_PLUGIN_SUBDIR=${1}
182 #****I* qt3.cygclass/doqt3plugin
183 #  SYNOPSIS
184 #  qt3pluginto SUBDIRECTORY
185 #  doqt3plugin PLUGINS
186 #  DESCRIPTION
187 #  Installs the given plugins into the subdirectory of QT3_PLUGINDIR passed
188 #  to the previous call to qt3pluginto.
189 #****
190 doqt3plugin() {
191         if ! defined __QT3_PLUGIN_SUBDIR
192         then
193                 error "qt3pluginto must be called before doqt3plugin"
194         fi
196         exeinto ${QT3_PLUGINSDIR}/${__QT3_PLUGIN_SUBDIR}
197         doexe ${@}
200 readonly -f doqt3inc doqt3lib qt3pluginto doqt3plugin