graphics/unpaper: Update for 7.0.0

Build system has moved to meson, so rewrite the SlackBuild based on the
standard meson template.

The manpage now requires "sphinx" to be built, which is a large python
package with many dependencies. Patch out the building of same by
default, and add the optional dep of Sphinx and the option SPHINX=true
for those that want it.

Update the README file to reflect this build option/optional dep, and
re-paragraph it to make it more readable.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Logan Rathbone 2023-08-12 13:03:54 -04:00 committed by Willy Sudiarto Raharjo
parent 52c3bcb851
commit a7244477f2
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
4 changed files with 95 additions and 36 deletions

View File

@ -3,21 +3,30 @@ especially for book pages that have been scanned from previously
created photocopies. The main purpose is to make scanned book pages
better readable on screen after conversion to PDF. Additionally,
unpaper might be useful to enhance the quality of scanned pages before
performing optical character recognition (OCR). unpaper tries to clean
scanned images by removing dark edges that appeared through scanning
or copying on areas outside the actual page content (e.g. dark areas
between the left-hand-side and the right-hand-side of a double-sided
book-page scan). The program also tries to detect disaligned
centering and rotation of pages and will automatically straighten
each page by rotating it to the correct angle. This process is called
"deskewing". Note that the automatic processing will sometimes fail.
It is always a good idea to manually control the results of unpaper
and adjust the parameter settings according to the requirements of
the input. Each processing step can also be disabled individually
for each sheet. Input and output files can be in either .pbm, .pgm or
performing optical character recognition (OCR).
unpaper tries to clean scanned images by removing dark edges that
appeared through scanning or copying on areas outside the actual page
content (e.g. dark areas between the left-hand-side and the
right-hand-side of a double-sided book-page scan). The program also
tries to detect disaligned centering and rotation of pages and will
automatically straighten each page by rotating it to the correct
angle. This process is called "deskewing".
Note that the automatic processing will sometimes fail. It is always
a good idea to manually control the results of unpaper and adjust the
parameter settings according to the requirements of the input. Each
processing step can also be disabled individually for each sheet.
Input and output files can be in either .pbm, .pgm or
.ppm format, thus generally in .pnm format, as also used by the Linux
scanning tools scanimage and scanadf. Conversion to PDF can e.g. be
achieved with the Linux tools pgm2tiff, tiffcp and tiff2pdf.
This is a fork of the original unpaper software by D.E. "Flameeyes"
Petteno'.
BUILD OPTIONS:
SPHINX => set to 'true' to build the manpage for unpaper, which now
requires "Sphinx" (available in SBo), which is a large python package
with many dependencies. Thus, it is disabled by default.

View File

@ -0,0 +1,21 @@
diff -Naur unpaper-7.0.0.orig/meson.build unpaper-7.0.0/meson.build
--- unpaper-7.0.0.orig/meson.build 2023-08-12 12:37:30.389999033 -0400
+++ unpaper-7.0.0/meson.build 2023-08-12 12:37:57.307998930 -0400
@@ -36,17 +36,6 @@
install : true,
)
-sphinx = find_program('sphinx-build', required: true, version: '>= 3.4')
-
-custom_target(
- 'man',
- command: [sphinx, '-b', 'man', join_paths(meson.source_root(), 'doc'), '@OUTDIR@'],
- input: ['doc/conf.py', 'doc/index.rst', 'doc/unpaper.1.rst'],
- output: 'unpaper.1',
- install: true,
- install_dir: join_paths(get_option('prefix'), get_option('mandir'), 'man1'),
-)
-
pymod = import('python')
python = pymod.find_installation(required: false, modules: ['pytest', 'PIL'], disabler: true)

View File

@ -3,7 +3,7 @@
# Slackware build script for unpaper
# Copyright 2008-2014 LukenShiro, Italy
# Copyright 2019 Logan Rathbone <poprocks@gmail.com>
# Copyright 2019-2023 Logan Rathbone <poprocks@gmail.com>
#
# All rights reserved.
#
@ -24,7 +24,7 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# CHANGELOG
# CHANGELOG - Discontinued as of 7.0.0; see git log.
#
# 20191107 Logan Rathbone <poprocks@gmail.com> 6.1-1
# - Update to 6.1
@ -39,7 +39,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=unpaper
VERSION=${VERSION:-6.1}
VERSION=${VERSION:-7.0.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -48,13 +48,11 @@ if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
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
@ -66,10 +64,16 @@ OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
@ -78,33 +82,58 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z
cd $PRGNAM-$VERSION
# Building the manpage requires "sphinx" which is a huge python package
# with many dependencies. Since there is no meson_options.txt in unpaper
# at this time which allows us to optionally disable this, patch it out
# unless the SPHINX option is set to true.
SPHINX=${SPHINX:-false}
if [ "$SPHINX" != "true" ]; then
patch -p1 < $CWD/unpaper-7.0.0-no-sphinx.patch
fi
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -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 {} \;
mkdir build
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
meson setup \
--buildtype=plain \
--infodir=/usr/info \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make
make install DESTDIR=$PKG
--prefix=/usr \
--sysconfdir=/etc \
-Dstrip=true \
build/
${NINJA:=ninja} -v -C build/
DESTDIR=$PKG $NINJA -C build/ install
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
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
if [ "$SPHINX" = "true" ]; then
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
cp AUTHORS COPYING NEWS README.md $PKG/usr/doc/$PRGNAM-$VERSION/
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS NEWS README.md LICENSES/ \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

View File

@ -1,8 +1,8 @@
PRGNAM="unpaper"
VERSION="6.1"
VERSION="7.0"
HOMEPAGE="https://www.flameeyes.com/projects/unpaper"
DOWNLOAD="https://www.flameeyes.com/files/unpaper-6.1.tar.xz"
MD5SUM="b5e79645765be7c7ae0e003697bdb9e2"
DOWNLOAD="https://www.flameeyes.com/files/unpaper-7.0.0.tar.xz"
MD5SUM="24be66b049a27b6f841cc7444ceff9cc"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""