recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tde / tqt3 / recipe
blob1fe60750878dbd8d86e98c2e4dbcb8e233da30b5
1 # Build recipe for tqt3 (trinity).
3 # Copyright (c) 2019-2022 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.
17 # Exit immediately on any error
18 set -e
20 program=tqt3
21 version=20220430_ec04b50a
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tde
27 tarname=${program}-${version}.tar.lz
29 # Remote source(s)
30 fetch="
31  https://dragora.mirror.garr.it/current/sources/$tarname
32  rsync://rsync.dragora.org/current/sources/$tarname
35 description="
36 Qt is a multiplatform C++ GUI application framework.
38 Qt 3.3 introduces new features and many improvements over
39 the 3.2.x series. See the changes file for details.
41 The Qt version 3.3 series is binary compatible with the
42 3.2.x series - applications compiled for 3.2 will continue
43 to run with 3.3.
46 homepage=https://www.trinitydesktop.org/
47 license="GPLv2+, GPLv3+ | The Q Public License"
49 # Source documentation
50 docs="FAQ LICENSE* README*"
51 docsdir="${docdir}/${program}-${version}"
53 build()
55     unpack "${tardir}/$tarname"
57     cd "$srcdir"
59     # Remove unneeded specs for targets other than GNU/Linux
60     ( cd mkspecs && find . -maxdepth 1 \( -type d -a ! -name 'linux-g++' \) -exec rm -rf -- '{}' \; )
62     # Do not build the HTML documentation in order to save disk space
63     #sed -i '/htmldocs/d' src/qt_install.pri
65     # Set custom compilation flags from Qi
66     sed -i \
67      -e "s:QMAKE_CFLAGS_RELEASE.*=:QMAKE_CFLAGS_RELEASE=${QICXXFLAGS} :" \
68       mkspecs/linux*/qmake.conf
70     # Set sane permissions
71     chmod -R u+w,go-w,a+rX-s .
73     LD_LIBRARY_PATH="${PWD}/lib:${LD_LIBRARY_PATH}"
74     LD_LIBRARY_PATH="${LD_LIBRARY_PATH%%:*}";   # Get the rid of ":".
75     export LD_LIBRARY_PATH
76     echo "New LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
78     echo yes | ./configure \
79      -L/usr/lib${libSuffix} \
80      -I/usr/include/freetype2 \
81      -I/usr/include/tirpc \
82      -prefix "/usr" \
83      -libdir "/usr/lib${libSuffix}" \
84      -sysconfdir "/etc/tqt3" \
85      -headerdir "/usr/include/tqt3" \
86      -plugindir "/usr/lib${libSuffix}/tqt3/plugins" \
87      -datadir "/usr/share/tqt3" \
88      -translationdir "/usr/share/tqt3/translations" \
89      -docdir "$docsdir" \
90      -no-exceptions \
91      -qt-gif \
92      -system-zlib \
93      -system-libpng \
94      -system-libjpeg \
95      -system-libmng \
96      -qt-imgfmt-mng \
97      -qt-imgfmt-png \
98      -qt-imgfmt-jpeg \
99      -plugin-imgfmt-mng \
100      -thread \
101      -shared \
102      -fast \
103      -glibmainloop \
104      -tablet \
105      -enable-opengl \
106      -dlopen-opengl \
107      -nis \
108      -sm \
109      -xshape \
110      -xinerama \
111      -xcursor \
112      -xrandr \
113      -xft \
114      -xrender \
115      -xkb \
116      -release
118     make -i -j${jobs} sub-tools
119     make -j${jobs} INSTALL_ROOT="$destdir" install
121     unset -v LD_LIBRARY_PATH
123     # Strip remaining binaries and libraries
124     find "$destdir" -type f | xargs file | \
125      awk '/ELF/ && /executable/ || /shared object/' | \
126       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
128     # Compress and link man pages (if needed)
129     if test -d "${destdir}/$mandir"
130     then
131         (
132             cd "${destdir}/$mandir"
133             find . -type f -exec lzip -9 {} +
134             find . -type l | while read -r file
135             do
136                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
137                 rm -- "$file"
138             done
139         )
140     fi
142     # Copy documentation
143     mkdir -p "${destdir}/$docsdir"
144     cp -p $docs "${destdir}/$docsdir"