1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

build: remove our own Ruby detection and rely on CMake detection, require CMake 3.18 (issue #1156)

This fixes the detection of Ruby on macOS 14.
This commit is contained in:
Sébastien Helleu
2024-10-19 11:12:33 +02:00
parent 712227da38
commit f8c7ed65e6
5 changed files with 34 additions and 50 deletions
+1
View File
@@ -6,6 +6,7 @@
- core: fix too many sorts of hotlist when buffers are moved ([#2097](https://github.com/weechat/weechat/issues/2097))
- relay, xfer: fix letters with actions displayed on top of buffer
- build: fix detection of Ruby on macOS 14, require CMake ≥ 3.18 ([#1156](https://github.com/weechat/weechat/issues/1156))
## Version 4.4.3 (2024-10-30)
+1 -1
View File
@@ -19,7 +19,7 @@
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
#
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.18)
project(weechat C)
-45
View File
@@ -1,45 +0,0 @@
#
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# 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 <https://www.gnu.org/licenses/>.
#
# - Find Ruby
# This module finds if Ruby 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:
#
# RUBY_INCLUDE_DIRS = C flags to compile with ruby
# RUBY_LIBRARY_DIRS = linker flags to compile with ruby (found with pkg-config)
# RUBY_LIB = ruby library (found without pkg-config)
if(RUBY_FOUND)
# Already in cache, be silent
set(RUBY_FIND_QUIETLY TRUE)
endif()
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# set specific search path for macOS
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/ruby/lib/pkgconfig")
endif()
pkg_search_module(RUBY ruby-3.3 ruby-3.2 ruby-3.1 ruby-3.0 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)
if(RUBY_FOUND AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# FIXME: weird hack: hardcoding the Ruby lib location on macOS
set(RUBY_LDFLAGS "${RUBY_LDFLAGS} -L/usr/local/opt/ruby/lib")
endif()
endif()
+2 -2
View File
@@ -28,8 +28,8 @@ if(RUBY_FOUND)
# caused by Ruby headers (with Ruby ≥ 3.1.0)
# see: https://github.com/ruby/ruby/pull/7085
add_definitions(-Wno-unused-parameter)
include_directories(${RUBY_INCLUDE_DIRS})
target_link_libraries(ruby ${RUBY_LDFLAGS} weechat_plugins_scripts coverage_config)
include_directories(${Ruby_INCLUDE_DIRS})
target_link_libraries(ruby ${Ruby_LIBRARIES} weechat_plugins_scripts coverage_config)
endif(RUBY_FOUND)
install(TARGETS ruby LIBRARY DESTINATION "${WEECHAT_LIBDIR}/plugins")
@@ -1,5 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d15a3548..0786637b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,7 +19,7 @@
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
#
-cmake_minimum_required(VERSION 3.18)
+cmake_minimum_required(VERSION 3.16)
project(weechat C)
diff --git a/debian-devel/rules b/debian-devel/rules
index cab713c93..d2756333b 100755
index 086056f76..559ccfffb 100755
--- a/debian-devel/rules
+++ b/debian-devel/rules
@@ -8,6 +8,7 @@ override_dh_auto_configure:
@@ -11,7 +24,7 @@ index cab713c93..d2756333b 100755
-DENABLE_MAN:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
diff --git a/debian-stable/rules b/debian-stable/rules
index cab713c93..d2756333b 100755
index 086056f76..559ccfffb 100755
--- a/debian-stable/rules
+++ b/debian-stable/rules
@@ -8,6 +8,7 @@ override_dh_auto_configure:
@@ -22,3 +35,18 @@ index cab713c93..d2756333b 100755
-DENABLE_DOC:BOOL=ON \
-DENABLE_MAN:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
diff --git a/src/plugins/ruby/CMakeLists.txt b/src/plugins/ruby/CMakeLists.txt
index 9f921fde8..2860f7d6d 100644
--- a/src/plugins/ruby/CMakeLists.txt
+++ b/src/plugins/ruby/CMakeLists.txt
@@ -28,8 +28,8 @@ if(RUBY_FOUND)
# caused by Ruby headers (with Ruby ≥ 3.1.0)
# see: https://github.com/ruby/ruby/pull/7085
add_definitions(-Wno-unused-parameter)
- include_directories(${Ruby_INCLUDE_DIRS})
- target_link_libraries(ruby ${Ruby_LIBRARIES} weechat_plugins_scripts coverage_config)
+ include_directories(${RUBY_INCLUDE_DIRS})
+ target_link_libraries(ruby ${RUBY_LIBRARY} weechat_plugins_scripts coverage_config)
endif(RUBY_FOUND)
install(TARGETS ruby LIBRARY DESTINATION "${WEECHAT_LIBDIR}/plugins")