stages: 2/04-iso: Create ISO using the Joliet, Rock Ridge extension
[dragora.git] / recipes / tde / tdelibs / recipe
bloba4cf5d152f11b470e298077ba112180265fe3a0f
1 # Build recipe for tdelibs.
3 # Copyright (c) 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.
17 program=tdelibs-trinity
18 pkgname=tdelibs
19 version=14.0.7
20 release=1
22 # Set 'outdir' for a nice and well-organized output directory
23 outdir="${outdir}/${arch}/tde"
25 tarname=${program}-${version}.tar.xz
27 # Remote source(s)
28 fetch=http://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/$tarname
30 description="
31 The Trinity Desktop Environment (TDE) libraries.
33 This package includes libraries that are central to the development and
34 execution of a KDE program, as well as internationalization files for
35 these libraries, misc HTML documentation, theme modules, and regression
36 tests.
39 homepage=http://www.trinitydesktop.org/
40 license="GPLv2+, LGPLv2+ | BSD 2-clause"
42 # Source documentation
43 docs="AUTHORS COPYING* DEBUG NAMING README TODO KDE?PORTING.html"
44 docsdir="${docdir}/${pkgname}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     patch -Np1 -i "${worktree}/patches/tdelibs/_isnan.patch"
55     patch -Np1 -i "${worktree}/patches/tdelibs/header-redirections.diff"
56     patch -Np1 -i "${worktree}/patches/tdelibs/tdeio-kssl_libressl.patch"
57     patch -Np1 -i "${worktree}/patches/tdelibs/start_tdeinit.c.diff"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     mkdir BUILD
63     cd BUILD
65     cmake \
66      -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"             \
67      -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"         \
68      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"        \
69      -DCMAKE_INSTALL_PREFIX=/opt/trinity                    \
70      -DLIB_SUFFIX=${libSuffix}                              \
71      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
72      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
73      -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus                  \
74      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
75      -DCMAKE_BUILD_TYPE=Release                             \
76      -DCMAKE_SKIP_INSTALL_RPATH=YES                         \
77      -DBUILD_ALL=ON                                         \
78      -DWITH_ALL_OPTIONS=ON                                  \
79      -DWITH_SUDO_TDESU_BACKEND=ON                           \
80      -DWITH_OPENEXR=OFF                                     \
81      -DWITH_CUPS=OFF                                        \
82      -DWITH_UTEMPTER=OFF                                    \
83      -DWITH_LIBIDN=OFF                                      \
84      -DWITH_LUA=OFF                                         \
85      -DWITH_ELFICON=OFF                                     \
86      -DWITH_GAMIN=OFF                                       \
87      -DWITH_HSPELL=OFF                                      \
88      -DWITH_HALL=OFF                                        \
89      -DWITH_UPOWER=OFF                                      \
90      -DWITH_UDISKS=OFF                                      \
91      -DWITH_UDISKS2=OFF                                     \
92      -DWITH_CONSOLEKIT=OFF                                  \
93      ..
95     make -j${jobs}
96     make -j${jobs} DESTDIR="$destdir" install
98     # Strip remaining binaries and libraries
99     find "$destdir" -type f -print0 | xargs -0 file | \
100      awk '/ELF/ && /executable/ || /shared object/' | \
101       cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
103     find "$destdir" -type f -print0 | xargs -0 file | \
104      awk '/current ar archive/' | \
105       cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
107     # To handle (dot) .new files via graft(1)
109     find "${destdir}/etc" -type d -print | while read -r directory
110     do
111         ( cd -- "$directory" && touch .graft-config )
112     done
114     # Compress and link man pages (if needed)
115     if test -d "${destdir}/$mandir"
116     then
117         (
118             cd "${destdir}/$mandir"
119             find . -type f -exec lzip -9 '{}' +
120             find . -type l | while read -r file
121             do
122                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
123                 rm -- "$file"
124             done
125         )
126     fi
128     cd ..
130     # Copy documentation
131     mkdir -p "${destdir}${docsdir}"
132     cp -p $docs "${destdir}${docsdir}"