recipe 3.1 KB

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