snap: apply patch in runtime to fix DESTDIR

This is a hotfix to fix https://github.com/kata-containers/runtime/pull/1162

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2019-01-25 07:50:36 -06:00
parent 526c5ffd76
commit 7c25b606ba
2 changed files with 31 additions and 0 deletions

27
snap/1162-runtime.patch Normal file
View File

@ -0,0 +1,27 @@
diff --git a/Makefile b/Makefile
index 1c11f74..9c4709b 100644
--- a/Makefile
+++ b/Makefile
@@ -248,11 +248,11 @@ ifeq (,$(findstring $(DEFAULT_HYPERVISOR),$(KNOWN_HYPERVISORS)))
endif
ifeq ($(DEFAULT_HYPERVISOR),$(HYPERVISOR_QEMU))
- DEFAULT_HYPERVISOR_CONFIG_PATH = $(CONFIG_PATH_QEMU)
+ DEFAULT_HYPERVISOR_CONFIG_FILE = $(CONFIG_FILE_QEMU)
endif
ifeq ($(DEFAULT_HYPERVISOR),$(HYPERVISOR_FC))
- DEFAULT_HYPERVISOR_CONFIG_PATH = $(CONFIG_PATH_FC)
+ DEFAULT_HYPERVISOR_CONFIG_FILE = $(CONFIG_FILE_FC)
endif
CONFDIR := $(DEFAULTSDIR)/$(PROJECT_DIR)
@@ -546,7 +546,7 @@ install-bin-libexec: $(BINLIBEXECLIST)
install-configs: $(CONFIGS)
$(QUIET_INST)$(foreach f,$(CONFIGS),$(call INSTALL_CONFIG,$f,$(dir $(CONFIG_PATH))))
- $(QUIET_INST)ln -sf $(DEFAULT_HYPERVISOR_CONFIG_PATH) $(CONFIG_PATH)
+ $(QUIET_INST)(cd $(dir $(DESTDIR)/$(CONFIG_PATH)) && ln -sf $(DEFAULT_HYPERVISOR_CONFIG_FILE) $(CONFIG_FILE))
install-scripts: $(SCRIPTS)
$(QUIET_INST)$(foreach f,$(SCRIPTS),$(call INSTALL_EXEC,$f,$(SCRIPTS_DIR)))

View File

@ -33,6 +33,7 @@ parts:
build-attributes: [no-patchelf]
override-build: |
pkg_name=runtime
patch1="$(realpath ../../../snap/1162-runtime.patch)"
# set GOPATH
export GOPATH=$(realpath go)
@ -46,6 +47,9 @@ parts:
git clone -b ${SNAPCRAFT_PROJECT_VERSION} https://github.com/kata-containers/${pkg_name} ${pkg_gopath}
cd ${pkg_gopath}
#Issue: https://github.com/kata-containers/runtime/pull/1162
patch -p1 < "${patch1}"
# build and install
make \
PREFIX=/snap/${SNAPCRAFT_PROJECT_NAME}/current/usr \