recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / tde / tdelibs / recipe
blob7338be49994692ea9bd9a320384df4fa52105400
1 # Build recipe for tdelibs.
3 # Copyright (c) 2020-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=tdelibs
21 version=20220503_32fc7e3e
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 The Trinity Desktop Environment (TDE) libraries.
38 This package includes libraries that are central to the development and
39 execution of a KDE program, as well as internationalization files for
40 these libraries, misc HTML documentation, theme modules, and regression
41 tests.
44 homepage=https://www.trinitydesktop.org/
45 license="GPLv2+, LGPLv2+ | BSD 2-clause"
47 # Source documentation
48 docs="AUTHORS COPYING* DEBUG NAMING README TODO KDE?PORTING.html"
49 docsdir="${docdir}/${program}-${version}"
51 build()
53     unpack "${tardir}/$tarname"
55     cd "$srcdir"
57     patch -Np1 -i "${worktree}/patches/tdelibs/xcomposite-shared-masterbranch.patch"
59     # Set sane permissions
60     chmod -R u+w,go-w,a+rX-s .
62     rm -rf BUILD
63     mkdir BUILD
64     cd BUILD
66     cmake \
67      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON                     \
68      -DCMAKE_BUILD_TYPE=RelWithDebInfo                      \
69      -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS"      \
70      -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS"  \
71      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo ${QILDFLAGS} | sed 's/-s//')" \
72      -DLIB_SUFFIX=${libSuffix}                              \
73      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
74      -DCMAKE_SKIP_RPATH=OFF                                 \
75      -DCMAKE_INSTALL_PREFIX=/opt/trinity                    \
76      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
77      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
78      -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix}      \
79      -DCMAKE_INCLUDE_PATH=/opt/trinity/include              \
80      -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus                  \
81      -DWITH_GCC_VISIBILITY=ON                               \
82      -DWITH_CUPS=OFF                                        \
83      -DWITH_ARTS=OFF                                        \
84      -DWITH_LIBART=ON                                       \
85      -DWITH_LIBIDN=OFF                                      \
86      -DWITH_TIFF=ON                                         \
87      -DWITH_JASPER=ON                                       \
88      -DWITH_OPENEXR=ON                                      \
89      -DWITH_AVAHI=OFF                                       \
90      -DWITH_ISPELL=OFF                                      \
91      -DWITH_ASPELL=ON                                       \
92      -DWITH_HSPELL=OFF                                      \
93      -DDEFAULT_SPELL_CHECKER=ASPELL                         \
94      -DWITH_ELFICON=ON                                      \
95      -DWITH_TDEHWLIB=ON                                     \
96      -DWITH_LOGINDPOWER=OFF                                 \
97      -DWITH_UDEVIL=ON                                       \
98      -DWITH_UPOWER=OFF                                      \
99      -DWITH_UDISKS=OFF                                      \
100      -DWITH_UDISKS2=OFF                                     \
101      -DWITH_CONSOLEKIT=OFF                                  \
102      -DWITH_NETWORK_MANAGER_BACKEND=OFF                     \
103      -DWITH_LZMA=ON                                         \
104      -DWITH_XRANDR=ON                                       \
105      -DWITH_XCOMPOSITE=ON                                   \
106      -DWITH_MITSHM=ON                                       \
107      -DWITH_IMAGETOPS_BINARY=ON                             \
108      -G Ninja ..
110     ninja -j${jobs}
111     DESTDIR="$destdir" ninja -j${jobs} install
113     # This symlink will be handled from the post-install
114     # script to point to the correct location
115     rm -f "${destdir}/opt/trinity/share/icons/default.tde"
117     # To handle (dot) .new files via graft(1)
119     find "${destdir}/etc" -type d -print | while read -r directory
120     do
121         ( cd -- "$directory" && touch .graft-config )
122     done
124     # Compress and link man pages (if needed)
125     if test -d "${destdir}/$mandir"
126     then
127         (
128             cd "${destdir}/$mandir"
129             find . -type f -exec lzip -9 {} +
130             find . -type l | while read -r file
131             do
132                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
133                 rm -- "$file"
134             done
135         )
136     fi
138     cd ..
140     # Copy documentation
141     mkdir -p "${destdir}/$docsdir"
142     cp -p $docs "${destdir}/$docsdir"