From 2513017bb1022fa603271a3e7380e82edd95e575 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Mon, 10 Dec 2018 22:19:47 +0100 Subject: [PATCH] Add patches and build files for mupdf-git --- thirdparty/mupdf-git/build-kobo.sh | 8 ++++ thirdparty/mupdf-git/kobo.patch | 61 ++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100755 thirdparty/mupdf-git/build-kobo.sh create mode 100644 thirdparty/mupdf-git/kobo.patch diff --git a/thirdparty/mupdf-git/build-kobo.sh b/thirdparty/mupdf-git/build-kobo.sh new file mode 100755 index 00000000..a43f8aba --- /dev/null +++ b/thirdparty/mupdf-git/build-kobo.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +[ -e thirdparty/README ] && rm -rf thirdparty/* + +make verbose=yes generate +make verbose=yes USE_SYSTEM_LIBS=yes OS=kobo + +arm-linux-gnueabihf-gcc -Wl,--gc-sections -Wl,-s -o build/release/libmupdf.so $(find build/release -name '*.o' | grep -Ev '(SourceHanSerif-Regular|DroidSansFallbackFull|color-lcms)') -lm -L../freetype2/objs/.libs -lfreetype -L../harfbuzz/src/.libs -lharfbuzz -L../jbig2dec/.libs -ljbig2dec -L../libjpeg/.libs -ljpeg -L../openjpeg/build/bin -lopenjp2 -L../zlib -lz -shared -Wl,-soname -Wl,libmupdf.so -Wl,--no-undefined diff --git a/thirdparty/mupdf-git/kobo.patch b/thirdparty/mupdf-git/kobo.patch new file mode 100644 index 00000000..eb0ed9e5 --- /dev/null +++ b/thirdparty/mupdf-git/kobo.patch @@ -0,0 +1,61 @@ +diff --git a/Makefile b/Makefile +index 97ccf19..c16892f 100644 +--- a/Makefile ++++ b/Makefile +@@ -200,7 +200,7 @@ $(THIRD_LIB) : $(THIRD_OBJ) + $(THREAD_LIB) : $(THREAD_OBJ) + $(PKCS7_LIB) : $(PKCS7_OBJ) + +-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) ++INSTALL_LIBS := $(MUPDF_LIB) + + # --- Main tools and viewers --- + +@@ -383,7 +383,7 @@ cscope.files: $(shell find include source platform -name '*.[ch]') + cscope.out: cscope.files + cscope -b + +-all: libs apps ++all: libs + + clean: + rm -rf $(OUT) +diff --git a/Makerules b/Makerules +index b62374d..c8a0580 100644 +--- a/Makerules ++++ b/Makerules +@@ -184,6 +184,34 @@ ifeq "$(OS)" "mingw64-cross" + HAVE_WIN32=yes + endif + ++ifeq "$(OS)" "kobo" ++CC = arm-linux-gnueabihf-gcc ++CXX = arm-linux-gnueabihf-gcc++ ++LD = arm-linux-gnueabihf-ld ++AR = arm-linux-gnueabihf-ar ++AS = arm-linux-gnueabihf-as ++CFLAGS += -O2 -fPIC -mcpu=cortex-a9 -mfpu=neon -DTOFU_CJK_LANG -DTOFU_CJK_EXT -DFZ_ENABLE_ICC=0 -DFZ_ENABLE_JS=0 ++CROSSCOMPILE=yes ++HAVE_PTHREAD := yes ++HAVE_LIBCRYPTO := no ++HAVE_X11 := no ++HAVE_GLFW := no ++SYS_PTHREAD_CFLAGS := ++SYS_PTHREAD_LIBS := -lpthread ++SYS_FREETYPE_CFLAGS := -I../freetype2/include ++SYS_FREETYPE_LIBS := -L../freetype2/objs/.libs -lfreetype ++SYS_HARFBUZZ_CFLAGS := -I../harfbuzz/src ++SYS_HARFBUZZ_LIBS := -L../harfbuzz/src/.libs -lharfbuzz ++SYS_OPENJPEG_CFLAGS := -I../openjpeg/src/lib/openjp2 ++SYS_OPENJPEG_LIBS := -L../openjpeg/build/bin -lopenjpeg ++SYS_JBIG2DEC_CFLAGS := -I../jbig2dec ++SYS_JBIG2DEC_LIBS := -L../jbig2dec/.libs -ljbig2dec ++SYS_LIBJPEG_CFLAGS := -I../libjpeg ++SYS_LIBJPEG_LIBS := -L../libjpeg/.libs -ljpeg ++SYS_ZLIB_CFLAGS := -I../zlib ++SYS_ZLIB_LIBS := -L../zlib -lz ++endif ++ + # Most variables when building for iOS are set up in ios/build_libs.sh, + # which is called from the Xcode project as a "Run Script" build step. + # The following section works for both device and simulator builds.