diff -Nru weechat-2.6/AUTHORS.adoc weechat-2.8/AUTHORS.adoc --- weechat-2.6/AUTHORS.adoc 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/AUTHORS.adoc 2020-03-29 07:39:36.000000000 +0000 @@ -68,6 +68,7 @@ * Koka El Kiwi (KiwiDash) * Krzysztof Koroscik (soltys) * Kyle Fuller (kylef) +* Kyle Sabo * Leonid Evdokimov * Lázaro A. * Linus Heckemann @@ -76,6 +77,7 @@ * Marco Paolone * Mateusz Poszwa * Matt Robinson +* Matthew Horan * Matthew Martin * Max Anton Teufel * Maxim Baz diff -Nru weechat-2.6/autogen.sh weechat-2.8/autogen.sh --- weechat-2.6/autogen.sh 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/autogen.sh 2020-03-29 07:39:36.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2005 Julien Louis # Copyright (C) 2005-2006 Emmanuel Bouthenot # @@ -24,8 +24,8 @@ ### common stuff ### -DIR=$(cd $(dirname "$0"); pwd) -cd $DIR +DIR=$(cd "$(dirname "$0")" || exit 1; pwd) +cd "$DIR" || exit 1 AUTOGEN_LOG=autogen.log @@ -41,9 +41,8 @@ run () { - echo -n "Running \"$@\"..." - eval $@ >$AUTOGEN_LOG 2>&1 - if [ $? = 0 ] ; then + printf "Running \"%s\"..." "$@" + if eval "$@" >$AUTOGEN_LOG 2>&1 ; then echo " OK" else echo " FAILED" diff -Nru weechat-2.6/ChangeLog.adoc weechat-2.8/ChangeLog.adoc --- weechat-2.6/ChangeLog.adoc 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/ChangeLog.adoc 2020-03-29 07:39:36.000000000 +0000 @@ -15,6 +15,119 @@ (file _ReleaseNotes.adoc_ in sources). +[[v2.8]] +== Version 2.8 (2020-03-29) + +New features:: + + * core: add variable "old_full_name" in buffer, set during buffer renaming (issue #1428) + * core: add debug option "-d" in command /eval (issue #1434) + * api: add functions crypto_hash and crypto_hash_pbkdf2 + * api: add info "auto_connect" (issue #1453) + * api: add info "weechat_headless" (issue #1433) + * buflist: add pointer "window" in bar item evaluation + * irc: add support of fake servers (no I/O, for testing purposes) + * relay: accept hash of password in init command of weechat protocol with option "password_hash" (PBKDF2, SHA256, SHA512) + * relay: reject client with weechat protocol if password or totp is received in init command but not set in WeeChat (issue #1435) + +Bug fixes:: + + * core: fix memory leak in completion + * core: flush stdout/stderr before forking in hook_process function (issue #1441) + * core: fix evaluation of condition with nested "if" (issue #1434) + * irc: split AUTHENTICATE message in 400-byte chunks (issue #1459) + * irc: copy temporary server flag in command /server copy + * irc: add nick changes in the hotlist (except self nick change) + * irc: case-insensitive comparison on incoming CTCP command, force upper case on CTCP replies (issue #1439) + * irc: fix memory leak when the channel topic is changed + * logger: fix crash when logging is disabled on a buffer and the log file was deleted in the meanwhile, when option logger.file.info_lines is on (issue #1444) + * php: fix crash when loading script with PHP 7.4 (issue #1452) + * relay: update buffers synchronization when buffers are renamed (issue #1428) + * script: fix memory leak in read of script repository file if it has invalid content + * script: fix unexpected display of scripts list in buffer with command /script list -i + * xfer: send signal "xfer_ended" after the received file has been renamed (issue #1438) + +Tests:: + + * scripts: fix generation of test scripts with Python 3.8 + * unit: add tests on IRC protocol functions and callbacks + * unit: add tests on function secure_derive_key + * unit: add tests on functions util_get_time_diff and util_file_get_content + +Build:: + + * core: fix Cygwin build + * guile: add detection of Guile 3.0.0 (issue #1442) + * irc: fix build with GnuTLS < 3.1.0 (issue #1431) + * php: add detection of PHP 7.4 + * ruby: add detection of Ruby 2.7 (issue #1455) + +[[v2.7.1]] +== Version 2.7.1 (2020-02-20) + +Bug fixes:: + + * irc: fix crash when a new message 005 is received with longer nick prefixes (CVE-2020-9760) + * irc: fix crash when receiving a malformed message 352 (who) (CVE-2020-9759) + * irc: fix crash when receiving a malformed message 324 (channel mode) (CVE-2020-8955) + +[[v2.7]] +== Version 2.7 (2019-12-08) + +New features:: + + * core: add option weechat.look.nick_color_hash_salt to shuffle nick colors (issue #635) + * core: add different icons sizes (16x16 to 512x512) (issue #1347) + * core: add file weechat.desktop + * core: add reverse of string for screen in evaluation of expressions with "revscr:" + * core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx" + * core: add calculation of expression in evaluation of expressions with "calc:xxx" (issue #997) + * core: add optional default path (evaluated) in completion "filename" + * core: add support of modifiers in evaluation of expressions with "modifier:name,data,string" + * api: add modifier "color_encode_ansi" (issue #528) + * api: add modifier "eval_path_home" + * irc: add filters on raw buffer (issue #1000) + * irc: add option irc.look.display_pv_warning_address to display a warning in private buffer if the remote nick address has changed (issue #892) + * irc: add server option "ssl_password" (issue #115, issue #1416) + * irc: add "user" in output of irc_message_parse (issue #136) + * irc: add options irc.color.message_kick and irc.color.reason_kick (issue #683, issue #684) + * logger: add option logger.file.color_lines (issue #528, issue #621) + * script: add options "-ol" and "-il" in command "/script list" to send translated string with list of scripts loaded, display "No scripts loaded" if no scripts are loaded + * xfer: add option xfer.file.download_temporary_suffix with default value ".part" (issue #1237) + +Bug fixes:: + + * core: set buffer name, short name and title only if the value has changed + * core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (issue #899, issue #978) + * core: optimize load of configuration files + * core: fix window separators not respecting window splits (issue #630) + * core: fix cursor mode info when prefix_align is none and with words split across lines (issue #610, issue #617, issue #619) + * core: add support of reverse video in ANSI color codes + * core: fixed segfault during excessive evaluation in function string_repeat (issue #1400) + * buflist: fix extra spaces between buffers when conditions are used to hide buffers (regression introduced in version 2.6) (issue #1403) + * irc: do not automatically open a channel with name "0" (issue #1429) + * irc: remove option irc.network.channel_encode, add server option "charset_message" to control which part of the IRC message is decoded/encoded to the target charset (issue #832) + * irc: use path from option xfer.file.upload_path to complete filename in command "/dcc send" (issue #60) + * logger: fix write in log file if it has been deleted or renamed (issue #123) + * python: send "bytes" instead of "str" to callbacks in Python 3 when the string is not UTF-8 valid (issue #1389) + * relay: send message "_buffer_title_changed" to clients only when the title is changed + * xfer: fix memory leak when a xfer is freed and when the plugin is unloaded + +Tests:: + + * unit: add tests on GUI color functions + +Build:: + + * core: fix build on Haiku (issue #1420) + * core: fix build on Alpine + * core: remove file FindTCL.cmake + * core: display an error on missing dependency in CMake (issue #916, issue #956) + * debian: disable Javascript plugin on Debian Sid and Ubuntu Eoan + * debian: build with Guile 2.2 + * guile: add support of Guile 2.2, disable /guile eval (issue #1098) + * python: add detection of Python 3.8 + [[v2.6]] == Version 2.6 (2019-09-08) @@ -165,11 +278,11 @@ * core: add repeat of string in evaluation of expressions with "repeat:count,string" (issue #958) * core: allow specifying buffer number/name for /buffer localvar (issue #1259) - * core: allow multiple arguments in command /buffer close + * core: allow multiple arguments in command "/buffer close" * core: allow multiple options "-r" (or "--run-command") in command line arguments (issue #1248) * core: add command line option "-P" (or "--plugins") to customize the plugins to load at startup - * core: allow partial buffer name in command /buffer close (issue #1226) - * api: add function hook_line + * core: allow partial buffer name in command "/buffer close" (issue #1226) + * api: add function hook_line (issue #66) * irc: display a warning when the value of option irc.server.xxx.autojoin is set to an invalid value * relay: add real IP in client description (issue #1256) * trigger: allow creation of temporary variables with the regex @@ -310,7 +423,7 @@ * core: add flag "input_get_empty" in buffer * core: add signals "buffer_filters_enabled" and "buffer_filters_disabled" * core: support loading of plugins from path in environment variable "WEECHAT_EXTRA_LIBDIR" (issue #971, issue #979) - * core: make value optional in command /buffer set (issue #746, issue #1088) + * core: make value optional in command "/buffer set" (issue #746, issue #1088) * core: allow floating point and hexadecimal numbers in comparison of evaluated values * core: add option weechat.look.save_config_with_fsync (issue #1083) * api: add support of prefix "quiet:" in function key_unbind to quietly remove keys @@ -395,7 +508,7 @@ New features:: * core: add option weechat.completion.nick_case_sensitive (issue #981) - * core: add wilcard matching operator (`+=*+` and `+!*+`) in evaluation of expressions (issue #611) + * core: add wildcard matching operator (`+=*+` and `+!*+`) in evaluation of expressions (issue #611) * core: add cut of string in evaluation of expressions with "cut:" (number of chars) and "cutscr:" (number of chars displayed on screen) * core: add ternary operator (condition) in evaluation of expressions (`${if:condition?value_if_true:value_if_false}`) * core: add resize of window parents with /window resize [h/v]size (task #11461, issue #893) @@ -488,7 +601,7 @@ New features:: - * core: add optional argument "lowest", "highest" or level mask in command /input hotlist_clear + * core: add optional argument "lowest", "highest" or level mask in command "/input hotlist_clear" * core: add option "cycle" in command /buffer * core, irc, xfer: display more information on memory allocation errors (issue #573) * api: add "extra" argument to evaluate extra variables in function string_eval_expression (issue #534) @@ -685,7 +798,7 @@ * core: add options weechat.look.word_chars_{highlight|input} (issue #55, task #9459) * core: remove WeeChat version from config files (issue #407) * core: display a warning on startup if the locale can not be set (issue #373) - * core: allow "*" as plugin name in command /plugin reload to reload all plugins with options + * core: allow "*" as plugin name in command "/plugin reload" to reload all plugins with options * core: add option "-s" in command /eval to split expression before evaluating it (no more split by default) (issue #324) * core: add priority in plugins to initialize them in order * api: add support of environment variables in function string_eval_expression and command /eval @@ -1629,14 +1742,14 @@ * core: allow name of buffer for command /buffer clear (task #11269) * core: add new command /repeat (execute a command several times) * core: save and restore layout for buffers and windows on /upgrade - * core: add option "-all" in command /buffer unmerge + * core: add option "-all" in command "/buffer unmerge" * core: add number in windows (add optional argument "-window" so some actions for command /window) * core: allow buffer name in /buffer close * core: add support of mouse: new command /mouse, new key context "mouse", new options weechat.look.mouse and weechat.look.mouse_timer_delay (task #5435) * core: add command /cursor (free movement of cursor on screen), with key context "cursor" * core: automatic scroll direction in /bar scroll (x/y is now optional) * core: add optional delay for key grab (commands /input grab_key and /input grab_key_command, default is 500 milliseconds) - * core: allow plugin name in command /buffer name + * core: allow plugin name in command "/buffer name" * core: add context "search" for keys (to define keys used during search in buffer with kbd:[Ctrl+r]) * core: add new option weechat.look.separator_vertical, rename option weechat.look.hline_char to weechat.look.separator_horizontal * core: add local variable "highlight_regex" in buffers @@ -1717,7 +1830,7 @@ * core: add option weechat.look.hotlist_buffer_separator * core: add messages counts in hotlist for each buffer, new options: weechat.look.hotlist_count_max, weechat.look.hotlist_count_min_msg and weechat.color.status_count_{msg|private|highlight|other} * core: add tag "notify_none" (line with this tag will not update hotlist) - * core: add optional bar name in command /bar default + * core: add optional bar name in command "/bar default" * core: add new option weechat.look.highlight_tags (force highlight on tags) * core: allow list of buffers in command /filter (exclusion with prefix "!") (task #10880) * core: allow relative size for command /window resize diff -Nru weechat-2.6/cmake/cmake_uninstall.cmake.in weechat-2.8/cmake/cmake_uninstall.cmake.in --- weechat-2.6/cmake/cmake_uninstall.cmake.in 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/cmake_uninstall.cmake.in 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -37,4 +37,4 @@ else() message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") endif() -endforeach(file) +endforeach() diff -Nru weechat-2.6/cmake/FindAsciidoctor.cmake weechat-2.8/cmake/FindAsciidoctor.cmake --- weechat-2.6/cmake/FindAsciidoctor.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindAsciidoctor.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -34,7 +34,7 @@ execute_process( COMMAND ${ASCIIDOCTOR_EXECUTABLE} --version OUTPUT_VARIABLE ASCIIDOCTOR_VERSION - ) + ) string(REGEX REPLACE "^Asciidoctor ([^ ]+) .*" "\\1" ASCIIDOCTOR_VERSION "${ASCIIDOCTOR_VERSION}") @@ -45,5 +45,5 @@ mark_as_advanced( ASCIIDOCTOR_EXECUTABLE ASCIIDOCTOR_VERSION - ) + ) endif() diff -Nru weechat-2.6/cmake/FindAspell.cmake weechat-2.8/cmake/FindAspell.cmake --- weechat-2.6/cmake/FindAspell.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindAspell.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -55,4 +55,4 @@ mark_as_advanced( ASPELL_INCLUDE_PATH ASPELL_LIBRARY - ) +) diff -Nru weechat-2.6/cmake/FindCppUTest.cmake weechat-2.8/cmake/FindCppUTest.cmake --- weechat-2.6/cmake/FindCppUTest.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindCppUTest.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2014-2019 Sébastien Helleu +# Copyright (C) 2014-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -27,8 +27,8 @@ # CPPUTEST_LIBRARIES = Link options to compile with CppUTest if(CPPUTEST_FOUND) - # Already in cache, be silent - set(CPPUTEST_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(CPPUTEST_FIND_QUIETLY TRUE) endif() find_package(PkgConfig) diff -Nru weechat-2.6/cmake/FindENCHANT.cmake weechat-2.8/cmake/FindENCHANT.cmake --- weechat-2.6/cmake/FindENCHANT.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindENCHANT.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -13,10 +13,8 @@ if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES) - # in cache already set(ENCHANT_FOUND TRUE) - else() if(NOT WIN32) # use pkg-config to get the directories and then use these values @@ -27,17 +25,19 @@ endif() find_path(ENCHANT_INCLUDE_DIR - NAMES enchant++.h - HINTS ${PC_ENCHANT_INCLUDEDIR} - ${PC_ENCHANT_INCLUDE_DIRS} - PATH_SUFFIXES enchant ) - - find_library(ENCHANT_LIBRARIES NAMES enchant - HINTS ${PC_ENCHANT_LIBDIR} - ${PC_ENCHANT_LIBRARY_DIRS} ) + NAMES enchant++.h + HINTS ${PC_ENCHANT_INCLUDEDIR} ${PC_ENCHANT_INCLUDE_DIRS} + PATH_SUFFIXES enchant + ) + + find_library(ENCHANT_LIBRARIES + NAMES enchant + HINTS ${PC_ENCHANT_LIBDIR} + ${PC_ENCHANT_LIBRARY_DIRS} + ) include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES ) + find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES) mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES) @@ -47,5 +47,4 @@ check_symbol_exists(enchant_get_version "enchant.h" HAVE_ENCHANT_GET_VERSION) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - endif() diff -Nru weechat-2.6/cmake/FindGCRYPT.cmake weechat-2.8/cmake/FindGCRYPT.cmake --- weechat-2.6/cmake/FindGCRYPT.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindGCRYPT.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # diff -Nru weechat-2.6/cmake/FindGettext.cmake weechat-2.8/cmake/FindGettext.cmake --- weechat-2.6/cmake/FindGettext.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindGettext.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2007 Julien Louis # Copyright (C) 2009 Emmanuel Bouthenot # @@ -28,8 +28,8 @@ # GETTEXT_FOUND = is gettext usable on system? if(GETTEXT_FOUND) - # Already in cache, be silent - set(GETTEXT_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(GETTEXT_FIND_QUIETLY TRUE) endif() include(CheckIncludeFiles) @@ -54,7 +54,7 @@ PATHS /usr/local/lib /usr/lib - ) + ) if(LIBINTL_LIBRARY) if(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") set(CMAKE_REQUIRED_LIBRARIES "iconv") @@ -62,7 +62,6 @@ else() check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT) endif() - if(LIBINTL_HAS_DGETTEXT) set(GETTEXT_FOUND TRUE) endif() diff -Nru weechat-2.6/cmake/FindGnuTLS.cmake weechat-2.8/cmake/FindGnuTLS.cmake --- weechat-2.6/cmake/FindGnuTLS.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindGnuTLS.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2009 Emmanuel Bouthenot # # This file is part of WeeChat, the extensible chat client. @@ -30,23 +30,23 @@ # GNUTLS_LDFLAGS = ldflags to use to compile if(GNUTLS_INCLUDE_PATH AND GNUTLS_LIBRARY) - # Already in cache, be silent - set(GNUTLS_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(GNUTLS_FIND_QUIETLY TRUE) endif() find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config) execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix gnutls - OUTPUT_VARIABLE GNUTLS_PREFIX + OUTPUT_VARIABLE GNUTLS_PREFIX ) execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --cflags gnutls - OUTPUT_VARIABLE GNUTLS_CFLAGS + OUTPUT_VARIABLE GNUTLS_CFLAGS ) string(REGEX REPLACE "[\r\n]" "" GNUTLS_CFLAGS "${GNUTLS_CFLAGS}") execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --libs gnutls - OUTPUT_VARIABLE GNUTLS_LDFLAGS + OUTPUT_VARIABLE GNUTLS_LDFLAGS ) string(REGEX REPLACE "[\r\n]" "" GNUTLS_LDFLAGS "${GNUTLS_LDFLAGS}") diff -Nru weechat-2.6/cmake/FindGuile.cmake weechat-2.8/cmake/FindGuile.cmake --- weechat-2.6/cmake/FindGuile.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindGuile.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2011-2019 Sébastien Helleu +# Copyright (C) 2011-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -27,13 +27,13 @@ # GUILE_LIBRARIES = Link options to compile Guile if(GUILE_FOUND) - # Already in cache, be silent - set(GUILE_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(GUILE_FIND_QUIETLY TRUE) endif() find_package(PkgConfig) if(PKG_CONFIG_FOUND) - pkg_search_module(GUILE guile-2.0) + pkg_search_module(GUILE guile-3.0 guile-2.2 guile-2.0) if(GUILE_FOUND) # check if variable "scm_install_gmp_memory_functions" exists set(CMAKE_REQUIRED_INCLUDES ${GUILE_INCLUDE_DIRS}) diff -Nru weechat-2.6/cmake/FindIconv.cmake weechat-2.8/cmake/FindIconv.cmake --- weechat-2.6/cmake/FindIconv.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindIconv.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -29,8 +29,8 @@ # ICONV_FOUND = is iconv usable on system? if(ICONV_FOUND) - # Already in cache, be silent - set(ICONV_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(ICONV_FIND_QUIETLY TRUE) endif() include(CheckLibraryExists) diff -Nru weechat-2.6/cmake/FindLua.cmake weechat-2.8/cmake/FindLua.cmake --- weechat-2.6/cmake/FindLua.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindLua.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -29,8 +29,8 @@ # LUA_FOUND = is liblua usable on system? if(LUA_FOUND) - # Already in cache, be silent - set(LUA_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(LUA_FIND_QUIETLY TRUE) endif() find_package(PkgConfig) diff -Nru weechat-2.6/cmake/FindNcurses.cmake weechat-2.8/cmake/FindNcurses.cmake --- weechat-2.6/cmake/FindNcurses.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindNcurses.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # diff -Nru weechat-2.6/cmake/FindPerl.cmake weechat-2.8/cmake/FindPerl.cmake --- weechat-2.6/cmake/FindPerl.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindPerl.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -29,31 +29,31 @@ # PERL_LFLAGS = perl compiler options for linking if(PERL_FOUND) - # Already in cache, be silent - set(PERL_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(PERL_FIND_QUIETLY TRUE) endif() find_program(PERL_EXECUTABLE NAMES perl perl5 PATHS /usr/bin /usr/local/bin /usr/pkg/bin - ) +) if(PERL_EXECUTABLE) execute_process( COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \"\$Config{archlibexp}/CORE\"" OUTPUT_VARIABLE PERL_INTERNAL_DIR - ) + ) execute_process( COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ccopts OUTPUT_VARIABLE PERL_CFLAGS - ) + ) execute_process( COMMAND ${PERL_EXECUTABLE} -MExtUtils::Embed -e ldopts OUTPUT_VARIABLE PERL_LFLAGS - ) + ) # remove the new lines from the output by replacing them with empty strings string(REPLACE "\n" "" PERL_INTERNAL_DIR "${PERL_INTERNAL_DIR}") @@ -63,12 +63,12 @@ find_path(PERL_INCLUDE_PATH NAMES perl.h PATHS ${PERL_INTERNAL_DIR} - ) + ) find_library(PERL_LIBRARY NAMES perl PATHS /usr/lib /usr/local/lib /usr/pkg/lib ${PERL_INTERNAL_DIR} - ) + ) if(PERL_LIBRARY AND PERL_INCLUDE_PATH) set(PERL_FOUND TRUE) @@ -80,5 +80,5 @@ PERL_LIBRARY PERL_CFLAGS PERL_LFLAGS - ) + ) endif() diff -Nru weechat-2.6/cmake/FindPHP.cmake weechat-2.8/cmake/FindPHP.cmake --- weechat-2.6/cmake/FindPHP.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindPHP.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,6 @@ # -# Copyright (C) 2003-2017 Adam Saponara +# Copyright (C) 2017 Adam Saponara +# Copyright (C) 2017-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -28,11 +29,13 @@ if(NOT PHP_FOUND) find_program(PHP_CONFIG_EXECUTABLE NAMES + php-config7.4 php-config74 php-config7.3 php-config73 php-config7.2 php-config72 php-config7.1 php-config71 php-config7.0 php-config70 - php-config php-config7) + php-config php-config7 + ) if (PHP_CONFIG_EXECUTABLE) execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --prefix OUTPUT_VARIABLE PHP_LIB_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --includes OUTPUT_VARIABLE PHP_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -40,8 +43,9 @@ execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE PHP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) if(${PHP_VERSION} MATCHES "^7") find_library(PHP_LIB - NAMES php7.3 php7.2 php7.1 php7.0 php7 - HINTS ${PHP_LIB_PREFIX} ${PHP_LIB_PREFIX}/lib ${PHP_LIB_PREFIX}/lib64) + NAMES php7.4 php7.3 php7.2 php7.1 php7.0 php7 + HINTS ${PHP_LIB_PREFIX} ${PHP_LIB_PREFIX}/lib ${PHP_LIB_PREFIX}/lib64 + ) if(PHP_LIB) get_filename_component(PHP_LIB_DIR ${PHP_LIB} DIRECTORY) string(REPLACE "-I" "" PHP_INCLUDE_DIRS ${PHP_INCLUDE_DIRS}) diff -Nru weechat-2.6/cmake/FindPkgConfig.cmake weechat-2.8/cmake/FindPkgConfig.cmake --- weechat-2.6/cmake/FindPkgConfig.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindPkgConfig.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,117 +1,60 @@ -# - a pkg-config module for CMake -# -# Usage: -# pkg_check_modules( [REQUIRED] []*) -# checks for all the given modules -# -# pkg_search_module( [REQUIRED] []*) -# checks for given modules and uses the first working one -# -# When the 'REQUIRED' argument was set, macros will fail with an error -# when module(s) could not be found -# -# It sets the following variables: -# PKG_CONFIG_FOUND ... true iff pkg-config works on the system -# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program -# _FOUND ... set to 1 iff module(s) exist -# -# For the following variables two sets of values exist; first one is the -# common one and has the given PREFIX. The second set contains flags -# which are given out when pkgconfig was called with the '--static' -# option. -# _LIBRARIES ... only the libraries (w/o the '-l') -# _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') -# _LDFLAGS ... all required linker flags -# _LDFLAGS_OTHER ... all other linker flags -# _INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') -# _CFLAGS ... all required cflags -# _CFLAGS_OTHER ... the other compiler flags -# -# = for common case -# = _STATIC for static linking -# -# There are some special variables whose prefix depends on the count -# of given modules. When there is only one module, stays -# unchanged. When there are multiple modules, the prefix will be -# changed to _: -# _VERSION ... version of the module -# _PREFIX ... prefix-directory of the module -# _INCLUDEDIR ... include-dir of the module -# _LIBDIR ... lib-dir of the module -# -# = when |MODULES| == 1, else -# = _ -# -# A parameter can have the following formats: -# {MODNAME} ... matches any version -# {MODNAME}>={VERSION} ... at least version is required -# {MODNAME}={VERSION} ... exactly version is required -# {MODNAME}<={VERSION} ... modules must not be newer than -# -# Examples -# pkg_check_modules (GLIB2 glib-2.0) -# -# pkg_check_modules (GLIB2 glib-2.0>=2.10) -# requires at least version 2.10 of glib2 and defines e.g. -# GLIB2_VERSION=2.10.3 -# -# pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) -# requires both glib2 and gtk2, and defines e.g. -# FOO_glib-2.0_VERSION=2.10.3 -# FOO_gtk+-2.0_VERSION=2.8.20 -# -# pkg_check_modules (XRENDER REQUIRED xrender) -# defines e.g.: -# XRENDER_LIBRARIES=Xrender;X11 -# XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp -# -# pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) - - -# Copyright (C) 2006 Enrico Scholz -# -# Redistribution and use, with or without modification, are permitted -# provided that the following conditions are met: -# -# 1. Redistributions must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. The name of the author may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[========================================[.rst: +FindPkgConfig +------------- + +A ``pkg-config`` module for CMake. + +Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`, +:command:`pkg_check_modules` and :command:`pkg_search_module` commands. The +following variables will also be set: + +``PKG_CONFIG_FOUND`` + if pkg-config executable was found +``PKG_CONFIG_EXECUTABLE`` + pathname of the pkg-config program +``PKG_CONFIG_VERSION_STRING`` + version of pkg-config (since CMake 2.8.8) +#]========================================] ### Common stuff #### set(PKG_CONFIG_VERSION 1) -set(PKG_CONFIG_FOUND 0) +# find pkg-config, use PKG_CONFIG if set +if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL "")) + set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable") +endif() find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") mark_as_advanced(PKG_CONFIG_EXECUTABLE) -if(PKG_CONFIG_EXECUTABLE) - set(PKG_CONFIG_FOUND 1) -endif(PKG_CONFIG_EXECUTABLE) - +if (PKG_CONFIG_EXECUTABLE) + execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif () + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +find_package_handle_standard_args(PkgConfig + REQUIRED_VARS PKG_CONFIG_EXECUTABLE + VERSION_VAR PKG_CONFIG_VERSION_STRING) + +# This is needed because the module name is "PkgConfig" but the name of +# this variable has always been PKG_CONFIG_FOUND so this isn't automatically +# handled by FPHSA. +set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}") # Unsets the given variables macro(_pkgconfig_unset var) set(${var} "" CACHE INTERNAL "") -endmacro(_pkgconfig_unset) +endmacro() macro(_pkgconfig_set var value) set(${var} ${value} CACHE INTERNAL "") -endmacro(_pkgconfig_set) +endmacro() # Invokes pkgconfig, cleans up the result and sets variables macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) @@ -120,55 +63,311 @@ execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist} OUTPUT_VARIABLE _pkgconfig_invoke_result - RESULT_VARIABLE _pkgconfig_failed) + RESULT_VARIABLE _pkgconfig_failed + OUTPUT_STRIP_TRAILING_WHITESPACE) if (_pkgconfig_failed) set(_pkgconfig_${_varname} "") _pkgconfig_unset(${_prefix}_${_varname}) - else(_pkgconfig_failed) - string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") - string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") + else() + string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") if (NOT ${_regexp} STREQUAL "") string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") - endif(NOT ${_regexp} STREQUAL "") + endif() separate_arguments(_pkgconfig_invoke_result) #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}") set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result}) _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}") - endif(_pkgconfig_failed) -endmacro(_pkgconfig_invoke) + endif() +endmacro() + +# Internal version of pkg_get_variable; expects PKG_CONFIG_PATH to already be set +function (_pkg_get_variable result pkg variable) + _pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}") + set("${result}" + "${prefix_result}" + PARENT_SCOPE) +endfunction () # Invokes pkgconfig two times; once without '--static' and once with # '--static' macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp) _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN}) -endmacro(_pkgconfig_invoke_dyn) +endmacro() # Splits given arguments into options and a package list -macro(_pkgconfig_parse_options _result _is_req) +macro(_pkgconfig_parse_options _result _is_req _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global) set(${_is_req} 0) + set(${_is_silent} 0) + set(${_no_cmake_path} 0) + set(${_no_cmake_environment_path} 0) + set(${_imp_target} 0) + set(${_imp_target_global} 0) + if(DEFINED PKG_CONFIG_USE_CMAKE_PREFIX_PATH) + if(NOT PKG_CONFIG_USE_CMAKE_PREFIX_PATH) + set(${_no_cmake_path} 1) + set(${_no_cmake_environment_path} 1) + endif() + elseif(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.1) + set(${_no_cmake_path} 1) + set(${_no_cmake_environment_path} 1) + endif() foreach(_pkg ${ARGN}) if (_pkg STREQUAL "REQUIRED") set(${_is_req} 1) - endif (_pkg STREQUAL "REQUIRED") - endforeach(_pkg ${ARGN}) + endif () + if (_pkg STREQUAL "QUIET") + set(${_is_silent} 1) + endif () + if (_pkg STREQUAL "NO_CMAKE_PATH") + set(${_no_cmake_path} 1) + endif() + if (_pkg STREQUAL "NO_CMAKE_ENVIRONMENT_PATH") + set(${_no_cmake_environment_path} 1) + endif() + if (_pkg STREQUAL "IMPORTED_TARGET") + set(${_imp_target} 1) + endif() + if (_pkg STREQUAL "GLOBAL") + set(${_imp_target_global} 1) + endif() + endforeach() + + if (${_imp_target_global} AND NOT ${_imp_target}) + message(SEND_ERROR "the argument GLOBAL may only be used together with IMPORTED_TARGET") + endif() set(${_result} ${ARGN}) list(REMOVE_ITEM ${_result} "REQUIRED") -endmacro(_pkgconfig_parse_options) + list(REMOVE_ITEM ${_result} "QUIET") + list(REMOVE_ITEM ${_result} "NO_CMAKE_PATH") + list(REMOVE_ITEM ${_result} "NO_CMAKE_ENVIRONMENT_PATH") + list(REMOVE_ITEM ${_result} "IMPORTED_TARGET") + list(REMOVE_ITEM ${_result} "GLOBAL") +endmacro() + +# Add the content of a variable or an environment variable to a list of +# paths +# Usage: +# - _pkgconfig_add_extra_path(_extra_paths VAR) +# - _pkgconfig_add_extra_path(_extra_paths ENV VAR) +function(_pkgconfig_add_extra_path _extra_paths_var _var) + set(_is_env 0) + if(ARGC GREATER 2 AND _var STREQUAL "ENV") + set(_var ${ARGV2}) + set(_is_env 1) + endif() + if(NOT _is_env) + if(NOT "${${_var}}" STREQUAL "") + list(APPEND ${_extra_paths_var} ${${_var}}) + endif() + else() + if(NOT "$ENV{${_var}}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{${_var}}" _path) + list(APPEND ${_extra_paths_var} ${_path}) + unset(_path) + endif() + endif() + set(${_extra_paths_var} ${${_extra_paths_var}} PARENT_SCOPE) +endfunction() + +# scan the LDFLAGS returned by pkg-config for library directories and +# libraries, figure out the absolute paths of that libraries in the +# given directories +function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path) + unset(_libs) + unset(_find_opts) + + # set the options that are used as long as the .pc file does not provide a library + # path to look into + if(_no_cmake_path) + list(APPEND _find_opts "NO_CMAKE_PATH") + endif() + if(_no_cmake_environment_path) + list(APPEND _find_opts "NO_CMAKE_ENVIRONMENT_PATH") + endif() + + unset(_search_paths) + foreach (flag IN LISTS ${_prefix}_LDFLAGS) + if (flag MATCHES "^-L(.*)") + list(APPEND _search_paths ${CMAKE_MATCH_1}) + continue() + endif() + if (flag MATCHES "^-l(.*)") + set(_pkg_search "${CMAKE_MATCH_1}") + else() + continue() + endif() + + if(_search_paths) + # Firstly search in -L paths + find_library(pkgcfg_lib_${_prefix}_${_pkg_search} + NAMES ${_pkg_search} + HINTS ${_search_paths} NO_DEFAULT_PATH) + endif() + find_library(pkgcfg_lib_${_prefix}_${_pkg_search} + NAMES ${_pkg_search} + ${_find_opts}) + mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search}) + if(pkgcfg_lib_${_prefix}_${_pkg_search}) + list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}") + else() + list(APPEND _libs ${_pkg_search}) + endif() + endforeach() + + set(${_prefix}_LINK_LIBRARIES "${_libs}" PARENT_SCOPE) +endfunction() + +# create an imported target from all the information returned by pkg-config +function(_pkg_create_imp_target _prefix _imp_target_global) + # only create the target if it is linkable, i.e. no executables + if (NOT TARGET PkgConfig::${_prefix} + AND ( ${_prefix}_INCLUDE_DIRS OR ${_prefix}_LINK_LIBRARIES OR ${_prefix}_LDFLAGS_OTHER OR ${_prefix}_CFLAGS_OTHER )) + if(${_imp_target_global}) + set(_global_opt "GLOBAL") + else() + unset(_global_opt) + endif() + add_library(PkgConfig::${_prefix} INTERFACE IMPORTED ${_global_opt}) + + if(${_prefix}_INCLUDE_DIRS) + set_property(TARGET PkgConfig::${_prefix} PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${${_prefix}_INCLUDE_DIRS}") + endif() + if(${_prefix}_LINK_LIBRARIES) + set_property(TARGET PkgConfig::${_prefix} PROPERTY + INTERFACE_LINK_LIBRARIES "${${_prefix}_LINK_LIBRARIES}") + endif() + if(${_prefix}_LDFLAGS_OTHER) + set_property(TARGET PkgConfig::${_prefix} PROPERTY + INTERFACE_LINK_OPTIONS "${${_prefix}_LDFLAGS_OTHER}") + endif() + if(${_prefix}_CFLAGS_OTHER) + set_property(TARGET PkgConfig::${_prefix} PROPERTY + INTERFACE_COMPILE_OPTIONS "${${_prefix}_CFLAGS_OTHER}") + endif() + endif() +endfunction() + +# recalculate the dynamic output +# this is a macro and not a function so the result of _pkg_find_libs is automatically propagated +macro(_pkg_recalculate _prefix _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global) + _pkg_find_libs(${_prefix} ${_no_cmake_path} ${_no_cmake_environment_path}) + if(${_imp_target}) + _pkg_create_imp_target(${_prefix} ${_imp_target_global}) + endif() +endmacro() ### -macro(_pkg_check_modules_internal _is_required _is_silent _prefix) +macro(_pkg_set_path_internal) + set(_extra_paths) + + if(NOT _no_cmake_path) + _pkgconfig_add_extra_path(_extra_paths CMAKE_PREFIX_PATH) + _pkgconfig_add_extra_path(_extra_paths CMAKE_FRAMEWORK_PATH) + _pkgconfig_add_extra_path(_extra_paths CMAKE_APPBUNDLE_PATH) + endif() + + if(NOT _no_cmake_environment_path) + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_PREFIX_PATH) + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_FRAMEWORK_PATH) + _pkgconfig_add_extra_path(_extra_paths ENV CMAKE_APPBUNDLE_PATH) + endif() + + if(NOT _extra_paths STREQUAL "") + # Save the PKG_CONFIG_PATH environment variable, and add paths + # from the CMAKE_PREFIX_PATH variables + set(_pkgconfig_path_old "$ENV{PKG_CONFIG_PATH}") + set(_pkgconfig_path "${_pkgconfig_path_old}") + if(NOT _pkgconfig_path STREQUAL "") + file(TO_CMAKE_PATH "${_pkgconfig_path}" _pkgconfig_path) + endif() + + # Create a list of the possible pkgconfig subfolder (depending on + # the system + set(_lib_dirs) + if(NOT DEFINED CMAKE_SYSTEM_NAME + OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" + AND NOT CMAKE_CROSSCOMPILING)) + if(EXISTS "/etc/debian_version") # is this a debian system ? + if(CMAKE_LIBRARY_ARCHITECTURE) + list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig") + endif() + else() + # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties + get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS) + if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) + list(APPEND _lib_dirs "lib32/pkgconfig") + endif() + get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS) + if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND _lib_dirs "lib64/pkgconfig") + endif() + get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS) + if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32") + list(APPEND _lib_dirs "libx32/pkgconfig") + endif() + endif() + endif() + if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING) + list(APPEND _lib_dirs "libdata/pkgconfig") + endif() + list(APPEND _lib_dirs "lib/pkgconfig") + list(APPEND _lib_dirs "share/pkgconfig") + + # Check if directories exist and eventually append them to the + # pkgconfig path list + foreach(_prefix_dir ${_extra_paths}) + foreach(_lib_dir ${_lib_dirs}) + if(EXISTS "${_prefix_dir}/${_lib_dir}") + list(APPEND _pkgconfig_path "${_prefix_dir}/${_lib_dir}") + list(REMOVE_DUPLICATES _pkgconfig_path) + endif() + endforeach() + endforeach() + + # Prepare and set the environment variable + if(NOT _pkgconfig_path STREQUAL "") + # remove empty values from the list + list(REMOVE_ITEM _pkgconfig_path "") + file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path) + if(UNIX) + string(REPLACE ";" ":" _pkgconfig_path "${_pkgconfig_path}") + string(REPLACE "\\ " " " _pkgconfig_path "${_pkgconfig_path}") + endif() + set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path}") + endif() + + # Unset variables + unset(_lib_dirs) + unset(_pkgconfig_path) + endif() +endmacro() + +macro(_pkg_restore_path_internal) + if(NOT _extra_paths STREQUAL "") + # Restore the environment variable + set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}") + endif() + + unset(_extra_paths) + unset(_pkgconfig_path_old) +endmacro() + +### +macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global _prefix) _pkgconfig_unset(${_prefix}_FOUND) _pkgconfig_unset(${_prefix}_VERSION) _pkgconfig_unset(${_prefix}_PREFIX) _pkgconfig_unset(${_prefix}_INCLUDEDIR) _pkgconfig_unset(${_prefix}_LIBDIR) + _pkgconfig_unset(${_prefix}_MODULE_NAME) _pkgconfig_unset(${_prefix}_LIBS) _pkgconfig_unset(${_prefix}_LIBS_L) _pkgconfig_unset(${_prefix}_LIBS_PATHS) @@ -193,83 +392,77 @@ # give out status message telling checked module if (NOT ${_is_silent}) if (_pkg_check_modules_cnt EQUAL 1) - message(STATUS "checking for module '${_pkg_check_modules_list}'") - else(_pkg_check_modules_cnt EQUAL 1) - message(STATUS "checking for modules '${_pkg_check_modules_list}'") - endif(_pkg_check_modules_cnt EQUAL 1) - endif(NOT ${_is_silent}) + message(STATUS "Checking for module '${_pkg_check_modules_list}'") + else() + message(STATUS "Checking for modules '${_pkg_check_modules_list}'") + endif() + endif() set(_pkg_check_modules_packages) set(_pkg_check_modules_failed) + _pkg_set_path_internal() + # iterate through module list and check whether they exist and match the required version foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list}) set(_pkg_check_modules_exist_query) # check whether version is given - if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") - string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") - string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}") - string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}") - else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") + if (_pkg_check_modules_pkg MATCHES "(.*[^><])(=|[><]=?)(.*)") + set(_pkg_check_modules_pkg_name "${CMAKE_MATCH_1}") + set(_pkg_check_modules_pkg_op "${CMAKE_MATCH_2}") + set(_pkg_check_modules_pkg_ver "${CMAKE_MATCH_3}") + else() set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") set(_pkg_check_modules_pkg_op) set(_pkg_check_modules_pkg_ver) - endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") - - # handle the operands - if (_pkg_check_modules_pkg_op STREQUAL ">=") - list(APPEND _pkg_check_modules_exist_query --atleast-version) - endif(_pkg_check_modules_pkg_op STREQUAL ">=") - - if (_pkg_check_modules_pkg_op STREQUAL "=") - list(APPEND _pkg_check_modules_exist_query --exact-version) - endif(_pkg_check_modules_pkg_op STREQUAL "=") - - if (_pkg_check_modules_pkg_op STREQUAL "<=") - list(APPEND _pkg_check_modules_exist_query --max-version) - endif(_pkg_check_modules_pkg_op STREQUAL "<=") - - # create the final query which is of the format: - # * --atleast-version - # * --exact-version - # * --max-version - # * --exists - if (_pkg_check_modules_pkg_op) - list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}") - else(_pkg_check_modules_pkg_op) - list(APPEND _pkg_check_modules_exist_query --exists) - endif(_pkg_check_modules_pkg_op) + endif() _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR) - list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}") list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}") + # create the final query which is of the format: + # * > + # * >= + # * = + # * <= + # * < + # * --exists + list(APPEND _pkg_check_modules_exist_query --print-errors --short-errors) + if (_pkg_check_modules_pkg_op) + list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name} ${_pkg_check_modules_pkg_op} ${_pkg_check_modules_pkg_ver}") + else() + list(APPEND _pkg_check_modules_exist_query --exists) + list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}") + endif() + # execute the query execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query} - RESULT_VARIABLE _pkgconfig_retval) + RESULT_VARIABLE _pkgconfig_retval + ERROR_VARIABLE _pkgconfig_error + ERROR_STRIP_TRAILING_WHITESPACE) # evaluate result and tell failures if (_pkgconfig_retval) if(NOT ${_is_silent}) - message(STATUS " package '${_pkg_check_modules_pkg}' not found") - endif(NOT ${_is_silent}) + message(STATUS " ${_pkgconfig_error}") + endif() set(_pkg_check_modules_failed 1) - endif(_pkgconfig_retval) - endforeach(_pkg_check_modules_pkg) + endif() + endforeach() if(_pkg_check_modules_failed) # fail when requested if (${_is_required}) - message(SEND_ERROR "A required package was not found") - endif (${_is_required}) - else(_pkg_check_modules_failed) + message(FATAL_ERROR "A required package was not found") + endif () + else() # when we are here, we checked whether requested modules # exist. Now, go through them and set variables @@ -281,17 +474,23 @@ # handle case when there is only one package required if (pkg_count EQUAL 1) set(_pkg_check_prefix "${_prefix}") - else(pkg_count EQUAL 1) + else() set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}") - endif(pkg_count EQUAL 1) + endif() _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion ) - _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix ) - _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir ) - _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir ) - - message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") - endforeach(_pkg_check_modules_pkg) + pkg_get_variable("${_pkg_check_prefix}_PREFIX" ${_pkg_check_modules_pkg} "prefix") + pkg_get_variable("${_pkg_check_prefix}_INCLUDEDIR" ${_pkg_check_modules_pkg} "includedir") + pkg_get_variable("${_pkg_check_prefix}_LIBDIR" ${_pkg_check_modules_pkg} "libdir") + foreach (variable IN ITEMS PREFIX INCLUDEDIR LIBDIR) + _pkgconfig_set("${_pkg_check_prefix}_${variable}" "${${_pkg_check_prefix}_${variable}}") + endforeach () + _pkgconfig_set("${_pkg_check_prefix}_MODULE_NAME" "${_pkg_check_modules_pkg}") + + if (NOT ${_is_silent}) + message(STATUS " Found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") + endif () + endforeach() # set variables which are combined for multiple modules _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) @@ -302,58 +501,271 @@ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) - endif(_pkg_check_modules_failed) - else(PKG_CONFIG_EXECUTABLE) - if (${_is_required}) - message(SEND_ERROR "pkg-config tool not found") - endif (${_is_required}) - endif(PKG_CONFIG_EXECUTABLE) -endmacro(_pkg_check_modules_internal) -### -### User visible macros start here -### + _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) + endif() -### + _pkg_restore_path_internal() + else() + if (${_is_required}) + message(SEND_ERROR "pkg-config tool not found") + endif () + endif() +endmacro() + + +#[========================================[.rst: +.. command:: pkg_check_modules + + Checks for all the given modules, setting a variety of result variables in + the calling scope. + + .. code-block:: cmake + + pkg_check_modules( + [REQUIRED] [QUIET] + [NO_CMAKE_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [IMPORTED_TARGET [GLOBAL]] + [...]) + + When the ``REQUIRED`` argument is given, the command will fail with an error + if module(s) could not be found. + + When the ``QUIET`` argument is given, no status messages will be printed. + + By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or + later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set to a + boolean ``True`` value, then the :variable:`CMAKE_PREFIX_PATH`, + :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` cache + and environment variables will be added to the ``pkg-config`` search path. + The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments + disable this behavior for the cache variables and environment variables + respectively. + + The ``IMPORTED_TARGET`` argument will create an imported target named + ``PkgConfig::`` that can be passed directly as an argument to + :command:`target_link_libraries`. The ``GLOBAL`` argument will make the + imported target available in global scope. + + Each ```` can be either a bare module name or it can be a + module name with a version constraint (operators ``=``, ``<``, ``>``, + ``<=`` and ``>=`` are supported). The following are examples for a module + named ``foo`` with various constraints: + + - ``foo`` matches any version. + - ``foo<2`` only matches versions before 2. + - ``foo>=3.1`` matches any version from 3.1 or later. + - ``foo=1.2.3`` requires that foo must be exactly version 1.2.3. + + The following variables may be set upon return. Two sets of values exist: + One for the common case (`` = ``) and another for the + information ``pkg-config`` provides when called with the ``--static`` + option (`` = _STATIC``). + + ``_FOUND`` + set to 1 if module(s) exist + ``_LIBRARIES`` + only the libraries (without the '-l') + ``_LINK_LIBRARIES`` + the libraries and their absolute paths + ``_LIBRARY_DIRS`` + the paths of the libraries (without the '-L') + ``_LDFLAGS`` + all required linker flags + ``_LDFLAGS_OTHER`` + all other linker flags + ``_INCLUDE_DIRS`` + the '-I' preprocessor flags (without the '-I') + ``_CFLAGS`` + all required cflags + ``_CFLAGS_OTHER`` + the other compiler flags + + All but ``_FOUND`` may be a :ref:`;-list ` if the + associated variable returned from ``pkg-config`` has multiple values. + + There are some special variables whose prefix depends on the number of + ```` given. When there is only one ````, + ```` will simply be ````, but if two or more ```` + items are given, ```` will be ``_``. + + ``_VERSION`` + version of the module + ``_PREFIX`` + prefix directory of the module + ``_INCLUDEDIR`` + include directory of the module + ``_LIBDIR`` + lib directory of the module + + Examples: + + .. code-block:: cmake + + pkg_check_modules (GLIB2 glib-2.0) + + Looks for any version of glib2. If found, the output variable + ``GLIB2_VERSION`` will hold the actual version found. + + .. code-block:: cmake + + pkg_check_modules (GLIB2 glib-2.0>=2.10) + + Looks for at least version 2.10 of glib2. If found, the output variable + ``GLIB2_VERSION`` will hold the actual version found. + + .. code-block:: cmake + + pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) + + Looks for both glib2-2.0 (at least version 2.10) and any version of + gtk2+-2.0. Only if both are found will ``FOO`` be considered found. + The ``FOO_glib-2.0_VERSION`` and ``FOO_gtk+-2.0_VERSION`` variables will be + set to their respective found module versions. + + .. code-block:: cmake + + pkg_check_modules (XRENDER REQUIRED xrender) + + Requires any version of ``xrender``. Example output variables set by a + successful call:: + + XRENDER_LIBRARIES=Xrender;X11 + XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp +#]========================================] macro(pkg_check_modules _prefix _module0) + _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global "${_module0}" ${ARGN}) # check cached value - if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) - _pkgconfig_parse_options (_pkg_modules _pkg_is_required "${_module0}" ${ARGN}) - _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules}) + if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND OR + (NOT "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0};${ARGN}") OR + ( "${ARGN}" STREQUAL "" AND NOT "${__pkg_config_arguments_${_prefix}}" STREQUAL "${_module0}")) + _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} "${_prefix}" ${_pkg_modules}) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) - endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) -endmacro(pkg_check_modules) + if (${_prefix}_FOUND) + _pkgconfig_set(__pkg_config_arguments_${_prefix} "${_module0};${ARGN}") + endif() + else() + if (${_prefix}_FOUND) + _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) + endif() + endif() +endmacro() + + +#[========================================[.rst: +.. command:: pkg_search_module + + The behavior of this command is the same as :command:`pkg_check_modules`, + except that rather than checking for all the specified modules, it searches + for just the first successful match. + + .. code-block:: cmake + + pkg_search_module( + [REQUIRED] [QUIET] + [NO_CMAKE_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] + [IMPORTED_TARGET [GLOBAL]] + [...]) + + If a module is found, the ``_MODULE_NAME`` variable will contain the + name of the matching module. This variable can be used if you need to run + :command:`pkg_get_variable`. -### + Example: + + .. code-block:: cmake + + pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) +#]========================================] macro(pkg_search_module _prefix _module0) + _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global "${_module0}" ${ARGN}) # check cached value if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) set(_pkg_modules_found 0) - _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN}) - message(STATUS "checking for one of the modules '${_pkg_modules_alt}'") + if (NOT ${_pkg_is_silent}) + message(STATUS "Checking for one of the modules '${_pkg_modules_alt}'") + endif () # iterate through all modules and stop at the first working one. foreach(_pkg_alt ${_pkg_modules_alt}) if(NOT _pkg_modules_found) - _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}") - endif(NOT _pkg_modules_found) + _pkg_check_modules_internal(0 1 ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global} "${_prefix}" "${_pkg_alt}") + endif() if (${_prefix}_FOUND) set(_pkg_modules_found 1) - endif(${_prefix}_FOUND) - endforeach(_pkg_alt) + break() + endif() + endforeach() if (NOT ${_prefix}_FOUND) if(${_pkg_is_required}) message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found") - endif(${_pkg_is_required}) - endif(NOT ${_prefix}_FOUND) + endif() + endif() _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) - endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND) -endmacro(pkg_search_module) + elseif (${_prefix}_FOUND) + _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) + endif() +endmacro() + +#[========================================[.rst: +.. command:: pkg_get_variable + + Retrieves the value of a pkg-config variable ``varName`` and stores it in the + result variable ``resultVar`` in the calling scope. + + .. code-block:: cmake + + pkg_get_variable( ) + + If ``pkg-config`` returns multiple values for the specified variable, + ``resultVar`` will contain a :ref:`;-list `. + + For example: + + .. code-block:: cmake + + pkg_get_variable(GI_GIRDIR gobject-introspection-1.0 girdir) +#]========================================] +function (pkg_get_variable result pkg variable) + _pkg_set_path_internal() + _pkgconfig_invoke("${pkg}" "prefix" "result" "" "--variable=${variable}") + set("${result}" + "${prefix_result}" + PARENT_SCOPE) + _pkg_restore_path_internal() +endfunction () + + +#[========================================[.rst: +Variables Affecting Behavior +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. variable:: PKG_CONFIG_EXECUTABLE + + This can be set to the path of the pkg-config executable. If not provided, + it will be set by the module as a result of calling :command:`find_program` + internally. The ``PKG_CONFIG`` environment variable can be used as a hint. + +.. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH + + Specifies whether :command:`pkg_check_modules` and + :command:`pkg_search_module` should add the paths in the + :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH` and + :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables to the + ``pkg-config`` search path. + + If this variable is not set, this behavior is enabled by default if + :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled + otherwise. +#]========================================] + ### Local Variables: ### mode: cmake diff -Nru weechat-2.6/cmake/FindPython.cmake weechat-2.8/cmake/FindPython.cmake --- weechat-2.6/cmake/FindPython.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindPython.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2009 Julien Louis # # This file is part of WeeChat, the extensible chat client. @@ -31,7 +31,10 @@ include(FindPkgConfig) if(ENABLE_PYTHON2) - pkg_check_modules(PYTHON python2) + pkg_check_modules(PYTHON python2 IMPORTED_TARGET GLOBAL) else() - pkg_check_modules(PYTHON python3) + pkg_check_modules(PYTHON python3-embed IMPORTED_TARGET GLOBAL) + if(NOT PYTHON_FOUND) + pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL) + endif() endif() diff -Nru weechat-2.6/cmake/FindRuby.cmake weechat-2.8/cmake/FindRuby.cmake --- weechat-2.6/cmake/FindRuby.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindRuby.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # @@ -27,13 +27,13 @@ # RUBY_LIB = ruby library (found without pkg-config) if(RUBY_FOUND) - # Already in cache, be silent - set(RUBY_FIND_QUIETLY TRUE) + # Already in cache, be silent + set(RUBY_FIND_QUIETLY TRUE) endif() find_package(PkgConfig) if(PKG_CONFIG_FOUND) - pkg_search_module(RUBY ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8) + pkg_search_module(RUBY ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9) endif() if(RUBY_FOUND) @@ -41,35 +41,35 @@ mark_as_advanced(RUBY_LIB) else() find_program(RUBY_EXECUTABLE - NAMES ruby2.6.0 ruby260 ruby2.6 ruby2.5.0 ruby250 ruby2.5 ruby2.4.0 ruby240 ruby2.4 ruby2.3.0 ruby230 ruby2.3 ruby23 ruby2.2.3 ruby223 ruby2.2.2 ruby222 ruby2.2.1 ruby221 ruby2.2.0 ruby220 ruby2.2 ruby22 ruby2.1.7 ruby217 ruby2.1.6 ruby216 ruby2.1.5 ruby215 ruby2.1.4 ruby214 ruby2.1.3 ruby213 ruby2.1.2 ruby212 ruby2.1.1 ruby211 ruby2.1.0 ruby210 ruby2.1 ruby21 ruby2.0 ruby20 ruby1.9.3 ruby193 ruby1.9.2 ruby192 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby + NAMES ruby2.7.0 ruby270 ruby2.7 ruby2.6.0 ruby260 ruby2.6 ruby2.5.0 ruby250 ruby2.5 ruby2.4.0 ruby240 ruby2.4 ruby2.3.0 ruby230 ruby2.3 ruby23 ruby2.2.3 ruby223 ruby2.2.2 ruby222 ruby2.2.1 ruby221 ruby2.2.0 ruby220 ruby2.2 ruby22 ruby2.1.7 ruby217 ruby2.1.6 ruby216 ruby2.1.5 ruby215 ruby2.1.4 ruby214 ruby2.1.3 ruby213 ruby2.1.2 ruby212 ruby2.1.1 ruby211 ruby2.1.0 ruby210 ruby2.1 ruby21 ruby2.0 ruby20 ruby1.9.3 ruby193 ruby1.9.2 ruby192 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby PATHS /usr/bin /usr/local/bin /usr/pkg/bin - ) + ) if(RUBY_EXECUTABLE) execute_process( COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir'] || RbConfig::CONFIG['archdir']" OUTPUT_VARIABLE RUBY_ARCH_DIR - ) + ) execute_process( COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['arch']" OUTPUT_VARIABLE RUBY_ARCH - ) + ) execute_process( COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['libdir']" OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH - ) + ) execute_process( COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubylibdir']" OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH - ) + ) find_path(RUBY_INCLUDE_DIRS NAMES ruby.h PATHS ${RUBY_ARCH_DIR} - ) + ) set(RUBY_INCLUDE_ARCH "${RUBY_INCLUDE_DIRS}/${RUBY_ARCH}") find_library(RUBY_LIB - NAMES ruby-1.9.3 ruby1.9.3 ruby193 ruby-1.9.2 ruby1.9.2 ruby192 ruby-1.9.1 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby + NAMES ruby-1.9.3 ruby1.9.3 ruby193 ruby-1.9.2 ruby1.9.2 ruby192 ruby-1.9.1 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby PATHS ${RUBY_POSSIBLE_LIB_PATH} ${RUBY_RUBY_LIB_PATH} - ) + ) if(RUBY_LIB AND RUBY_INCLUDE_DIRS) set(RUBY_FOUND TRUE) endif() @@ -78,6 +78,6 @@ RUBY_INCLUDE_DIRS RUBY_LIBRARY_DIRS RUBY_LIB - ) + ) endif() endif() diff -Nru weechat-2.6/cmake/FindTCL.cmake weechat-2.8/cmake/FindTCL.cmake --- weechat-2.6/cmake/FindTCL.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindTCL.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -# -# Copyright (C) 2008 Julien Louis -# Copyright (C) 2008-2019 Sébastien Helleu -# -# This file is part of WeeChat, the extensible chat client. -# -# WeeChat is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# WeeChat is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with WeeChat. If not, see . -# - -# - Find Tcl includes and libraries. -# This module finds if Tcl is installed and determines where the -# include files and libraries are. It also determines what the name of -# the library is. This code sets the following variables: -# TCL_FOUND = Tcl was found -# TK_FOUND = Tk was found -# TCLTK_FOUND = Tcl and Tk were found -# TCL_LIBRARY = path to Tcl library (tcl tcl80) -# TCL_INCLUDE_PATH = path to where tcl.h can be found -# TCL_TCLSH = path to tclsh binary (tcl tcl80) -# TK_LIBRARY = path to Tk library (tk tk80 etc) -# TK_INCLUDE_PATH = path to where tk.h can be found -# TK_WISH = full path to the wish executable -# -# In an effort to remove some clutter and clear up some issues for people -# who are not necessarily Tcl/Tk gurus/developpers, some variables were -# moved or removed. Changes compared to CMake 2.4 are: -# - The stub libraries are now found in FindTclStub.cmake -# => they were only useful for people writing Tcl/Tk extensions. -# - TCL_LIBRARY_DEBUG and TK_LIBRARY_DEBUG were removed. -# => these libs are not packaged by default with Tcl/Tk distributions. -# Even when Tcl/Tk is built from source, several flavors of debug libs -# are created and there is no real reason to pick a single one -# specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx). -# Let's leave that choice to the user by allowing him to assign -# TCL_LIBRARY to any Tcl library, debug or not. -# - TK_INTERNAL_PATH was removed. -# => this ended up being only a Win32 variable, and there is a lot of -# confusion regarding the location of this file in an installed Tcl/Tk -# tree anyway (see 8.5 for example). If you need the internal path at -# this point it is safer you ask directly where the *source* tree is -# and dig from there. - -if(TCL_FOUND) - set(TCL_FIND_QUIETLY TRUE) -endif() - -include(CMakeFindFrameworks) -include(FindTclsh) - -get_filename_component(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) -get_filename_component(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH) -string(REGEX REPLACE - "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}") - -get_filename_component(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH) - -get_filename_component(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) -get_filename_component(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH) -string(REGEX REPLACE - "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_VERSION "${TCL_LIBRARY}") - -set(TCL_POSSIBLE_LIB_PATHS - "${TCL_INCLUDE_PATH_PARENT}/lib" - "${TCL_INCLUDE_PATH_PARENT}/lib64" - "${TCL_LIBRARY_PATH}" - "${TCL_TCLSH_PATH_PARENT}/lib" - "${TCL_TCLSH_PATH_PARENT}/lib64" - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - ) - -if(WIN32) - get_filename_component( - ActiveTcl_CurrentVersion - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl;CurrentVersion]" - NAME) - set(TCLTK_POSSIBLE_LIB_PATHS ${TCLTK_POSSIBLE_LIB_PATHS} - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib" - "$ENV{ProgramFiles}/Tcl/Lib" - "C:/Program Files/Tcl/lib" - "C:/Tcl/lib" - ) -endif() - -find_library(TCL_LIBRARY - NAMES - tcl86 tcl8.6 - tcl85 tcl8.5 - tcl - tcl${TCL_VERSION} tcl${TCL_TCLSH_VERSION} - PATHS ${TCL_POSSIBLE_LIB_PATHS} - ) - -cmake_find_frameworks(Tcl) - -set(TCL_FRAMEWORK_INCLUDES) -if(Tcl_FRAMEWORKS) - if(NOT TCL_INCLUDE_PATH) - foreach(dir ${Tcl_FRAMEWORKS}) - set(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers) - endforeach(dir) - endif() -endif() - -set(TCL_POSSIBLE_INCLUDE_PATHS - "${TCL_LIBRARY_PATH_PARENT}/include" - "${TCL_INCLUDE_PATH}" - ${TCL_FRAMEWORK_INCLUDES} - "${TCL_TCLSH_PATH_PARENT}/include" - /usr/include/tcl8.6 - /usr/include/tcl8.5 - /usr/include - /usr/local/include - /usr/include/tcl${TCL_VERSION} - /usr/local/include/tcl${TCL_VERSION} - /usr/local/include/tcl8.6 - /usr/local/include/tcl8.5 - ) - -if(WIN32) - set(TCLTK_POSSIBLE_INCLUDE_PATHS ${TCLTK_POSSIBLE_INCLUDE_PATHS} - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include" - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include" - "$ENV{ProgramFiles}/Tcl/include" - "C:/Program Files/Tcl/include" - "C:/Tcl/include" - ) -endif() - -find_path(TCL_INCLUDE_PATH - NAMES tcl.h - PATHS ${TCL_POSSIBLE_INCLUDE_PATHS} - ) - -if(TCL_LIBRARY AND TCL_INCLUDE_PATH) - set(TCL_VERSION ${TCL_VERSION}) - set(TCL_LIBARY ${TCL_LIBRARY}) - set(TCL_INCLUDE_PATH ${TCL_INCLUDE_PATH}) - set(TCL_FOUND TRUE) -endif() - -mark_as_advanced( - TCL_INCLUDE_PATH - TCL_LIBRARY - TCL_VERSION - ) diff -Nru weechat-2.6/cmake/FindV8.cmake weechat-2.8/cmake/FindV8.cmake --- weechat-2.6/cmake/FindV8.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindV8.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2015-2019 Sébastien Helleu +# Copyright (C) 2015-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # diff -Nru weechat-2.6/cmake/FindZLIB.cmake weechat-2.8/cmake/FindZLIB.cmake --- weechat-2.6/cmake/FindZLIB.cmake 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/cmake/FindZLIB.cmake 2020-03-29 07:39:36.000000000 +0000 @@ -41,7 +41,7 @@ ${ZLIB_NAMES} PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib" - ) +) mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR) if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") diff -Nru weechat-2.6/CMakeLists.txt weechat-2.8/CMakeLists.txt --- weechat-2.6/CMakeLists.txt 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/CMakeLists.txt 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2007-2008 Julien Louis # Copyright (C) 2008-2009 Emmanuel Bouthenot # @@ -180,6 +180,12 @@ find_package(Gettext) if(GETTEXT_FOUND) add_definitions(-DENABLE_NLS) + find_package(Intl) + if(Intl_FOUND) + list(APPEND EXTRA_LIBS "${Intl_LIBRARIES}") + endif() + else() + message(SEND_ERROR "Gettext not found") endif() endif() @@ -197,6 +203,8 @@ include_directories(${GNUTLS_INCLUDE_PATH}) set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${GNUTLS_LIBRARY_PATH}") list(APPEND EXTRA_LIBS gnutls) + else() + message(SEND_ERROR "GnuTLS not found") endif() endif() @@ -227,6 +235,8 @@ list(APPEND EXTRA_LIBS dl) endif() +add_subdirectory(icons) + if(ENABLE_NLS) add_subdirectory(po) endif() @@ -234,10 +244,14 @@ add_subdirectory(src) add_subdirectory(doc) -find_package(CppUTest) -if(ENABLE_TESTS AND CPPUTEST_FOUND) - enable_testing() - add_subdirectory(tests) +if(ENABLE_TESTS) + find_package(CppUTest) + if(CPPUTEST_FOUND) + enable_testing() + add_subdirectory(tests) + else() + message(SEND_ERROR "CppUTest not found") + endif() endif() configure_file(config.h.cmake config.h @ONLY) @@ -245,19 +259,23 @@ # set the git version in "config-git.h" add_custom_target(version_git ALL COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/git-version.sh" "${CMAKE_CURRENT_SOURCE_DIR}" "${VERSION}" "config-git.h" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - IMMEDIATE @ONLY) + IMMEDIATE @ONLY +) add_custom_target(uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" +) add_custom_target(dist "${CMAKE_CURRENT_SOURCE_DIR}/tools/makedist.sh" "${VERSION}" "HEAD" "${CMAKE_CURRENT_BINARY_DIR}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) # pkgconfig file set(PACKAGE "${PROJECT_NAME}") @@ -279,11 +297,12 @@ ${CMAKE_CURRENT_SOURCE_DIR}/Contributing.adoc ${CMAKE_CURRENT_SOURCE_DIR}/README.adoc ${CMAKE_CURRENT_SOURCE_DIR}/ReleaseNotes.adoc - DESTINATION ${SHAREDIR}/doc/${PROJECT_NAME}) + DESTINATION ${SHAREDIR}/doc/${PROJECT_NAME} + ) endif() -# icon -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/weechat.png DESTINATION ${SHAREDIR}/icons/hicolor/32x32/apps) +# desktop file +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/weechat.desktop DESTINATION ${SHAREDIR}/applications) # packages set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast, light and extensible chat client") @@ -301,7 +320,8 @@ # source package set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2") set(CPACK_SOURCE_PACKAGE_FILE_NAME weechat-${VERSION}) -set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git" "/build/" "/m4/" +set(CPACK_SOURCE_IGNORE_FILES + "/\\\\.git" "/build/" "/m4/" "/autom4te\\\\.cache/" "/ABOUT-NLS$" "/config\\\\.guess$" "/config\\\\.h$" "/config\\\\.h.in$" "/config\\\\.log$" "/config\\\\.rpath$" "/config\\\\.status$" "/config\\\\.sub$" "/configure$" "/depcomp$" diff -Nru weechat-2.6/configure.ac weechat-2.8/configure.ac --- weechat-2.6/configure.ac 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/configure.ac 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2005 Benoit Papillault # Copyright (C) 2005-2006 Julien Louis # Copyright (C) 2005-2009 Emmanuel Bouthenot @@ -47,10 +47,12 @@ case "$host_os" in freebsd* | openbsd*) CFLAGS="$CFLAGS -I/usr/local/include" + CXXFLAGS="$CXXFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" ;; netbsd*) CFLAGS="$CFLAGS -I/usr/pkg/include" + CXXFLAGS="$CXXFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -L/usr/pkg/lib" ;; solaris*) @@ -477,7 +479,10 @@ if test "x$enable_python2" = "xyes" ; then PKG_CHECK_MODULES(PYTHON, [python2], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python2`], [PYTHON_FOUND=no]) else - PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no]) + PKG_CHECK_MODULES(PYTHON, [python3-embed], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3-embed`], [PYTHON_FOUND=no]) + if test "x$PYTHON_FOUND" != "xyes"; then + PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no]) + fi fi if test "x$PYTHON_FOUND" != "xyes" ; then AC_MSG_WARN([ @@ -505,7 +510,7 @@ if test "x$enable_ruby" = "xyes" ; then RUBY_CFLAGS="" RUBY_LFLAGS="" - for v in "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.9" "1.8" ; do + for v in "2.7" "2.6" "2.5" "2.4" "2.3" "2.2" "2.1" "2.0" "1.9" "1.8" ; do pkgconfig_ruby_found=`$PKGCONFIG --exists ruby-$v 2>/dev/null` if test "x$?" = "x0" ; then RUBY_VERSION=`$PKGCONFIG --modversion ruby-$v` @@ -517,7 +522,7 @@ # detect old Ruby versions if test "x$RUBY_CFLAGS" = "x" -o "x$RUBY_LFLAGS" = "x" ; then - AC_PATH_PROGS(RUBY, ruby1.9.3 ruby1.9.2 ruby1.9.1 ruby1.9 ruby1.8 ruby) + AC_PATH_PROGS(RUBY, ruby1.9.3 ruby1.9.2 ruby1.9.1 ruby1.9 ruby) if test -z $RUBY ; then AC_MSG_WARN([ *** Ruby must be installed on your system but ruby interpreter couldn't be found in path. @@ -559,7 +564,7 @@ LUA_VERSION= if test "x$enable_lua" = "xyes" ; then - ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -568,7 +573,7 @@ if test -n "$lua_inc"; then CFLAGS="$CFLAGS -I$lua_inc" - CPPFLAGS="$CPPFLAGS -I$lua_inc" + CXXFLAGS="$CXXFLAGS -I$lua_inc" fi if test -n "$lua_lib"; then LDFLAGS="$LDFLAGS -L$lua_lib" @@ -665,7 +670,7 @@ fi CFLAGS="$ac_save_CFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" LDFLAGS="$ac_save_LDFLAGS" else not_asked="$not_asked lua" @@ -727,7 +732,7 @@ guile_found="no" AC_MSG_CHECKING(for Guile headers and libraries) echo - for v in "2.0" ; do + for v in "3.0" "2.2" "2.0" ; do pkgconfig_guile_found=`$PKGCONFIG --exists guile-$v 2>/dev/null` if test "x$?" = "x0" ; then GUILE_VERSION=`$PKGCONFIG --modversion guile-$v` @@ -831,7 +836,7 @@ PHP_VERSION= if test "x$enable_php" = "xyes" ; then - ac_save_CPPFLAGS="$CPPFLAGS" + ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CFLAGS="$CFLAGS" ac_save_LDFLAGS="$LDFLAGS" @@ -840,7 +845,7 @@ if test -n "$php_inc"; then CFLAGS="$CFLAGS -I$php_inc" - CPPFLAGS="$CPPFLAGS -I$php_inc" + CXXFLAGS="$CXXFLAGS -I$php_inc" fi if test -n "$php_lib"; then LDFLAGS="$LDFLAGS -L$php_lib" @@ -849,7 +854,7 @@ if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then AC_MSG_CHECKING(for PHP headers and libraries with pkg-config) echo - for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do + for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do pkgconfig_php_found=`$PKGCONFIG --exists php$l 2>/dev/null` if test "x$?" = "x0" ; then pkgconfig_php_found=`$PKGCONFIG --atleast-version=7 php$l 2>/dev/null` @@ -866,7 +871,7 @@ if test "x$PHP_CFLAGS" = "x" -o "x$PHP_LFLAGS" = "x" ; then PHPCONFIG="" AC_MSG_CHECKING(for PHP headers and libraries with php-config) - for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do + for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do AC_CHECK_PROG(PHPCONFIG, "php-config$l", "php-config$l") if test "x$PHPCONFIG" != "x" ; then php_config_version=`$PHPCONFIG --version` @@ -887,7 +892,7 @@ if test "x$ac_found_php_header" = "xyes" ; then PHP_CFLAGS="$CFLAGS" fi - for l in "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do + for l in "7.4" "74" "7.3" "73" "7.2" "72" "7.1" "71" "7.0" "70" "7" "$php_suffix" "" ; do AC_CHECK_LIB(php$l,php_execute_script,ac_found_php_lib="yes",ac_found_php_lib="no") if test "x$ac_found_php_lib" = "xyes" ; then PHP_VERSION=">=7.0.0" @@ -922,7 +927,7 @@ fi CFLAGS="$ac_save_CFLAGS" - CPPFLAGS="$ac_save_CPPFLAGS" + CXXFLAGS="$ac_save_CXXFLAGS" LDFLAGS="$ac_save_LDFLAGS" else not_asked="$not_asked php" @@ -1106,6 +1111,7 @@ if test "x$enable_largefile" = "xyes" ; then CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES" + CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES" else not_asked="$not_asked largefile" fi @@ -1285,10 +1291,13 @@ AC_SUBST(weechat_libdir) COMMON_CFLAGS="-fsigned-char -Wall -Wextra -Werror-implicit-function-declaration" +COMMON_CXXFLAGS="-fsigned-char -Wall -Wextra" + AC_MSG_CHECKING([whether we have GNU assembler]) GAS=`as --version < /dev/null 2>/dev/null | grep GNU` if test "$GAS"; then COMMON_CFLAGS="${COMMON_CFLAGS} -pipe" + COMMON_CXXFLAGS="${COMMON_CXXFLAGS} -pipe" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) @@ -1298,10 +1307,18 @@ CFLAGS=`echo $CFLAGS | sed 's/^-g //g'` CFLAGS=`echo $CFLAGS | sed 's/ -g$//g'` CFLAGS=`echo $CFLAGS | sed 's/^-g$//g'` + +CXXFLAGS=`echo $CXXFLAGS | sed 's/ -g / /g'` +CXXFLAGS=`echo $CXXFLAGS | sed 's/^-g //g'` +CXXFLAGS=`echo $CXXFLAGS | sed 's/ -g$//g'` +CXXFLAGS=`echo $CXXFLAGS | sed 's/^-g$//g'` + if test "x$debug" = "x0" ; then CFLAGS="$COMMON_CFLAGS $CFLAGS" + CXXFLAGS="$COMMON_CXXFLAGS $CXXFLAGS" else CFLAGS="$COMMON_CFLAGS $CFLAGS -g -O0" + CXXFLAGS="$COMMON_CXXFLAGS $CXXFLAGS -g -O0" fi LIBS="$LIBS $INTLLIBS" @@ -1311,7 +1328,7 @@ if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then CFLAGS="$CFLAGS -pthread" fi - CFLAGS="$CFLAGS $CPPFLAGS" + CFLAGS="$CFLAGS $CXXFLAGS" ;; openbsd*) if test "x$enable_python" = "xyes" ; then @@ -1322,17 +1339,20 @@ if test "x$enable_perl" = "xyes" -o "x$enable_python" = "xyes" ; then CFLAGS="$CFLAGS -pthread" fi - CFLAGS="$CFLAGS $CPPFLAGS" + CFLAGS="$CFLAGS $CXXFLAGS" ;; gnu*) LDFLAGS="$LDFLAGS -lpthread" ;; +haiku*) + LDFLAGS="$LDFLAGS -lnetwork" + ;; *) ;; esac CFLAGS="$CFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\"" -CPPFLAGS="$CPPFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\"" +CXXFLAGS="$CXXFLAGS -DWEECHAT_VERSION=\\\"$VERSION\\\" -DWEECHAT_LICENSE=\\\"$LICENSE\\\"" # ------------------------------------------------------------------------------ # output Makefiles @@ -1369,6 +1389,7 @@ AM_CONDITIONAL(DOC, test "$enable_doc" = "yes") AC_OUTPUT([Makefile + icons/Makefile doc/Makefile doc/en/Makefile doc/fr/Makefile diff -Nru weechat-2.6/debian/changelog weechat-2.8/debian/changelog --- weechat-2.6/debian/changelog 2020-04-13 09:21:33.000000000 +0000 +++ weechat-2.8/debian/changelog 2020-04-04 09:01:45.000000000 +0000 @@ -1,39 +1,28 @@ -weechat (2.6-2ubuntu2) focal; urgency=medium +weechat (2.8-1) unstable; urgency=medium - * Correctly find and link against libpython3.8 (LP: #1866065) - * CVE-2020-8955 fix crashes when receiving malformed messages - (LP: #1872425) + * New upstream release + - Fix FTBFS with ruby 2.7 (Closes: #954701, #954789) + - Remove patch to fix compilation error while testing iconv support + - Remove patch to fix a crash when loading script with PHP 7.4 + + -- Emmanuel Bouthenot Sat, 04 Apr 2020 09:01:45 +0000 + +weechat (2.7.1-1) unstable; urgency=medium + + * New upstream release + - fix CVE-2020-8955: possible remote DOS via malformed IRC messages + (Closes: #951289) + - rebuilt against python 3.8 (Closes: #953620) + * Remove Guile 2.2 support patch (merged upstream) + * Add a patch to fix compilation error while testing iconv support + * Add a patch to fix a crash when loading script with PHP 7.4 + * Bump Standards-Version to 4.5.0 + * Replace gem2deb build dependency by ruby-dev to facilitate + transitions to new versions of ruby (Closes: #951713) + * Set Rules-Requires-Root to no + * Switch debhelper compatibility to 12 - -- Tj Mon, 13 Apr 2020 10:21:33 +0100 - -weechat (2.6-2ubuntu1) focal; urgency=medium - - * Add ruby2.7 support (LP: #1865873) - + Add patch to allow cmake to search for ruby2.7 - - -- Lucas Kanashiro Tue, 03 Mar 2020 09:39:30 -0300 - -weechat (2.6-2build3) focal; urgency=medium - - [ Rafael David Tinoco ] - * Sponsoring ruby2.7 transitions - - [ Lucas Kanashiro ] - * No-change rebuild for ruby2.7 - - -- Rafael David Tinoco Mon, 02 Mar 2020 16:35:24 +0000 - -weechat (2.6-2build2) focal; urgency=medium - - * No-change rebuild to build with python3.8. - - -- Matthias Klose Sat, 25 Jan 2020 04:41:22 +0000 - -weechat (2.6-2build1) focal; urgency=medium - - * No-change rebuild for the perl update. - - -- Matthias Klose Fri, 18 Oct 2019 19:38:36 +0000 + -- Emmanuel Bouthenot Mon, 09 Mar 2020 14:59:31 +0000 weechat (2.6-2) unstable; urgency=medium diff -Nru weechat-2.6/debian/compat weechat-2.8/debian/compat --- weechat-2.6/debian/compat 2019-03-04 10:28:58.000000000 +0000 +++ weechat-2.8/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -12 diff -Nru weechat-2.6/debian/control weechat-2.8/debian/control --- weechat-2.6/debian/control 2020-03-03 12:39:30.000000000 +0000 +++ weechat-2.8/debian/control 2020-03-10 10:57:02.000000000 +0000 @@ -1,15 +1,15 @@ Source: weechat Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Emmanuel Bouthenot +Maintainer: Emmanuel Bouthenot Build-Depends: asciidoctor (>= 1.5.4), ruby-pygments.rb, debhelper (>= 12), + debhelper-compat (= 12), cmake, pkg-config, libncursesw5-dev, - gem2deb, + ruby-dev, libperl-dev, python3-dev, libaspell-dev, @@ -22,7 +22,8 @@ libgcrypt20-dev, libgnutls28-dev, zlib1g-dev -Standards-Version: 4.4.0 +Rules-Requires-Root: no +Standards-Version: 4.5.0 Homepage: https://weechat.org/ Vcs-Git: https://salsa.debian.org/kolter/weechat.git Vcs-Browser: https://salsa.debian.org/kolter/weechat diff -Nru weechat-2.6/debian/patches/01_fix_asciidoctor_options.patch weechat-2.8/debian/patches/01_fix_asciidoctor_options.patch --- weechat-2.6/debian/patches/01_fix_asciidoctor_options.patch 2019-03-04 10:28:58.000000000 +0000 +++ weechat-2.8/debian/patches/01_fix_asciidoctor_options.patch 2020-03-09 15:06:24.000000000 +0000 @@ -6,12 +6,12 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt -@@ -24,7 +24,7 @@ - +@@ -21,7 +21,7 @@ + if(ENABLE_MAN OR ENABLE_DOC) + find_package(Asciidoctor) if(ASCIIDOCTOR_FOUND) - - set(ASCIIDOCTOR_ARGS -a experimental -a icons=font -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=prettify) + set(ASCIIDOCTOR_ARGS -a experimental -a reproducible -a webfonts! -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=pygments) - add_subdirectory(cs) add_subdirectory(de) + add_subdirectory(en) diff -Nru weechat-2.6/debian/patches/guile_2.2-support.patch weechat-2.8/debian/patches/guile_2.2-support.patch --- weechat-2.6/debian/patches/guile_2.2-support.patch 2019-10-11 15:07:22.000000000 +0000 +++ weechat-2.8/debian/patches/guile_2.2-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,198 +0,0 @@ -Description: Add support for Guile 2.2 -Author: -Origin: upstream, https://github.com/weechat/weechat/issues/1098 -Bug: https://github.com/weechat/weechat/issues/1098 -Bug-Debian: https://bugs.debian.org/885235 -Forwarded: not-needed -Last-Update: 2019-10-11 ---- -This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/cmake/FindGuile.cmake -+++ b/cmake/FindGuile.cmake -@@ -33,7 +33,7 @@ - - find_package(PkgConfig) - if(PKG_CONFIG_FOUND) -- pkg_search_module(GUILE guile-2.0) -+ pkg_search_module(GUILE guile-2.2 guile-2.0) - if(GUILE_FOUND) - # check if variable "scm_install_gmp_memory_functions" exists - set(CMAKE_REQUIRED_INCLUDES ${GUILE_INCLUDE_DIRS}) ---- a/configure.ac -+++ b/configure.ac -@@ -727,7 +727,7 @@ - guile_found="no" - AC_MSG_CHECKING(for Guile headers and libraries) - echo -- for v in "2.0" ; do -+ for v in "2.2" "2.0" ; do - pkgconfig_guile_found=`$PKGCONFIG --exists guile-$v 2>/dev/null` - if test "x$?" = "x0" ; then - GUILE_VERSION=`$PKGCONFIG --modversion guile-$v` ---- a/src/plugins/guile/weechat-guile-api.c -+++ b/src/plugins/guile/weechat-guile-api.c -@@ -4874,10 +4874,17 @@ - void - weechat_guile_api_module_init (void *data) - { -- scm_t_bits port_type; -+#if SCM_MAJOR_VERSION >= 3 || (SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION >= 2) -+ /* Guile >= 2.2 */ -+ scm_t_port_type *port_type; - -- /* make C compiler happy */ -- (void) data; -+ port_type = scm_make_port_type ("weechat_stdout", -+ &weechat_guile_port_fill_input, -+ &weechat_guile_port_write); -+ guile_port = scm_c_make_port (port_type, 0, 0); -+#else -+ /* Guile < 2.2 */ -+ scm_t_bits port_type; - - port_type = scm_make_port_type ("weechat_stdout", - &weechat_guile_port_fill_input, -@@ -4886,6 +4893,10 @@ - SCM_SET_CELL_TYPE (guile_port, port_type | SCM_OPN | SCM_WRTNG); - scm_set_current_output_port (guile_port); - scm_set_current_error_port (guile_port); -+#endif -+ -+ /* make C compiler happy */ -+ (void) data; - - /* interface functions */ - API_DEF_FUNC(register, 7); ---- a/src/plugins/guile/weechat-guile.c -+++ b/src/plugins/guile/weechat-guile.c -@@ -914,9 +914,24 @@ - else - break; - } -+ /* -+ * FIXME: this does not yet work with Guile >= 2.2, so the eval -+ * feature is temporarily disabled, waiting for a fix -+ */ -+ /* - if (!weechat_guile_eval (buffer, send_to_buffer_as_input, - exec_commands, ptr_code)) - WEECHAT_COMMAND_ERROR; -+ */ -+ /* TODO: fix /guile eval */ -+ (void) buffer; -+ (void) ptr_code; -+ (void) send_to_buffer_as_input; -+ (void) exec_commands; -+ weechat_printf (NULL, -+ _("%sCommand \"/%s eval\" is not yet implemented"), -+ weechat_prefix ("error"), -+ weechat_guile_plugin->name); - } - else - WEECHAT_COMMAND_ERROR; -@@ -1127,6 +1142,21 @@ - * Fills input. - */ - -+#if SCM_MAJOR_VERSION >= 3 || (SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION >= 2) -+/* Guile >= 2.2 */ -+size_t -+weechat_guile_port_fill_input (SCM port, SCM dst, size_t start, size_t count) -+{ -+ /* make C compiler happy */ -+ (void) port; -+ (void) dst; -+ (void) start; -+ (void) count; -+ -+ return ' '; -+} -+#else -+/* Guile < 2.2 */ - int - weechat_guile_port_fill_input (SCM port) - { -@@ -1135,11 +1165,47 @@ - - return ' '; - } -+#endif - - /* - * Write. - */ - -+#if SCM_MAJOR_VERSION >= 3 || (SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION >= 2) -+/* Guile >= 2.2 */ -+size_t -+weechat_guile_port_write (SCM port, SCM src, size_t start, size_t count) -+{ -+ char *data2, *ptr_data, *ptr_newline; -+ const char *data; -+ -+ /* make C compiler happy */ -+ (void) port; -+ -+ data = scm_to_locale_string (src); -+ -+ data2 = malloc (count + 1); -+ if (!data2) -+ return 0; -+ -+ memcpy (data2, data + start, count); -+ data2[count] = '\0'; -+ -+ ptr_data = data2; -+ while ((ptr_newline = strchr (ptr_data, '\n')) != NULL) -+ { -+ ptr_newline[0] = '\0'; -+ weechat_string_dyn_concat (guile_buffer_output, ptr_data); -+ weechat_guile_output_flush (); -+ ptr_newline[0] = '\n'; -+ ptr_data = ++ptr_newline; -+ } -+ weechat_string_dyn_concat (guile_buffer_output, ptr_data); -+ -+ return count; -+} -+#else -+/* Guile < 2.2 */ - void - weechat_guile_port_write (SCM port, const void *data, size_t size) - { -@@ -1166,6 +1232,7 @@ - } - weechat_string_dyn_concat (guile_buffer_output, ptr_data); - } -+#endif - - /* - * Initializes guile plugin. ---- a/src/plugins/guile/weechat-guile.h -+++ b/src/plugins/guile/weechat-guile.h -@@ -20,6 +20,8 @@ - #ifndef WEECHAT_PLUGIN_GUILE_H - #define WEECHAT_PLUGIN_GUILE_H - -+#include -+ - #define weechat_plugin weechat_guile_plugin - #define GUILE_PLUGIN_NAME "guile" - -@@ -45,7 +47,16 @@ - extern void *weechat_guile_exec (struct t_plugin_script *script, - int ret_type, const char *function, - char *format, void **argv); -+#if SCM_MAJOR_VERSION >= 3 || (SCM_MAJOR_VERSION == 2 && SCM_MINOR_VERSION >= 2) -+/* Guile >= 2.2 */ -+extern size_t weechat_guile_port_fill_input (SCM port, SCM dst, -+ size_t start, size_t count); -+extern size_t weechat_guile_port_write (SCM port, SCM src, -+ size_t start, size_t count); -+#else -+/* Guile < 2.2 */ - extern int weechat_guile_port_fill_input (SCM port); - extern void weechat_guile_port_write (SCM port, const void *data, size_t size); -+#endif - - #endif /* WEECHAT_PLUGIN_GUILE_H */ diff -Nru weechat-2.6/debian/patches/lp1866065-python3-linking.patch weechat-2.8/debian/patches/lp1866065-python3-linking.patch --- weechat-2.6/debian/patches/lp1866065-python3-linking.patch 2020-04-13 09:21:33.000000000 +0000 +++ weechat-2.8/debian/patches/lp1866065-python3-linking.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -commit 3da688a8f8ba75a9f3cb411011e24398d65497ad -Author: Tj -Date: Mon Apr 13 09:09:33 2020 +0100 - - python: find and correctly link against libpython3.8 - -diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake -index 2e71e4c57..4fa6d24e7 100644 ---- a/cmake/FindPython.cmake -+++ b/cmake/FindPython.cmake -@@ -33,5 +33,8 @@ include(FindPkgConfig) - if(ENABLE_PYTHON2) - pkg_check_modules(PYTHON python2) - else() -- pkg_check_modules(PYTHON python3) -+ pkg_check_modules(PYTHON python3-embed) -+ if(NOT PYTHON_FOUND) -+ pkg_check_modules(PYTHON python3) -+ endif() - endif() -diff --git a/configure.ac b/configure.ac -index ea014a988..e026789c3 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -477,7 +477,10 @@ if test "x$enable_python" = "xyes" ; then - if test "x$enable_python2" = "xyes" ; then - PKG_CHECK_MODULES(PYTHON, [python2], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python2`], [PYTHON_FOUND=no]) - else -- PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no]) -+ PKG_CHECK_MODULES(PYTHON, [python3-embed], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3-embed`], [PYTHON_FOUND=no]) -+ if test "x$PYTHON_FOUND" != "xyes"; then -+ PKG_CHECK_MODULES(PYTHON, [python3], [PYTHON_FOUND=yes; PYTHON_VERSION=`$PKGCONFIG --modversion python3`], [PYTHON_FOUND=no]) -+ fi - fi - if test "x$PYTHON_FOUND" != "xyes" ; then - AC_MSG_WARN([ diff -Nru weechat-2.6/debian/patches/lp1872425-CVEs-from-2.7.1.patch weechat-2.8/debian/patches/lp1872425-CVEs-from-2.7.1.patch --- weechat-2.6/debian/patches/lp1872425-CVEs-from-2.7.1.patch 2020-04-13 09:21:33.000000000 +0000 +++ weechat-2.8/debian/patches/lp1872425-CVEs-from-2.7.1.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -diff --git a/src/plugins/irc/irc-mode.c b/src/plugins/irc/irc-mode.c -index d6c749168..55e0b612a 100644 ---- a/src/plugins/irc/irc-mode.c -+++ b/src/plugins/irc/irc-mode.c -@@ -224,17 +224,20 @@ irc_mode_channel_update (struct t_irc_server *server, - current_arg++; - if (pos[0] == chanmode) - { -- chanmode_found = 1; -- if (set_flag == '+') -+ if (!chanmode_found) - { -- str_mode[0] = pos[0]; -- str_mode[1] = '\0'; -- strcat (new_modes, str_mode); -- if (argument) -+ chanmode_found = 1; -+ if (set_flag == '+') - { -- if (new_args[0]) -- strcat (new_args, " "); -- strcat (new_args, argument); -+ str_mode[0] = pos[0]; -+ str_mode[1] = '\0'; -+ strcat (new_modes, str_mode); -+ if (argument) -+ { -+ if (new_args[0]) -+ strcat (new_args, " "); -+ strcat (new_args, argument); -+ } - } - } - } -diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c -index 57bb1d601..765a39e59 100644 ---- a/src/plugins/irc/irc-nick.c -+++ b/src/plugins/irc/irc-nick.c -@@ -643,6 +643,53 @@ irc_nick_set_mode (struct t_irc_server *server, struct t_irc_channel *channel, - } - } - -+/* -+ * Reallocates the "prefixes" string in all nicks of all channels on the server -+ * (after 005 has been received). -+ */ -+ -+void -+irc_nick_realloc_prefixes (struct t_irc_server *server, -+ int old_length, int new_length) -+{ -+ struct t_irc_channel *ptr_channel; -+ struct t_irc_nick *ptr_nick; -+ char *new_prefixes; -+ -+ for (ptr_channel = server->channels; ptr_channel; -+ ptr_channel = ptr_channel->next_channel) -+ { -+ for (ptr_nick = ptr_channel->nicks; ptr_nick; -+ ptr_nick = ptr_nick->next_nick) -+ { -+ if (ptr_nick->prefixes) -+ { -+ new_prefixes = realloc (ptr_nick->prefixes, new_length + 1); -+ if (new_prefixes) -+ { -+ ptr_nick->prefixes = new_prefixes; -+ if (new_length > old_length) -+ { -+ memset (ptr_nick->prefixes + old_length, -+ ' ', -+ new_length - old_length); -+ } -+ ptr_nick->prefixes[new_length] = '\0'; -+ } -+ } -+ else -+ { -+ ptr_nick->prefixes = malloc (new_length + 1); -+ if (ptr_nick->prefixes) -+ { -+ memset (ptr_nick->prefixes, ' ', new_length); -+ ptr_nick->prefixes[new_length] = '\0'; -+ } -+ } -+ } -+ } -+} -+ - /* - * Removes a nick from a channel. - */ -diff --git a/src/plugins/irc/irc-nick.h b/src/plugins/irc/irc-nick.h -index 52316891d..1d5b2914d 100644 ---- a/src/plugins/irc/irc-nick.h -+++ b/src/plugins/irc/irc-nick.h -@@ -74,6 +74,8 @@ extern void irc_nick_change (struct t_irc_server *server, - extern void irc_nick_set_mode (struct t_irc_server *server, - struct t_irc_channel *channel, - struct t_irc_nick *nick, int set, char mode); -+extern void irc_nick_realloc_prefixes (struct t_irc_server *server, -+ int old_length, int new_length); - extern void irc_nick_free (struct t_irc_server *server, - struct t_irc_channel *channel, - struct t_irc_nick *nick); -diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c -index 9b483930d..c2beef541 100644 ---- a/src/plugins/irc/irc-protocol.c -+++ b/src/plugins/irc/irc-protocol.c -@@ -4681,7 +4681,7 @@ IRC_PROTOCOL_CALLBACK(352) - - if (argc > 8) - { -- arg_start = (strcmp (argv[8], "*") == 0) ? 9 : 8; -+ arg_start = ((argc > 9) && (strcmp (argv[8], "*") == 0)) ? 9 : 8; - if (argv[arg_start][0] == ':') - { - pos_attr = NULL; -diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c -index 1b3737b99..6e4a597df 100644 ---- a/src/plugins/irc/irc-server.c -+++ b/src/plugins/irc/irc-server.c -@@ -986,11 +986,15 @@ irc_server_set_prefix_modes_chars (struct t_irc_server *server, - const char *prefix) - { - char *pos; -- int i, length_modes, length_chars; -+ int i, old_length_chars, length_modes, length_chars; - - if (!server || !prefix) - return; - -+ old_length_chars = (server->prefix_chars) ? -+ strlen (server->prefix_chars) : -+ strlen (irc_server_prefix_chars_default); -+ - /* free previous values */ - if (server->prefix_modes) - { -@@ -1030,6 +1034,13 @@ irc_server_set_prefix_modes_chars (struct t_irc_server *server, - } - } - } -+ -+ length_chars = (server->prefix_chars) ? -+ strlen (server->prefix_chars) : -+ strlen (irc_server_prefix_chars_default); -+ -+ if (length_chars != old_length_chars) -+ irc_nick_realloc_prefixes (server, old_length_chars, length_chars); - } - - /* diff -Nru weechat-2.6/debian/patches/ruby27-support.patch weechat-2.8/debian/patches/ruby27-support.patch --- weechat-2.6/debian/patches/ruby27-support.patch 2020-03-03 12:39:30.000000000 +0000 +++ weechat-2.8/debian/patches/ruby27-support.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Description: Add detection for Ruby 2.7 -Author: Lucas Kanashiro -Forwarded: https://github.com/weechat/weechat/pull/1455 -Last-Updated: 2020-03-03 - ---- a/cmake/FindRuby.cmake -+++ b/cmake/FindRuby.cmake -@@ -33,7 +33,7 @@ - - find_package(PkgConfig) - if(PKG_CONFIG_FOUND) -- pkg_search_module(RUBY ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8) -+ pkg_search_module(RUBY ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby-1.8) - endif() - - if(RUBY_FOUND) -@@ -41,7 +41,7 @@ - mark_as_advanced(RUBY_LIB) - else() - find_program(RUBY_EXECUTABLE -- NAMES ruby2.6.0 ruby260 ruby2.6 ruby2.5.0 ruby250 ruby2.5 ruby2.4.0 ruby240 ruby2.4 ruby2.3.0 ruby230 ruby2.3 ruby23 ruby2.2.3 ruby223 ruby2.2.2 ruby222 ruby2.2.1 ruby221 ruby2.2.0 ruby220 ruby2.2 ruby22 ruby2.1.7 ruby217 ruby2.1.6 ruby216 ruby2.1.5 ruby215 ruby2.1.4 ruby214 ruby2.1.3 ruby213 ruby2.1.2 ruby212 ruby2.1.1 ruby211 ruby2.1.0 ruby210 ruby2.1 ruby21 ruby2.0 ruby20 ruby1.9.3 ruby193 ruby1.9.2 ruby192 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby -+ NAMES ruby2.7.0 ruby270 ruby2.7 ruby2.6.0 ruby260 ruby2.6 ruby2.5.0 ruby250 ruby2.5 ruby2.4.0 ruby240 ruby2.4 ruby2.3.0 ruby230 ruby2.3 ruby23 ruby2.2.3 ruby223 ruby2.2.2 ruby222 ruby2.2.1 ruby221 ruby2.2.0 ruby220 ruby2.2 ruby22 ruby2.1.7 ruby217 ruby2.1.6 ruby216 ruby2.1.5 ruby215 ruby2.1.4 ruby214 ruby2.1.3 ruby213 ruby2.1.2 ruby212 ruby2.1.1 ruby211 ruby2.1.0 ruby210 ruby2.1 ruby21 ruby2.0 ruby20 ruby1.9.3 ruby193 ruby1.9.2 ruby192 ruby1.9.1 ruby191 ruby1.9 ruby19 ruby1.8 ruby18 ruby - PATHS /usr/bin /usr/local/bin /usr/pkg/bin - ) - if(RUBY_EXECUTABLE) diff -Nru weechat-2.6/debian/patches/series weechat-2.8/debian/patches/series --- weechat-2.6/debian/patches/series 2020-04-13 09:21:33.000000000 +0000 +++ weechat-2.8/debian/patches/series 2020-04-04 09:01:45.000000000 +0000 @@ -1,5 +1 @@ 01_fix_asciidoctor_options.patch -guile_2.2-support.patch -ruby27-support.patch -lp1866065-python3-linking.patch -lp1872425-CVEs-from-2.7.1.patch diff -Nru weechat-2.6/debian/rules weechat-2.8/debian/rules --- weechat-2.6/debian/rules 2019-03-04 10:28:58.000000000 +0000 +++ weechat-2.8/debian/rules 2020-03-09 16:20:53.000000000 +0000 @@ -10,6 +10,7 @@ cmake .. \ -DCMAKE_INSTALL_PREFIX:FILEPATH=/usr \ -DLIBDIR=/usr/lib/${DEB_HOST_MULTIARCH} \ + -DENABLE_JAVASCRIPT:BOOL=OFF \ -DENABLE_DOC:BOOL=ON \ -DENABLE_MAN:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ diff -Nru weechat-2.6/debian/source/include-binaries weechat-2.8/debian/source/include-binaries --- weechat-2.6/debian/source/include-binaries 2019-03-04 10:28:58.000000000 +0000 +++ weechat-2.8/debian/source/include-binaries 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/upstream-signing-key.pgp diff -Nru weechat-2.6/doc/CMakeLists.txt weechat-2.8/doc/CMakeLists.txt --- weechat-2.6/doc/CMakeLists.txt 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/doc/CMakeLists.txt 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # Copyright (C) 2009 Emmanuel Bouthenot # # This file is part of WeeChat, the extensible chat client. @@ -19,13 +19,9 @@ # if(ENABLE_MAN OR ENABLE_DOC) - find_package(Asciidoctor) - if(ASCIIDOCTOR_FOUND) - set(ASCIIDOCTOR_ARGS -a experimental -a icons=font -a revnumber="${VERSION}" -a sectanchors -a source-highlighter=prettify) - add_subdirectory(cs) add_subdirectory(de) add_subdirectory(en) @@ -35,7 +31,7 @@ add_subdirectory(ja) add_subdirectory(pl) add_subdirectory(ru) - + else() + message(SEND_ERROR "Asciidoctor not found") endif() - endif() diff -Nru weechat-2.6/doc/cs/CMakeLists.txt weechat-2.8/doc/cs/CMakeLists.txt --- weechat-2.6/doc/cs/CMakeLists.txt 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/doc/cs/CMakeLists.txt 2020-03-29 07:39:36.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (C) 2003-2019 Sébastien Helleu +# Copyright (C) 2003-2020 Sébastien Helleu # # This file is part of WeeChat, the extensible chat client. # diff -Nru weechat-2.6/doc/cs/docinfo.html weechat-2.8/doc/cs/docinfo.html --- weechat-2.6/doc/cs/docinfo.html 2019-09-08 06:13:58.000000000 +0000 +++ weechat-2.8/doc/cs/docinfo.html 2020-03-29 07:39:36.000000000 +0000 @@ -1,6 +1,6 @@