[packages/ruby-ffi-yajl] instead of depending on ruby-libyajl2 hack, use system libyajl directly

glen glen at pld-linux.org
Wed Nov 12 22:22:06 CET 2014


commit 8df45b88acb509f3d200d2fdb772586af5579806
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Nov 12 23:18:32 2014 +0200

    instead of depending on ruby-libyajl2 hack, use system libyajl directly

 ruby-ffi-yajl.spec |  8 +++++---
 system-yajl.patch  | 27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/ruby-ffi-yajl.spec b/ruby-ffi-yajl.spec
index a062130..8b38b34 100644
--- a/ruby-ffi-yajl.spec
+++ b/ruby-ffi-yajl.spec
@@ -9,11 +9,12 @@
 Summary:	Ruby FFI wrapper around YAJL 2.x
 Name:		ruby-%{pkgname}
 Version:	1.2.0
-Release:	0.2
+Release:	0.3
 License:	Apache v2.0
 Group:		Development/Languages
 Source0:	http://rubygems.org/downloads/%{pkgname}-%{version}.gem
 # Source0-md5:	d507e47bd318e13b546b1b1f9c90a3fd
+Patch0:		system-yajl.patch
 URL:		http://github.com/opscode/ffi-yajl
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.656
@@ -33,8 +34,8 @@ BuildRequires:	ruby-rspec >= 2.99
 %endif
 Requires:	ruby-ffi < 2
 Requires:	ruby-ffi >= 1.5
-Requires:	ruby-libyajl2 < 2
-Requires:	ruby-libyajl2 >= 1.0
+# libyajl.so.2 opened by FFI
+Requires:	yajl >= 2.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -42,6 +43,7 @@ Ruby FFI wrapper around YAJL 2.x
 
 %prep
 %setup -q -n %{pkgname}-%{version}
+%patch0 -p1
 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
 
 %build
diff --git a/system-yajl.patch b/system-yajl.patch
new file mode 100644
index 0000000..ef923aa
--- /dev/null
+++ b/system-yajl.patch
@@ -0,0 +1,27 @@
+--- ffi-yajl-1.2.0/lib/ffi_yajl/ffi.rb~	2014-11-12 23:07:49.846221611 +0200
++++ ffi-yajl-1.2.0/lib/ffi_yajl/ffi.rb	2014-11-12 23:13:10.000000000 +0200
+@@ -1,23 +1,10 @@
+-require 'rubygems'
+-
+-require 'libyajl2'
+ require 'ffi'
+ 
+ module FFI_Yajl
+   extend ::FFI::Library
+ 
+   libname = ::FFI.map_library_name("yajl")
+-  # XXX: need to replace ::FFI.map_library_name here as well
+-  libname = "libyajl.so" if libname == "yajl.dll"
+-  libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
+-  libpath.gsub!(/dylib/, 'bundle')
+-
+-  if File.file?(libpath)
+-    # use our vendored version of libyajl2 if we find it installed
+-    ffi_lib libpath
+-  else
+-    ffi_lib 'yajl'
+-  end
++  ffi_lib 'yajl.so.2'
+ 
+   class YajlCallbacks < ::FFI::Struct
+     layout :yajl_null, :pointer,
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-ffi-yajl.git/commitdiff/c06241f1079adf6db3d2861a5147fc48325bca59



More information about the pld-cvs-commit mailing list