logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

weechat-2.7.1.ebuild (4034B)


  1. # Copyright 1999-2020 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. PYTHON_COMPAT=( python{3_6,3_7,3_8} )
  5. inherit cmake-utils python-single-r1 xdg-utils
  6. if [[ ${PV} == "9999" ]] ; then
  7. inherit git-r3
  8. EGIT_REPO_URI="https://github.com/weechat/weechat.git"
  9. else
  10. SRC_URI="https://weechat.org/files/src/${P}.tar.xz"
  11. KEYWORDS="~amd64 ~arm ~ppc64 ~x86 ~x64-macos"
  12. fi
  13. DESCRIPTION="Portable and multi-interface IRC client"
  14. HOMEPAGE="https://weechat.org/"
  15. LICENSE="GPL-3"
  16. SLOT="0"
  17. NETWORKS="+irc"
  18. PLUGINS="+alias +buflist +charset +exec +fifo +fset +logger +relay +scripts +spell +trigger +xfer"
  19. # dev-lang/v8 was dropped from Gentoo so we can't enable javascript support
  20. SCRIPT_LANGS="guile lua +perl php +python ruby tcl"
  21. LANGS=" cs de es fr it ja pl ru"
  22. IUSE="doc man nls +ssl test ${SCRIPT_LANGS} ${PLUGINS} ${INTERFACES} ${NETWORKS}"
  23. REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
  24. RDEPEND="
  25. dev-libs/libgcrypt:0=
  26. net-misc/curl[ssl]
  27. sys-libs/ncurses:0=
  28. sys-libs/zlib
  29. charset? ( virtual/libiconv )
  30. guile? ( >=dev-scheme/guile-2.0 )
  31. lua? ( dev-lang/lua:0[deprecated] )
  32. nls? ( virtual/libintl )
  33. perl? ( dev-lang/perl:= )
  34. php? ( >=dev-lang/php-7.0:*[embed] )
  35. python? ( ${PYTHON_DEPS} )
  36. ruby? ( || ( dev-lang/ruby:2.6 dev-lang/ruby:2.5 dev-lang/ruby:2.4 ) )
  37. ssl? ( net-libs/gnutls )
  38. spell? ( app-text/aspell )
  39. tcl? ( >=dev-lang/tcl-8.4.15:0= )
  40. "
  41. DEPEND="${RDEPEND}
  42. test? ( dev-util/cpputest )
  43. "
  44. BDEPEND="
  45. virtual/pkgconfig
  46. doc? ( >=dev-ruby/asciidoctor-1.5.4 )
  47. man? ( >=dev-ruby/asciidoctor-1.5.4 )
  48. nls? ( >=sys-devel/gettext-0.15 )
  49. "
  50. DOCS="AUTHORS.adoc ChangeLog.adoc Contributing.adoc ReleaseNotes.adoc README.adoc"
  51. # tests need to be fixed to not use system plugins if weechat is already installed
  52. RESTRICT="test"
  53. pkg_setup() {
  54. use python && python-single-r1_pkg_setup
  55. }
  56. src_prepare() {
  57. cmake-utils_src_prepare
  58. # install only required translations
  59. local i
  60. for i in ${LANGS} ; do
  61. if ! has ${i} ${LINGUAS-${i}} ; then
  62. sed -i \
  63. -e "/${i}.po/d" \
  64. po/CMakeLists.txt || die
  65. fi
  66. done
  67. # install only required documentation ; en always
  68. for i in $(grep add_subdirectory doc/CMakeLists.txt \
  69. | sed -e 's/.*add_subdirectory(\(..\)).*/\1/' -e '/en/d'); do
  70. if ! has ${i} ${LINGUAS-${i}} ; then
  71. sed -i \
  72. -e '/add_subdirectory('${i}')/d' \
  73. doc/CMakeLists.txt || die
  74. fi
  75. done
  76. # install docs in correct directory
  77. sed -i "s#\${SHAREDIR}/doc/\${PROJECT_NAME}#\0-${PV}/html#" doc/*/CMakeLists.txt || die
  78. if [[ ${CHOST} == *-darwin* ]]; then
  79. # fix linking error on Darwin
  80. sed -i "s/+ get_config_var('LINKFORSHARED')//" \
  81. cmake/FindPython.cmake || die
  82. # allow to find the plugins by default
  83. sed -i 's/".so,.dll"/".bundle,.so,.dll"/' \
  84. src/core/wee-config.c || die
  85. fi
  86. }
  87. src_configure() {
  88. local mycmakeargs=(
  89. -DLIBDIR=/usr/$(get_libdir)
  90. -DENABLE_JAVASCRIPT=OFF
  91. -DENABLE_LARGEFILE=ON
  92. -DENABLE_NCURSES=ON
  93. -DENABLE_ALIAS=$(usex alias)
  94. -DENABLE_BUFLIST=$(usex buflist)
  95. -DENABLE_CHARSET=$(usex charset)
  96. -DENABLE_DOC=$(usex doc)
  97. -DENABLE_EXEC=$(usex exec)
  98. -DENABLE_FIFO=$(usex fifo)
  99. -DENABLE_FSET=$(usex fset)
  100. -DENABLE_GNUTLS=$(usex ssl)
  101. -DENABLE_GUILE=$(usex guile)
  102. -DENABLE_IRC=$(usex irc)
  103. -DENABLE_LOGGER=$(usex logger)
  104. -DENABLE_LUA=$(usex lua)
  105. -DENABLE_MAN=$(usex man)
  106. -DENABLE_NLS=$(usex nls)
  107. -DENABLE_PERL=$(usex perl)
  108. -DENABLE_PHP=$(usex php)
  109. -DENABLE_PYTHON=$(usex python)
  110. -DENABLE_RELAY=$(usex relay)
  111. -DENABLE_RUBY=$(usex ruby)
  112. -DENABLE_SCRIPT=$(usex scripts)
  113. -DENABLE_SCRIPTS=$(usex scripts)
  114. -DENABLE_SPELL=$(usex spell)
  115. -DENABLE_TCL=$(usex tcl)
  116. -DENABLE_TESTS=$(usex test)
  117. -DENABLE_TRIGGER=$(usex trigger)
  118. -DENABLE_XFER=$(usex xfer)
  119. )
  120. if use python; then
  121. python_is_python3 || mycmakeargs+=( -DENABLE_PYTHON2=ON )
  122. fi
  123. cmake-utils_src_configure
  124. }
  125. pkg_postinst() {
  126. xdg_desktop_database_update
  127. xdg_icon_cache_update
  128. xdg_mimeinfo_database_update
  129. }
  130. pkg_postrm() {
  131. xdg_desktop_database_update
  132. xdg_icon_cache_update
  133. xdg_mimeinfo_database_update
  134. }