Reconfigure Trinity options, paths, and other adjustments
[dragora.git] / recipes / tde / tdelibs / recipe
blobada0a6382b5d1b0d17975f5da6d85e97ff3a5f50
1 # Build recipe for tdelibs.
3 # Copyright (c) 2020-2021 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=tdelibs-trinity
21 version=14.0.9
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=tde
27 tarname=${program}-${version}.tar.xz
29 # Remote source(s)
30 fetch=https://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/$tarname
32 description="
33 The Trinity Desktop Environment (TDE) libraries.
35 This package includes libraries that are central to the development and
36 execution of a KDE program, as well as internationalization files for
37 these libraries, misc HTML documentation, theme modules, and regression
38 tests.
41 homepage=https://www.trinitydesktop.org/
42 license="GPLv2+, LGPLv2+ | BSD 2-clause"
44 # Source documentation
45 docs="AUTHORS COPYING* DEBUG NAMING README TODO KDE?PORTING.html"
46 docsdir="${docdir}/${program}-${version}"
48 build()
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     patch -p1 < "${worktree}/patches/tdelibs/xcomposite-shared.patch"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     mkdir BUILD
60     cd BUILD
62     cmake \
63      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON                     \
64      -DCMAKE_BUILD_TYPE=RelWithDebInfo                      \
65      -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS"      \
66      -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS"  \
67      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
68      -DCMAKE_INSTALL_PREFIX=/usr                            \
69      -DLIB_SUFFIX=${libSuffix}                              \
70      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
71      -DCMAKE_SKIP_RPATH=OFF                                 \
72      -DCMAKE_INSTALL_PREFIX=/opt/trinity                    \
73      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
74      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
75      -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix}      \
76      -DCMAKE_INCLUDE_PATH=/opt/trinity/include              \
77      -DWITH_GCC_VISIBILITY=ON                               \
78      -DWITH_CUPS=OFF                                        \
79      -DWITH_ARTS=OFF                                        \
80      -DWITH_LIBART=ON                                       \
81      -DWITH_LIBIDN=OFF                                      \
82      -DWITH_TIFF=ON                                         \
83      -DWITH_JASPER=ON                                       \
84      -DWITH_OPENEXR=OFF                                     \
85      -DWITH_AVAHI=OFF                                       \
86      -DWITH_ISPELL=OFF                                      \
87      -DWITH_ASPELL=ON                                       \
88      -DWITH_HSPELL=OFF                                      \
89      -DDEFAULT_SPELL_CHECKER=ASPELL                         \
90      -DWITH_ELFICON=OFF                                     \
91      -DWITH_TDEHWLIB=ON                                     \
92      -DWITH_TDEHWLIB_DAEMONS=ON                             \
93      -DWITH_LOGINDPOWER=ON                                  \
94      -DWITH_UPOWER=OFF                                      \
95      -DWITH_UDISKS=OFF                                      \
96      -DWITH_UDISKS2=OFF                                     \
97      -DWITH_UDEVIL=ON                                       \
98      -DWITH_CONSOLEKIT=OFF                                  \
99      -DWITH_NETWORK_MANAGER_BACKEND=OFF                     \
100      -DWITH_LZMA=ON                                         \
101      -DWITH_XRANDR=ON                                       \
102      -DWITH_XCOMPOSITE=ON                                   \
103      -DWITH_MITSHM=ON                                       \
104      -DWITH_PCSC=ON                                         \
105      -DWITH_PKCS=ON                                         \
106      -DWITH_CRYPTSETUP=ON                                   \
107      -DWITH_IMAGETOPS_BINARY=ON                             \
108      -G Ninja ..
110     ninja -j${jobs}
111     DESTDIR="$destdir" ninja -j${jobs} install
113     # To handle (dot) .new files via graft(1)
115     find "${destdir}/etc" -type d -print | while read -r directory
116     do
117         ( cd -- "$directory" && touch .graft-config )
118     done
120     # Compress and link man pages (if needed)
121     if test -d "${destdir}/$mandir"
122     then
123         (
124             cd "${destdir}/$mandir"
125             find . -type f -exec lzip -9 {} +
126             find . -type l | while read -r file
127             do
128                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
129                 rm -- "$file"
130             done
131         )
132     fi
134     cd ..
136     # Copy documentation
137     mkdir -p "${destdir}${docsdir}"
138     cp -p $docs "${destdir}${docsdir}"