[Libguestfs] Fwd: Patch for hivex ruby library extension

Richard W.M. Jones rjones at redhat.com
Mon Aug 8 18:14:37 UTC 2016


----- Forwarded message from Margaret Lewicka -----

Date: Sat, 16 Jul 2016 23:56:39 +0100
From: Margaret Lewicka
To: "Richard W.M. Jones"
Subject: Patch for hivex ruby library extension

Hi,

Attaching a patch that fixes hivex ruby bindings on Mac, if you're
interested. Wasn't sure if it belonged on the libguestfs list, so mailing
it directly to you.

----- End forwarded message -----

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
-------------- next part --------------
>From 50be5b4346291e897186c3ab7c86d1bad1f7428a Mon Sep 17 00:00:00 2001
From: Margaret Lewicka <margaret at meaningless.name>
Date: Sat, 16 Jul 2016 16:22:47 +0100
Subject: [PATCH] dlext patch

---
 ruby/Makefile.am | 6 ++++--
 ruby/Rakefile.in | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 0e9a868..e8e5e45 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -15,6 +15,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
+DLEXT := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['DLEXT']")
+
 EXTRA_DIST = \
 	Rakefile.in \
 	README.rdoc \
@@ -32,7 +34,7 @@ CLEANFILES = \
 	ext/hivex/*~ \
 	ext/hivex/extconf.h \
 	ext/hivex/_hivex.o \
-	ext/hivex/_hivex.so \
+	ext/hivex/_hivex.$(DLEXT) \
 	ext/hivex/mkmf.log \
 	ext/hivex/Makefile
 
@@ -57,6 +59,6 @@ install:
 	$(MKDIR_P) $(DESTDIR)$(RUBY_LIBDIR)
 	$(MKDIR_P) $(DESTDIR)$(RUBY_ARCHDIR)
 	$(INSTALL) -p -m 0644 $(srcdir)/lib/hivex.rb $(DESTDIR)$(RUBY_LIBDIR)
-	$(INSTALL) -p -m 0755 $(builddir)/ext/hivex/_hivex.so $(DESTDIR)$(RUBY_ARCHDIR)
+	$(INSTALL) -p -m 0755 $(builddir)/ext/hivex/_hivex.$(DLEXT) $(DESTDIR)$(RUBY_ARCHDIR)
 
 endif
diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in
index cd99507..86f3195 100644
--- a/ruby/Rakefile.in
+++ b/ruby/Rakefile.in
@@ -40,9 +40,10 @@ end
 PKG_NAME='@PACKAGE_NAME@'
 PKG_VERSION='@PACKAGE_VERSION@'
 
+DLEXT=RbConfig::CONFIG['DLEXT']
 EXT_CONF='@abs_srcdir@/ext/hivex/extconf.rb'
 MAKEFILE='@builddir@/ext/hivex/Makefile'
-HIVEX_MODULE='@builddir@/ext/hivex/_hivex.so'
+HIVEX_MODULE="@builddir@/ext/hivex/_hivex.#{DLEXT}"
 HIVEX_SRC='@abs_srcdir@/ext/hivex/_hivex.c'
 
 CLEAN.include [ "@builddir@/ext/**/*.o", HIVEX_MODULE,
-- 
2.9.1



More information about the Libguestfs mailing list