[arch-commits] Commit in facter/trunk (PKGBUILD ruby23.patch)

Evangelos Foutras foutrelis at archlinux.org
Tue Dec 29 00:56:24 UTC 2015


    Date: Tuesday, December 29, 2015 @ 01:56:24
  Author: foutrelis
Revision: 154772

upgpkg: facter 3.1.3-6

Fix incompatibility with Ruby 2.3.0 (FACT-1291 upstream).

Added:
  facter/trunk/ruby23.patch
Modified:
  facter/trunk/PKGBUILD

--------------+
 PKGBUILD     |   23 ++++++++++++--
 ruby23.patch |   90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-12-29 00:43:07 UTC (rev 154771)
+++ PKGBUILD	2015-12-29 00:56:24 UTC (rev 154772)
@@ -8,7 +8,7 @@
 
 pkgname=facter
 pkgver=3.1.3
-pkgrel=5
+pkgrel=6
 pkgdesc="Collect and display system facts"
 arch=('i686' 'x86_64')
 url="http://puppetlabs.com/facter"
@@ -17,9 +17,19 @@
 makedepends=('boost' 'cmake' 'java-environment')
 optdepends=('java-environment: jruby support')
 replaces=('cfacter')
-source=(http://downloads.puppetlabs.com/$pkgname/$pkgname-$pkgver.tar.gz)
-md5sums=('0a07f8f88ac8c1f2ed7566a51dc775bc')
+source=(http://downloads.puppetlabs.com/$pkgname/$pkgname-$pkgver.tar.gz
+        ruby23.patch)
+md5sums=('0a07f8f88ac8c1f2ed7566a51dc775bc'
+         'cae82c863a8efe27688b7ef6fc66bc6f')
 
+prepare() {
+  cd $pkgname-$pkgver
+
+  # Replace rb_data_object_alloc symbol with rb_data_object_wrap
+  # https://tickets.puppetlabs.com/browse/FACT-1291
+  patch -Np1 -i ../ruby23.patch
+}
+
 build() {
   cd $pkgname-$pkgver
 
@@ -28,6 +38,13 @@
   make
 }
 
+check() {
+  cd $pkgname-$pkgver
+
+  # TODO: Investigate why tests fail on i686 most of the time with Ruby 2.3.0
+  make test || [[ $CARCH == i686 ]]
+}
+
 package() {
   cd $pkgname-$pkgver
 

Added: ruby23.patch
===================================================================
--- ruby23.patch	                        (rev 0)
+++ ruby23.patch	2015-12-29 00:56:24 UTC (rev 154772)
@@ -0,0 +1,90 @@
+diff -uprb facter-3.1.3.orig/lib/src/ruby/aggregate_resolution.cc facter-3.1.3/lib/src/ruby/aggregate_resolution.cc
+--- facter-3.1.3.orig/lib/src/ruby/aggregate_resolution.cc	2015-11-25 02:13:58.000000000 +0200
++++ facter-3.1.3/lib/src/ruby/aggregate_resolution.cc	2015-12-29 02:03:30.735361627 +0200
+@@ -138,7 +138,7 @@ namespace facter { namespace ruby {
+ 
+         // Create a resolution and wrap with a Ruby data object
+         unique_ptr<aggregate_resolution> r(new aggregate_resolution());
+-        VALUE self = r->_self = ruby.rb_data_object_alloc(klass, r.get(), mark, free);
++        VALUE self = r->_self = ruby.rb_data_object_wrap(klass, r.get(), mark, free);
+         ruby.register_data_object(self);
+ 
+         // Release the smart pointer; ownership is now with Ruby's GC
+diff -uprb facter-3.1.3.orig/lib/src/ruby/fact.cc facter-3.1.3/lib/src/ruby/fact.cc
+--- facter-3.1.3.orig/lib/src/ruby/fact.cc	2015-11-25 02:13:58.000000000 +0200
++++ facter-3.1.3/lib/src/ruby/fact.cc	2015-12-29 02:03:30.738695043 +0200
+@@ -285,7 +285,7 @@ namespace facter { namespace ruby {
+ 
+         // Create a fact and wrap with a Ruby data object
+         unique_ptr<fact> f(new fact());
+-        VALUE self = f->_self = ruby.rb_data_object_alloc(klass, f.get(), mark, free);
++        VALUE self = f->_self = ruby.rb_data_object_wrap(klass, f.get(), mark, free);
+         ruby.register_data_object(self);
+ 
+         // Release the smart pointer; ownership is now with Ruby's GC
+diff -uprb facter-3.1.3.orig/lib/src/ruby/module.cc facter-3.1.3/lib/src/ruby/module.cc
+--- facter-3.1.3.orig/lib/src/ruby/module.cc	2015-11-25 02:13:58.000000000 +0200
++++ facter-3.1.3/lib/src/ruby/module.cc	2015-12-29 02:03:30.738695043 +0200
+@@ -50,7 +50,7 @@ namespace facter { namespace ruby {
+             // The easiest way to get notified is to have a global data object that never gets collected
+             // until the VM shuts down
+             auto const& ruby = api::instance();
+-            _canary = ruby.rb_data_object_alloc(*ruby.rb_cObject, this, nullptr, cleanup);
++            _canary = ruby.rb_data_object_wrap(*ruby.rb_cObject, this, nullptr, cleanup);
+             ruby.rb_gc_register_address(&_canary);
+             ruby.register_data_object(_canary);
+         }
+diff -uprb facter-3.1.3.orig/lib/src/ruby/simple_resolution.cc facter-3.1.3/lib/src/ruby/simple_resolution.cc
+--- facter-3.1.3.orig/lib/src/ruby/simple_resolution.cc	2015-11-25 02:13:58.000000000 +0200
++++ facter-3.1.3/lib/src/ruby/simple_resolution.cc	2015-12-29 02:03:30.738695043 +0200
+@@ -74,7 +74,7 @@ namespace facter { namespace ruby {
+ 
+         // Create a resolution and wrap with a Ruby data object
+         unique_ptr<simple_resolution> r(new simple_resolution());
+-        VALUE self = r->_self = ruby.rb_data_object_alloc(klass, r.get(), mark, free);
++        VALUE self = r->_self = ruby.rb_data_object_wrap(klass, r.get(), mark, free);
+         ruby.register_data_object(self);
+ 
+         // Release the smart pointer; ownership is now with Ruby's GC
+diff -uprb facter-3.1.3.orig/vendor/leatherman/ruby/inc/leatherman/ruby/api.hpp facter-3.1.3/vendor/leatherman/ruby/inc/leatherman/ruby/api.hpp
+--- facter-3.1.3.orig/vendor/leatherman/ruby/inc/leatherman/ruby/api.hpp	2015-11-25 02:14:00.000000000 +0200
++++ facter-3.1.3/vendor/leatherman/ruby/inc/leatherman/ruby/api.hpp	2015-12-29 02:03:30.738695043 +0200
+@@ -341,7 +341,7 @@ namespace leatherman {  namespace ruby {
+         /**
+          * See MRI documentation.
+          */
+-        VALUE (* const rb_data_object_alloc)(VALUE, void*, RUBY_DATA_FUNC, RUBY_DATA_FUNC);
++        VALUE (* const rb_data_object_wrap)(VALUE, void*, RUBY_DATA_FUNC, RUBY_DATA_FUNC);
+         /**
+          * See MRI documentation.
+          */
+@@ -621,7 +621,7 @@ namespace leatherman {  namespace ruby {
+ 
+         /**
+          * Gets the underlying native instance from a Ruby data object.
+-         * The Ruby object must have been allocated with rb_data_object_alloc.
++         * The Ruby object must have been allocated with rb_data_object_wrap.
+          * @tparam T The underlying native type.
+          * @param obj The Ruby data object to get the native instance for.
+          * @return Returns a pointer to the underlying native type.
+@@ -634,7 +634,7 @@ namespace leatherman {  namespace ruby {
+ 
+         /**
+          * Registers a data object for cleanup when the API is destructed.
+-         * The object must have been created with rb_data_object_alloc.
++         * The object must have been created with rb_data_object_wrap.
+          * @param obj The data object to register.
+          */
+         void register_data_object(VALUE obj) const
+diff -uprb facter-3.1.3.orig/vendor/leatherman/ruby/src/api.cc facter-3.1.3/vendor/leatherman/ruby/src/api.cc
+--- facter-3.1.3.orig/vendor/leatherman/ruby/src/api.cc	2015-11-25 02:14:00.000000000 +0200
++++ facter-3.1.3/vendor/leatherman/ruby/src/api.cc	2015-12-29 02:03:30.738695043 +0200
+@@ -80,7 +80,7 @@ namespace leatherman { namespace ruby {
+         LOAD_SYMBOL(rb_to_id),
+         LOAD_SYMBOL(rb_id2name),
+         LOAD_SYMBOL(rb_define_alloc_func),
+-        LOAD_SYMBOL(rb_data_object_alloc),
++        LOAD_SYMBOL(rb_data_object_wrap),
+         LOAD_SYMBOL(rb_gc_mark),
+         LOAD_SYMBOL(rb_yield_values),
+         LOAD_SYMBOL(rb_require),



More information about the arch-commits mailing list