Source: conmon Version: 0.3.0-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
conmon fails to cross build from source, because the upstream Makefile hard codes the build architecture pkg-config. After making it substitutable, conmon cross builds successfully. Please consider applying the attached patch. Helmut
--- conmon-0.3.0.orig/Makefile +++ conmon-0.3.0/Makefile @@ -3,6 +3,7 @@ BINDIR ?= ${PREFIX}/bin LIBEXECDIR ?= ${PREFIX}/libexec GO ?= go +PKG_CONFIG ?= pkg-config PROJECT := github.com/containers/conmon @@ -23,10 +24,10 @@ $(eval GIT_BRANCH_CLEAN := unknown) endif -override LIBS += $(shell pkg-config --libs glib-2.0) +override LIBS += $(shell $(PKG_CONFIG) --libs glib-2.0) CFLAGS ?= -std=c99 -Os -Wall -Wextra -Werror -override CFLAGS += $(shell pkg-config --cflags glib-2.0) -DVERSION=\"$(VERSION)\" -DGIT_COMMIT=\"$(GIT_COMMIT)\" +override CFLAGS += $(shell $(PKG_CONFIG) --cflags glib-2.0) -DVERSION=\"$(VERSION)\" -DGIT_COMMIT=\"$(GIT_COMMIT)\" # Conditionally compile journald logging code if the libraries can be found # if they can be found, set USE_JOURNALD macro for use in conmon code. @@ -34,12 +35,12 @@ # "pkg-config --exists" will error if the package doesn't exist. Make can only compare # output of commands, so the echo commands are to allow pkg-config to error out, make to catch it, # and allow the compilation to complete. -ifeq ($(shell pkg-config --exists libsystemd-journal && echo "0" || echo "1"), 0) - override LIBS += $(shell pkg-config --libs libsystemd-journal) - override CFLAGS += $(shell pkg-config --cflags libsystemd-journal) -D USE_JOURNALD=0 -else ifeq ($(shell pkg-config --exists libsystemd && echo "0" || echo "1"), 0) - override LIBS += $(shell pkg-config --libs libsystemd) - override CFLAGS += $(shell pkg-config --cflags libsystemd) -D USE_JOURNALD=0 +ifeq ($(shell $(PKG_CONFIG) --exists libsystemd-journal && echo "0" || echo "1"), 0) + override LIBS += $(shell $(PKG_CONFIG) --libs libsystemd-journal) + override CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd-journal) -D USE_JOURNALD=0 +else ifeq ($(shell $(PKG_CONFIG) --exists libsystemd && echo "0" || echo "1"), 0) + override LIBS += $(shell $(PKG_CONFIG) --libs libsystemd) + override CFLAGS += $(shell $(PKG_CONFIG) --cflags libsystemd) -D USE_JOURNALD=0 endif bin/conmon: src/conmon.o src/cmsg.o src/ctr_logging.o src/utils.o | bin