From: Jeffrey 'jf' Lim Date: 2014-07-31T18:03:10+08:00 Subject: [ruby-core:64137] Ruby 2.1.2 (and 2.1.1 and probably others) assumes a libffi with 3 version numbers in extconf.rb --bcaec53d54775082e704ff7a61b0 Content-Type: text/plain; charset=ISO-8859-1 As per subject. If you have the latest libffi version (3.1) installed, fiddle wont be configured. The offending section in extconf.rb: ======== 7 pkg_config("libffi") 8 if ver = pkg_config("libffi", "modversion") 9 ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored. 10 $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d' % ver.split('.') }}) 11 end ======== I'm not too sure what the idiomatic approach would be; how about the following? =============== --- ext/fiddle/extconf.rb.orig 2013-05-19 10:42:16.000000000 +0800 +++ ext/fiddle/extconf.rb 2014-07-31 18:00:47.000000000 +0800 @@ -7,7 +7,8 @@ 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('.') + $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ ('%d' + '%03d'*(versplit.length-1)) % versplit }}) end unless have_header('ffi.h') ================= -jf -- He who settles on the idea of the intelligent man as a static entity only shows himself to be a fool. Mensan / Full-Stack Technical Polymath / System Administrator 12 years over the entire web stack: Performance, Sysadmin, Ruby and Frontend --bcaec53d54775082e704ff7a61b0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
As per subject.

If you have th= e latest libffi version (3.1) installed, fiddle wont be configured.

=
The offending section in extconf.rb:
=3D=3D=3D=3D=3D=3D=3D=3D
= =A0 7 pkg_config("libffi")
=A0 8 if ver =3D pkg_config("libffi", "modversion")
= =A0 9=A0=A0 ver =3D ver.gsub(/-rc\d+/, '') # If ver contains rc ver= sion, just ignored.
=A010=A0=A0 $defs.push(%{-DRUBY_LIBFFI_MODVERSION=3D= #{ '%d%03d' % ver.split('.') }})
=A011 end
=3D=3D=3D=3D=3D=3D=3D=3D

I'm not too sur= e what the idiomatic approach would be; how about the following?

=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- ext/fiddle/extconf.rb.ori= g=A0=A0=A0 2013-05-19 10:42:16.000000000 +0800
+++ ext/fiddle/extconf.rb=A0=A0=A0 2014-07-31 18:00:47.000000000 +0800
@= @ -7,7 +7,8 @@
=A0pkg_config("libffi")
=A0if ver =3D pkg_co= nfig("libffi", "modversion")
=A0=A0 ver =3D ver.gsub= (/-rc\d+/, '') # If ver contains rc version, just ignored.
-=A0 $defs.push(%{-DRUBY_LIBFFI_MODVERSION=3D#{ '%d%03d%03d' % ver.= split('.') }})
+=A0 ver_split =3D ver.split('.')
+=A0= $defs.push(%{-DRUBY_LIBFFI_MODVERSION=3D#{ ('%d' + '%03d'*= (versplit.length-1)) % versplit }})
=A0end
=A0
=A0unless have_header('ffi.h')
=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

-jf

--
He who sett= les on the idea of the intelligent man as a static entity only shows himsel= f to be a fool.

Mensan / Full-Stack Technical Polymath / System Administrator
12 yea= rs over the entire web stack: Performance, Sysadmin, Ruby and Frontend
--bcaec53d54775082e704ff7a61b0--