recipe 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. # Build recipe for tdebase.
  2. #
  3. # Copyright (c) 2020-2023 Matias Fonzo, <selk@dragora.org>.
  4. #
  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
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  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.
  16. # Exit immediately on any error
  17. set -e
  18. program=tdebase
  19. version=20230217_2ffa44200
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tde
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch="
  26. https://dragora.mirror.garr.it/current/sources/$tarname
  27. rsync://rsync.dragora.org/current/sources/$tarname
  28. "
  29. description="
  30. TDE base libraries and programs.
  31. tdebase is the second mandatory package (besides tdelibs) for the
  32. Trinity Desktop Environment. Here we have various applications
  33. and infrastructure files and libraries.
  34. "
  35. homepage=https://www.trinitydesktop.org/
  36. license="GPLv2+, GFDLv1.2"
  37. # Source documentation
  38. docs="AUTHORS COPYING* README*"
  39. docsdir="${docdir}/${program}-${version}"
  40. build()
  41. {
  42. unpack "${tardir}/$tarname"
  43. cd "$srcdir"
  44. # https://mirror.git.trinitydesktop.org/gitea/TDE/tdebase/pulls/205
  45. patch -Np1 -i "${worktree}/patches/tdebase/kicker-clock-FTBFS.patch"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. rm -rf BUILD
  49. mkdir BUILD
  50. cd BUILD
  51. cmake \
  52. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  53. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  54. -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS" \
  55. -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS" \
  56. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
  57. -DLIB_SUFFIX=${libSuffix} \
  58. -DCMAKE_VERBOSE_MAKEFILE=ON \
  59. -DCMAKE_SKIP_RPATH=OFF \
  60. -DCMAKE_INSTALL_PREFIX=/opt/trinity \
  61. -DCONFIG_INSTALL_DIR=/etc/trinity \
  62. -DSYSCONF_INSTALL_DIR=/etc/trinity \
  63. -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix} \
  64. -DCMAKE_INCLUDE_PATH=/opt/trinity/include \
  65. -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus \
  66. -DHTDIG_SEARCH_BINARY=/usr/bin/hlsearch \
  67. -DWITH_GCC_VISIBILITY=ON \
  68. -DBUILD_ALL=ON \
  69. -DBUILD_TDM_SYSTEMD_UNIT_FILE=OFF \
  70. -DWITH_USBIDS=/usr/share/hwdata/usb.ids \
  71. -DWITH_ARTS=OFF \
  72. -DWITH_PAM=OFF \
  73. -DWITH_SASL=OFF \
  74. -DWITH_ELFICON=ON \
  75. -DWITH_SUDO_TDESU_BACKEND=ON \
  76. -DWITH_SUDO_KONSOLE_SUPER_USER_COMMAND=OFF \
  77. -DWITH_LDAP=OFF \
  78. -DWITH_SAMBA=OFF \
  79. -DWITH_LIBUSB=ON \
  80. -DWITH_LIBRAW1394=OFF \
  81. -DWITH_OPENEXR=ON \
  82. -DWITH_XCOMPOSITE=ON \
  83. -DWITH_XCURSOR=ON \
  84. -DWITH_XFIXES=ON \
  85. -DWITH_XRANDR=ON \
  86. -DWITH_XINERAMA=ON \
  87. -DWITH_SENSORS=ON \
  88. -DWITH_HAL=OFF \
  89. -DWITH_TDEHWLIB=ON \
  90. -DWITH_XDMCP=ON \
  91. -DWITH_XRENDER=ON \
  92. -DWITH_XTEST=ON \
  93. -DWITH_OPENGL=ON \
  94. -DWITH_XSCREENSAVER=OFF \
  95. -DWITH_UPOWER=OFF \
  96. -DWITH_LIBART=ON \
  97. -DWITH_LIBCONFIG=OFF \
  98. -DWITH_PCRE=ON \
  99. -G Ninja ..
  100. ninja -j${jobs}
  101. DESTDIR="$destdir" ninja -j${jobs} install
  102. # To handle (dot) .new files via graft(1)
  103. find "${destdir}/etc" -type d -print | while read -r directory
  104. do
  105. ( cd -- "$directory" && touch .graft-config )
  106. done
  107. # Include wallpaper of our team mate "Oswald Kelso"
  108. install -p -m 644 "${worktree}/archive/tdebase/bluedragora.jpg" \
  109. "${destdir}"/opt/trinity/share/wallpapers/
  110. install -p -m 644 "${worktree}/archive/tdebase/bluedragora.jpg.desktop" \
  111. "${destdir}"/opt/trinity/share/wallpapers/
  112. # Set or point to our wallpaper location
  113. sed \
  114. -e 's|Trinity-lineart.svg.desktop|bluedragora.jpg.desktop|g' \
  115. -e 's|Wallpaper=Trinity-lineart.svg|Wallpaper=bluedragora.jpg|g' \
  116. -i "${destdir}"/opt/trinity/bin/starttde
  117. # Include xinitrc file to start TDE
  118. mkdir -p "${destdir}/etc/X11/xinit"
  119. cp -p "${worktree}/archive/tdebase/xinitrc-tde" \
  120. "${destdir}/etc/X11/xinit/"
  121. chmod 644 "${destdir}/etc/X11/xinit/xinitrc-tde"
  122. # Include profile file
  123. mkdir -p "${destdir}/etc/profile.d"
  124. cp -p "${worktree}/archive/tdebase/etc/profile.d/trinity.sh" \
  125. "${destdir}/etc/profile.d/"
  126. chmod 644 "${destdir}/etc/profile.d/trinity.sh"
  127. # To handle .new config file(s)
  128. touch "${destdir}/etc/profile.d/.graft-config" \
  129. "${destdir}/etc/X11/xinit/.graft-config"
  130. # Create post-install script
  131. mkdir -p "${destdir}/var/lib/qi"
  132. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  133. # Make symlink for canonical path at /opt/trinity/lib
  134. #
  135. # Link using \$libSuffix
  136. if test -n "$libSuffix" && test ! -e "\${rootdir}/opt/trinity/lib"
  137. then
  138. ( cd -- "\${rootdir}/opt/trinity" && ln -sf lib${libSuffix} lib )
  139. fi
  140. echo "Updating desktop database: update-desktop-database -q opt/trinity/share/applications/tde"
  141. chroot "\$rootdir" /usr/bin/update-desktop-database -q opt/trinity/share/applications/tde 2> /dev/null
  142. echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor"
  143. chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor 2> /dev/null
  144. echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg"
  145. chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg 2> /dev/null
  146. # Set xinitrc as default to start TDE when this package is installed
  147. cd -- "\${rootdir}/etc/X11/xinit" && ln -sf xinitrc-tde xinitrc
  148. EOF
  149. # Compress and link man pages (if needed)
  150. if test -d "${destdir}/$mandir"
  151. then
  152. (
  153. cd "${destdir}/$mandir"
  154. find . -type f -exec lzip -9 {} +
  155. find . -type l | while read -r file
  156. do
  157. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  158. rm -- "$file"
  159. done
  160. )
  161. fi
  162. cd ..
  163. # Copy documentation
  164. mkdir -p "${destdir}/$docsdir"
  165. cp -p $docs "${destdir}/$docsdir"
  166. }