Skip to content

Commit

Permalink
Add patches and build files for mupdf-git
Browse files Browse the repository at this point in the history
  • Loading branch information
baskerville committed Dec 10, 2018
1 parent d5f829a commit 2513017
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 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
61 changes: 61 additions & 0 deletions 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.

0 comments on commit 2513017

Please sign in to comment.