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
20 program=tdebase-trinity
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.xz
30 fetch=https://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/$tarname
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}"
49 unpack "${tardir}/$tarname"
53 # Set sane permissions
54 chmod -R u+w,go-w,a+rX-s .
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 \
78 -DBUILD_TDM_SYSTEMD_UNIT_FILE=OFF \
79 -DWITH_USBIDS=/usr/share/hwdata/usb.ids \
84 -DWITH_SUDO_TDESU_BACKEND=ON \
85 -DWITH_SUDO_KONSOLE_SUPER_USER_COMMAND=OFF \
89 -DWITH_LIBRAW1394=OFF \
91 -DWITH_XCOMPOSITE=ON \
103 -DWITH_XSCREENSAVER=OFF \
106 -DWITH_LIBCONFIG=OFF \
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
118 ( cd -- "$directory" && touch .graft-config )
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"
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"
167 cd "${destdir}/$mandir"
168 find . -type f -exec lzip -9 {} +
169 find . -type l | while read -r file
171 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
180 mkdir -p "${destdir}${docsdir}"
181 cp -p $docs "${destdir}${docsdir}"