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