recipe 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Build recipe for tdelibs.
  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=tdelibs-trinity
  17. pkgname=tdelibs
  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. The Trinity Desktop Environment (TDE) libraries.
  27. This package includes libraries that are central to the development and
  28. execution of a KDE program, as well as internationalization files for
  29. these libraries, misc HTML documentation, theme modules, and regression
  30. tests.
  31. "
  32. homepage=http://www.trinitydesktop.org/
  33. license="GPLv2+, LGPLv2+ | BSD 2-clause"
  34. # Source documentation
  35. docs="AUTHORS COPYING* DEBUG NAMING README TODO KDE?PORTING.html"
  36. docsdir="${docdir}/${pkgname}-${version}"
  37. build()
  38. {
  39. set -e
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. patch -Np1 -i "${worktree}/patches/tdelibs/_isnan.patch"
  43. patch -Np1 -i "${worktree}/patches/tdelibs/header-redirections.diff"
  44. patch -Np1 -i "${worktree}/patches/tdelibs/tdeio-kssl_libressl.patch"
  45. patch -Np1 -i "${worktree}/patches/tdelibs/start_tdeinit.c.diff"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. mkdir BUILD
  49. cd BUILD
  50. cmake \
  51. -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS" \
  52. -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS" \
  53. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS" \
  54. -DCMAKE_INSTALL_PREFIX=/opt/trinity \
  55. -DLIB_SUFFIX=${libSuffix} \
  56. -DCONFIG_INSTALL_DIR=/etc/trinity \
  57. -DSYSCONF_INSTALL_DIR=/etc/trinity \
  58. -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus \
  59. -DCMAKE_VERBOSE_MAKEFILE=ON \
  60. -DCMAKE_BUILD_TYPE=Release \
  61. -DCMAKE_SKIP_INSTALL_RPATH=YES \
  62. -DBUILD_ALL=ON \
  63. -DWITH_ALL_OPTIONS=ON \
  64. -DWITH_SUDO_TDESU_BACKEND=ON \
  65. -DWITH_OPENEXR=OFF \
  66. -DWITH_CUPS=OFF \
  67. -DWITH_UTEMPTER=OFF \
  68. -DWITH_LIBIDN=OFF \
  69. -DWITH_LUA=OFF \
  70. -DWITH_ELFICON=OFF \
  71. -DWITH_GAMIN=OFF \
  72. -DWITH_HSPELL=OFF \
  73. -DWITH_HALL=OFF \
  74. -DWITH_UPOWER=OFF \
  75. -DWITH_UDISKS=OFF \
  76. -DWITH_UDISKS2=OFF \
  77. -DWITH_CONSOLEKIT=OFF \
  78. ..
  79. make -j${jobs}
  80. make -j${jobs} DESTDIR="$destdir" install
  81. # Strip remaining binaries and libraries
  82. find "$destdir" -type f -print0 | xargs -0 file | \
  83. awk '/ELF/ && /executable/ || /shared object/' | \
  84. cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  85. find "$destdir" -type f -print0 | xargs -0 file | \
  86. awk '/current ar archive/' | \
  87. cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null || true
  88. # To handle (dot) .new files via graft(1)
  89. find "${destdir}/etc" -type d -print | while read -r directory
  90. do
  91. ( cd -- "$directory" && touch .graft-config )
  92. done
  93. # Compress and link man pages (if needed)
  94. if test -d "${destdir}/$mandir"
  95. then
  96. (
  97. cd "${destdir}/$mandir"
  98. find . -type f -exec lzip -9 '{}' +
  99. find . -type l | while read -r file
  100. do
  101. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  102. rm -- "$file"
  103. done
  104. )
  105. fi
  106. cd ..
  107. # Copy documentation
  108. mkdir -p "${destdir}${docsdir}"
  109. cp -p $docs "${destdir}${docsdir}"
  110. }