Bump version to 0.36.9
[cygport.git] / cygclass / qt4-qmake.cygclass
blobc2b5ab8832954e9f48d28aea9ae377dfeaa6738d
1 ################################################################################
3 # qt4-qmake.cygclass - functions for building QMake-based Qt4 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/qt4-qmake.cygclass
25 #  SYNOPSIS
26 #  inherit qt4-qmake
27 #  DESCRIPTION
28 #  This cygclass builds Qt4-based packages which use the qmake build system.
29 #  INHERITS
30 #  qt4.cygclass
31 #****
33 inherit qt4
35 #****C* qt4-qmake.cygclass/cygqmake4
36 #  SYNOPSIS
37 #  cd $B
38 #  cygqmake4
39 #  DESCRIPTION
40 #  Generates Makefiles from the package's qmake project files.
41 #****
42 cygqmake4() {
43         if [ ! -x ${QT4_QMAKE} ]
44         then
45                 error "libQtCore4-devel is required to build this package"
46         fi
48         ${QT4_QMAKE} -recursive \
49                 QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
50                 QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
51                 QMAKE_LFLAGS="${LDFLAGS}" \
52                 QMAKE_LFLAGS_RPATH= \
53                 QMAKE_STRIP=: \
54                 QMAKE_PROJECT_DEPTH=0 \
55                 ${CYGQMAKE4_ARGS} "${@}" \
56                 || error "qmake failed"
59 #****C* qt4-qmake.cygclass/qt4_qmake_compile
60 #  DEFINITION
61 qt4_qmake_compile() {
62         cygqmake4
63         cygmake
65 #****
67 #****I* qt4-qmake.cygclass/qt4_qmake_install
68 #  SYNOPSIS
69 #  cd $B
70 #  qt4_qmake_install
71 #  DESCRIPTION
72 #  Installs the package into $D and fixes some common installation issues.
73 #  WARNING
74 #  Many qmake projects do not define correct install rules, if any at all.
75 #  qt4_qmake_install is of no use in such cases; you must use manual
76 #  installation commands instead.
77 #****
78 qt4_qmake_install() {
79         local dll pc
81         make install INSTALL_ROOT=${D} || error "make install failed"
83         for dll in $(find ${D}$(__host_prefix)/lib/ -maxdepth 1 -name '*.dll' 2> /dev/null)
84         do
85                 dodir $(__host_prefix)/bin
86                 mv ${dll} ${D}$(__host_prefix)/bin/
87         done
90 #****o* qt4-qmake.cygclass/src_compile (qt4-qmake)
91 #  DEFINITION
92 src_compile() {
93         lndirs
94         cd ${B}
95         qt4_qmake_compile
97 #****
99 #****o* qt4-qmake.cygclass/src_install (qt4-qmake)
100 #  DEFINITION
101 src_install() {
102         cd ${B}
103         qt4_qmake_install
105 #****
107 readonly -f cygqmake4 qt4_qmake_compile qt4_qmake_install