From 94d336f7d230647bad4e3fd7cb7913c99e8d1df6 Mon Sep 17 00:00:00 2001 From: Wolfgang Jenkner Date: Fri, 27 Nov 2020 12:30:50 +0100 Subject: [PATCH] Use bundled freeglut lib for mupdf It supports unicode input and the clipboard. Comment out FreeBSD specific joystick support bit rot. Make sure to include bundled freeglut headers (in case freeglut is installed sytem-wide). --- graphics/mupdf/Makefile | 9 ++++++--- graphics/mupdf/files/patch-Makerules | 2 +- graphics/mupdf/files/patch-Makethird | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 graphics/mupdf/files/patch-Makethird diff --git a/graphics/mupdf/Makefile b/graphics/mupdf/Makefile index f9bceaee67db..0a887a3500a2 100644 --- a/graphics/mupdf/Makefile +++ b/graphics/mupdf/Makefile @@ -22,8 +22,8 @@ LIB_DEPENDS= libcurl.so:ftp/curl \ libopenjp2.so:graphics/openjpeg USES= cpe compiler:c++11-lang gl gmake jpeg pkgconfig xorg -USE_XORG= x11 xcursor xext xinerama xrandr -USE_GL= gl glut +USE_XORG= ice x11 xcursor xext xi xinerama xrandr +USE_GL= gl glu USE_LDCONFIG= yes CPE_VENDOR= artifex @@ -33,7 +33,7 @@ CFLAGS+= `pkg-config --cflags libopenjp2` LDFLAGS+= `pkg-config --libs libjpeg libopenjp2` -ljbig2dec MAKE_ARGS= build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes \ - XCFLAGS+="-I${WRKSRC}/include/mupdf -fPIC" \ + XCFLAGS+="-I${WRKSRC}/include/mupdf -I${WRKSRC}/thirdparty/freeglut/include -fPIC" \ XLIBS+="-L${LOCALBASE}/lib -L${WRKSRC}/build/release" \ SOVERSION=${DISTVERSION} ALL_TARGET= all extra-libs @@ -52,6 +52,9 @@ PLIST_SUB= SOVERSION=${PORTVERSION} post-patch: @${REINPLACE_CMD} -e 's/-pipe -O2//' -e 's/-ldl//' ${WRKSRC}/Makerules + @(cd ${WRKSRC}/thirdparty/freeglut/src && \ + ${REINPLACE_CMD} -E 's/defined *\( *__FreeBSD(_kernel)?__ *\)/0/g' \ + fg_internal.h fg_joystick.c x11/fg_internal_x11.h x11/fg_joystick_x11.c) post-install: ${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 \ diff --git a/graphics/mupdf/files/patch-Makerules b/graphics/mupdf/files/patch-Makerules index 3878e5d9a25c..6bdebcaa050d 100644 --- a/graphics/mupdf/files/patch-Makerules +++ b/graphics/mupdf/files/patch-Makerules @@ -61,7 +61,7 @@ + SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2) + # glut + HAVE_GLUT := yes -+ USE_SYSTEM_GLUT := yes ++ USE_SYSTEM_GLUT := no + SYS_GLUT_CFLAGS := + SYS_GLUT_LIBS := -lglut -lGL + # harfbuzz diff --git a/graphics/mupdf/files/patch-Makethird b/graphics/mupdf/files/patch-Makethird new file mode 100644 index 000000000000..5328b12d52b5 --- /dev/null +++ b/graphics/mupdf/files/patch-Makethird @@ -0,0 +1,19 @@ +--- Makethird.orig 2020-11-21 14:51:06 UTC ++++ Makethird +@@ -436,6 +436,7 @@ GLUT_OBJ := $(GLUT_SRC:%.c=$(OUT)/%.o) + + LOCAL_GLUT_CFLAGS += -Ithirdparty/freeglut/include + LOCAL_GLUT_CFLAGS += -Ithirdparty/freeglut/src ++LOCAL_GLUT_CFLAGS += $(shell pkgconf --cflags gl) + LOCAL_GLUT_CFLAGS += -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_X11_EXTENSIONS_XRANDR_H + LOCAL_GLUT_CFLAGS += -Wno-sign-compare + +@@ -447,7 +448,7 @@ $(OUT)/thirdparty/freeglut/%.o: thirdpar + $(CC_CMD) $(LIB_CFLAGS) $(LOCAL_GLUT_CFLAGS) + + GLUT_CFLAGS := -Ithirdparty/freeglut/include +-GLUT_LIBS := -lGL -lX11 -lXrandr ++GLUT_LIBS := $(shell pkgconf --libs gl) -lX11 -lXrandr + + endif + -- 2.31.0