diff options
author | B. Watson <yalhcru@gmail.com> | 2021-08-01 12:34:54 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-13 00:51:25 +0700 |
commit | 16d1462031c43d817f2460dd535219fbb21ff8e6 (patch) | |
tree | 8018f135510a0938532410494b7f5ac3ec931170 /office | |
parent | 499ca7b26310bc343b19c314f28ef49ccf29fbb4 (diff) |
office/zathura-pdf-mupdf: Updated for version 0.3.7.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office')
-rw-r--r-- | office/zathura-pdf-mupdf/README | 11 | ||||
-rw-r--r-- | office/zathura-pdf-mupdf/mupdf19.diff | 131 | ||||
-rw-r--r-- | office/zathura-pdf-mupdf/upstream.README | 23 | ||||
-rw-r--r-- | office/zathura-pdf-mupdf/zathura-pdf-mupdf.SlackBuild | 53 | ||||
-rw-r--r-- | office/zathura-pdf-mupdf/zathura-pdf-mupdf.info | 8 |
5 files changed, 29 insertions, 197 deletions
diff --git a/office/zathura-pdf-mupdf/README b/office/zathura-pdf-mupdf/README index e573ded57c65e..fa5542afee0a5 100644 --- a/office/zathura-pdf-mupdf/README +++ b/office/zathura-pdf-mupdf/README @@ -6,10 +6,7 @@ the zathura package). To switch between the mupdf and poppler backends without reinstalling packages, adjust the symlink at /usr/lib(64)/zathura/pdf.so. It -should point to either pdf-mupdf/pdf.so or pdf-poppler/pdf.so. You can -also reinstall zathura to switch to the poppler backend, or reinstall -zathura-pdf-mupdf to switch to the mupdf backend (whichever was installed -last "wins"). - -zathura-pdf-mupdf 0.3.2 is the last possible update for Slackware -14.2. Newer versions would require a newer gtk+3. +should point to either pdf/libpdf-mupdf.so or pdf/libpdf-poppler.so. +You can also reinstall zathura to switch to the poppler backend, or +reinstall zathura-pdf-mupdf to switch to the mupdf backend (whichever +was installed last "wins"). diff --git a/office/zathura-pdf-mupdf/mupdf19.diff b/office/zathura-pdf-mupdf/mupdf19.diff deleted file mode 100644 index 83437093f9f54..0000000000000 --- a/office/zathura-pdf-mupdf/mupdf19.diff +++ /dev/null @@ -1,131 +0,0 @@ -diff --git a/AUTHORS b/AUTHORS -index f5f8430..371ebf1 100644 ---- a/AUTHORS -+++ b/AUTHORS -@@ -5,5 +5,6 @@ Sebastian Ramacher <s.ramacher@gmx.at> - - Other contributors are (in alphabetical order): - -+Christian Hesse <mail@eworm.de> - Pavel Borzenkov <pavel.borzenkov@gmail.com> - William Skeith <wes@cs.ccny.cuny.edu> -diff --git a/config.mk b/config.mk -index cba8d40..6407ae6 100644 ---- a/config.mk -+++ b/config.mk -@@ -32,7 +32,7 @@ endif - OPENSSL_INC ?= $(shell pkg-config --cflags libcrypto) - OPENSSL_LIB ?= $(shell pkg-config --libs libcrypto) - --MUPDF_LIB ?= -lmupdf -lmujs -+MUPDF_LIB ?= -lmupdf -lmupdfthird - - INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC} - LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} -ljbig2dec -lopenjp2 -ljpeg -diff --git a/document.c b/document.c -index 873866c..548f4ff 100644 ---- a/document.c -+++ b/document.c -@@ -109,12 +109,12 @@ pdf_document_save_as(zathura_document_t* document, mupdf_document_t* - } - - fz_try (mupdf_document->ctx) { -- /* fz_write_document claims to accepts NULL as third argument but doesn't. -+ /* pdf_save_document claims to accepts NULL as third argument but doesn't. - * pdf_write_document does not check if the third arguments is NULL for some - * options. */ - -- fz_write_options opts = { 0 }; /* just use the default options */ -- fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) path, &opts); -+ pdf_write_options opts = { 0 }; /* just use the default options */ -+ pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, &opts); - } fz_catch (mupdf_document->ctx) { - return ZATHURA_ERROR_UNKNOWN; - } -diff --git a/image.c b/image.c -index 97d4143..8f6912b 100644 ---- a/image.c -+++ b/image.c -@@ -93,7 +93,7 @@ pdf_page_image_get_cairo(zathura_page_t* page, mupdf_page_t* mupdf_page, - fz_pixmap* pixmap = NULL; - cairo_surface_t* surface = NULL; - -- pixmap = fz_new_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); -+ pixmap = fz_get_pixmap_from_image(mupdf_page->ctx, mupdf_image, 0, 0); - if (pixmap == NULL) { - goto error_free; - } -diff --git a/page.c b/page.c -index beb0351..219fc2a 100644 ---- a/page.c -+++ b/page.c -@@ -43,12 +43,12 @@ pdf_page_init(zathura_page_t* page) - /* setup text */ - mupdf_page->extracted_text = false; - -- mupdf_page->text = fz_new_text_page(mupdf_page->ctx); -+ mupdf_page->text = fz_new_stext_page(mupdf_page->ctx); - if (mupdf_page->text == NULL) { - goto error_free; - } - -- mupdf_page->sheet = fz_new_text_sheet(mupdf_page->ctx); -+ mupdf_page->sheet = fz_new_stext_sheet(mupdf_page->ctx); - if (mupdf_page->sheet == NULL) { - goto error_free; - } -@@ -74,11 +74,11 @@ pdf_page_clear(zathura_page_t* page, mupdf_page_t* mupdf_page) - - if (mupdf_page != NULL) { - if (mupdf_page->text != NULL) { -- fz_drop_text_page(mupdf_page->ctx, mupdf_page->text); -+ fz_drop_stext_page(mupdf_page->ctx, mupdf_page->text); - } - - if (mupdf_page->sheet != NULL) { -- fz_drop_text_sheet(mupdf_page->ctx, mupdf_page->sheet); -+ fz_drop_stext_sheet(mupdf_page->ctx, mupdf_page->sheet); - } - - if (mupdf_page->page != NULL) { -diff --git a/plugin.h b/plugin.h -index f2fb4a0..84c5e53 100644 ---- a/plugin.h -+++ b/plugin.h -@@ -21,8 +21,8 @@ typedef struct mupdf_page_s - { - fz_page* page; /**< Reference to the mupdf page */ - fz_context* ctx; /**< Context */ -- fz_text_sheet* sheet; /**< Text sheet */ -- fz_text_page* text; /**< Page text */ -+ fz_stext_sheet* sheet; /**< Text sheet */ -+ fz_stext_page* text; /**< Page text */ - fz_rect bbox; /**< Bbox */ - bool extracted_text; /**< If text has already been extracted */ - } mupdf_page_t; -diff --git a/search.c b/search.c -index 3a9fad4..c672b9f 100644 ---- a/search.c -+++ b/search.c -@@ -40,7 +40,7 @@ pdf_page_search_text(zathura_page_t* page, mupdf_page_t* mupdf_page, const char* - } - - fz_rect* hit_bbox = fz_malloc_array(mupdf_page->ctx, N_SEARCH_RESULTS, sizeof(fz_rect)); -- int num_results = fz_search_text_page(mupdf_page->ctx, mupdf_page->text, -+ int num_results = fz_search_stext_page(mupdf_page->ctx, mupdf_page->text, - (char*) text, hit_bbox, N_SEARCH_RESULTS); - - for (int i = 0; i < num_results; i++) { -diff --git a/utils.c b/utils.c -index 4a003b9..a4b9320 100644 ---- a/utils.c -+++ b/utils.c -@@ -14,7 +14,7 @@ mupdf_page_extract_text(mupdf_document_t* mupdf_document, mupdf_page_t* mupdf_pa - fz_device* text_device = NULL; - - fz_try (mupdf_page->ctx) { -- text_device = fz_new_text_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); -+ text_device = fz_new_stext_device(mupdf_page->ctx, mupdf_page->sheet, mupdf_page->text); - - /* Disable FZ_IGNORE_IMAGE to collect image blocks */ - fz_disable_device_hints(mupdf_page->ctx, text_device, FZ_IGNORE_IMAGE); diff --git a/office/zathura-pdf-mupdf/upstream.README b/office/zathura-pdf-mupdf/upstream.README deleted file mode 100644 index 34db54affd45e..0000000000000 --- a/office/zathura-pdf-mupdf/upstream.README +++ /dev/null @@ -1,23 +0,0 @@ -zathura-pdf-mupdf -================= -The zathura-pdf-mupdf plugin adds PDF support to zathura by using the mupdf -rendering library. - -Requirements ------------- -zathura (>= 0.2.0) -girara -mupdf (>= 1.7) -openjpeg (>= 2.0) - -Installation ------------- -To build and install the plugin: - - make install - -Uninstall: ----------- -To delete the plugin from your system, just type: - - make uninstall diff --git a/office/zathura-pdf-mupdf/zathura-pdf-mupdf.SlackBuild b/office/zathura-pdf-mupdf/zathura-pdf-mupdf.SlackBuild index 759face073bcc..e975417f56d75 100644 --- a/office/zathura-pdf-mupdf/zathura-pdf-mupdf.SlackBuild +++ b/office/zathura-pdf-mupdf/zathura-pdf-mupdf.SlackBuild @@ -9,8 +9,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=zathura-pdf-mupdf -VERSION=${VERSION:-0.3.2} -BUILD=${BUILD:-2} +VERSION=${VERSION:-0.3.7} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -22,9 +22,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -50,15 +47,6 @@ fi set -e -if [ ! -d /opt/mupdf-legacy ]; then - echo "*** Missing required dependency 'mupdf-legacy'" 1>&2 - exit 1 -fi - -# Use old libs/headers. Works even if a newer mupdf is installed in /usr. -PKG_CONFIG_PATH=/opt/mupdf-legacy/lib$LIBDIRSUFFIX/pkgconfig:$PKG_CONFIG_PATH -export PKG_CONFIG_PATH - rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP @@ -69,24 +57,25 @@ chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ -# Upstream left the README out of the release tarball for some reason. -cat $CWD/upstream.README > README - -# mupdf 1.4 and later no longer have libmupdf-js-none (moved to libmupdf). -# Anyway it's better to use pkg-config now that mupdf supports it. -sed -i \ - -e "s,-fPIC,$SLKCFLAGS," \ - -e '/^MUPDF_LIB/s,-.*,$(shell pkg-config --libs mupdf),' \ - -e '/^INCS/s,= ,&$(shell pkg-config --cflags mupdf) ,' \ - config.mk - -PLUGDIR=/usr/lib$LIBDIRSUFFIX/zathura - -make VERBOSE=1 -strip *.so -make install DESTDIR=$PKG PLUGINDIR="$PLUGDIR/pdf-mupdf" - -ln -s pdf-mupdf/pdf.so $PKG/$PLUGDIR/pdf.so +mkdir build +cd build + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + meson .. \ + --buildtype=release \ + --infodir=/usr/info \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --mandir=/usr/man \ + --prefix=/usr \ + --sysconfdir=/etc \ + -Dstrip=true \ + -Dplugindir=/usr/lib$LIBDIRSUFFIX/zathura/pdf + "${NINJA:=ninja}" + DESTDIR=$PKG $NINJA install +cd .. + +ln -s pdf/libpdf-mupdf.so $PKG/usr/lib$LIBDIRSUFFIX/zathura/pdf.so mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a README AUTHORS LICENSE $PKG/usr/doc/$PRGNAM-$VERSION diff --git a/office/zathura-pdf-mupdf/zathura-pdf-mupdf.info b/office/zathura-pdf-mupdf/zathura-pdf-mupdf.info index eb8961c45df2f..6825f9b400477 100644 --- a/office/zathura-pdf-mupdf/zathura-pdf-mupdf.info +++ b/office/zathura-pdf-mupdf/zathura-pdf-mupdf.info @@ -1,10 +1,10 @@ PRGNAM="zathura-pdf-mupdf" -VERSION="0.3.2" +VERSION="0.3.7" HOMEPAGE="https://github.com/pwmt/zathura-pdf-mupdf" -DOWNLOAD="https://github.com/pwmt/zathura-pdf-mupdf/archive/0.3.2/zathura-pdf-mupdf-0.3.2.tar.gz" -MD5SUM="b9659efbc5c04c06c5e986248d3dec19" +DOWNLOAD="https://github.com/pwmt/zathura-pdf-mupdf/archive/0.3.7/zathura-pdf-mupdf-0.3.7.tar.gz" +MD5SUM="c686b3cef6c78d4e0f8318899478dc81" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="mupdf-legacy zathura" +REQUIRES="mupdf zathura" MAINTAINER="B. Watson" EMAIL="yalhcru@gmail.com" |