recipe 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # Build recipe for tdelibs.
  2. #
  3. # Copyright (c) 2020-2022 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=tdelibs
  19. version=20220503_32fc7e3e
  20. release=2
  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. The Trinity Desktop Environment (TDE) libraries.
  31. This package includes libraries that are central to the development and
  32. execution of a KDE program, as well as internationalization files for
  33. these libraries, misc HTML documentation, theme modules, and regression
  34. tests.
  35. "
  36. homepage=https://www.trinitydesktop.org/
  37. license="GPLv2+, LGPLv2+ | BSD 2-clause"
  38. # Source documentation
  39. docs="AUTHORS COPYING* DEBUG NAMING README TODO KDE?PORTING.html"
  40. docsdir="${docdir}/${program}-${version}"
  41. build()
  42. {
  43. unpack "${tardir}/$tarname"
  44. cd "$srcdir"
  45. patch -Np1 -i "${worktree}/patches/tdelibs/xcomposite-shared-masterbranch.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. -DWITH_GCC_VISIBILITY=ON \
  67. -DWITH_CUPS=OFF \
  68. -DWITH_ARTS=OFF \
  69. -DWITH_LIBART=ON \
  70. -DWITH_LIBIDN=OFF \
  71. -DWITH_TIFF=ON \
  72. -DWITH_JASPER=ON \
  73. -DWITH_OPENEXR=ON \
  74. -DWITH_AVAHI=OFF \
  75. -DWITH_ISPELL=OFF \
  76. -DWITH_ASPELL=ON \
  77. -DWITH_HSPELL=OFF \
  78. -DDEFAULT_SPELL_CHECKER=ASPELL \
  79. -DWITH_ELFICON=ON \
  80. -DWITH_TDEHWLIB=OFF \
  81. -DWITH_LOGINDPOWER=OFF \
  82. -DWITH_UDEVIL=ON \
  83. -DWITH_UPOWER=OFF \
  84. -DWITH_UDISKS=OFF \
  85. -DWITH_UDISKS2=OFF \
  86. -DWITH_CONSOLEKIT=OFF \
  87. -DWITH_NETWORK_MANAGER_BACKEND=OFF \
  88. -DWITH_LZMA=ON \
  89. -DWITH_XRANDR=ON \
  90. -DWITH_XCOMPOSITE=ON \
  91. -DWITH_MITSHM=ON \
  92. -DWITH_IMAGETOPS_BINARY=ON \
  93. -G Ninja ..
  94. ninja -j${jobs}
  95. DESTDIR="$destdir" ninja -j${jobs} install
  96. # This symlink will be handled from the post-install
  97. # script to point to the correct location
  98. rm -f "${destdir}/opt/trinity/share/icons/default.tde"
  99. # To handle (dot) .new files via graft(1)
  100. find "${destdir}/etc" -type d -print | while read -r directory
  101. do
  102. ( cd -- "$directory" && touch .graft-config )
  103. done
  104. # Compress and link man pages (if needed)
  105. if test -d "${destdir}/$mandir"
  106. then
  107. (
  108. cd "${destdir}/$mandir"
  109. find . -type f -exec lzip -9 {} +
  110. find . -type l | while read -r file
  111. do
  112. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  113. rm -- "$file"
  114. done
  115. )
  116. fi
  117. cd ..
  118. # Copy documentation
  119. mkdir -p "${destdir}/$docsdir"
  120. cp -p $docs "${destdir}/$docsdir"
  121. }