mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
golang: Fix bindings for golang 1.16.
See https://blog.golang.org/go116-module-changes
This commit is contained in:
@@ -26,27 +26,20 @@ source_files = \
|
||||
|
||||
generator_built = \
|
||||
$(source_files) \
|
||||
bindtests.go
|
||||
bindtests/bindtests.go
|
||||
|
||||
EXTRA_DIST = \
|
||||
src/libguestfs.org/guestfs/.gitignore \
|
||||
$(generator_built) \
|
||||
bindtests/go.mod \
|
||||
config-test.go \
|
||||
run-bindtests \
|
||||
run-tests
|
||||
|
||||
if HAVE_GOLANG
|
||||
|
||||
golangpkgdir = $(GOROOT)/pkg/$(GOOS)_$(GOARCH)/$(pkg)
|
||||
golangsrcdir = $(GOROOT)/src/pkg/$(pkg)
|
||||
|
||||
golangpkg_DATA = \
|
||||
pkg/$(GOOS)_$(GOARCH)/$(pkg).a
|
||||
|
||||
pkg/$(GOOS)_$(GOARCH)/$(pkg).a: src/$(pkg)/guestfs.go
|
||||
$(top_builddir)/run $(GOLANG) install $(pkg)
|
||||
|
||||
golangsrc_DATA = $(source_files)
|
||||
all-local: $(source_files)
|
||||
cd src/$(pkg) && $(GOLANG) build
|
||||
|
||||
TESTS_ENVIRONMENT = pkg=$(pkg) $(top_builddir)/run $(VG) # --test
|
||||
|
||||
@@ -55,6 +48,3 @@ TESTS = run-bindtests run-tests
|
||||
endif
|
||||
|
||||
CLEANFILES += src/$(pkg)/*~
|
||||
|
||||
clean-local:
|
||||
rm -rf pkg
|
||||
|
||||
4
golang/bindtests/go.mod
Normal file
4
golang/bindtests/go.mod
Normal file
@@ -0,0 +1,4 @@
|
||||
module main
|
||||
|
||||
replace libguestfs.org/guestfs => ../src/libguestfs.org/guestfs
|
||||
require libguestfs.org/guestfs v1.0.0
|
||||
@@ -19,8 +19,10 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
|
||||
EXTRA_DIST = \
|
||||
LICENSE \
|
||||
create-disk.go \
|
||||
inspect-vm.go \
|
||||
create-disk/go.mod \
|
||||
create-disk/create-disk.go \
|
||||
inspect-vm/go.mod \
|
||||
inspect-vm/inspect-vm.go \
|
||||
guestfs-golang.pod
|
||||
|
||||
man_MANS = guestfs-golang.3
|
||||
@@ -28,13 +30,14 @@ noinst_DATA = $(top_builddir)/website/guestfs-golang.3.html
|
||||
|
||||
guestfs-golang.3 $(top_builddir)/website/guestfs-golang.3.html: stamp-guestfs-golang.pod
|
||||
|
||||
stamp-guestfs-golang.pod: guestfs-golang.pod create-disk.go inspect-vm.go
|
||||
stamp-guestfs-golang.pod: guestfs-golang.pod \
|
||||
create-disk/create-disk.go inspect-vm/inspect-vm.go
|
||||
$(PODWRAPPER) \
|
||||
--section 3 \
|
||||
--man guestfs-golang.3 \
|
||||
--html $(top_builddir)/website/guestfs-golang.3.html \
|
||||
--verbatim $(srcdir)/create-disk.go:@EXAMPLE1@ \
|
||||
--verbatim $(srcdir)/inspect-vm.go:@EXAMPLE2@ \
|
||||
--verbatim $(srcdir)/create-disk/create-disk.go:@EXAMPLE1@ \
|
||||
--verbatim $(srcdir)/inspect-vm/inspect-vm.go:@EXAMPLE2@ \
|
||||
--license examples \
|
||||
$<
|
||||
touch $@
|
||||
|
||||
4
golang/examples/create-disk/go.mod
Normal file
4
golang/examples/create-disk/go.mod
Normal file
@@ -0,0 +1,4 @@
|
||||
module main
|
||||
|
||||
replace libguestfs.org/guestfs => ../../src/libguestfs.org/guestfs
|
||||
require libguestfs.org/guestfs v1.0.0
|
||||
4
golang/examples/inspect-vm/go.mod
Normal file
4
golang/examples/inspect-vm/go.mod
Normal file
@@ -0,0 +1,4 @@
|
||||
module main
|
||||
|
||||
replace libguestfs.org/guestfs => ../../src/libguestfs.org/guestfs
|
||||
require libguestfs.org/guestfs v1.0.0
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
$GOLANG run $srcdir/bindtests.go > bindtests.tmp
|
||||
diff -u $srcdir/../bindtests bindtests.tmp
|
||||
cd $srcdir/bindtests
|
||||
$GOLANG run bindtests.go > bindtests.tmp
|
||||
diff -u $srcdir/../../bindtests bindtests.tmp
|
||||
rm bindtests.tmp
|
||||
|
||||
@@ -18,4 +18,6 @@
|
||||
|
||||
set -e
|
||||
|
||||
$GOLANG test $pkg
|
||||
cd src/$pkg
|
||||
|
||||
$GOLANG test
|
||||
|
||||
4
golang/src/libguestfs.org/guestfs/go.mod
Normal file
4
golang/src/libguestfs.org/guestfs/go.mod
Normal file
@@ -0,0 +1,4 @@
|
||||
module libguestfs.org/guestfs
|
||||
|
||||
// First version of golang with working module support.
|
||||
go 1.13
|
||||
Reference in New Issue
Block a user