recipe 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # Build recipe for tdebase.
  2. #
  3. # Copyright (c) 2020 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. program=tdebase-trinity
  17. pkgname=tdebase
  18. version=14.0.7
  19. release=1
  20. # Set 'outdir' for a nice and well-organized output directory
  21. outdir="${outdir}/${arch}/tde"
  22. tarname=${program}-${version}.tar.xz
  23. # Remote source(s)
  24. fetch=http://mirror.ppa.trinitydesktop.org/trinity/releases/R${version}/main/$tarname
  25. description="
  26. TDE base libraries and programs.
  27. tdebase is the second mandatory package (besides tdelibs) for the
  28. Trinity Desktop Environment. Here we have various applications
  29. and infrastructure files and libraries.
  30. "
  31. homepage=http://www.trinitydesktop.org/
  32. license="GPLv2+, GFDLv1.2"
  33. # Source documentation
  34. docs="AUTHORS COPYING* README*"
  35. docsdir="${docdir}/${pkgname}-${version}"
  36. build()
  37. {
  38. set -e
  39. unpack "${tardir}/$tarname"
  40. cd "$srcdir"
  41. patch -Np1 -i "${worktree}/patches/tdebase/missing-header.patch"
  42. patch -Np1 -i "${worktree}/patches/tdebase/header-redirections.patch"
  43. # Set sane permissions
  44. chmod -R u+w,go-w,a+rX-s .
  45. mkdir BUILD
  46. cd BUILD
  47. cmake \
  48. -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
  49. -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
  50. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
  51. -DCMAKE_INSTALL_PREFIX=/opt/trinity \
  52. -DCONFIG_INSTALL_DIR=/etc/trinity \
  53. -DSYSCONF_INSTALL_DIR=/etc/trinity \
  54. -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus \
  55. -DLIB_SUFFIX=${libSuffix} \
  56. -DCMAKE_VERBOSE_MAKEFILE=ON \
  57. -DCMAKE_BUILD_TYPE=Release \
  58. -DCMAKE_SKIP_INSTALL_RPATH=YES \
  59. -DBUILD_ALL=ON \
  60. -DWITH_ALL_OPTIONS=ON \
  61. -DWITH_SUDO_KONSOLE_SUPER_USER_COMMAND=OFF \
  62. -DWITH_USBIDS=/usr/share/hwdata/usb.ids \
  63. -DHTDIG_SEARCH_BINARY=/usr/bin/hlsearch \
  64. -DWITH_PAM=OFF \
  65. -DWITH_LIBCONFIG=OFF \
  66. -DWITH_XSCREENSAVER=OFF \
  67. -DWITH_ELFICON=OFF \
  68. -DWITH_LIBUSB=OFF \
  69. -DWITH_LIBRAW1394=OFF \
  70. -DWITH_SASL=OFF \
  71. -DWITH_HAL=OFF \
  72. -DWITH_UPOWER=OFF \
  73. -DWITH_OPENEXR=OFF \
  74. -DWITH_LDAP=OFF \
  75. -DWITH_SAMBA=OFF \
  76. ..
  77. make -j${jobs}
  78. make -j${jobs} DESTDIR="$destdir" install
  79. # Strip remaining binaries and libraries
  80. find "$destdir" -type f -print0 | xargs -0 file | \
  81. awk '/ELF/ && /executable/ || /shared object/' | \
  82. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  83. find "$destdir" -type f -print0 | xargs -0 file | \
  84. awk '/current ar archive/' | \
  85. cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
  86. # To handle (dot) .new files via graft(1)
  87. find "${destdir}/etc" -type d -print | while read -r directory
  88. do
  89. ( cd -- "$directory" && touch .graft-config )
  90. done
  91. # Include xinitrc file to start TDE
  92. mkdir -p "${destdir}/etc/X11/xinit"
  93. cp -p "${worktree}/archive/tdebase/xinitrc-tde" \
  94. "${destdir}/etc/X11/xinit/"
  95. chmod 644 "${destdir}/etc/X11/xinit/xinitrc-tde"
  96. touch "${destdir}/etc/X11/xinit/.graft-config"
  97. # Compress and link man pages (if needed)
  98. if test -d "${destdir}/$mandir"
  99. then
  100. (
  101. cd "${destdir}/$mandir"
  102. find . -type f -exec lzip -9 '{}' +
  103. find . -type l | while read -r file
  104. do
  105. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  106. rm -- "$file"
  107. done
  108. )
  109. fi
  110. cd ..
  111. # Copy documentation
  112. mkdir -p "${destdir}${docsdir}"
  113. cp -p $docs "${destdir}${docsdir}"
  114. }