recipe 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. # Build recipe for weechat.
  2. #
  3. # Copyright (c) 2019-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=weechat
  19. version=3.4
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=networking
  23. tarname=${program}-${version}.tar.bz2
  24. # Remote source(s)
  25. fetch=https://weechat.org/files/src/$tarname
  26. homepage=https://weechat.org
  27. license=GPLv3+
  28. description="
  29. WeeChat is a fast, light and extensible chat client.
  30. WeeChat (Wee Enhanced Environment for Chat) is a free chat client,
  31. fast and light, designed for many operating systems. It is highly
  32. customizable and extensible with scripts.
  33. For more information, visit: $homepage
  34. "
  35. # Source documentation
  36. docs=COPYING
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. rm -rf BUILD
  45. mkdir BUILD
  46. cd BUILD
  47. # Note about NLS: it does not work with gettex-tiny, currently.
  48. cmake \
  49. -DCMAKE_C_FLAGS:STRING="$QICFLAGS" \
  50. -DCMAKE_CXX_FLAGS:STRING="$QICXXFLAGS" \
  51. -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS" \
  52. -DCMAKE_INSTALL_PREFIX=/usr \
  53. -DCMAKE_BUILD_TYPE=Release \
  54. -DCMAKE_VERBOSE_MAKEFILE=ON \
  55. -DCMAKE_SKIP_INSTALL_RPATH=YES \
  56. -DLIBDIR=/usr/lib${libSuffix} \
  57. -DENABLE_NLS=ON \
  58. -DENABLE_JAVASCRIPT=OFF \
  59. -DENABLE_ENCHANT=OFF \
  60. -DENABLE_PHP=OFF \
  61. -DENABLE_MAN=ON \
  62. -DENABLE_DOC=ON \
  63. -G Ninja ..
  64. ninja -j${jobs}
  65. DESTDIR="$destdir" ninja -j${jobs} install
  66. # Move generated documentation directory, if enabled
  67. mkdir -p "${destdir}/$docsdir"
  68. if test -d "${destdir}/usr/share/doc/weechat"
  69. then
  70. for file in "${destdir}/usr/share/doc/weechat"/*
  71. do
  72. mv -f -- "$file" "${destdir}/$docsdir"
  73. done
  74. unset -v file
  75. rm -rf "${destdir}/usr/share/doc/weechat"
  76. fi
  77. cd ..
  78. # Copy documentation
  79. cp -p $docs "${destdir}/$docsdir"
  80. # Compress and link man pages (if needed)
  81. if test -d "${destdir}/$mandir"
  82. then
  83. (
  84. cd "${destdir}/$mandir"
  85. find . -type f -exec lzip -9 {} +
  86. find . -type l | while read -r file
  87. do
  88. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  89. rm -- "$file"
  90. done
  91. )
  92. fi
  93. }