[MacPorts] #44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works -------------------------+-------------------------------- Reporter: jfs.world@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Keywords: | Port: -------------------------+-------------------------------- To confirm: {{{ ruby2.1 -e 'p require "fiddle"' }}} Correctly configured and compiled, the output should be {{{ true }}} NOTE: this patch is only for libffi 3.1, and should be removed once libffi goes to 3 numbers in its version. It is, of course best fixed upstream, and I will deal with that and report back once it's solved there. Until then, this patch will fix things. {{{ --- ext/fiddle/extconf.rb.orig 2013-05-19 10:42:16.000000000 +0800 +++ ext/fiddle/extconf.rb 2014-07-31 16:26:56.000000000 +0800 @@ -7,7 +7,7 @@ pkg_config("libffi") if ver = pkg_config("libffi", "modversion") ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored. - $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }}) + $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d' % ver.split('.') }}) end unless have_header('ffi.h') }}} -- Ticket URL: <https://trac.macports.org/ticket/44508> MacPorts <http://www.macports.org/> Ports system for OS X
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works --------------------------+-------------------------------- Reporter: jfs.world@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: | --------------------------+-------------------------------- Comment (by jfs.world@…): Ok sorry, the patch should be this instead (ext/fiddle/closure.c relies on RUBY_LIBFFI_MODVERSION being generated off of a 3-digit 'ver')! {{{ --- ext/fiddle/extconf.rb.orig 2013-05-19 10:42:16.000000000 +0800 +++ ext/fiddle/extconf.rb 2014-07-31 23:39:34.000000000 +0800 @@ -7,7 +7,9 @@ pkg_config("libffi") if ver = pkg_config("libffi", "modversion") ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored. - $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }}) + ver_split = ver.split('.') + ver_split.push '0' if ver_split.length == 2 + $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver_split }}) end unless have_header('ffi.h') }}} -- Ticket URL: <https://trac.macports.org/ticket/44508#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works --------------------------+----------------------- Reporter: jfs.world@… | Owner: kimuraw@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: ruby21 | --------------------------+----------------------- Changes (by ryandesign@…): * owner: macports-tickets@… => kimuraw@… * port: => ruby21 -- Ticket URL: <https://trac.macports.org/ticket/44508#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works -----------------------------+----------------------- Reporter: jfs.world@… | Owner: kimuraw@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: ruby21, ruby20 | -----------------------------+----------------------- Changes (by kimuraw@…): * status: new => assigned * port: ruby21 => ruby21, ruby20 Comment: Thanks! ruby-2.1 branch was fixed this problem at https://bugs.ruby- lang.org/projects/ruby-21/repository/revisions/46609. I'll apply this change. note: upstream ruby filed this problem as http://bugs.ruby- lang.org/issues/9897. ruby-2.0 has same problem. -- Ticket URL: <https://trac.macports.org/ticket/44508#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works -----------------------------+----------------------- Reporter: jfs.world@… | Owner: kimuraw@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: | Keywords: Port: ruby21, ruby20 | -----------------------------+----------------------- Comment (by jfs.world@…): Sure. I realized that myself after some time.... That patch will take care of libffi versions with (?) just 1 number, as well as 2. -- Ticket URL: <https://trac.macports.org/ticket/44508#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#44508: ruby21: fix compilation with libffi (*3.1!) so that module fiddle works --------------------------+----------------------- Reporter: jfs.world@… | Owner: kimuraw@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.1 Resolution: fixed | Keywords: Port: ruby21 | --------------------------+----------------------- Changes (by kimuraw@…): * status: assigned => closed * resolution: => fixed * port: ruby21, ruby20 => ruby21 Comment: fixed at r122863. my misunderstanding, ruby2.0 does not have this problem. -- Ticket URL: <https://trac.macports.org/ticket/44508#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts