[packages/ruby-ffi-yajl] up to 2.2.3

glen glen at pld-linux.org
Thu Jun 2 18:13:16 CEST 2016


commit 07684df0185289870abb877b2761df7c2c468ecc
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Jun 2 18:59:04 2016 +0300

    up to 2.2.3

 ruby-ffi-yajl.spec | 14 +++++----
 system-yajl.patch  | 87 ++++++++++++++++++++++++++++--------------------------
 2 files changed, 54 insertions(+), 47 deletions(-)
---
diff --git a/ruby-ffi-yajl.spec b/ruby-ffi-yajl.spec
index 89cba49..378bba7 100644
--- a/ruby-ffi-yajl.spec
+++ b/ruby-ffi-yajl.spec
@@ -8,14 +8,14 @@
 %define	pkgname	ffi-yajl
 Summary:	Ruby FFI wrapper around YAJL 2.x
 Name:		ruby-%{pkgname}
-Version:	1.3.1
-Release:	3
+Version:	2.2.3
+Release:	0.1
 License:	Apache v2.0
 Group:		Development/Languages
 Source0:	http://rubygems.org/downloads/%{pkgname}-%{version}.gem
-# Source0-md5:	ac12c13508dc6df56724a14670d6684a
+# Source0-md5:	f3ddfeddd03f44b6f7c02ad9e39fd41f
 Patch0:		system-yajl.patch
-URL:		http://github.com/opscode/ffi-yajl
+URL:		https://github.com/chef/ffi-yajl
 BuildRequires:	rpm-rubyprov
 BuildRequires:	rpmbuild(macros) >= 1.656
 BuildRequires:	ruby-devel
@@ -23,6 +23,8 @@ BuildRequires:	ruby-rubygems
 BuildRequires:	sed >= 4.0
 BuildRequires:	yajl-devel >= 2.0
 %if %{with tests}
+BuildRequires:	ruby-ffi < 2
+BuildRequires:	ruby-ffi >= 1.5
 BuildRequires:	ruby-mime-types < 2
 BuildRequires:	ruby-mime-types >= 1.16
 BuildRequires:	ruby-pry < 1
@@ -37,6 +39,7 @@ BuildRequires:	ruby-rspec >= 2.99
 Requires:	ruby-ffi < 2
 Requires:	ruby-ffi >= 1.5
 # libyajl.so.2 opened by FFI
+Requires:	yajl < 3
 Requires:	yajl >= 2.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -95,8 +98,9 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_vendorlibdir}/ffi_yajl/encoder.rb
 %{ruby_vendorlibdir}/ffi_yajl/ext.rb
 %{ruby_vendorlibdir}/ffi_yajl/ffi.rb
-%{ruby_vendorlibdir}/ffi_yajl/json_gem.rb
+%{ruby_vendorlibdir}/ffi_yajl/map_library_name.rb
 %{ruby_vendorlibdir}/ffi_yajl/parser.rb
+%{ruby_vendorlibdir}/ffi_yajl/platform.rb
 %{ruby_vendorlibdir}/ffi_yajl/version.rb
 %dir %{ruby_vendorlibdir}/ffi_yajl/ffi
 %{ruby_vendorlibdir}/ffi_yajl/ffi/encoder.rb
diff --git a/system-yajl.patch b/system-yajl.patch
index 1f441ed..68d2e3d 100644
--- a/system-yajl.patch
+++ b/system-yajl.patch
@@ -1,52 +1,26 @@
---- 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 @@
+--- ffi-yajl-2.2.3/lib/ffi_yajl/ffi.rb~	2016-06-02 18:51:31.000000000 +0300
++++ ffi-yajl-2.2.3/lib/ffi_yajl/ffi.rb	2016-06-02 18:52:21.951416437 +0300
+@@ -20,9 +20,6 @@
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
 -require 'rubygems'
 -
 -require 'libyajl2'
- require 'ffi'
- 
- module FFI_Yajl
-   extend ::FFI::Library
+ begin
+   require 'ffi'
+ rescue LoadError
+--- ffi-yajl-2.2.3/lib/ffi_yajl/ext.rb~	2016-06-02 18:54:08.000000000 +0300
++++ ffi-yajl-2.2.3/lib/ffi_yajl/ext.rb	2016-06-02 18:54:34.768251524 +0300
+@@ -20,8 +20,6 @@
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  
-   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')
+-require 'rubygems'
 -
--  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,
---- ruby-ffi-yajl-1.3.1/lib/ffi_yajl/ext.rb	2015-01-22 13:55:11.513182150 +0200
-+++ ruby-ffi-yajl-1.3.1/lib/ffi_yajl/ext.rb	2015-01-22 13:55:53.882526948 +0200
-@@ -3,18 +3,9 @@
  require 'ffi_yajl/encoder'
  require 'ffi_yajl/parser'
- require 'ffi'
--require 'libyajl2'
- 
- module FFI_Yajl
--  # FIXME: DRY with ffi_yajl/ffi.rb
--  # FIXME: extract map_library_name from FFI and stop requiring it at the top level
--  #        so that the C-library can be installed without FFI
--  libname = ::FFI.map_library_name("yajl")
--  # awful windows patch, but there is an open issue to entirely replace FFI.map_library_name already
--  libname = "libyajl.so" if libname == "yajl.dll"
--  libpath = File.expand_path(File.join(Libyajl2.opt_path, libname))
--  libpath.gsub!(/dylib/, 'bundle')
--  libpath = ::FFI.map_library_name("yajl") unless File.exist?(libpath)
-+  libpath = 'libyajl.so.2'
- 
-   #
-   # FFS, what exactly was so wrong with DL.dlopen that ruby had to get rid of it???
+ require 'ffi_yajl/ext/dlopen'
 --- ffi-yajl-1.2.0/ext/ffi_yajl/ext/encoder/extconf.rb~	2014-11-12 23:19:03.000000000 +0200
 +++ ffi-yajl-1.2.0/ext/ffi_yajl/ext/encoder/extconf.rb	2014-11-12 23:20:13.882893756 +0200
 @@ -1,13 +1,8 @@
@@ -79,3 +53,32 @@
  # remove "-Wl,--no-undefined" flag if existent to allow for loading with dlopen
  $LDFLAGS.slice!("-Wl,--no-undefined")
  
+--- ffi-yajl-2.2.3/lib/ffi_yajl/map_library_name.rb~	2016-06-02 18:51:31.000000000 +0300
++++ ffi-yajl-2.2.3/lib/ffi_yajl/map_library_name.rb	2016-06-02 18:53:35.695211477 +0300
+@@ -20,8 +20,6 @@
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ 
+-require 'libyajl2'
+-
+ # Mixin for use in finding the right yajl library on the system.  The 'caller'
+ # needs to also mixin either the FFI module or the DLopen module.  Those are
+ # deliberately not mixed in to avoid loading the dlopen module in the ffi
+@@ -45,16 +43,7 @@
+     # @api private
+     # @return Array<String> Array of yajl library names for platform
+     def library_names
+-      case host_os
+-      when /mingw|mswin/
+-        [ "libyajl.so", "yajl.dll" ]
+-      when /cygwin/
+-        [ "libyajl.so", "cygyajl.dll" ]
+-      when /darwin/
+-        [ "libyajl.bundle", "libyajl.dylib" ]
+-      else
+-        [ "libyajl.so" ]
+-      end
++      [ "libyajl.so.2" ]
+     end
+ 
+     # Array of yajl library names prepended with the libyajl2 path to use to
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list