ruby: fix build with libffi 3.1

This commit is contained in:
Juergen Daubert 2014-06-03 11:20:28 +02:00
parent e483a10804
commit ae04a17d49
3 changed files with 20 additions and 2 deletions

View File

@ -1 +1,2 @@
ed9b8565bdeccb401d628ec8d54a0774 ruby-2.1.2.tar.bz2
0fc7c8079e55abd9d1b23779852b441e ruby-libffi_ver_string.patch

View File

@ -5,12 +5,16 @@
name=ruby
version=2.1.2
release=1
source=(ftp://ftp.ruby-lang.org/pub/$name/2.1/$name-$version.tar.bz2)
release=2
source=(ftp://ftp.ruby-lang.org/pub/$name/2.1/$name-$version.tar.bz2
$name-libffi_ver_string.patch)
build () {
cd $name-$version
# fiddle requires a 3-digit version string form libffi
patch -p1 -i $SRC/$name-libffi_ver_string.patch
./configure --prefix=/usr \
--mandir=/usr/man \
--enable-shared \

View File

@ -0,0 +1,13 @@
diff -Nru ruby-2.1.2.orig/ext/fiddle/extconf.rb ruby-2.1.2/ext/fiddle/extconf.rb
--- ruby-2.1.2.orig/ext/fiddle/extconf.rb 2014-06-03 10:54:39.663000000 +0200
+++ ruby-2.1.2/ext/fiddle/extconf.rb 2014-06-03 10:56:49.318000000 +0200
@@ -7,6 +7,9 @@
pkg_config("libffi")
if ver = pkg_config("libffi", "modversion")
ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
+ while ver.split('.').size < 3
+ ver = ver + ".0"
+ end
$defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }})
end