Commit 2dcade9f authored by Kan-Ru Chen's avatar Kan-Ru Chen

More FTCBFS patches

Thanks: Helmut Grohne for the patches.
Closes: 903319
parent f2ad7468
From: Kan-Ru Chen <kanru@kanru.info>
Date: Mon, 3 Sep 2018 08:51:04 +0900
Subject: MuPDF crossbuild use target arch pkg-config
mupdf fails to cross build, because it uses the build architecture
pkg-config and thus fails to find a pile of .pc files.
---
Makerules | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/Makerules b/Makerules
index 9f06b98..2e5bbce 100644
--- a/Makerules
+++ b/Makerules
@@ -6,6 +6,8 @@ OS := $(OS:MSYS%=MINGW)
OS := $(OS:Windows_NT=MINGW)
OS := $(OS:Darwin=MACOS)
+PKG_CONFIG ?= pkg-config
+
HAVE_LIBDL ?= yes
CFLAGS += -Wall -Wdeclaration-after-statement
@@ -100,43 +102,43 @@ HAVE_GLUT := yes
SYS_GLUT_CFLAGS :=
SYS_GLUT_LIBS := -lglut -lGL
-ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
+ifeq "$(shell $(PKG_CONFIG) --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
HAVE_LIBCRYPTO := yes
-SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
-SYS_LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell $(PKG_CONFIG) --cflags libcrypto)
+SYS_LIBCRYPTO_LIBS := $(shell $(PKG_CONFIG) --libs libcrypto)
endif
-ifeq "$(shell pkg-config --exists libcurl && echo yes)" "yes"
+ifeq "$(shell $(PKG_CONFIG) --exists libcurl && echo yes)" "yes"
HAVE_CURL := yes
-SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
-SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
-ifeq "$(shell pkg-config --exists openssl && echo yes)" "yes"
+SYS_CURL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libcurl)
+SYS_CURL_LIBS := $(shell $(PKG_CONFIG) --libs libcurl)
+ifeq "$(shell $(PKG_CONFIG) --exists openssl && echo yes)" "yes"
HAVE_OPENSSL_SSL := yes
-SYS_CURL_CFLAGS += $(shell pkg-config --cflags openssl)
-SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
+SYS_CURL_CFLAGS += $(shell $(PKG_CONFIG) --cflags openssl)
+SYS_CURL_DEPS += $(shell $(PKG_CONFIG) --libs openssl)
endif
endif
SYS_CURL_DEPS += -lpthread -lrt
-ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
+ifeq "$(shell $(PKG_CONFIG) --exists x11 xext && echo yes)" "yes"
HAVE_X11 := yes
-SYS_X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
-SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
+SYS_X11_CFLAGS := $(shell $(PKG_CONFIG) --cflags x11 xext)
+SYS_X11_LIBS := $(shell $(PKG_CONFIG) --libs x11 xext)
endif
-ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes"
-SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
-SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
+ifeq "$(shell $(PKG_CONFIG) --exists harfbuzz && echo yes)" "yes"
+SYS_HARFBUZZ_CFLAGS := $(shell $(PKG_CONFIG) --cflags harfbuzz)
+SYS_HARFBUZZ_LIBS := $(shell $(PKG_CONFIG) --libs harfbuzz)
endif
-ifeq "$(shell pkg-config --exists freetype2 && echo yes)" "yes"
-SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
-SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
+ifeq "$(shell $(PKG_CONFIG) --exists freetype2 && echo yes)" "yes"
+SYS_FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
+SYS_FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
endif
-ifeq "$(shell pkg-config --exists libopenjp2 && echo yes)" "yes"
-SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
-SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
+ifeq "$(shell $(PKG_CONFIG) --exists libopenjp2 && echo yes)" "yes"
+SYS_OPENJPEG_CFLAGS := $(shell $(PKG_CONFIG) --cflags libopenjp2)
+SYS_OPENJPEG_LIBS := $(shell $(PKG_CONFIG) --libs libopenjp2)
endif
SYS_JBIG2DEC_LIBS := -ljbig2dec
From: Kan-Ru Chen <kanru@kanru.info>
Date: Mon, 3 Sep 2018 08:53:44 +0900
Subject: MuPDF crossbuild use host cc for utils
---
Makefile | 4 ++++
Makerules | 1 +
2 files changed, 5 insertions(+)
diff --git a/Makefile b/Makefile
index 98e6567..3002bb5 100644
--- a/Makefile
+++ b/Makefile
@@ -180,6 +180,8 @@ $(SIGNATURE_OBJ) : $(PKCS7_HDR)
# --- Generated PDF name tables ---
NAMEDUMP_EXE := $(OUT)/scripts/namedump.exe
+$(NAMEDUMP_EXE): scripts/namedump.c | $(ALL_DIR)
+ $(QUIET_CC) $(CC_FOR_BUILD) $(CFLAGS) $< -o $@
include/mupdf/pdf.h : include/mupdf/pdf/name-table.h
NAME_GEN := include/mupdf/pdf/name-table.h source/pdf/pdf-name-table.h
@@ -197,6 +199,8 @@ generate: $(NAME_GEN)
# --- Generated embedded font files ---
HEXDUMP_EXE := $(OUT)/scripts/hexdump.exe
+$(HEXDUMP_EXE): scripts/hexdump.c | $(ALL_DIR)
+ $(QUIET_CC) $(CC_FOR_BUILD) $(CFLAGS) -o $@ $<
FONT_BIN_DROID := $(sort $(wildcard resources/fonts/droid/*.ttf))
FONT_BIN_NOTO := $(sort $(wildcard resources/fonts/noto/*.ttf))
diff --git a/Makerules b/Makerules
index 2e5bbce..fed3ce6 100644
--- a/Makerules
+++ b/Makerules
@@ -7,6 +7,7 @@ OS := $(OS:Windows_NT=MINGW)
OS := $(OS:Darwin=MACOS)
PKG_CONFIG ?= pkg-config
+CC_FOR_BUILD ?= $(CC)
HAVE_LIBDL ?= yes
......@@ -2,3 +2,5 @@
0003-Sort-files-in-static-library-to-make-the-build-repro.patch
0003-use-debian-flavor-build-options.patch
0004-Bug-699271-Fix-eternal-loop-when-skipping-space-befo.patch
0005-MuPDF-crossbuild-use-target-arch-pkg-config.patch
0006-MuPDF-crossbuild-use-host-cc-for-utils.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment