recipe 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Build recipe for libr.
  2. #
  3. # Copyright (c) 2021-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=libr
  19. version=20220826_7671e68
  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. ELF resource manager library.
  31. This is a simple inter-process messaging system (TQt-based shared library).
  32. "
  33. homepage=https://www.trinitydesktop.org/
  34. license=LGPLv2.1
  35. # Source documentation
  36. docs="AUTHORS COPYING* ChangeLog NEWS README"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # We don't have doxygen by the moment, so we avoid calling it
  43. # for generate the documentation (aka manpage)
  44. patch -Np1 -i "${worktree}/patches/libr/do-not-call-doxygen-for-doc.diff"
  45. rm -rf man/
  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_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
  56. -DCMAKE_INSTALL_PREFIX=/usr \
  57. -DLIB_SUFFIX=${libSuffix} \
  58. -DCMAKE_VERBOSE_MAKEFILE=ON \
  59. -DWITH_BACKEND_LIBBFD=ON \
  60. -DWITH_BACKEND_LIBELF=ON \
  61. -DWITH_BACKEND_READONLY=ON \
  62. -G Ninja ..
  63. ninja -j${jobs}
  64. DESTDIR="$destdir" ninja -j${jobs} install
  65. # Compress and link man pages (if needed)
  66. if test -d "${destdir}/$mandir"
  67. then
  68. (
  69. cd "${destdir}/$mandir"
  70. find . -type f -exec lzip -9 {} +
  71. find . -type l | while read -r file
  72. do
  73. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  74. rm -- "$file"
  75. done
  76. )
  77. fi
  78. cd ..
  79. # Copy documentation
  80. mkdir -p "${destdir}/$docsdir"
  81. cp -p $docs "${destdir}/$docsdir"
  82. }