aboutsummaryrefslogtreecommitdiff
path: root/python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-11-09 16:33:21 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2025-11-15 11:25:08 +0700
commit78eb72336bfabce45018b93ed9d234fb22dd08f7 (patch)
tree5e5790582f22a73cd6d6bfcaa18016dbe89748a7 /python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild
parent8c522a62f7779fc68bdec5faf9f3ea2d73752762 (diff)
python/python3-PyMuPDF: Updated for version 1.24.11, new maintainer.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild')
-rw-r--r--python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild80
1 files changed, 38 insertions, 42 deletions
diff --git a/python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild b/python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild
index 89c74cdaab..7ca63578da 100644
--- a/python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild
+++ b/python/python3-PyMuPDF/python3-PyMuPDF.SlackBuild
@@ -2,30 +2,28 @@
# Slackware build script for python3-PyMuPDF
-# Copyright 2023-2024, Alexander Verbovetsky, Moscow, Russia
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Originally written by Alexander Verbovetsky.
+# Modified and now maintained by B. Watson (urchlay@slackware.uk).
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20251109 bkw:
+# - take over maintenance.
+# - relicense as WTFPL (with permission from Alexander).
+# - update for v1.24.11, which is the newest version I could get
+# to build on 15.0. I suspect we'd need a newer swig for later
+# versions.
+# - simplify script.
+
+# Note to self: the PyMuPDF and mupdf version numbers are not kept in
+# sync. Look at changes.txt in the PyMuPDF tarball to find the correct
+# version of mupdf (and set MUVER to that).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=python3-PyMuPDF
-VERSION=${VERSION:-1.24.10}
+SRCNAM=PyMuPDF
+VERSION=${VERSION:-1.24.11}
+MUVER=${MUVER:-1.24.10}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -52,32 +50,30 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf ${PRGNAM:8}-$VERSION mupdf*
-tar xvf $CWD/mupdf-*-source.tar.lz
-mv mupdf* mupdf
-tar xvf $CWD/${PRGNAM:8}-$VERSION.tar.gz
-cd ${PRGNAM:8}-$VERSION
-chown -R root:root . ../mupdf
-find -L . ../mupdf \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-sed -i -e "s/ret.append([ ]*'libclang'[ ]*)/pass/" \
- -e "s/ret.append([ ]*'swig'[ ]*)/pass/" \
- setup.py
-
-export PYMUPDF_SETUP_MUPDF_BUILD=../mupdf
+rm -rf $PRGNAM-$VERSION
+mkdir -p $PRGNAM-$VERSION
+cd $PRGNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+tar xvf $CWD/mupdf-$MUVER-source.tar.lz
+chown -R root:root .
+find . ! -type l -a \
+ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \
+ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \)
+
+cd $SRCNAM-$VERSION
+
+sed -i.bak "s/ret.append([ ]*'\\(libclang\\|swig\\)'[ ]*)/pass/" setup.py
+
+export PYMUPDF_SETUP_MUPDF_BUILD=../mupdf-$MUVER-source
python3 -m build --wheel --no-isolation
python3 -m installer --destdir "$PKG" dist/*.whl
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+strip $PKG/usr/lib*/python3*/site-packages/pymupdf/* &>/dev/null || true
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a README* changes.txt docs $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a README* changes.txt docs $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc