add create-libguestfs-module.sh

master
Max Erenberg 3 months ago
parent d7cc9610f3
commit 1f2428f804
  1. 1
      Makefile
  2. 5
      README.md
  3. 14
      scripts/create-libguestfs-module.sh
  4. 4
      scripts/download-deps.sh

@ -17,6 +17,7 @@ guestfish:
deps:
scripts/download-deps.sh
scripts/create-libguestfs-module.sh
guestfish-deps:
scripts/download-guestfish-deps.sh

@ -5,7 +5,8 @@ cloudbuild downloads, modifies and uploads VM templates for the CSC cloud
## Installing dependencies
If you have root access, run
```sh
apt install golang-guestfs-dev
sudo apt install golang-guestfs-dev
scripts/create-libguestfs-module.sh
```
Otherwise, run
@ -20,7 +21,7 @@ for guestfs.
If you have root access, run
```sh
apt install libguestfs-tools
sudo apt install libguestfs-tools
```
Otherwise, run

@ -0,0 +1,14 @@
#!/bin/bash
set -ex
DEPS_DIR=
if ! [ -d /usr/share/gocode/src/libguestfs.org/guestfs ]; then
DEPS_DIR=guestfs/deps
fi
mkdir -p guestfs
cp $DEPS_DIR/usr/share/gocode/src/libguestfs.org/guestfs/guestfs.go guestfs/
cp $DEPS_DIR/usr/include/guestfs.h guestfs/
cd guestfs
rm -f go.mod
go mod init guestfs

@ -62,7 +62,3 @@ for dep in "${dependencies[@]}"; do
done
set -x
rm -f *.deb
cp deps/usr/share/gocode/src/libguestfs.org/guestfs/guestfs.go .
cp deps/usr/include/guestfs.h .
go mod init guestfs

Loading…
Cancel
Save