Skip to content

Commit

Permalink
swig bindings: exclude incompatible swig/python/ruby combinations by …
Browse files Browse the repository at this point in the history
  • Loading branch information
mpranj committed Apr 27, 2020
1 parent a2d4763 commit 6b9fc85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ The following section lists news about the [modules](https://www.libelektra.org/
### SWIG

- Configure line (-DBINDINGS="..") for SWIG based bindings have been changed from `swig_foo` to `foo`. _(Manuel Mausz)_
- Exclude SWIG bindings if SWIG Version is 4.0.1 and Python is >= 3.8 or Ruby is >= 2.7 due to incompatibility (#3378, #3379). _(Mihael Pranjić)_

### SWIG/python

Expand Down Expand Up @@ -257,7 +258,6 @@ you up to date with the multi-language support provided by Elektra.
- Disable tcl on FreeBSD images because of test failures (see #3353). _(Mihael Pranjić)_
- Disable curlget plugin for macOS jobs (see #3382). _(Mihael Pranjić)_
- Add more dependencies to Fedora image to cover many tests. _(Mihael Pranjić)_
- Downgrade ruby version on cirrus due to upstream swig incompatibility (see #3378). _(Mihael Pranjić)_

### Jenkins

Expand Down
2 changes: 2 additions & 0 deletions src/bindings/swig/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ elseif (NOT PYTHONLIBS_FOUND)
exclude_binding (python "python3 libs not found")
elseif (PYTHONLIBS_VERSION_STRING MATCHES "^2\\.[0-9]+")
exclude_binding (python "python3 is for python 3 only and not ${PYTHONLIBS_VERSION_STRING}")
elseif (SWIG_VERSION VERSION_LESS "4.0.2" AND (PYTHONLIBS_VERSION_STRING VERSION_GREATER "3.8.0" OR PYTHONLIBS_VERSION_STRING VERSION_EQUAL "3.8.0"))
exclude_binding (python "SWIG <= 4.0.1 incompatible with Python >= 3.8")
elseif (NOT BUILD_SHARED)
exclude_binding (python "it can only be built if `BUILD_SHARED` is enabled")
else ()
Expand Down
4 changes: 3 additions & 1 deletion src/bindings/swig/ruby/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (APPLE)
set (CMAKE_FIND_FRAMEWORK "LAST") # try user environment first, then search for system libs required on OSX under rvm

# Prefer Ruby versions installed via Homebrew
set (RUBY_DIRECTORIES "/usr/local/opt/ruby@2.5" "/usr/local/opt/ruby")
set (RUBY_DIRECTORIES "/usr/local/opt/ruby@2.6" "/usr/local/opt/ruby")
foreach (directory ${RUBY_DIRECTORIES})
if (EXISTS ${directory})
list (APPEND CMAKE_PREFIX_PATH ${directory})
Expand All @@ -17,6 +17,8 @@ find_package (Ruby QUIET)

if (NOT RUBY_FOUND)
exclude_binding (ruby "ruby interpreter or ruby header files not found (package ruby-dev/ruby-devel installed?)")
elseif (SWIG_VERSION VERSION_LESS "4.0.2" AND (RUBY_VERSION VERSION_GREATER "2.7.0" OR RUBY_VERSION VERSION_EQUAL "2.7.0"))
exclude_binding (ruby "SWIG <= 4.0.1 incompatible with Ruby >= 2.7")
elseif (SWIG_VERSION MATCHES "^([12]\\.)|(3\\.0\\.[01234567])$")
exclude_binding (ruby "found SWIG version (${SWIG_VERSION}) is not suitable. SWIG version >= 3.0.8 required")
else ()
Expand Down

0 comments on commit 6b9fc85

Please sign in to comment.