aboutsummaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2017-02-07 21:39:59 +0800
committertijl <tijl@FreeBSD.org>2017-02-07 21:39:59 +0800
commit25fec6dfe3d7c0fb622be7fb88046c205f3448d9 (patch)
tree0c4f6ad1e8fb99ead456185d07fac47432f49d40 /graphics
parent807993c64fe05d0d01e249f1b3128360c764a5d2 (diff)
downloadfreebsd-ports-gnome-25fec6dfe3d7c0fb622be7fb88046c205f3448d9.tar.gz
freebsd-ports-gnome-25fec6dfe3d7c0fb622be7fb88046c205f3448d9.tar.zst
freebsd-ports-gnome-25fec6dfe3d7c0fb622be7fb88046c205f3448d9.zip
Patch graphics/mupdf to build shared libraries instead of static ones.
Because the libraries are faily big this significantly reduces the size of programs linking to it. Use PORTVERSION as the library version because upstream does not guarantee compatibility between any two versions. Add an upstream patch to graphics/llpp to fix brightness increase key. PR: 216823 Submitted by: Tobias Kortkamp <t@tobik.me> (maintainer of llpp) Approved by: Zsolt Udvari <udvzsolt@gmail.com> (maintainer) Obtained from: OpenBSD
Diffstat (limited to 'graphics')
-rw-r--r--graphics/llpp/Makefile10
-rw-r--r--graphics/llpp/files/patch-build.sh2
-rw-r--r--graphics/llpp/files/patch-main.ml15
-rw-r--r--graphics/mupdf/Makefile21
-rw-r--r--graphics/mupdf/files/patch-Makefile23
-rw-r--r--graphics/mupdf/pkg-plist8
-rw-r--r--graphics/zathura-pdf-mupdf/Makefile12
7 files changed, 65 insertions, 26 deletions
diff --git a/graphics/llpp/Makefile b/graphics/llpp/Makefile
index 915056517b6b..04d2b04db896 100644
--- a/graphics/llpp/Makefile
+++ b/graphics/llpp/Makefile
@@ -3,6 +3,7 @@
PORTNAME= llpp
PORTVERSION= 25
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= http://repo.or.cz/llpp.git/snapshot/
DISTNAME= v${PORTVERSION}
@@ -12,20 +13,19 @@ MAINTAINER= t@tobik.me
COMMENT= PDF pager
# llpp itself is in the public domain, but it bundles lablGL which
-# uses a BSD 3-clause license and statically links to mupdf which is
-# AGPLv3 licensed.
-LICENSE= PUBLIC_DOMAIN BSD3CLAUSE AGPLv3
+# uses a BSD 3-clause license
+LICENSE= PUBLIC_DOMAIN BSD3CLAUSE
LICENSE_COMB= multi
LICENSE_NAME_PUBLIC_DOMAIN= Public Domain
LICENSE_FILE_PUBLIC_DOMAIN= ${WRKSRC}/README
LICENSE_PERMS_PUBLIC_DOMAIN= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
-BUILD_DEPENDS= gsed:textproc/gsed \
- ${LOCALBASE}/lib/libmupdf_pic.a:graphics/mupdf
+BUILD_DEPENDS= gsed:textproc/gsed
LIB_DEPENDS= libcurl.so:ftp/curl \
libfreetype.so:print/freetype2 \
libharfbuzz.so:print/harfbuzz \
libjbig2dec.so:graphics/jbig2dec \
+ libmupdf.so:graphics/mupdf \
libopenjp2.so:graphics/openjpeg
RUN_DEPENDS= xsel:x11/xsel-conrad
diff --git a/graphics/llpp/files/patch-build.sh b/graphics/llpp/files/patch-build.sh
index 14613ebcd5f2..24bb55a3c44f 100644
--- a/graphics/llpp/files/patch-build.sh
+++ b/graphics/llpp/files/patch-build.sh
@@ -35,4 +35,4 @@
$comp -c $mloptgl -I $builddir -o $builddir/main$osu $srcdir/main.ml
$comp -c $mlopt -I $builddir -o $builddir/wsi$osu $srcdir/wsi.ml
-$comp -g $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-lGL -lX11 -lmupdf -lmupdfthird -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o"
-+$comp $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-L${LOCALBASE}/lib -lGL -lX11 -lmupdf_pic -lmupdfthird_pic -lharfbuzz -lz -lfreetype -ljpeg -ljbig2dec -lopenjp2 -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o"
++$comp $lfl -I lablGL -o $builddir/llpp unix$asu str$asu $builddir/help$osu $builddir/lablGL/raw$osu $builddir/utils$osu $builddir/parser$osu $builddir/lablGL/glMisc$osu $builddir/wsi$osu $builddir/lablGL/gl$osu $builddir/lablGL/glMat$osu $builddir/lablGL/glFunc$osu $builddir/lablGL/glClear$osu $builddir/lablGL/glPix$osu $builddir/lablGL/glTex$osu $builddir/lablGL/glDraw$osu $builddir/config$osu $builddir/lablGL/glArray$osu $builddir/main$osu $builddir/link.o -cclib "-L${LOCALBASE}/lib -lGL -lX11 -lmupdf -lmupdfthird -lharfbuzz -lz -lfreetype -ljpeg -ljbig2dec -lopenjp2 -lpthread -L$srcdir/mupdf/build/native -lcrypto $builddir/lablGL/ml_gl.o $builddir/lablGL/ml_glarray.o $builddir/lablGL/ml_raw.o"
diff --git a/graphics/llpp/files/patch-main.ml b/graphics/llpp/files/patch-main.ml
new file mode 100644
index 000000000000..7b88a7874f8d
--- /dev/null
+++ b/graphics/llpp/files/patch-main.ml
@@ -0,0 +1,15 @@
+Fix brightness increase key
+
+Upstream commit: 35113fbe37a385e8a886288a86cf970ac85e742e
+
+--- main.ml.orig 2017-02-01 01:49:58 UTC
++++ main.ml
+@@ -5057,7 +5057,7 @@ let viewkeyboard key mask =
+
+ | Ascii ('['|']' as c) ->
+ conf.colorscale <-
+- bound (conf.colorscale +. (if c = '>' then 0.1 else -0.1)) 0.0 1.0;
++ bound (conf.colorscale +. (if c = ']' then 0.1 else -0.1)) 0.0 1.0;
+ G.postRedisplay "brightness";
+
+ | Ascii 'c' when state.mode = View ->
diff --git a/graphics/mupdf/Makefile b/graphics/mupdf/Makefile
index 17244ea77bd1..9c9af791644d 100644
--- a/graphics/mupdf/Makefile
+++ b/graphics/mupdf/Makefile
@@ -4,6 +4,7 @@
PORTNAME= mupdf
PORTVERSION= 1.10a
DISTVERSIONSUFFIX= -source
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= graphics
MASTER_SITES= http://www.mupdf.com/downloads/ \
@@ -21,12 +22,14 @@ LIB_DEPENDS= libcurl.so:ftp/curl \
libjbig2dec.so:graphics/jbig2dec \
libopenjp2.so:graphics/openjpeg
-CFLAGS+= -I${WRKSRC}/include/mupdf
+CFLAGS+= -I${WRKSRC}/include/mupdf -fPIC
LIBS+= -L${LOCALBASE}/lib
-MAKE_ARGS= build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes
+MAKE_ARGS= build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes \
+ SOVERSION=${PORTVERSION}
USES= cpe compiler:c++11-lang gmake jpeg pkgconfig
USE_XORG= x11 xcursor xext xinerama xrandr
USE_GL= gl
+USE_LDCONFIG= yes
CPE_VENDOR= artifex
@@ -40,6 +43,8 @@ JS_LIB_DEPENDS= libv8.so:lang/v8
JS_MAKE_ARGS= V8_PRESENT=1 V8LIBS=-lv8
SCROLL_EXTRA_PATCHES= ${FILESDIR}/scroll_hack-platform__x11__pdfapp.c
+PLIST_SUB= SOVERSION=${PORTVERSION}
+
post-patch:
@${REINPLACE_CMD} -e 's/-pipe -O2 //' \
-e 's|/usr/local|${LOCALBASE}|' \
@@ -53,15 +58,11 @@ post-patch:
${WRKSRC}/thirdparty/openjpeg \
${WRKSRC}/thirdparty/zlib
-post-build:
- (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
- ${MAKEFILE} ${MAKE_ARGS} OUT=build/pic XCFLAGS=-fpic libs)
-
post-install:
- ${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdf.a \
- ${STAGEDIR}${PREFIX}/lib/libmupdf_pic.a
- ${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdfthird.a \
- ${STAGEDIR}${PREFIX}/lib/libmupdfthird_pic.a
${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 ${STAGEDIR}${PREFIX}/bin/mupdf
+ ${LN} -s libmupdf.so.${PORTVERSION} \
+ ${STAGEDIR}${PREFIX}/lib/libmupdf.so
+ ${LN} -s libmupdfthird.so.${PORTVERSION} \
+ ${STAGEDIR}${PREFIX}/lib/libmupdfthird.so
.include <bsd.port.mk>
diff --git a/graphics/mupdf/files/patch-Makefile b/graphics/mupdf/files/patch-Makefile
new file mode 100644
index 000000000000..0d2857e150c3
--- /dev/null
+++ b/graphics/mupdf/files/patch-Makefile
@@ -0,0 +1,23 @@
+$OpenBSD: patch-Makefile,v 1.12 2016/12/12 10:54:39 sthen Exp $
+--- Makefile.orig 2016-11-28 13:34:04 UTC
++++ Makefile
+@@ -152,14 +152,17 @@ $(FONT_GEN_SIL) : $(FONT_BIN_SIL)
+
+ # --- Library ---
+
+-MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdfthird.a
++MUPDF_LIB = libmupdf.so.$(SOVERSION)
++THIRD_LIB = libmupdfthird.so.$(SOVERSION)
+
+ MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(SVG_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
+ THIRD_OBJ := $(FREETYPE_OBJ) $(HARFBUZZ_OBJ) $(JBIG2DEC_OBJ) $(JPEG_OBJ) $(JPEGXR_OBJ) $(LURATECH_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
+
+ $(MUPDF_LIB) : $(MUPDF_OBJ)
++ $(CC) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $^ $(LIBS)
++
+ $(THIRD_LIB) : $(THIRD_OBJ)
++ $(CC) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $^ $(LIBS)
+
+ INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
+
diff --git a/graphics/mupdf/pkg-plist b/graphics/mupdf/pkg-plist
index dfb70a33cb69..6d163705a787 100644
--- a/graphics/mupdf/pkg-plist
+++ b/graphics/mupdf/pkg-plist
@@ -80,10 +80,10 @@ include/mupdf/pdf/resource.h
include/mupdf/pdf/widget.h
include/mupdf/pdf/xref.h
include/mupdf/svg.h
-lib/libmupdf.a
-lib/libmupdfthird.a
-lib/libmupdfthird_pic.a
-lib/libmupdf_pic.a
+lib/libmupdf.so
+lib/libmupdf.so.%%SOVERSION%%
+lib/libmupdfthird.so
+lib/libmupdfthird.so.%%SOVERSION%%
man/man1/mupdf.1.gz
man/man1/mutool.1.gz
%%PORTDOCS%%%%DOCSDIR%%/CHANGES
diff --git a/graphics/zathura-pdf-mupdf/Makefile b/graphics/zathura-pdf-mupdf/Makefile
index bb1929f54875..75285840e8ad 100644
--- a/graphics/zathura-pdf-mupdf/Makefile
+++ b/graphics/zathura-pdf-mupdf/Makefile
@@ -3,6 +3,7 @@
PORTNAME= zathura-pdf-mupdf
PORTVERSION= 0.3.1
+PORTREVISION= 1
CATEGORIES= graphics
MASTER_SITES= https://pwmt.org/projects/zathura-pdf-mupdf/download/ \
http://www.madpilot.net/~mad/pwmt.org/
@@ -13,19 +14,18 @@ COMMENT= MuPDF render PDF plugin for Zathura PDF viewer
LICENSE= ZLIB
LICENSE_FILE= ${WRKSRC}/LICENSE
-BUILD_DEPENDS= zathura:graphics/zathura \
- mupdf>=1.8,1:graphics/mupdf
+BUILD_DEPENDS= zathura:graphics/zathura
RUN_DEPENDS= zathura:graphics/zathura
LIB_DEPENDS= libjbig2dec.so:graphics/jbig2dec \
libfreetype.so:print/freetype2 \
+ libgirara-gtk3.so:x11-toolkits/girara \
libharfbuzz.so:print/harfbuzz \
- libopenjp2.so:graphics/openjpeg \
- libgirara-gtk3.so:x11-toolkits/girara
+ libmupdf.so:graphics/mupdf \
+ libopenjp2.so:graphics/openjpeg
PLIST_FILES= lib/zathura/pdf.so share/applications/zathura-pdf-mupdf.desktop
-MAKE_ARGS= MUPDF_LIB="-lmupdf_pic -lmupdfthird_pic" OPENSSL_INC=-I${OPENSSLINC} \
- OPENSSL_LIB="-L${OPENSSLLIB} -lcrypto"
+MAKE_ARGS= OPENSSL_INC=-I${OPENSSLINC} OPENSSL_LIB="-L${OPENSSLLIB} -lcrypto"
USES= compiler:c11 desktop-file-utils gmake gettext jpeg pkgconfig ssl
USE_GNOME= cairo gdkpixbuf2 glib20 gtk30