With python USE flag enabled weechat always compiling against python-2.7, regardless PYTHON_TARGETS or PYTHON_SINGLE_TARGET set. emerge weechat -pv Calculating dependencies... done! [ebuild R ] net-irc/weechat-1.4::gentoo USE="alias charset exec fifo irc logger nls perl python relay scripts spell ssl trigger xfer -doc -guile -lua -ruby -tcl {-test}" LINGUAS="-cs -de -es -fr -hu -it -ja -pl -pt_BR -ru -tr" PYTHON_SINGLE_TARGET="python3_4 -python2_7 -python3_3 -python3_5" PYTHON_TARGETS="python2_7 python3_4 -python3_3 -python3_5" 0 KiB notice a python_targets used. Compile and install it. When running weechat notice: Error: unable to load plugin "/usr/lib64/weechat/plugins/python.so": /usr/lib64/weechat/plugins/python.so: undefined symbol: PyUnicode_AsUTF8String If you're trying to load a script and not a C plugin, try command to load scripts (/perl, /python, ...) PyUnicode_AsUTF8String symbol only present in python3.4: oleg2 ~ # scanelf -r -s PyUnicode_AsUTF8String /lib/* /usr/* /opt/* ET_DYN - PyUnicode_AsUTF8String /usr/lib64/libboost_python-3.4.so.1.58.0 ET_DYN - PyUnicode_AsUTF8String /usr/lib64/libpython3.4m.so.1.0 oleg2 ~ # somehow, weechat is only built against python-2.7 oleg2 ~ # scanelf -nf $(qlist weechat | sort) TYPE NEEDED FILE ET_EXEC libgcrypt.so.20,libgnutls.so.28,libdl.so.2,libncursesw.so.6,libpthread.so.0,libm.so.6,libcurl.so.4,libc.so.6 /usr/bin/weechat-curses ET_DYN libc.so.6 /usr/lib64/weechat/plugins/alias.so ET_DYN libaspell.so.15,libc.so.6 /usr/lib64/weechat/plugins/aspell.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/charset.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/exec.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/fifo.so ET_DYN libgnutls.so.28,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/irc.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/logger.so ET_DYN libperl.so.5.22,libc.so.6 /usr/lib64/weechat/plugins/perl.so ET_DYN libpython2.7.so.1.0,libc.so.6 /usr/lib64/weechat/plugins/python.so ET_DYN libz.so.1,libgcrypt.so.20,libgnutls.so.28,libc.so.6 /usr/lib64/weechat/plugins/relay.so ET_DYN libz.so.1,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/script.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/trigger.so ET_DYN libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/xfer.so oleg2 ~ # After forcefully setting: oleg2 ~ # USE="-python_targets_python2_7 python_targets_python3_4 python_single_target_python3_4" emerge weechat and installing, weechat is still built against python-2.7 oleg2 ~ # scanelf -nf $(qlist weechat | sort) TYPE NEEDED FILE ET_EXEC libgcrypt.so.20,libgnutls.so.28,libdl.so.2,libncursesw.so.6,libpthread.so.0,libm.so.6,libcurl.so.4,libc.so.6 /usr/bin/weechat-curses ET_DYN libc.so.6 /usr/lib64/weechat/plugins/alias.so ET_DYN libaspell.so.15,libc.so.6 /usr/lib64/weechat/plugins/aspell.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/charset.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/exec.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/fifo.so ET_DYN libgnutls.so.28,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/irc.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/logger.so ET_DYN libperl.so.5.22,libc.so.6 /usr/lib64/weechat/plugins/perl.so ET_DYN libpython2.7.so.1.0,libc.so.6 /usr/lib64/weechat/plugins/python.so ET_DYN libz.so.1,libgcrypt.so.20,libgnutls.so.28,libc.so.6 /usr/lib64/weechat/plugins/relay.so ET_DYN libz.so.1,libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/script.so ET_DYN libc.so.6 /usr/lib64/weechat/plugins/trigger.so ET_DYN libgcrypt.so.20,libc.so.6 /usr/lib64/weechat/plugins/xfer.so oleg2 ~ # Reproducible: Always Steps to Reproduce: 1. USE=python emerge weechat 2. try running weechat 3.
problem is that weechat hardcodes python executables and lins and library path: if(ENABLE_PYTHON3) find_program(PYTHON_EXECUTABLE NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python PATHS /usr/bin /usr/local/bin /usr/pkg/bin ) else() find_program(PYTHON_EXECUTABLE NAMES python2.7 python2.6 python2.5 python PATHS /usr/bin /usr/local/bin /usr/pkg/bin ) endif() if(ENABLE_PYTHON3) find_library(PYTHON_LIBRARY NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) else() find_library(PYTHON_LIBRARY NAMES python2.7 python2.6 python2.5 python HINTS ${PYTHON_POSSIBLE_LIB_PATH} ) endif()
attached the diff in ebuilds and ebuild itself, which fixes this. only with 1.4 verison
Created attachment 429274 [details] diff
Created attachment 429276 [details] ebuild
Fixed in 1.4-r1 and 9999.