Add upstream patch to fix golang bindings.
This commit is contained in:
parent
9515ff6cf9
commit
997d83ab66
@ -0,0 +1,61 @@
|
|||||||
|
From 0bc729e85b11262e5c1a38aff1602c960277c2b4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||||
|
Date: Tue, 9 Jul 2013 13:59:52 +0100
|
||||||
|
Subject: [PATCH] golang: Fix it so it builds if libguestfs is not installed.
|
||||||
|
|
||||||
|
It was using the installed copy of libguestfs not the local copy.
|
||||||
|
|
||||||
|
We can't encode the paths in guestfs.go, since this source file gets
|
||||||
|
copied into the install directory where those paths would not make
|
||||||
|
sense. Instead we have to use CGO_CFLAGS and CGO_LDFLAGS to
|
||||||
|
communicate the right flags to go when doing the local build and test.
|
||||||
|
---
|
||||||
|
generator/golang.ml | 6 +++---
|
||||||
|
run.in | 12 ++++++++++++
|
||||||
|
2 files changed, 15 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/generator/golang.ml b/generator/golang.ml
|
||||||
|
index f7010bc..82c1a0d 100644
|
||||||
|
--- a/generator/golang.ml
|
||||||
|
+++ b/generator/golang.ml
|
||||||
|
@@ -37,11 +37,11 @@ let generate_golang_go () =
|
||||||
|
package guestfs
|
||||||
|
|
||||||
|
/*
|
||||||
|
-#cgo CFLAGS: -I../src -DGUESTFS_PRIVATE=1
|
||||||
|
-#cgo LDFLAGS: -L../src/.libs -lguestfs
|
||||||
|
+#cgo CFLAGS: -DGUESTFS_PRIVATE=1
|
||||||
|
+#cgo LDFLAGS: -lguestfs
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
-#include <guestfs.h>
|
||||||
|
+#include \"guestfs.h\"
|
||||||
|
|
||||||
|
// cgo can't deal with variable argument functions.
|
||||||
|
static guestfs_h *
|
||||||
|
diff --git a/run.in b/run.in
|
||||||
|
index 46cd71f..5d9ad75 100755
|
||||||
|
--- a/run.in
|
||||||
|
+++ b/run.in
|
||||||
|
@@ -171,6 +171,18 @@ else
|
||||||
|
GOPATH="$b/golang:$GOPATH"
|
||||||
|
fi
|
||||||
|
export GOPATH
|
||||||
|
+if [ -z "$CGO_CFLAGS" ]; then
|
||||||
|
+ CGO_CFLAGS="-I$s/src"
|
||||||
|
+else
|
||||||
|
+ CGO_CFLAGS="$CGO_CFLAGS -I$s/src"
|
||||||
|
+fi
|
||||||
|
+export CGO_CFLAGS
|
||||||
|
+if [ -z "$CGO_LDFLAGS" ]; then
|
||||||
|
+ CGO_LDFLAGS="-L$b/src/.libs"
|
||||||
|
+else
|
||||||
|
+ CGO_LDFLAGS="$CGO_LDFLAGS -L$b/src/.libs"
|
||||||
|
+fi
|
||||||
|
+export CGO_LDFLAGS
|
||||||
|
|
||||||
|
# For GObject, Javascript and friends.
|
||||||
|
export GJS=@GJS@
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
@ -12,13 +12,15 @@ Summary: Access and modify virtual machine disk images
|
|||||||
Name: libguestfs
|
Name: libguestfs
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 1.23.8
|
Version: 1.23.8
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
|
|
||||||
# Source and patches.
|
# Source and patches.
|
||||||
URL: http://libguestfs.org/
|
URL: http://libguestfs.org/
|
||||||
Source0: http://libguestfs.org/download/1.23-development/%{name}-%{version}.tar.gz
|
Source0: http://libguestfs.org/download/1.23-development/%{name}-%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch1: 0001-golang-Fix-it-so-it-builds-if-libguestfs-is-not-inst.patch
|
||||||
|
|
||||||
# Basic build requirements:
|
# Basic build requirements:
|
||||||
BuildRequires: perl(Pod::Simple)
|
BuildRequires: perl(Pod::Simple)
|
||||||
BuildRequires: perl(Pod::Man)
|
BuildRequires: perl(Pod::Man)
|
||||||
@ -534,6 +536,8 @@ for %{name}.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then
|
if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then
|
||||||
# For sVirt to work, the local temporary directory we use in the
|
# For sVirt to work, the local temporary directory we use in the
|
||||||
# tests must be labelled the same way as /tmp.
|
# tests must be labelled the same way as /tmp.
|
||||||
@ -906,9 +910,10 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/libguestfs
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Jul 9 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.23.8-1
|
* Tue Jul 9 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.23.8-2
|
||||||
- New upstream version 1.23.8.
|
- New upstream version 1.23.8.
|
||||||
- Try enabling golang bindings.
|
- Try enabling golang bindings.
|
||||||
|
- Add upstream patch to fix golang bindings.
|
||||||
|
|
||||||
* Wed Jul 3 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.23.7-1
|
* Wed Jul 3 2013 Richard W.M. Jones <rjones@redhat.com> - 1:1.23.7-1
|
||||||
- New upstream version 1.23.7.
|
- New upstream version 1.23.7.
|
||||||
|
Loading…
Reference in New Issue
Block a user