[libguestfs] Add upstream patch to fix OCaml bytecode compilation.

Richard W.M. Jones rjones at fedoraproject.org
Sat Jan 28 17:42:04 UTC 2012


commit 33c8a61346c13ca40979827e600b7e7ce5d6225c
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Jan 28 17:41:54 2012 +0000

    Add upstream patch to fix OCaml bytecode compilation.

 ...ml-Various-fixes-for-bytecode-compilation.patch |  104 ++++++++++++++++++++
 libguestfs.spec                                    |   10 ++-
 2 files changed, 112 insertions(+), 2 deletions(-)
---
diff --git a/0001-ocaml-Various-fixes-for-bytecode-compilation.patch b/0001-ocaml-Various-fixes-for-bytecode-compilation.patch
new file mode 100644
index 0000000..359d48a
--- /dev/null
+++ b/0001-ocaml-Various-fixes-for-bytecode-compilation.patch
@@ -0,0 +1,104 @@
+From 03684e7a616eab56a81665c8c8859426e50ae429 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Sat, 28 Jan 2012 17:35:34 +0000
+Subject: [PATCH] ocaml: Various fixes for bytecode compilation.
+
+Set LD_LIBRARY_PATH so we link against the just-built library, not
+the installed library.
+
+Use OCAMLCFLAGS instead of OCAMLOPTFLAGS where appropriate.
+
+Remove unnecessary -cclib option for bytecode linking (gcc is not used
+in this case).
+
+This fixes commit eb68a314133c88260cdf4547d7d338446488e698.
+---
+ ocaml/Makefile.am |   23 +++++++++++++++--------
+ 1 files changed, 15 insertions(+), 8 deletions(-)
+
+diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
+index 50f2649..c512d0b 100644
+--- a/ocaml/Makefile.am
++++ b/ocaml/Makefile.am
+@@ -102,7 +102,8 @@ noinst_DATA += \
+ 
+ bindtests.bc: bindtests.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ bindtests.opt: bindtests.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -110,7 +111,8 @@ bindtests.opt: bindtests.cmx mlguestfs.cmxa
+ 
+ t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -118,7 +120,8 @@ t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
+ 
+ t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -126,7 +129,8 @@ t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
+ 
+ t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -134,7 +138,8 @@ t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
+ 
+ t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -142,7 +147,8 @@ t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
+ 
+ t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -150,7 +156,8 @@ t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
+ 
+ t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma
+ 	mkdir -p t
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cma $< -o $@
++	LD_LIBRARY_PATH=../src/.libs \
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
+ 
+ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
+ 	mkdir -p t
+@@ -159,7 +166,7 @@ t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
+ # Need to rebuild the tests from source if the main library has
+ # changed at all, otherwise we get inconsistent assumptions.
+ t/guestfs_070_threads.cmo: t/guestfs_070_threads.ml mlguestfs.cma
+-	$(OCAMLFIND) ocamlc $(OCAMLOPTFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
++	$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
+ 
+ t/guestfs_070_threads.cmx: t/guestfs_070_threads.ml mlguestfs.cmxa
+ 	$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix,threads -thread -linkpkg -c $< -o $@
+-- 
+1.7.6
+
diff --git a/libguestfs.spec b/libguestfs.spec
index ff8fb9d..5edb092 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -30,7 +30,7 @@ Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
 Version:       1.17.3
-Release:       1%{?dist}
+Release:       2%{?dist}
 License:       LGPLv2+
 Group:         Development/Libraries
 URL:           http://libguestfs.org/
@@ -41,6 +41,9 @@ BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root
 ExclusiveArch: x86_64
 %endif
 
+# Upstream patch to fix OCaml bytecode compilation.
+Patch0001:     0001-ocaml-Various-fixes-for-bytecode-compilation.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -623,6 +626,8 @@ for %{name}.
 %prep
 %setup -q
 
+%patch0001 -p1
+
 mkdir -p daemon/m4
 
 # Replace developer-specific README that ships with libguestfs, with
@@ -1021,9 +1026,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Sat Jan 28 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.17.3-1
+* Sat Jan 28 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.17.3-2
 - New upstream version 1.17.3.
 - Remove patch now upstream.
+- Add upstream patch to fix OCaml bytecode compilation.
 
 * Fri Jan 27 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.17.2-3
 - Upstream patch to work with udev >= 176.


More information about the scm-commits mailing list