recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / tde / tdebase / recipe
blob62eafb566599ee65c17ea1b537f421e5d10bb2d2
1 # Build recipe for tdebase.
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=tdebase-trinity
18 pkgname=tdebase
19 version=14.0.7
20 release=4
22 # Define a category for the output of the package name
23 pkgcategory=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 TDE base libraries and programs.
33 tdebase is the second mandatory package (besides tdelibs) for the
34 Trinity Desktop Environment.  Here we have various applications
35 and infrastructure files and libraries.
38 homepage=http://www.trinitydesktop.org/
39 license="GPLv2+, GFDLv1.2"
41 # Source documentation
42 docs="AUTHORS COPYING* README*"
43 docsdir="${docdir}/${pkgname}-${version}"
45 build()
47     set -e
49     unpack "${tardir}/$tarname"
51     cd "$srcdir"
53     patch -Np1 -i \
54      "${worktree}/patches/tdebase/branch-updates_e37f480d1f2bc9786bdc578a37f657ca65052613.diff"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     mkdir BUILD
60     cd BUILD
62     cmake \
63      -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"             \
64      -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"         \
65      -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"        \
66      -DCMAKE_INSTALL_PREFIX=/opt/trinity                    \
67      -DCONFIG_INSTALL_DIR=/etc/trinity                      \
68      -DSYSCONF_INSTALL_DIR=/etc/trinity                     \
69      -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus                  \
70      -DLIB_SUFFIX=${libSuffix}                              \
71      -DCMAKE_VERBOSE_MAKEFILE=ON                            \
72      -DCMAKE_BUILD_TYPE=Release                             \
73      -DCMAKE_SKIP_INSTALL_RPATH=YES                         \
74      -DBUILD_ALL=ON                                         \
75      -DWITH_ALL_OPTIONS=ON                                  \
76      -DWITH_SUDO_KONSOLE_SUPER_USER_COMMAND=OFF             \
77      -DWITH_USBIDS=/usr/share/hwdata/usb.ids                \
78      -DHTDIG_SEARCH_BINARY=/usr/bin/hlsearch                \
79      -DWITH_TDEHWLIB=ON                                    \
80      -DWITH_ARTS=OFF                                        \
81      -DWITH_PAM=OFF                                         \
82      -DWITH_LIBCONFIG=OFF                                   \
83      -DWITH_XSCREENSAVER=OFF                                \
84      -DWITH_ELFICON=OFF                                     \
85      -DWITH_LIBUSB=OFF                                      \
86      -DWITH_LIBRAW1394=OFF                                  \
87      -DWITH_SASL=OFF                                        \
88      -DWITH_HAL=OFF                                         \
89      -DWITH_UPOWER=OFF                                      \
90      -DWITH_OPENEXR=OFF                                     \
91      -DWITH_LDAP=OFF                                        \
92      -DWITH_SAMBA=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     # Include xinitrc file to start TDE
116     mkdir -p "${destdir}/etc/X11/xinit"
117     cp -p "${worktree}/archive/tdebase/xinitrc-tde" \
118           "${destdir}/etc/X11/xinit/"
119     chmod 644 "${destdir}/etc/X11/xinit/xinitrc-tde"
121     touch "${destdir}/etc/X11/xinit/.graft-config"
123     # Compress and link man pages (if needed)
124     if test -d "${destdir}/$mandir"
125     then
126         (
127             cd "${destdir}/$mandir"
128             find . -type f -exec lzip -9 '{}' +
129             find . -type l | while read -r file
130             do
131                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
132                 rm -- "$file"
133             done
134         )
135     fi
137     cd ..
139     # Copy documentation
140     mkdir -p "${destdir}${docsdir}"
141     cp -p $docs "${destdir}${docsdir}"