wok-next rev 20668

mupdf: up / fix build (1.13.0)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri May 11 13:08:01 2018 +0300 (2018-05-11)
parents f4db0f796bc3
children ede5a90b22f3
files mupdf/description.mupdf-gl.txt mupdf/description.mupdf-tools.txt mupdf/description.txt mupdf/receipt mupdf/stuff/mupdf.desktop mupdf/stuff/patches/series mupdf/stuff/patches/use_openjpeg_1.5.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mupdf/description.mupdf-gl.txt	Fri May 11 13:08:01 2018 +0300
     1.3 @@ -0,0 +1,3 @@
     1.4 +The OpenGL based viewer can read PDF, XPS, CBZ, EPUB, and FB2 documents. It
     1.5 +compiles on any platform that has a GLUT library. The latest release builds on
     1.6 +Linux, Windows, and MacOS.
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/mupdf/description.mupdf-tools.txt	Fri May 11 13:08:01 2018 +0300
     2.3 @@ -0,0 +1,27 @@
     2.4 +The command line tools are all gathered into one umbrella command: `mutool`.
     2.5 +
     2.6 +For rendering and converting documents there are three commands available:
     2.7 +
     2.8 +  * `mutool draw`: This is the more customizable tool, but also has a more
     2.9 +    difficult set of command line options. It is primarily used for rendering
    2.10 +    a document to image files.
    2.11 +  * `mutool convert`: This tool is used for converting documents into other
    2.12 +    formats, and is easier to use.
    2.13 +  * `mutool trace`: This is a debugging tool used for printing a trace of the
    2.14 +    graphics device calls on a page.
    2.15 +
    2.16 +There are also several tools specifically for working with PDF files:
    2.17 +
    2.18 +  * `mutool show`: A tool for displaying the internal objects in a PDF file.
    2.19 +  * `mutool extract`: Extract images and embedded font resources.
    2.20 +  * `mutool clean`: Rewrite PDF file. Used to fix broken files, or to make
    2.21 +    a PDF file human editable.
    2.22 +  * `mutool merge`: Merge pages from multiple input files into a new PDF.
    2.23 +  * `mutool create`: Create a new PDF file from a text file with graphics
    2.24 +    commands.
    2.25 +  * `mutool portfolio`: Manipulate PDF portfolios.
    2.26 +
    2.27 +And finally, there is a tool for doing anything you can imagine:
    2.28 +
    2.29 +  * `mutool run`: A tool for running Javascript programs with access to the
    2.30 +    MuPDF library functions.
     3.1 --- a/mupdf/description.txt	Fri May 11 09:27:12 2018 +0200
     3.2 +++ b/mupdf/description.txt	Fri May 11 13:08:01 2018 +0300
     3.3 @@ -1,11 +1,12 @@
     3.4 -The renderer in MuPDF is tailored for high quality anti-aliased graphics.
     3.5 -It renders text with metrics and spacing accurate to within fractions of a pixel
     3.6 -for the highest fidelity in reproducing the look of a printed page on screen.
     3.7 +MuPDF is an open source software framework for viewing and converting PDF, XPS,
     3.8 +and E-book documents. There are viewers for various platforms, several command
     3.9 +line tools, and a software library for building tools and applications.
    3.10  
    3.11 -MuPDF is also small, fast, and yet complete. It supports PDF 1.7 with
    3.12 -transparency, encryption, hyperlinks, annotations, searching and more. It also
    3.13 -reads XPS and OpenXPS documents. MuPDF is written modularly, so features can be
    3.14 -added on by integrators if they so desire.
    3.15 +Viewers
    3.16 +-------
    3.17  
    3.18 -Since the 1.2 release of MuPDF, we optionally support interactive features
    3.19 -such as form form filling, javascript and transitions.
    3.20 +For Linux and Windows there are two viewers. One is a very basic viewer using
    3.21 +x11 and win32, respectively. It has been supplanted by a newer viewer using
    3.22 +OpenGL for rendering, which has more features such as table of contents,
    3.23 +unicode search, etc. We keep the old viewers around for older systems where
    3.24 +OpenGL is not available.
     4.1 --- a/mupdf/receipt	Fri May 11 09:27:12 2018 +0200
     4.2 +++ b/mupdf/receipt	Fri May 11 13:08:01 2018 +0300
     4.3 @@ -1,23 +1,28 @@
     4.4  # SliTaz package receipt v2.
     4.5  
     4.6  PACKAGE="mupdf"
     4.7 -VERSION="1.11"
     4.8 -CATEGORY="utilities"
     4.9 -SHORT_DESC="A lightweight PDF and XPS viewer"
    4.10 +VERSION="1.13.0"
    4.11 +CATEGORY="x-window"
    4.12 +SHORT_DESC="MuPDF document viewer"
    4.13  MAINTAINER="jozee@slitaz.org"
    4.14 -LICENSE="GPL3"
    4.15 -WEB_SITE="http://mupdf.com/"
    4.16 +LICENSE="AGPL3"
    4.17 +WEB_SITE="https://mupdf.com/"
    4.18  
    4.19 -TARBALL="$PACKAGE-$VERSION-source.tar.gz"
    4.20 -WGET_URL="http://mupdf.com/downloads/$TARBALL"
    4.21 +TARBALL="$PACKAGE-$VERSION-source.tar.xz"
    4.22 +WGET_URL="https://mupdf.com/downloads/$TARBALL"
    4.23  
    4.24 -BUILD_DEPENDS="freetype-dev fontconfig-dev jbig2dec-dev libjpeg-turbo-dev \
    4.25 -openjpeg-dev zlib-dev xorg-dev"
    4.26 -SPLIT="mudraw mupdf mupdf-dev"
    4.27 +BUILD_DEPENDS="freetype-dev libjpeg-turbo-dev jbig2dec-dev openjpeg2-dev \
    4.28 +freeglut-dev mesa-dev glu-dev curl-dev"
    4.29 +SPLIT="mupdf mupdf-gl mupdf-tools mupdf-dev"
    4.30  
    4.31  compile_rules() {
    4.32 -	# Use system wide libraries instead of included ones
    4.33 -	rm -rf $src/thirdparty
    4.34 +	# use system wide libraries instead of included ones; leave mujs
    4.35 +	rm -rf thirdparty/curl      thirdparty/freeglut  thirdparty/freetype \
    4.36 +	       thirdparty/harfbuzz  thirdparty/jbig2dec  thirdparty/lcms2 \
    4.37 +	       thirdparty/libjpeg   thirdparty/openjpeg  thirdparty/zlib
    4.38 +
    4.39 +	# fix includes for jbig2dec
    4.40 +	sed -i '/^JBIG2DEC_CFLAGS :=/s|$| -I./include/mupdf|' Makethird
    4.41  
    4.42  	case "$ARCH" in
    4.43  		arm*)
    4.44 @@ -34,24 +39,48 @@
    4.45  CROSSCOMPILE=yes
    4.46  endif
    4.47  EOT
    4.48 -			ln -s /usr/include/freetype2/freetype/ /usr/include/freetype
    4.49  			;;
    4.50  	esac
    4.51 -	make ${ARCH_ARGS} build=release &&
    4.52 -	make ${ARCH_ARGS} build=release prefix=/usr install
    4.53 -	rm -rf /usr/include/freetype
    4.54 +	make $ARCH_ARGS build=small libs apps extra &&
    4.55 +	make $ARCH_ARGS build=small prefix=/usr install || return 1
    4.56 +
    4.57 +	# install tools
    4.58 +	cd $src/build/small
    4.59 +	cp mjsgen mujstest muraster mupdf-x11-curl $install/usr/bin/
    4.60 +
    4.61 +	# desktop integration
    4.62 +	install -Dm644 $stuff/mupdf.desktop \
    4.63 +		$install/usr/share/applications/mupdf.desktop
    4.64 +	install -Dm644 $src/docs/logo/mupdf.png \
    4.65 +		$install/usr/share/icons/hicolor/48x48/apps/mupdf.png
    4.66 +
    4.67 +	# fix permissions
    4.68 +	find $install/usr/include $install/usr/share $install/usr/lib -type f \
    4.69 +		-exec chmod 0644 '{}' \;
    4.70  }
    4.71  
    4.72  genpkg_rules() {
    4.73  	case $PACKAGE in
    4.74 -		mudraw)
    4.75 -			copy mudraw
    4.76 -			CAT="development|mudraw"
    4.77 -			DEPENDS="bzlib freetype jbig2dec openjpeg"
    4.78 +		mupdf)
    4.79 +			copy mupdf-x11-curl mupdf.desktop mupdf.png
    4.80 +			ln -s mupdf-x11-curl $fs/usr/bin/mupdf
    4.81 +			DEPENDS="freetype jbig2dec libcurl libharfbuzz libjpeg-turbo \
    4.82 +			openjpeg2 openssl xorg-libX11 xorg-libXext zlib"
    4.83 +			CAT="x-window|basic X11 version"
    4.84  			;;
    4.85 -		mupdf)
    4.86 -			copy @std @rm
    4.87 -			DEPENDS="bzlib freetype fontconfig jbig2dec openjpeg xorg-libXext"
    4.88 +		mupdf-gl)
    4.89 +			copy mupdf-gl mupdf.desktop mupdf.png
    4.90 +			ln -s mupdf-gl $fs/usr/bin/mupdf
    4.91 +			DEPENDS="freeglut freetype jbig2dec libharfbuzz libjpeg-turbo mesa \
    4.92 +			openjpeg2 zlib"
    4.93 +			CAT="x-window|full featured OpenGL accelerated version"
    4.94 +			PROVIDE="mupdf:mesa"
    4.95 +			;;
    4.96 +		mupdf-tools)
    4.97 +			copy mutool mjsgen mujstest muraster
    4.98 +			DEPENDS="freetype jbig2dec libharfbuzz libjpeg-turbo openjpeg2 \
    4.99 +			openssl zlib"
   4.100 +			CAT="x-window|multipurpose PDF tools"
   4.101  			;;
   4.102  		mupdf-dev)
   4.103  			copy @dev
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/mupdf/stuff/mupdf.desktop	Fri May 11 13:08:01 2018 +0300
     5.3 @@ -0,0 +1,7 @@
     5.4 +[Desktop Entry]
     5.5 +Type=Application
     5.6 +Name=MuPDF file viewer
     5.7 +Exec=mupdf %f
     5.8 +Icon=mupdf
     5.9 +Categories=Viewer;Graphics;
    5.10 +MimeType=MimeType=image/tiff;image/x-tiff;application/epub+zip;application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;image/jpeg;image/pjpeg;image/png;
     6.1 --- a/mupdf/stuff/patches/series	Fri May 11 09:27:12 2018 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,2 +0,0 @@
     6.4 -# apply debian 1.4-1 patch
     6.5 --p1|use_openjpeg_1.5.patch
     7.1 --- a/mupdf/stuff/patches/use_openjpeg_1.5.patch	Fri May 11 09:27:12 2018 +0200
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,149 +0,0 @@
     7.4 -commit a7341e98ef48d6041028b7294d1acc13665b04ba
     7.5 -Author: Quoc-Viet Nguyen <afelion@gmail.com>
     7.6 -Date:   Fri Apr 18 23:48:29 2014 +1000
     7.7 -
     7.8 -    Use openjpeg 1.5 rather than 2.0
     7.9 ----
    7.10 - source/fitz/load-jpx.c | 104 +++++++++----------------------------------------
    7.11 - 1 file changed, 18 insertions(+), 86 deletions(-)
    7.12 -
    7.13 -diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
    7.14 -index dfb89f4..d27b5de 100644
    7.15 ---- a/source/fitz/load-jpx.c
    7.16 -+++ b/source/fitz/load-jpx.c
    7.17 -@@ -605,41 +605,6 @@
    7.18 - 	/* fz_warn("openjpeg info: %s", msg); */
    7.19 - }
    7.20 - 
    7.21 --static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)
    7.22 --{
    7.23 --	stream_block *sb = (stream_block *)p_user_data;
    7.24 --	OPJ_SIZE_T len;
    7.25 --
    7.26 --	len = sb->size - sb->pos;
    7.27 --	if (len == 0)
    7.28 --		return (OPJ_SIZE_T)-1; /* End of file! */
    7.29 --	if (len > p_nb_bytes)
    7.30 --		len = p_nb_bytes;
    7.31 --	memcpy(p_buffer, sb->data + sb->pos, len);
    7.32 --	sb->pos += len;
    7.33 --	return len;
    7.34 --}
    7.35 --
    7.36 --static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data)
    7.37 --{
    7.38 --	stream_block *sb = (stream_block *)p_user_data;
    7.39 --
    7.40 --	if (skip > (OPJ_OFF_T)(sb->size - sb->pos))
    7.41 --		skip = (OPJ_OFF_T)(sb->size - sb->pos);
    7.42 --	sb->pos += skip;
    7.43 --	return sb->pos;
    7.44 --}
    7.45 --
    7.46 --static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data)
    7.47 --{
    7.48 --	stream_block *sb = (stream_block *)p_user_data;
    7.49 --
    7.50 --	if (seek_pos > (OPJ_OFF_T)sb->size)
    7.51 --		return OPJ_FALSE;
    7.52 --	sb->pos = seek_pos;
    7.53 --	return OPJ_TRUE;
    7.54 --}
    7.55 --
    7.56 - static int
    7.57 - l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w)
    7.58 - {
    7.59 -@@ -656,10 +621,11 @@
    7.60 - jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta)
    7.61 - {
    7.62 - 	fz_pixmap *img;
    7.63 -+	opj_event_mgr_t evtmgr;
    7.64 - 	opj_dparameters_t params;
    7.65 --	opj_codec_t *codec;
    7.66 -+	opj_dinfo_t *codec;
    7.67 - 	opj_image_t *jpx;
    7.68 --	opj_stream_t *stream;
    7.69 -+	opj_cio_t *stream;
    7.70 - 	unsigned char *p;
    7.71 - 	OPJ_CODEC_FORMAT format;
    7.72 - 	int a, n, w, h, depth, sgnd;
    7.73 -@@ -677,55 +643,30 @@
    7.74 - 
    7.75 - 	/* Check for SOC marker -- if found we have a bare J2K stream */
    7.76 - 	if (data[0] == 0xFF && data[1] == 0x4F)
    7.77 --		format = OPJ_CODEC_J2K;
    7.78 -+		format = CODEC_J2K;
    7.79 - 	else
    7.80 --		format = OPJ_CODEC_JP2;
    7.81 -+		format = CODEC_JP2;
    7.82 - 
    7.83 -+	memset(&evtmgr, 0, sizeof(evtmgr));
    7.84 -+	evtmgr.error_handler = fz_opj_error_callback;
    7.85 -+	evtmgr.warning_handler = fz_opj_warning_callback;
    7.86 -+	evtmgr.info_handler = fz_opj_info_callback;
    7.87 -+
    7.88 - 	opj_set_default_decoder_parameters(&params);
    7.89 - 	if (fz_colorspace_is_indexed(ctx, defcs))
    7.90 - 		params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
    7.91 - 
    7.92 - 	codec = opj_create_decompress(format);
    7.93 --	opj_set_info_handler(codec, fz_opj_info_callback, ctx);
    7.94 --	opj_set_warning_handler(codec, fz_opj_warning_callback, ctx);
    7.95 --	opj_set_error_handler(codec, fz_opj_error_callback, ctx);
    7.96 --	if (!opj_setup_decoder(codec, &params))
    7.97 --	{
    7.98 --		opj_destroy_codec(codec);
    7.99 --		fz_throw(ctx, FZ_ERROR_GENERIC, "j2k decode failed");
   7.100 --	}
   7.101 -+	opj_set_event_mgr((opj_common_ptr)codec, &evtmgr, ctx);
   7.102 -+	opj_setup_decoder(codec, &params);
   7.103 - 
   7.104 --	stream = opj_stream_default_create(OPJ_TRUE);
   7.105 --	sb.data = data;
   7.106 --	sb.pos = 0;
   7.107 --	sb.size = size;
   7.108 -+	stream = opj_cio_open((opj_common_ptr)codec, data, size);
   7.109 - 
   7.110 --	opj_stream_set_read_function(stream, fz_opj_stream_read);
   7.111 --	opj_stream_set_skip_function(stream, fz_opj_stream_skip);
   7.112 --	opj_stream_set_seek_function(stream, fz_opj_stream_seek);
   7.113 --	opj_stream_set_user_data(stream, &sb, NULL);
   7.114 --	/* Set the length to avoid an assert */
   7.115 --	opj_stream_set_user_data_length(stream, size);
   7.116 -+	jpx = opj_decode(codec, stream);
   7.117 - 
   7.118 --	if (!opj_read_header(stream, codec, &jpx))
   7.119 --	{
   7.120 --		opj_stream_destroy(stream);
   7.121 --		opj_destroy_codec(codec);
   7.122 --		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to read JPX header");
   7.123 --	}
   7.124 -+	opj_cio_close(stream);
   7.125 -+	opj_destroy_decompress(codec);
   7.126 - 
   7.127 --	if (!opj_decode(codec, stream, jpx))
   7.128 --	{
   7.129 --		opj_stream_destroy(stream);
   7.130 --		opj_destroy_codec(codec);
   7.131 --		opj_image_destroy(jpx);
   7.132 --		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to decode JPX image");
   7.133 --	}
   7.134 --
   7.135 --	opj_stream_destroy(stream);
   7.136 --	opj_destroy_codec(codec);
   7.137 --
   7.138 --	/* jpx should never be NULL here, but check anyway */
   7.139 - 	if (!jpx)
   7.140 - 		fz_throw(ctx, FZ_ERROR_GENERIC, "opj_decode failed");
   7.141 - 
   7.142 -@@ -733,8 +674,8 @@
   7.143 - 	depth = jpx->comps[0].prec;
   7.144 - 	sgnd = jpx->comps[0].sgnd;
   7.145 - 
   7.146 --	if (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
   7.147 --	else if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
   7.148 -+	if (jpx->color_space == CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
   7.149 -+	else if (jpx->color_space == CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
   7.150 - 	else if (n == 2) { n = 1; a = 1; }
   7.151 - 	else if (n > 4) { n = 4; a = 1; }
   7.152 - 	else { a = 0; }