1 # Build recipe for tqt3 (trinity).
3 # Copyright (c) 2019-2020 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/tde"
25 tarname=${program}-${version}.tar.xz
28 fetch=http://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/dependencies/$tarname
31 Qt is a multiplatform C++ GUI application framework.
33 Qt 3.3 introduces new features and many improvements over the 3.2.x
34 series. See the changes file for details.
36 The Qt version 3.3 series is binary compatible with the 3.2.x series -
37 applications compiled for 3.2 will continue to run with 3.3.
40 homepage=http://www.trinitydesktop.org/
41 license="GPLv2+, GPLv3+ | The Q Public License"
43 # Source documentation
44 docs="FAQ LICENSE* README*"
45 docsdir="${docdir}/${pkgname}-${version}"
51 unpack "${tardir}/$tarname"
55 # Remove unneeded specs for targets other than GNU/Linux
56 ( cd mkspecs && find . -maxdepth 1 \( -type d -a ! -name 'linux-g++' \) -exec rm -rf -- '{}' \; )
58 # Do not build the HTML documentation in order to save disk space
59 sed -i '/htmldocs/d' src/qt_install.pri
61 # Set custom compilation flags from Qi
63 -e "s:QMAKE_CFLAGS_RELEASE.*=:QMAKE_CFLAGS_RELEASE=${QICXXFLAGS} :" \
64 mkspecs/linux*/qmake.conf
66 # Set sane permissions
67 chmod -R u+w,go-w,a+rX-s .
71 LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}"
73 PATH="${PWD}/bin:${PATH}"
76 echo "New QTDIR: $QTDIR"
77 echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
78 echo "New PATH: $PATH"
81 export QTDIR LD_LIBRARY_PATH PATH
83 echo yes | ./configure -L/usr/lib${libSuffix} \
84 -prefix /opt/trinity/lib${libSuffix}/${pkgname}-${version} \
85 -sysconfdir /opt/etc \
86 -sysshare /usr/share \
108 -plugin-style-compact \
109 -plugin-style-motif \
110 -plugin-style-motifplus \
111 -plugin-style-platinum \
113 -plugin-style-windows \
116 make -i -j${jobs} sub-tools
117 make -j${jobs} INSTALL_ROOT="$destdir" install
121 unset SAVED_QTDIR SAVED_PATH LD_LIBRARY_PATH
124 # Strip remaining binaries and libraries
125 find "$destdir" -type f | xargs file | \
126 awk '/ELF/ && /executable/ || /shared object/' | \
127 cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
129 # Make symlinks in order to have canonical paths
131 cd "${destdir}/opt/trinity" || exit 1
133 if test -n "$libSuffix"
135 ln -sf lib${libSuffix} lib
137 cd lib${libSuffix} && ln -sf ${pkgname}-${version} $pkgname
139 # Link tqt3's pkg-config files at /opt/trinity/lib/pkgconfig
141 mkdir -p "${destdir}/opt/trinity/lib${libSuffix}/pkgconfig"
142 cd "${destdir}/opt/trinity/lib${libSuffix}/${pkgname}-${version}"/lib/pkgconfig/
145 ln -sf $file ../../../pkgconfig/${file}
148 # Link tqt3's programs at /opt/trinity/bin
150 mkdir -p "${destdir}/opt/trinity/bin"
151 cd "${destdir}/opt/trinity/lib${libSuffix}/${pkgname}-${version}"/bin/
154 test -x "$file" && ln -sf $file ../../../bin/${file}
157 cd -- "${TMPDIR}/$srcdir"
159 # Include profile file
160 mkdir -p "${destdir}/etc/profile.d"
161 cp -p "${worktree}/archive/tqt3/etc/profile.d/tqt3.sh" \
162 "${destdir}/etc/profile.d/"
163 chmod 644 "${destdir}/etc/profile.d/tqt3.sh"
165 # To handle config file(s)
166 touch "${destdir}/etc/profile.d/.graft-config"
168 # Compress and link man pages (if needed)
169 if test -d "${destdir}/$mandir"
172 cd "${destdir}/$mandir"
173 find . -type f -exec lzip -9 '{}' +
174 find . -type l | while read -r file
176 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
183 mkdir -p "${destdir}${docsdir}"
184 cp -p $docs "${destdir}${docsdir}"