Reconfigure Trinity options, paths, and other adjustments
[dragora.git] / recipes / tde / tdebase / recipe
blob7053713fe18422590f9618f7cb8b89cee0c9e93f
1 # Build recipe for tdebase.
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=tdebase-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 TDE base libraries and programs.
35 tdebase is the second mandatory package (besides tdelibs) for the
36 Trinity Desktop Environment.  Here we have various applications
37 and infrastructure files and libraries.
40 homepage=https://www.trinitydesktop.org/
41 license="GPLv2+, GFDLv1.2"
43 # Source documentation
44 docs="AUTHORS COPYING* README*"
45 docsdir="${docdir}/${program}-${version}"
47 build()
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     # Set sane permissions
54     chmod -R u+w,go-w,a+rX-s .
56     mkdir BUILD
57     cd BUILD
59     cmake \
60      -DCMAKE_EXPORT_COMPILE_COMMANDS=ON                     \
61      -DCMAKE_BUILD_TYPE=RelWithDebInfo                      \
62      -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS"      \
63      -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS"  \
64      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
65      -DCMAKE_INSTALL_PREFIX=/usr                            \
66      -DLIB_SUFFIX=${libSuffix}                              \
67      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
68      -DCMAKE_SKIP_RPATH=OFF                                 \
69      -DCMAKE_INSTALL_PREFIX=/opt/trinity                    \
70      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
71      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
72      -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix}      \
73      -DCMAKE_INCLUDE_PATH=/opt/trinity/include              \
74      -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus                  \
75      -DHTDIG_SEARCH_BINARY=/usr/bin/hlsearch                \
76      -DWITH_GCC_VISIBILITY=ON                               \
77      -DBUILD_ALL=ON                                         \
78      -DBUILD_TDM_SYSTEMD_UNIT_FILE=OFF                      \
79      -DWITH_USBIDS=/usr/share/hwdata/usb.ids                \
80      -DWITH_ARTS=OFF                                        \
81      -DWITH_PAM=OFF                                         \
82      -DWITH_SASL=OFF                                        \
83      -DWITH_ELFICON=OFF                                     \
84      -DWITH_SUDO_TDESU_BACKEND=ON                           \
85      -DWITH_SUDO_KONSOLE_SUPER_USER_COMMAND=OFF             \
86      -DWITH_LDAP=OFF                                        \
87      -DWITH_SAMBA=OFF                                       \
88      -DWITH_LIBUSB=OFF                                      \
89      -DWITH_LIBRAW1394=OFF                                  \
90      -DWITH_OPENEXR=OFF                                     \
91      -DWITH_XCOMPOSITE=ON                                   \
92      -DWITH_XCURSOR=ON                                      \
93      -DWITH_XFIXES=ON                                       \
94      -DWITH_XRANDR=ON                                       \
95      -DWITH_XINERAMA=ON                                     \
96      -DWITH_SENSORS=ON                                      \
97      -DWITH_HAL=OFF                                         \
98      -DWITH_TDEHWLIB=ON                                     \
99      -DWITH_XDMCP=ON                                        \
100      -DWITH_XRENDER=ON                                      \
101      -DWITH_XTEST=ON                                        \
102      -DWITH_OPENGL=ON                                       \
103      -DWITH_XSCREENSAVER=OFF                                \
104      -DWITH_UPOWER=OFF                                      \
105      -DWITH_LIBART=ON                                       \
106      -DWITH_LIBCONFIG=OFF                                   \
107      -DWITH_PCRE=ON                                         \
108      -DWITH_KRB5=OFF                                        \
109      ..
111     make -j${jobs}
112     make -j${jobs} DESTDIR="$destdir" install
114     # To handle (dot) .new files via graft(1)
116     find "${destdir}/etc" -type d -print | while read -r directory
117     do
118         ( cd -- "$directory" && touch .graft-config )
119     done
121     # Include xinitrc file to start TDE
123     mkdir -p "${destdir}/etc/X11/xinit"
124     cp -p "${worktree}/archive/tdebase/xinitrc-tde" \
125           "${destdir}/etc/X11/xinit/"
126     chmod 644 "${destdir}/etc/X11/xinit/xinitrc-tde"
128     # Include profile file
130     mkdir -p "${destdir}/etc/profile.d"
131     cp -p "${worktree}/archive/tdebase/etc/profile.d/trinity.sh" \
132            "${destdir}/etc/profile.d/"
133     chmod 644 "${destdir}/etc/profile.d/trinity.sh"
135     # To handle .new config file(s)
136     touch "${destdir}/etc/profile.d/.graft-config" \
137           "${destdir}/etc/X11/xinit/.graft-config"
139     # Create post-install script
141     mkdir -p "${destdir}/var/lib/qi"
142     cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
144 # Make symlink for canonical path at /opt/trinity/lib
146 # Link using \$libSuffix
147 if test -n "$libSuffix" && test ! -e "\${rootdir}/opt/trinity/lib"
148 then
149     ( cd -- "\${rootdir}/opt/trinity" && ln -sf lib${libSuffix} lib )
152 echo "Updating desktop database: update-desktop-database -q opt/trinity/share/applications/tde"
153 chroot "\$rootdir" /usr/bin/update-desktop-database -q opt/trinity/share/applications/tde
155 echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor"
156 chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor
158 echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg"
159 chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg
163     # Compress and link man pages (if needed)
164     if test -d "${destdir}/$mandir"
165     then
166         (
167             cd "${destdir}/$mandir"
168             find . -type f -exec lzip -9 {} +
169             find . -type l | while read -r file
170             do
171                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
172                 rm -- "$file"
173             done
174         )
175     fi
177     cd ..
179     # Copy documentation
180     mkdir -p "${destdir}${docsdir}"
181     cp -p $docs "${destdir}${docsdir}"