Source: lsp-plugins Version: 1.1.30-1 Tags: patch User: debian-cr...@lists.debian.org Usertags: ftcbfs
lsp-plugins fails to cross build from source, becaue it uses the build architecture ld and pkg-config. For ld, dh_auto_build does not pass a cross tool as the use of LD variable is inconsistent across upstream projects. pkg-config instead is hard coded in the upstream build system. The attached patch addresses both, but it does not make lsp-plugins cross buildable, because lsp-plugins builds some build tools and fails running them with an Exec format error (e.g. gen_resources.exe or gen_php.exe). I suppose more thought is required for fixing these. Please consider applying my patch as an incremental improvement and close this bug when doing so. Helmut
diff --minimal -Nru lsp-plugins-1.1.30/debian/changelog lsp-plugins-1.1.30/debian/changelog --- lsp-plugins-1.1.30/debian/changelog 2021-08-19 12:50:50.000000000 +0200 +++ lsp-plugins-1.1.30/debian/changelog 2021-11-20 12:54:14.000000000 +0100 @@ -1,3 +1,10 @@ +lsp-plugins (1.1.30-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Improve cross building: Use the host arch ld and pkg-config. (Closes: #-1) + + -- Helmut Grohne <hel...@subdivi.de> Sat, 20 Nov 2021 12:54:14 +0100 + lsp-plugins (1.1.30-1) unstable; urgency=medium * Provide the lsp-plugins-r3d-glx package, diff --minimal -Nru lsp-plugins-1.1.30/debian/patches/cross.patch lsp-plugins-1.1.30/debian/patches/cross.patch --- lsp-plugins-1.1.30/debian/patches/cross.patch 1970-01-01 01:00:00.000000000 +0100 +++ lsp-plugins-1.1.30/debian/patches/cross.patch 2021-11-20 12:54:14.000000000 +0100 @@ -0,0 +1,58 @@ +--- lsp-plugins-1.1.30.orig/scripts/make/configure.mk ++++ lsp-plugins-1.1.30/scripts/make/configure.mk +@@ -131,17 +131,17 @@ + export ICONV_LIBS = -liconv + export MATH_LIBS = -lm + export DL_LIBS = -ldl +- export CAIRO_HEADERS = $(shell pkg-config --cflags cairo) +- export CAIRO_LIBS = $(shell pkg-config --libs cairo) +- export XLIB_HEADERS = $(shell pkg-config --cflags x11) +- export XLIB_LIBS = $(shell pkg-config --libs x11) +- export LV2_HEADERS = $(shell pkg-config --cflags lv2) +- export LV2_LIBS = $(shell pkg-config --libs lv2) +- export SNDFILE_HEADERS = $(shell pkg-config --cflags sndfile) +- export SNDFILE_LIBS = $(shell pkg-config --libs sndfile) +- export JACK_HEADERS = $(shell pkg-config --cflags jack) +- export JACK_LIBS = $(shell pkg-config --libs jack) +- export OPENGL_HEADERS = $(shell pkg-config --cflags gl 2>/dev/null || echo "") +- export OPENGL_LIBS = $(shell pkg-config --libs gl 2>/dev/null || echo "") ++ export CAIRO_HEADERS = $(shell $(PKG_CONFIG) --cflags cairo) ++ export CAIRO_LIBS = $(shell $(PKG_CONFIG) --libs cairo) ++ export XLIB_HEADERS = $(shell $(PKG_CONFIG) --cflags x11) ++ export XLIB_LIBS = $(shell $(PKG_CONFIG) --libs x11) ++ export LV2_HEADERS = $(shell $(PKG_CONFIG) --cflags lv2) ++ export LV2_LIBS = $(shell $(PKG_CONFIG) --libs lv2) ++ export SNDFILE_HEADERS = $(shell $(PKG_CONFIG) --cflags sndfile) ++ export SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile) ++ export JACK_HEADERS = $(shell $(PKG_CONFIG) --cflags jack) ++ export JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack) ++ export OPENGL_HEADERS = $(shell $(PKG_CONFIG) --cflags gl 2>/dev/null || echo "") ++ export OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl 2>/dev/null || echo "") + endif + +--- lsp-plugins-1.1.30.orig/scripts/make/tools.mk ++++ lsp-plugins-1.1.30/scripts/make/tools.mk +@@ -3,6 +3,7 @@ + TOOL_CC = gcc + TOOL_CXX = g++ + TOOL_PHP = php ++TOOL_PKG_CONFIG = pkg-config + + # Setup preferred flags + FLAG_RELRO = -Wl,-z,relro,-z,now +@@ -24,6 +25,7 @@ + CXX ?= $(TOOL_CXX) + PHP ?= $(TOOL_PHP) + LD ?= $(TOOL_LD) ++PKG_CONFIG ?= $(TOOL_PKG_CONFIG) + + MAKE_OPTS = -s + CFLAGS += $(CC_ARCH) $(FLAG_CTUNE) $(CC_FLAGS) $(FLAG_VERSION) +@@ -61,6 +63,7 @@ + export CXX + export PHP + export LD ++export PKG_CONFIG + + export MAKE_OPTS + export CFLAGS diff --minimal -Nru lsp-plugins-1.1.30/debian/patches/series lsp-plugins-1.1.30/debian/patches/series --- lsp-plugins-1.1.30/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ lsp-plugins-1.1.30/debian/patches/series 2021-11-20 12:52:02.000000000 +0100 @@ -0,0 +1 @@ +cross.patch diff --minimal -Nru lsp-plugins-1.1.30/debian/rules lsp-plugins-1.1.30/debian/rules --- lsp-plugins-1.1.30/debian/rules 2021-08-18 23:41:28.000000000 +0200 +++ lsp-plugins-1.1.30/debian/rules 2021-11-20 12:54:12.000000000 +0100 @@ -3,6 +3,7 @@ export PREFIX=/usr include /usr/share/dpkg/architecture.mk +-include /usr/share/dpkg/buildtools.mk ifeq ($(DEB_HOST_ARCH),amd64) export BUILD_PROFILE=x86_64 endif @@ -18,6 +19,7 @@ ifeq ($(DEB_HOST_ARCH),armhf) export BUILD_PROFILE=armv7a endif +export LD ?= ld %: dh $@