summaryrefslogtreecommitdiffstats
path: root/office
diff options
context:
space:
mode:
Diffstat (limited to 'office')
-rw-r--r--office/LibreOffice/LibreOffice.SlackBuild42
-rw-r--r--office/LibreOffice/LibreOffice.info12
-rw-r--r--office/LibreOffice/README38
-rw-r--r--office/LibreOffice/no-check-if-root.diff30
-rw-r--r--office/abook/abook.SlackBuild2
-rw-r--r--office/apvlv/apvlv.SlackBuild25
-rw-r--r--office/apvlv/apvlv.info6
-rw-r--r--office/asymptote/asymptote.SlackBuild2
-rw-r--r--office/asymptote/asymptote.info8
-rw-r--r--office/calibre/calibre.SlackBuild10
-rw-r--r--office/calibre/calibre.info8
-rw-r--r--office/calibre/patches/icu.patch31
-rw-r--r--office/calibre/patches/qt-5.15.patch40
-rw-r--r--office/calibre/patches/remove-desktop-integration.patch13
-rw-r--r--office/evince/evince.SlackBuild25
-rw-r--r--office/evince/evince.info6
-rw-r--r--office/evince/shim.h25
-rw-r--r--office/fbreader/fbreader-qt5.patch510
-rw-r--r--office/fbreader/fbreader.SlackBuild10
-rw-r--r--office/gbgoffice/gbgoffice.SlackBuild1
-rw-r--r--office/gbgoffice/patches/12_gcc6.patch21
-rw-r--r--office/gnokii/gnokii-0.6.31-gcc7.patch17
-rw-r--r--office/gnokii/gnokii.SlackBuild3
-rw-r--r--office/gnucash-docs/README2
-rw-r--r--office/gnucash-docs/gnucash-docs.SlackBuild2
-rw-r--r--office/gnucash-docs/gnucash-docs.info6
-rw-r--r--office/gnucash-legacy/gnucash-legacy.info2
-rw-r--r--office/gnucash/gnucash.SlackBuild2
-rw-r--r--office/gnucash/gnucash.info6
-rw-r--r--office/gnumeric/gnumeric.SlackBuild4
-rw-r--r--office/goldendict/goldendict.SlackBuild11
-rw-r--r--office/goldendict/patches/goldendict-ffmpeg4.patch167
-rw-r--r--office/goldendict/patches/goldendict-qt-5.11-1.patch34
-rw-r--r--office/goldendict/patches/goldendict-qt-5.11-2.patch22
-rw-r--r--office/juffed/README6
-rw-r--r--office/juffed/doinst.sh3
-rw-r--r--office/juffed/juffed.SlackBuild98
-rw-r--r--office/juffed/juffed.info10
-rw-r--r--office/juffed/slack-desc19
-rw-r--r--office/kbgoffice/gcc6.patch17
-rw-r--r--office/kbgoffice/kbgoffice.SlackBuild3
-rw-r--r--office/kbibtex/README13
-rw-r--r--office/kbibtex/kbibtex.SlackBuild11
-rw-r--r--office/kbibtex/kbibtex.info6
-rw-r--r--office/kbibtex/slack-desc16
-rw-r--r--office/kmymoney/README6
-rw-r--r--office/kmymoney/doinst.sh13
-rw-r--r--office/kmymoney/kmymoney.SlackBuild101
-rw-r--r--office/kmymoney/kmymoney.info10
-rw-r--r--office/kmymoney/slack-desc19
-rw-r--r--office/mu/mu.SlackBuild4
-rw-r--r--office/mu/mu.info6
-rw-r--r--office/pdfpc/pdfpc.SlackBuild6
-rw-r--r--office/pdfpc/pdfpc.info6
-rw-r--r--office/pdftk/README7
-rw-r--r--office/pdftk/pdftk-1.44-add_custom_optflags.patch26
-rw-r--r--office/pdftk/pdftk-2.02-use-gcc5.patch15
-rw-r--r--office/pdftk/pdftk.SlackBuild11
-rw-r--r--office/pdftk/pdftk.info2
-rw-r--r--office/qpdfview-qt5/qpdfview-qt5.SlackBuild2
-rw-r--r--office/qpdfview-qt5/qt-5.15.patch24
-rw-r--r--office/referencer/referencer-lib_path.patch11
-rw-r--r--office/referencer/referencer.SlackBuild3
-rw-r--r--office/sc-im/README2
-rw-r--r--office/sc-im/sc-im.SlackBuild99
-rw-r--r--office/sc-im/sc-im.info10
-rw-r--r--office/sc-im/slack-desc19
-rw-r--r--office/scribus/README3
-rw-r--r--office/scribus/poppler-21.4.0.patch4347
-rw-r--r--office/scribus/scribus.SlackBuild14
-rw-r--r--office/scribus/scribus.info6
-rw-r--r--office/teapot/teapot.SlackBuild2
-rw-r--r--office/tellico/tellico.SlackBuild6
-rw-r--r--office/tellico/tellico.info6
-rw-r--r--office/texlive/README14
-rw-r--r--office/texlive/README.tlpkg17
-rw-r--r--office/texlive/doinst.sh5
-rw-r--r--office/texlive/patches/tabu.sty.diff32
-rw-r--r--office/texlive/prep/texmf_get.sh1146
-rw-r--r--office/texlive/slack-desc19
-rw-r--r--office/texlive/texlive.SlackBuild253
-rw-r--r--office/texlive/texlive.info12
82 files changed, 5463 insertions, 2166 deletions
diff --git a/office/LibreOffice/LibreOffice.SlackBuild b/office/LibreOffice/LibreOffice.SlackBuild
index 14fd0f2042..c984e6e079 100644
--- a/office/LibreOffice/LibreOffice.SlackBuild
+++ b/office/LibreOffice/LibreOffice.SlackBuild
@@ -4,7 +4,7 @@
# Slackware build script for LibreOffice
-# Copyright 2015-2019 Christoph Willing Brisbane, Australia
+# Copyright 2015-2021 Christoph Willing Brisbane, Australia
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -26,11 +26,10 @@
PRGNAM=LibreOffice
SRCNAM=libreoffice
-VERSION=${VERSION:-6.2.8.2}
+VERSION=${VERSION:-7.1.2.2}
SHORT_VERSION=${VERSION%.*.*}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-PACKAGER=${PACKAGER:-"AnonymousCoward"}
HAVE_SRCS_TARBALL=${HAVE_SRCS_TARBALL:-1}
@@ -91,16 +90,22 @@ jval="$(echo $MAKEFLAGS |grep -o "\-j *[0-9]*" | grep -o "[0-9]*")" || true
# If PARALLEL environment variable is set, use that to override everything.
[ "${PARALLEL:-0}" != "0" ] && parallel="--with-parallelism=$PARALLEL"
-JAVA=${JAVA:-openjdk7}
-if [ "$JAVA" = "openjdk7" ]; then
- . /etc/profile.d/openjdk7.sh
- use_java="--with-java=java"
-elif [ "$JAVA" = "openjdk8" ]; then
- . /etc/profile.d/openjdk8.sh
- use_java="--with-java=java"
-elif [ "$JAVA" = "jdk" ]; then
- . /etc/profile.d/jdk.sh
- use_java="--with-java=java"
+JAVA=${JAVA:-jdk11}
+if [ "$JAVA" = "jdk11" ]; then
+ . /etc/profile.d/jdk11.sh
+ use_java="--with-jdk-home=$JAVA_HOME"
+elif [ "$JAVA" = "jdk12" ]; then
+ . /etc/profile.d/jdk12.sh
+ use_java="--with-jdk-home=$JAVA_HOME"
+elif [ "$JAVA" = "jdk13" ]; then
+ . /etc/profile.d/jdk13.sh
+ use_java="--with-jdk-home=$JAVA_HOME"
+elif [ "$JAVA" = "jdk14" ]; then
+ . /etc/profile.d/jdk14.sh
+ use_java="--with-jdk-home=$JAVA_HOME"
+elif [ "$JAVA" = "jdk15" ]; then
+ . /etc/profile.d/jdk15.sh
+ use_java="--with-jdk-home=$JAVA_HOME"
elif [ "$JAVA" = "no" ]; then
use_java="--with-java=no"
fi
@@ -154,7 +159,6 @@ if pkg-config --exists python3 ; then Python3="--enable-python=system" ; else Py
if pkg-config --exists Qt5 ; then qt5="--enable-qt5" ; else qt5="" ; fi
if pkg-config --exists valgrind ; then valgrind="--with-valgrind" ; else valgrind="" ; fi
-kde4="--enable-kde4" ; [ "${KDE4:-yes}" != "yes" ] && kde4="--disable-kde4"
use_ccache="--disable-ccache" ; [ "${USE_CCACHE:-no}" != "no" ] && use_ccache=""
# Extensions
@@ -175,7 +179,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
--libdir=/usr/lib$LIBDIRSUFFIX \
--sysconfdir=/etc \
--build=$ARCH-slackware-linux \
- --with-build-version="SlackBuild for $PRGNAM-$VERSION by $PACKAGER" \
--with-vendor="Just Another Slacker" \
--with-lang="$LOLANGS" \
--enable-release-build=yes \
@@ -188,7 +191,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
$avahi \
$Python3 \
$vlc \
- $kde4 \
$use_ccache \
$use_java \
$parallel \
@@ -225,7 +227,6 @@ extnlpsolver="--enable-ext-nlpsolver"; [ "${EXTNLPSOLVER:-yes}" != "yes" ] &
--with-system-openldap \
--with-system-openssl \
--with-system-poppler \
- --with-system-redland \
--with-system-sane \
--with-system-zlib \
$coinmp \
@@ -273,6 +274,13 @@ fi
patch -p0 < $CWD/no-check-if-root.diff
+# GCC10 requirements (Tx alienBOB)
+sed -i external/libcdr/ExternalProject_libcdr.mk \
+ -e '/configure /i \\t\t&& sed -i "s/TRUE/true/g" src/lib/libcdr_utils.cpp \\'
+sed -i external/libebook/ExternalProject_libebook.mk \
+ -e '/configure /i \\t\t&& sed -i "s/TRUE/true/g" src/lib/EBOOKCharsetConverter.cpp \\'
+sed -i i18npool/source/calendar/calendar_gregorian.cxx -e 's/TRUE/true/'
+
export LDFLAGS="-lboost_system"
make build-nocheck
make distro-pack-install DESTDIR=$PKG
diff --git a/office/LibreOffice/LibreOffice.info b/office/LibreOffice/LibreOffice.info
index fc9a4c48ec..ed348de618 100644
--- a/office/LibreOffice/LibreOffice.info
+++ b/office/LibreOffice/LibreOffice.info
@@ -1,12 +1,12 @@
PRGNAM="LibreOffice"
-VERSION="6.2.8.2"
+VERSION="7.1.2.2"
HOMEPAGE="https://www.libreoffice.org"
-DOWNLOAD="https://download.documentfoundation.org/libreoffice/src/6.2.8/libreoffice-6.2.8.2.tar.xz \
- http://sourceforge.net/projects/slackbuildsdirectlinks/files/LibreOffice/libreoffice-6.2.8.2-srcs.tar.xz"
-MD5SUM="1438fdfae3076b8b1b1460054a318f0b \
- b5d5e57832056d8a5625b1d5dc3aa024"
+DOWNLOAD="https://download.documentfoundation.org/libreoffice/src/7.1.2/libreoffice-7.1.2.2.tar.xz \
+ https://sourceforge.net/projects/slackbuildsdirectlinks/files/LibreOffice/libreoffice-7.1.2.2-srcs.tar.xz"
+MD5SUM="60af85a8960ef2bc0f70880e589dc12c \
+ 2dafa97e09bb43c3f7ea7f122940597d"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="python3 openjdk7 apache-ant perl-Archive-Zip"
+REQUIRES="jdk11 apache-ant perl-Archive-Zip"
MAINTAINER="Christoph Willing"
EMAIL="chris.willing@linux.com"
diff --git a/office/LibreOffice/README b/office/LibreOffice/README
index dc7ee5981e..1d0aa001af 100644
--- a/office/LibreOffice/README
+++ b/office/LibreOffice/README
@@ -20,7 +20,7 @@ internal versions. Packages from SBo that will be use in this way are:
libexttextcat libfreehand libmspub libmwaw libnumbertext liborcus
libpagemaker libqxp libnumbertext libstaroffice libtommath libwps libzmf
lpsolve mythes postgresql qt5 valgrind ucpp unixODBC avahi
- libetonyek xmlsec vlc
+ libetonyek xmlsec
Remember, these packages are not essential but entirely optional. If not found,
LibreOffice will simply build its own internal versions.
@@ -31,34 +31,26 @@ e.g. if avahi is detected and used at build time, it will also need to be
installed at run time.
Build time environment variables that may be set to vary features are as follows:
-1. enable the experimental VLC avmedia backend (disabled by default) with:
- VLC="yes"
- This requires the vlc package (available from SBo) to be installed.
-
-2. disable kde4 support (enabled by default) with:
- KDE4="no"
-
-3. support additional languages by overriding the LOLANGS variable, whose
+1. support additional languages by overriding the LOLANGS variable, whose
default setting is LOLANGS="de es fr id it ja nl vi zh-CN". Note that en-US
is always added to whatever LOLANGS is set. Thus building with, for example,
- LOLANGS="de" sh LibreOffice
+ LOLANGS="de" sh LibreOffice.SlackBuild
would build LibreOffice with support for german and US english languages.
Additionally, setting LOLANGS="ALL" will build in support for all available
languages.
-4. A number of Java Development Kits are suitable for building LibreOffice.
- The default JDK for this SlackBuild is openjdk7. Others may be chosen by
- setting the JAVA environment variable when running the SlackBuild. Recognised
- values are openjdk7 (the default, not explicitly required), openjdk8 and jdk
- e.g. JAVA=jdk (to use SBo jdk package with Oracle binary version). Using an
- alternate JDK will require presence of the appropriate package when building
- LibreOffice. Since the apache-ant package is already required by openjdk7,
- hence openjdk8, its listing in the REQUIRES field is redundant in these cases.
- However it remains listed to accomodate the case of JAVA=jdk, in which the
- apache-ant package is needed to build LibreOffice.
- Finally, setting JAVA=no will build LibreOffice without any Java support.
+2. A number of Java Development Kits are suitable for building LibreOffice.
+ At the moment (since, at least, LO version 7.0.0.3) the default JDK is the
+ latest LTS release, jdk11. Other JDK's supported by the SlackBuild are jdk12,
+ jdk13, jdk14 & jdk15 but these non-default JDK's must be explicitly specified
+ when running the SlackBuild using the JAVA environment variable e.g.
+ JAVA=jdk15 sh LibreOffice.SlackBuild
+
+ It is also possible to build LibreOffice without any JAVA support (with
+ somewhat reduced capability in LO Base) by running:
+ JAVA=no sh LibreOffice.SlackBuild
-5. The number of parallel make jobs used by the LibreOffice build system defaults
+3. The number of parallel make jobs used by the LibreOffice build system defaults
to the number of available cpu cores. If the MAKEFLAGS environment variable
contains the -j option e.g.
MAKEFLAGS=-j6
@@ -69,7 +61,7 @@ Build time environment variables that may be set to vary features are as follows
which would limit building to a single make process, overriding any value set
with the -j option in MAKEFLAGS.
-6. Use of ccache during building is turned off by default to save disk space (and
+4. Use of ccache during building is turned off by default to save disk space (and
possible build failure due to lack of disk space). It may be reinstated by
setting the USE_CCACHE environment to "yes" e.g.
USE_CCACHE=yes sh LibreOffice.SlackBuild
diff --git a/office/LibreOffice/no-check-if-root.diff b/office/LibreOffice/no-check-if-root.diff
index ff63ada2f7..946526c69c 100644
--- a/office/LibreOffice/no-check-if-root.diff
+++ b/office/LibreOffice/no-check-if-root.diff
@@ -1,20 +1,10 @@
---- Makefile.orig 2018-02-07 22:18:13.161535968 +1000
-+++ Makefile 2018-02-07 22:17:41.560533422 +1000
-@@ -9,7 +9,7 @@
-
- gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck uicheck screenshot
-
--.PHONY : all check-if-root bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch get-submodules id install install-gdb-printers install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
-+.PHONY : all bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch get-submodules id install install-gdb-printers install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
-
- MAKECMDGOALS?=all
- build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
-@@ -254,7 +254,7 @@
- #
- # Bootstrap
- #
--bootstrap: check-if-root compilerplugins
-+bootstrap: compilerplugins
-
- #
- # Build
+--- Makefile.orig 2020-12-13 08:04:37.172000000 +1000
++++ Makefile 2020-12-13 08:04:58.538000000 +1000
+@@ -63,7 +63,6 @@
+ echo; \
+ echo 'Building LibreOffice as root is a very bad idea, use a regular user.'; \
+ echo; \
+- exit 1; \
+ fi
+
+ gb_Side ?= host
diff --git a/office/abook/abook.SlackBuild b/office/abook/abook.SlackBuild
index 45031e240b..5f8fef6ccf 100644
--- a/office/abook/abook.SlackBuild
+++ b/office/abook/abook.SlackBuild
@@ -75,7 +75,7 @@ find -L . \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
aclocal && automake --add-missing && autoconf
-sed 's/0.18/0.19/g' -i po/Makefile.in.in
+sed 's/0.18/0.20/g' -i po/Makefile.in.in
# thanks to the archers for this patch ;)
patch -p1 -i $CWD/gcc5.patch
diff --git a/office/apvlv/apvlv.SlackBuild b/office/apvlv/apvlv.SlackBuild
index 5246eb400f..62eff77de8 100644
--- a/office/apvlv/apvlv.SlackBuild
+++ b/office/apvlv/apvlv.SlackBuild
@@ -23,15 +23,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
PRGNAM=apvlv
-VERSION=${VERSION:-0.1.4}
+VERSION=${VERSION:-20160627_9ab7626}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -42,8 +41,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -61,21 +60,21 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$VERSION-Source
-tar xvf $CWD/$PRGNAM-$VERSION-Source.tar.gz
-cd $PRGNAM-$VERSION-Source
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
+cd $PRGNAM-$VERSION
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 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+ \( -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 -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_CXX_FLAGS_RELEASE="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS_RELEASE="$SLKCFLAGS -fpermissive" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DAPVLV_WITH_UMD=false \
-DMANDIR=/usr/man \
diff --git a/office/apvlv/apvlv.info b/office/apvlv/apvlv.info
index da882def19..4df540a600 100644
--- a/office/apvlv/apvlv.info
+++ b/office/apvlv/apvlv.info
@@ -1,8 +1,8 @@
PRGNAM="apvlv"
-VERSION="0.1.4"
+VERSION="20160627_9ab7626"
HOMEPAGE="http://naihe2010.github.com/apvlv/"
-DOWNLOAD="https://github.com/downloads/naihe2010/apvlv/apvlv-0.1.4-Source.tar.gz"
-MD5SUM="bcd3e96350a2378662e2f2d0fa02d342"
+DOWNLOAD="http://ponce.cc/slackware/sources/repo/apvlv-20160627_9ab7626.tar.xz"
+MD5SUM="e7a285ca7ac4d3abc1842519c0f20987"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/asymptote/asymptote.SlackBuild b/office/asymptote/asymptote.SlackBuild
index c591eca5ff..4a28ee876b 100644
--- a/office/asymptote/asymptote.SlackBuild
+++ b/office/asymptote/asymptote.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=asymptote
-VERSION=${VERSION:-2.44}
+VERSION=${VERSION:-2.70}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
diff --git a/office/asymptote/asymptote.info b/office/asymptote/asymptote.info
index 2d7de25278..26d4a4f763 100644
--- a/office/asymptote/asymptote.info
+++ b/office/asymptote/asymptote.info
@@ -1,10 +1,10 @@
PRGNAM="asymptote"
-VERSION="2.44"
+VERSION="2.70"
HOMEPAGE="http://asymptote.sourceforge.net/"
-DOWNLOAD="https://downloads.sourceforge.net/sourceforge/asymptote/asymptote-2.44.src.tgz"
-MD5SUM="98cd8858841e6e833039b85e0b814257"
+DOWNLOAD="https://downloads.sourceforge.net/asymptote/asymptote-2.70.src.tgz"
+MD5SUM="b57e685568a7cca69024a86c7276eb6d"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="texlive"
+REQUIRES="glm texlive"
MAINTAINER="Johannes Schoepfer"
EMAIL="slackbuilds[at]schoepfer[dot]info"
diff --git a/office/calibre/calibre.SlackBuild b/office/calibre/calibre.SlackBuild
index 048798bcf9..ef72f00a09 100644
--- a/office/calibre/calibre.SlackBuild
+++ b/office/calibre/calibre.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=calibre
-VERSION=${VERSION:-3.34.0}
+VERSION=${VERSION:-3.48.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -70,6 +70,10 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Patch for the newer icu4c
+patch -p1 < $CWD/patches/icu.patch
+# Patch for qt-5.15.x
+patch -p1 < $CWD/patches/qt-5.15.patch
# Remove desktop integration. We'll do that later.
patch -p1 < $CWD/patches/remove-desktop-integration.patch
# Fix calibre module location.
@@ -79,10 +83,6 @@ patch -p1 < $CWD/patches/calibre-no-update.patch
# Remove calibre portable scripts.
rm -f resources/calibre-portable.*
-PYTHONVER=$(python -V 2>&1 | cut -f 2 -d' ' | cut -f 1-2 -d.)
-export SIP_BIN=/usr/bin/python2-sip
-export SIP_INC_DIR="/usr/include/python$PYTHONVER/python2-sip"
-
OVERRIDE_CFLAGS="$SLKCFLAGS" \
OVERRIDE_LDFLAGS="-L/usr/lib${LIBDIRSUFFIX}" \
python setup.py build
diff --git a/office/calibre/calibre.info b/office/calibre/calibre.info
index ef7454be15..a2716dfff7 100644
--- a/office/calibre/calibre.info
+++ b/office/calibre/calibre.info
@@ -1,10 +1,10 @@
PRGNAM="calibre"
-VERSION="3.34.0"
+VERSION="3.48.0"
HOMEPAGE="https://calibre-ebook.com"
-DOWNLOAD="https://download.calibre-ebook.com/3.34.0/calibre-3.34.0.tar.xz"
-MD5SUM="8d462959dba64b829529b63fd3f78b8c"
+DOWNLOAD="https://download.calibre-ebook.com/3.48.0/calibre-3.48.0.tar.xz"
+MD5SUM="ec7431dcdeea8a9d8eca3edc83bdec42"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="cssutils dnspython mechanize podofo python-dateutil netifaces psutil cssselect apsw optipng PyQt5 Pygments msgpack-python regex html5-parser dukpy unrardll"
+REQUIRES="css-parser dnspython mechanize podofo python-dateutil netifaces psutil cssselect apsw optipng PyQt5 Pygments msgpack-python regex html5-parser dukpy unrardll python2-pillow"
MAINTAINER="Larry Hajali"
EMAIL="larryhaja[at]gmail[dot]com"
diff --git a/office/calibre/patches/icu.patch b/office/calibre/patches/icu.patch
new file mode 100644
index 0000000000..498691e90a
--- /dev/null
+++ b/office/calibre/patches/icu.patch
@@ -0,0 +1,31 @@
+diff -Naur calibre-3.48.0.orig/src/calibre/utils/icu.c calibre-3.48.0/src/calibre/utils/icu.c
+--- calibre-3.48.0.orig/src/calibre/utils/icu.c 2019-09-13 04:46:46.000000000 +0200
++++ calibre-3.48.0/src/calibre/utils/icu.c 2020-12-05 09:20:59.063932000 +0100
+@@ -243,14 +243,14 @@
+
+ a = python_to_icu(a_, &asz);
+ if (a == NULL) goto end;
+- if (asz == 0) { found = TRUE; goto end; }
++ if (asz == 0) { found = true; goto end; }
+ b = python_to_icu(b_, &bsz);
+ if (b == NULL) goto end;
+
+ search = usearch_openFromCollator(a, asz, b, bsz, self->collator, NULL, &status);
+ if (U_SUCCESS(status)) {
+ pos = usearch_first(search, &status);
+- if (pos != USEARCH_DONE) found = TRUE;
++ if (pos != USEARCH_DONE) found = true;
+ }
+ end:
+ if (search != NULL) usearch_close(search);
+diff -Naur calibre-3.48.0.orig/src/calibre/utils/matcher.c calibre-3.48.0/src/calibre/utils/matcher.c
+--- calibre-3.48.0.orig/src/calibre/utils/matcher.c 2019-09-13 04:46:46.000000000 +0200
++++ calibre-3.48.0/src/calibre/utils/matcher.c 2020-12-05 09:26:57.800932000 +0100
+@@ -15,7 +15,6 @@
+ #define inline
+ #endif
+
+-typedef unsigned char bool;
+ #define TRUE 1
+ #define FALSE 0
+ #define MAX(x, y) ((x > y) ? x : y)
diff --git a/office/calibre/patches/qt-5.15.patch b/office/calibre/patches/qt-5.15.patch
new file mode 100644
index 0000000000..bfcb486e9b
--- /dev/null
+++ b/office/calibre/patches/qt-5.15.patch
@@ -0,0 +1,40 @@
+From db7007a25faefb0cc90e64dda1c0793393b9512d Mon Sep 17 00:00:00 2001
+From: Antonio Rojas <arojas@archlinux.org>
+Date: Tue, 26 May 2020 20:10:48 +0200
+Subject: [PATCH] Update fontconfig database for Qt 5.15
+
+---
+ src/calibre/headless/fontconfig_database.cpp | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/src/calibre/headless/fontconfig_database.cpp b/src/calibre/headless/fontconfig_database.cpp
+index d867f02948..96a6365ba2 100644
+--- a/src/calibre/headless/fontconfig_database.cpp
++++ b/src/calibre/headless/fontconfig_database.cpp
+@@ -295,7 +295,26 @@ static const char specialLanguages[][6] = {
+ "", // MasaramGondi
+ "", // Nushu
+ "", // Soyombo
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++ "", // ZanabazarSquare
++ "", // Dogra
++ "", // GunjalaGondi
++ "", // HanifiRohingya
++ "", // Makasar
++ "", // Medefaidrin
++ "", // OldSogdian
++ "", // Sogdian
++ "", // Elymaic
++ "", // Nandinagari
++ "", // NyiakengPuachueHmong
++ "", // Wancho
++ "", // Chorasmian
++ "", // DivesAkuru
++ "", // KhitanSmallScript
++ "" // Yezidi
++#else
+ "" // ZanabazarSquare
++#endif // Qt >= 5.15
+ #else
+ "" // SignWriting
+ #endif // Qt >= 5.11
diff --git a/office/calibre/patches/remove-desktop-integration.patch b/office/calibre/patches/remove-desktop-integration.patch
index dbf54d6cb0..0272a7c6eb 100644
--- a/office/calibre/patches/remove-desktop-integration.patch
+++ b/office/calibre/patches/remove-desktop-integration.patch
@@ -1,13 +1,14 @@
-diff -Naur calibre.orig/src/calibre/linux.py calibre/src/calibre/linux.py
---- calibre.orig/src/calibre/linux.py 2012-06-29 04:53:39.000000000 +0000
-+++ calibre/src/calibre/linux.py 2012-07-03 02:57:13.834849391 +0000
-@@ -177,9 +177,6 @@
- self.mime_resources = []
+diff -Naur calibre-3.48.0.orig/src/calibre/linux.py calibre-3.48.0/src/calibre/linux.py
+--- calibre-3.48.0.orig/src/calibre/linux.py 2019-09-13 04:46:46.000000000 +0200
++++ calibre-3.48.0/src/calibre/linux.py 2020-03-04 15:02:49.789055000 +0100
+@@ -725,10 +725,6 @@
+ self.appdata_resources = []
if islinux or isbsd:
self.setup_completion()
- if islinux or isbsd:
- self.setup_desktop_integration()
-- self.create_uninstaller()
+- if not getattr(self.opts, 'staged_install', False):
+- self.create_uninstaller()
from calibre.utils.config import config_dir
if os.path.exists(config_dir):
diff --git a/office/evince/evince.SlackBuild b/office/evince/evince.SlackBuild
index a1f6e48489..b944aacad0 100644
--- a/office/evince/evince.SlackBuild
+++ b/office/evince/evince.SlackBuild
@@ -33,7 +33,7 @@
# some fugly hackery to work, see shim.h for gory details and polemic.
PRGNAM=evince
-VERSION=${VERSION:-3.28.5}
+VERSION=${VERSION:-3.34.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -89,20 +89,6 @@ if [ "$NLS" != "YES" ]; then
-e 's/ENABLE_NLS 1/ENABLE_NLS 0/g' configure
fi
-# 20200101 bkw: "shim" to let us actually compile with gtk+-3.18 and
-# glib-2.46.2. Supposedly these versions are supported by evince-3.28.5,
-# but upstream uses a couple of functions that are new in gtk+-3.22
-# and glib-2.52. Fortunately it's stuff we can work around with a few
-# #defines.
-SLKCFLAGS="$SLKCFLAGS -include $CWD/shim.h"
-
-# 20200101 bkw: 14.2's mime stuff identifies djvu files as
-# image/vnd.djvu only, but evince wants image/vnd.djvu+multipage.
-sed -i '/^ *DJVU_MIME_TYPES/s|="|&image/vnd.djvu;|' configure
-
-# If we were building 3.30.x, we'd need this:
-# --without-gspell \
-
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
@@ -126,23 +112,18 @@ CXXFLAGS="$SLKCFLAGS" \
--disable-static \
--disable-nautilus \
--disable-maintainer-mode \
+ --without-gspell \
--with-systemduserunitdir=no \
--build=$ARCH-slackware-linux
-# ugh. glib-genmarshal's flags changed gratuitously.
-sed -i 's,--prototypes,--header,' libview/Makefile
-
make V=1
make install-strip DESTDIR=$PKG
-# Fix desktop entry
-sed -i "/NoDisplay=true/d" $PKG/usr/share/applications/evince.desktop
-
gzip -9 $PKG/usr/man/man1/$PRGNAM.1
rm -rf $PKG/{usr/share/gtk-doc,etc}
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS COPYING NEWS README MAINTAINERS $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COPYING NEWS README.md MAINTAINERS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/office/evince/evince.info b/office/evince/evince.info
index 91a6eca4f1..a5814eea74 100644
--- a/office/evince/evince.info
+++ b/office/evince/evince.info
@@ -1,8 +1,8 @@
PRGNAM="evince"
-VERSION="3.28.5"
+VERSION="3.34.2"
HOMEPAGE="http://projects.gnome.org/evince/"
-DOWNLOAD="https://download.gnome.org/sources/evince/3.28/evince-3.28.5.tar.xz"
-MD5SUM="855600d64544a959add349e32f5185e0"
+DOWNLOAD="https://download.gnome.org/sources/evince/3.34/evince-3.34.2.tar.xz"
+MD5SUM="9e9e82fa8f6045ad7817157d9335d185"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/evince/shim.h b/office/evince/shim.h
deleted file mode 100644
index 8439c34ac5..0000000000
--- a/office/evince/shim.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 20191231 bkw: This seems like stupidity: g_content_type_is_mime_type
- is a new function in glib-2.52, which literally just calls the
- g_content_type_is_a function from older glibs, and returns its
- result. Here's the function from the glib-2.52 source:
-
- gboolean
- g_content_type_is_mime_type (const gchar *type,
- const gchar *mime_type)
- {
- return g_content_type_is_a (type, mime_type);
- }
-
- The docs describe it as a "convenience wrapper" but there's
- nothing more or less convenient about it, except that it breaks builds
- with older glib versions. Why does it even exist?
- */
-#define g_content_type_is_mime_type(x,y) g_content_type_is_a(x,y)
-
-/* 20191231 bkw: We'd need gtk+-3.22 to have gtk_popover_popup and
- gtk_popover_popdown. They're functionally the same as gtk_widget_show
- and gtk_widget_hide, except they have a "transition" (fade-in/out).
- Some folks might actually prefer it without the fade.
- */
-#define gtk_popover_popup(x) gtk_widget_show(GTK_WIDGET(x))
-#define gtk_popover_popdown(x) gtk_widget_hide(GTK_WIDGET(x))
diff --git a/office/fbreader/fbreader-qt5.patch b/office/fbreader/fbreader-qt5.patch
new file mode 100644
index 0000000000..e0f0a5235a
--- /dev/null
+++ b/office/fbreader/fbreader-qt5.patch
@@ -0,0 +1,510 @@
+diff -r -U2 fbreader-0.99.4.orig/fbreader/Makefile fbreader-0.99.4/fbreader/Makefile
+--- fbreader-0.99.4.orig/fbreader/Makefile 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/fbreader/Makefile 2018-01-11 22:18:18.000208200 +0700
+@@ -23,5 +23,5 @@
+ done;
+ @echo -n 'Linking $(TARGET) ...'
+- @$(LD) $(LDFLAGS) -o $(TARGET) `find src -name *.o` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3
++ @$(LD) -fuse-ld=bfd $(LDFLAGS) -o $(TARGET) `find src -name *.o` $(TEXT_LIBS) $(CORE_LIBS) $(ZLUI_LIB) -lsqlite3
+ @echo ' OK'
+
+diff -r -U2 fbreader-0.99.4.orig/makefiles/arch/desktop.mk fbreader-0.99.4/makefiles/arch/desktop.mk
+--- fbreader-0.99.4.orig/makefiles/arch/desktop.mk 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/makefiles/arch/desktop.mk 2018-01-11 22:18:40.119207269 +0700
+@@ -15,27 +15,9 @@
+ CFLAGS = -pipe -fno-exceptions -Wall -Wno-ctor-dtor-privacy -W -DLIBICONV_PLUG
+ LDFLAGS =
+-EXTERNAL_INCLUDE = $(shell pkg-config --cflags fribidi)
++EXTERNAL_INCLUDE = $(shell pkg-config --cflags fribidi)
+
+-ifeq "$(UI_TYPE)" "qt"
+- MOC = moc-qt3
+- QTINCLUDE = -I /usr/include/qt3
+-else
+- MOC = $(shell pkg-config QtCore --variable=moc_location)
+- QTINCLUDE = -I $(shell pkg-config --cflags QtCore)
+-endif
+-
+-GTKINCLUDE = $(shell pkg-config --cflags gtk+-2.0 libpng xft)
+-
+-ifeq "$(UI_TYPE)" "qt"
+- UILIBS = -lqt-mt
+-endif
+-
+-ifeq "$(UI_TYPE)" "qt4"
+- UILIBS = $(shell pkg-config --libs QtCore QtGui QtNetwork)
+-endif
+-
+-ifeq "$(UI_TYPE)" "gtk"
+- UILIBS = $(shell pkg-config --libs gtk+-2.0 gio-2.0) -lpng -ljpeg
+-endif
++MOC = "$(shell pkg-config --variable=host_bins Qt5Core)/moc"
++QTINCLUDE = $(shell pkg-config --cflags Qt5Gui Qt5Widgets Qt5Network)
++UILIBS = $(shell pkg-config --libs Qt5Gui Qt5Widgets Qt5Network)
+
+ RM = rm -rvf
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/LineEditParameter.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/application/LineEditParameter.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/LineEditParameter.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/application/LineEditParameter.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,7 +18,7 @@
+ */
+
+-#include <QtGui/QBoxLayout>
+-#include <QtGui/QLineEdit>
+-#include <QtGui/QToolBar>
++#include <QtWidgets/QBoxLayout>
++#include <QtWidgets/QLineEdit>
++#include <QtWidgets/QToolBar>
+ #include <QtGui/QKeyEvent>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,15 +18,15 @@
+ */
+
+-#include <QtGui/QApplication>
++#include <QtWidgets/QApplication>
+ #include <QtGui/QPixmap>
+ #include <QtGui/QImage>
+ #include <QtGui/QIcon>
+-#include <QtGui/QToolBar>
+-#include <QtGui/QMenuBar>
+-#include <QtGui/QMenu>
+-#include <QtGui/QToolButton>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QToolBar>
++#include <QtWidgets/QMenuBar>
++#include <QtWidgets/QMenu>
++#include <QtWidgets/QToolButton>
++#include <QtWidgets/QLayout>
+ #include <QtGui/QWheelEvent>
+-#include <QtGui/QDockWidget>
++#include <QtWidgets/QDockWidget>
+ #include <QtCore/QObjectList>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h fbreader-0.99.4/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h 2018-01-11 22:18:40.120207269 +0700
+@@ -23,6 +23,6 @@
+ #include <map>
+
+-#include <QtGui/QMainWindow>
+-#include <QtGui/QAction>
++#include <QtWidgets/QMainWindow>
++#include <QtWidgets/QAction>
+ #include <QtGui/QCursor>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,6 +18,6 @@
+ */
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QPushButton>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QPushButton>
+
+ #include <ZLDialogManager.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h 2018-01-11 22:18:40.120207269 +0700
+@@ -21,6 +21,6 @@
+ #define __ZLQTDIALOG_H__
+
+-#include <QtGui/QDialog>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QDialog>
++#include <QtWidgets/QLayout>
+
+ #include <ZLDialog.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,8 +18,8 @@
+ */
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QDesktopWidget>
+-#include <QtGui/QWidget>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QDesktopWidget>
++#include <QtWidgets/QWidget>
++#include <QtWidgets/QLayout>
+
+ #include "ZLQtDialogContent.h"
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,9 +18,9 @@
+ */
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QMessageBox>
+-#include <QtGui/QFileDialog>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QMessageBox>
++#include <QtWidgets/QFileDialog>
+ #include <QtGui/QClipboard>
+-#include <QtGui/QDesktopWidget>
++#include <QtWidgets/QDesktopWidget>
+
+ #include "ZLQtDialogManager.h"
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,5 +18,5 @@
+ */
+
+-#include <QtGui/QFileDialog>
++#include <QtWidgets/QFileDialog>
+
+ #include "ZLQtOpenFileDialog.h"
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp 2018-01-11 22:18:40.121207269 +0700
+@@ -20,14 +20,14 @@
+ #include <cctype>
+
+-#include <QtGui/QCheckBox>
+-#include <QtGui/QComboBox>
+-#include <QtGui/QLabel>
+-#include <QtGui/QGroupBox>
+-#include <QtGui/QRadioButton>
+-#include <QtGui/QPushButton>
+-#include <QtGui/QSpinBox>
+-#include <QtGui/QLineEdit>
+-#include <QtGui/QSlider>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QCheckBox>
++#include <QtWidgets/QComboBox>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QGroupBox>
++#include <QtWidgets/QRadioButton>
++#include <QtWidgets/QPushButton>
++#include <QtWidgets/QSpinBox>
++#include <QtWidgets/QLineEdit>
++#include <QtWidgets/QSlider>
++#include <QtWidgets/QLayout>
+
+ #include <ZLStringUtil.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp 2018-01-11 22:18:40.121207269 +0700
+@@ -18,9 +18,9 @@
+ */
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QDesktopWidget>
+-#include <QtGui/QLayout>
+-#include <QtGui/QPushButton>
+-#include <QtGui/QButtonGroup>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QDesktopWidget>
++#include <QtWidgets/QLayout>
++#include <QtWidgets/QPushButton>
++#include <QtWidgets/QButtonGroup>
+ #include <QtGui/QResizeEvent>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h 2018-01-11 22:18:40.121207269 +0700
+@@ -21,7 +21,7 @@
+ #define __ZLQTOPTIONSDIALOG_H__
+
+-#include <QtGui/QWidget>
+-#include <QtGui/QTabWidget>
+-#include <QtGui/QDialog>
++#include <QtWidgets/QWidget>
++#include <QtWidgets/QTabWidget>
++#include <QtWidgets/QDialog>
+
+ #include "../../../../core/src/desktop/dialogs/ZLDesktopOptionsDialog.h"
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp 2018-01-11 22:18:40.121207269 +0700
+@@ -20,9 +20,9 @@
+ #include <unistd.h>
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QDesktopWidget>
+-#include <QtGui/QWidget>
+-#include <QtGui/QLabel>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QDesktopWidget>
++#include <QtWidgets/QWidget>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QLayout>
+ #include <QtCore/QThreadPool>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h 2018-01-11 22:18:40.121207269 +0700
+@@ -23,9 +23,9 @@
+ #include <string>
+
+-#include <QtGui/QWidget>
++#include <QtWidgets/QWidget>
+ #include <QtGui/QCursor>
+-#include <QtGui/QDialog>
+-#include <QtGui/QProgressBar>
+-#include <QtGui/QLabel>
++#include <QtWidgets/QDialog>
++#include <QtWidgets/QProgressBar>
++#include <QtWidgets/QLabel>
+ #include <QtCore/QRunnable>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -20,10 +20,10 @@
+ #include <algorithm>
+
+-#include <QtGui/QSplitter>
+-#include <QtGui/QVBoxLayout>
+-#include <QtGui/QHBoxLayout>
+-#include <QtGui/QScrollBar>
+ #include <QtGui/QResizeEvent>
+ #include <QtCore/QDebug>
++#include <QtWidgets/QSplitter>
++#include <QtWidgets/QVBoxLayout>
++#include <QtWidgets/QHBoxLayout>
++#include <QtWidgets/QScrollBar>
+
+ #include <ZLFile.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h 2018-01-11 22:18:40.121207269 +0700
+@@ -25,10 +25,10 @@
+ #include <QtCore/QMap>
+
+-#include <QtGui/QDialog>
+-#include <QtGui/QScrollArea>
+-#include <QtGui/QPushButton>
+-#include <QtGui/QLabel>
+-#include <QtGui/QLineEdit>
+-#include <QtGui/QWidget>
++#include <QtWidgets/QDialog>
++#include <QtWidgets/QScrollArea>
++#include <QtWidgets/QPushButton>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QLineEdit>
++#include <QtWidgets/QWidget>
+
+ #include <ZLTreeDialog.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/library/ZLQApplication.h fbreader-0.99.4/zlibrary/ui/src/qt4/library/ZLQApplication.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/library/ZLQApplication.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/library/ZLQApplication.h 2018-01-11 22:18:40.121207269 +0700
+@@ -21,5 +21,5 @@
+ #define __ZLQAPPLICATION_H__
+
+-#include <QtGui/QApplication>
++#include <QtWidgets/QApplication>
+
+ class ZLQApplication : public QApplication {
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/library/ZLibrary.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/library/ZLibrary.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/library/ZLibrary.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/library/ZLibrary.cpp 2018-01-11 22:18:40.121207269 +0700
+@@ -20,5 +20,5 @@
+ #include <QtCore/QTextCodec>
+ #include <QtCore/QFile>
+-#include <QtGui/QApplication>
++#include <QtWidgets/QApplication>
+ #include <QtGui/QFileOpenEvent>
+
+@@ -73,5 +73,5 @@
+ new ZLQApplication(argc, argv);
+
+- QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf-8"));
++ QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
+
+ ZLibrary::parseArguments(argc, argv);
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -25,5 +25,7 @@
+ #include <QtCore/QList>
+ #include <QtCore/QTimer>
++#include <QtCore/QUrlQuery>
+
++#include <QtNetwork/QNetworkCookie>
+ #include <QtNetwork/QNetworkRequest>
+ #include <QtNetwork/QNetworkReply>
+@@ -150,10 +152,10 @@
+ if (!scope.request->postParameters().empty()) {
+ QByteArray data;
+- QUrl tmp;
++ QUrlQuery tmp;
+ typedef std::pair<std::string, std::string> string_pair;
+ foreach (const string_pair &pair, scope.request->postParameters()) {
+ tmp.addQueryItem(QString::fromStdString(pair.first), QString::fromStdString(pair.second));
+ }
+- data = tmp.encodedQuery();
++ data = tmp.query(QUrl::FullyEncoded).toUtf8(); //encodedQuery();
+ reply = const_cast<QNetworkAccessManager&>(myManager).post(networkRequest, data);
+ } else {
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.cpp 2018-01-11 22:13:39.639219906 +0700
+@@ -87,5 +87,5 @@
+
+ void QtWaitingSpinner::setRoundness(qreal roundness) {
+- myRoundness = std::max(0.0, std::min(100.0, roundness));
++ myRoundness = std::max(static_cast<qreal>(0.0), std::min(static_cast<qreal>(100.0), roundness));
+ }
+
+@@ -149,5 +149,5 @@
+ qreal gradation = alphaDiff / (qreal)(distanceThreshold + 1);
+ qreal resultAlpha = color.alphaF() - gradation * distance;
+- resultAlpha = std::min(1.0, std::max(0.0, resultAlpha)); //if alpha is out of bound, force it to bounds
++ resultAlpha = std::min(static_cast<qreal>(1.0), std::max(static_cast<qreal>(0.0), resultAlpha)); //if alpha is out of bound, force it to bounds
+ color.setAlphaF(resultAlpha);
+ return color;
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h 2018-01-11 22:18:40.121207269 +0700
+@@ -4,5 +4,5 @@
+ #include <QtCore/QTimer>
+
+-#include <QtGui/QWidget>
++#include <QtWidgets/QWidget>
+ #include <QtGui/QColor>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,12 +18,12 @@
+ */
+
+-#include <QtGui/QVBoxLayout>
+-#include <QtGui/QHBoxLayout>
+ #include <QtGui/QPixmap>
+ #include <QtGui/QPalette>
+ #include <QtGui/QPainter>
+ #include <QtGui/QPaintEvent>
+-#include <QtGui/QScrollBar>
+ #include <QtCore/QTimer>
++#include <QtWidgets/QVBoxLayout>
++#include <QtWidgets/QHBoxLayout>
++#include <QtWidgets/QScrollBar>
+
+ #include <QtCore/QDebug>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h 2018-01-11 22:18:40.120207269 +0700
+@@ -21,10 +21,10 @@
+ #define __ZLQTITEMSLISTWIDGET_H__
+
+-#include <QtGui/QWidget>
+-#include <QtGui/QFrame>
+-#include <QtGui/QPushButton>
+-#include <QtGui/QLabel>
+-#include <QtGui/QVBoxLayout>
+-#include <QtGui/QScrollArea>
++#include <QtWidgets/QWidget>
++#include <QtWidgets/QFrame>
++#include <QtWidgets/QPushButton>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QVBoxLayout>
++#include <QtWidgets/QScrollArea>
+
+ #include <ZLTreeTitledNode.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -18,8 +18,8 @@
+ */
+
+-#include <QtGui/QVBoxLayout>
+-#include <QtGui/QHBoxLayout>
+-#include <QtGui/QScrollBar>
+-#include <QtGui/QGraphicsDropShadowEffect>
++#include <QtWidgets/QVBoxLayout>
++#include <QtWidgets/QHBoxLayout>
++#include <QtWidgets/QScrollBar>
++#include <QtWidgets/QGraphicsDropShadowEffect>
+
+ #include <QtCore/QDebug>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h 2018-01-11 22:18:40.121207269 +0700
+@@ -21,9 +21,9 @@
+ #define __ZLQTPREVIEWWIDGET_H__
+
+-#include <QtGui/QWidget>
+-#include <QtGui/QPushButton>
+-#include <QtGui/QLabel>
+-#include <QtGui/QScrollArea>
+-#include <QtGui/QVBoxLayout>
++#include <QtWidgets/QWidget>
++#include <QtWidgets/QPushButton>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QScrollArea>
++#include <QtWidgets/QVBoxLayout>
+ #include <QtCore/QSet>
+
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp 2018-01-11 22:18:40.120207269 +0700
+@@ -19,7 +19,7 @@
+
+ #include <QtCore/QDebug>
+-#include <QtGui/QStyle>
+-#include <QtGui/QCompleter>
+-#include <QtGui/QStringListModel>
++#include <QtCore/QStringListModel>
++#include <QtWidgets/QStyle>
++#include <QtWidgets/QCompleter>
+
+ #include <ZLibrary.h>
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h 2018-01-11 22:18:40.121207269 +0700
+@@ -22,6 +22,6 @@
+
+ #include <QtCore/QSet>
+-#include <QtGui/QLabel>
+-#include <QtGui/QLineEdit>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QLineEdit>
+
+ #include "QtWaitingSpinner.h"
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp 2018-01-11 22:18:40.121207269 +0700
+@@ -20,6 +20,6 @@
+ #include <algorithm>
+
+-#include <QtGui/QLayout>
+-#include <QtGui/QScrollBar>
++#include <QtWidgets/QLayout>
++#include <QtWidgets/QScrollBar>
+ #include <QtGui/QPainter>
+ #include <QtGui/QPixmap>
+@@ -186,9 +186,9 @@
+ void ZLQtViewWidget::setScrollbarEnabled(ZLView::Direction direction, bool enabled) {
+ if (direction == ZLView::VERTICAL) {
+- myRightScrollBar->setShown(enabled && myShowScrollBarAtRight);
+- myLeftScrollBar->setShown(enabled && !myShowScrollBarAtRight);
++ myRightScrollBar->setVisible(enabled && myShowScrollBarAtRight);
++ myLeftScrollBar->setVisible(enabled && !myShowScrollBarAtRight);
+ } else {
+- myBottomScrollBar->setShown(enabled && myShowScrollBarAtBottom);
+- myTopScrollBar->setShown(enabled && !myShowScrollBarAtBottom);
++ myBottomScrollBar->setVisible(enabled && myShowScrollBarAtBottom);
++ myTopScrollBar->setVisible(enabled && !myShowScrollBarAtBottom);
+ }
+ }
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h fbreader-0.99.4/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h 2018-01-11 22:18:40.121207269 +0700
+@@ -21,5 +21,5 @@
+ #define __ZLQTVIEWWIDGET_H__
+
+-#include <QtGui/QWidget>
++#include <QtWidgets/QWidget>
+
+ #include "../../../../core/src/view/ZLViewWidget.h"
diff --git a/office/fbreader/fbreader.SlackBuild b/office/fbreader/fbreader.SlackBuild
index d5c54adeac..bef54c8b35 100644
--- a/office/fbreader/fbreader.SlackBuild
+++ b/office/fbreader/fbreader.SlackBuild
@@ -56,14 +56,18 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Needed for gcc >= 6.x
+sed -i "s|-Wall|-Wall -Wno-narrowing|" makefiles/arch/desktop.mk
patch -p1 < $CWD/fbreader-0.99.4.patch
+# Port to qt5 - patch from gentoo
+patch -p1 < $CWD/fbreader-qt5.patch
export TARGET_ARCH=desktop
-export UI_TYPE=qt4
+export UI_TYPE=qt4 # this hasn't changed
export TARGET_STATUS=release
-make LIBDIR=/usr/lib${LIBDIRSUFFIX} ZLSHARED=no MOC=/usr/bin/moc
-make install LIBDIR=/usr/lib${LIBDIRSUFFIX} ZLSHARED=no DESTDIR=$PKG
+make LIBDIR=/usr/lib${LIBDIRSUFFIX}
+make install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG
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
diff --git a/office/gbgoffice/gbgoffice.SlackBuild b/office/gbgoffice/gbgoffice.SlackBuild
index 08a3eac59b..268a1f6f00 100644
--- a/office/gbgoffice/gbgoffice.SlackBuild
+++ b/office/gbgoffice/gbgoffice.SlackBuild
@@ -78,6 +78,7 @@ patch -p1 -i $CWD/patches/08_fix_const_conversion.patch
patch -p1 -i $CWD/patches/09_deprecated_SigC.patch
patch -p1 -i $CWD/patches/10_workhelper-buttonbox.patch
patch -p1 -i $CWD/patches/11_explicit-linkage.patch
+patch -p1 -i $CWD/patches/12_gcc6.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS -std=c++11" \
diff --git a/office/gbgoffice/patches/12_gcc6.patch b/office/gbgoffice/patches/12_gcc6.patch
new file mode 100644
index 0000000000..2ec2c344f4
--- /dev/null
+++ b/office/gbgoffice/patches/12_gcc6.patch
@@ -0,0 +1,21 @@
+Description: fixes compilation with GCC-6
+ return type must be Translator* and can't be boolean
+Author: Damyan Ivanov <dmn@debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811619
+
+--- a/src/translator_manager.cpp
++++ b/src/translator_manager.cpp
+@@ -176,11 +176,11 @@ Translator *TranslatorManager::getTestDi
+ isDataOk = isDataOk && tr->init(tr->BG_EN, string(string(prop->getDirectory()) + prop->getString("data")).c_str());
+ } else {
+ cerr << "TranslatorManager::getTestDictionaryObject - Wrong description file: " << testDictionaries[index].fileName << "\n";
+- return false;
++ return NULL;
+ }
+ if (!isDataOk) {
+ cerr << "TranslatorManager::getTestDictionaryObject - Problem initialazing dictionary: " << testDictionaries[index].fileName << "\n";
+- return false;
++ return NULL;
+ }
+ char c[16];
+ sprintf(c, "%d", level);
diff --git a/office/gnokii/gnokii-0.6.31-gcc7.patch b/office/gnokii/gnokii-0.6.31-gcc7.patch
new file mode 100644
index 0000000000..6637a6af62
--- /dev/null
+++ b/office/gnokii/gnokii-0.6.31-gcc7.patch
@@ -0,0 +1,17 @@
+Patch by Robert Scheck <robert@fedoraproject.org> for gnokii <= 0.6.31 to avoid
+build failures with GCC 7.x as "../common/.libs/libgnokii.so: undefined reference
+to `local_atoi'". The "inline" is only a hint that the compiler doesn't complain
+about double defined symbols, but does not guarantee that a function is inlined
+or that a symbol is generated when needed.
+
+--- gnokii-0.6.31/common/gsm-filetypes.c 2011-12-02 15:53:04.000000000 +0100
++++ gnokii-0.6.31/common/gsm-filetypes.c.gcc7 2017-02-12 00:55:39.000000000 +0100
+@@ -1409,7 +1409,7 @@
+ #define GET_NEXT_TOKEN() o = get_next_token(line + offset, ';')
+ #define STORE_TOKEN(a) strip_slashes(a, line + offset, sizeof(a) - 1, o - 1)
+
+-inline int local_atoi(char *str, int len)
++static int local_atoi(char *str, int len)
+ {
+ int retval;
+ char *aux = strndup(str, len);
diff --git a/office/gnokii/gnokii.SlackBuild b/office/gnokii/gnokii.SlackBuild
index eb3b4f1519..5301e1c7cf 100644
--- a/office/gnokii/gnokii.SlackBuild
+++ b/office/gnokii/gnokii.SlackBuild
@@ -73,6 +73,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Thnx to fedora for this patch
+patch -p1 < $CWD/gnokii-0.6.31-gcc7.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
diff --git a/office/gnucash-docs/README b/office/gnucash-docs/README
index 0dbc6ce019..cb542cedc1 100644
--- a/office/gnucash-docs/README
+++ b/office/gnucash-docs/README
@@ -25,6 +25,6 @@ Note 1: This script builds the internal guides in all available
languages, but the HTML guides are only in the spacified language
to save space and avoid excessive package bloat.
-Note 2: This builds the docs for version 3.x of Gnucash. If you
+Note 2: This builds the docs for version 4.x of Gnucash. If you
need the old stable 2.6 branch, use gnucash-legacy-docs, also
available on SBo.
diff --git a/office/gnucash-docs/gnucash-docs.SlackBuild b/office/gnucash-docs/gnucash-docs.SlackBuild
index d43e8ff27f..f533faff82 100644
--- a/office/gnucash-docs/gnucash-docs.SlackBuild
+++ b/office/gnucash-docs/gnucash-docs.SlackBuild
@@ -24,7 +24,7 @@
PRGNAM=gnucash-docs
DESTNAM=gnucash
-VERSION=${VERSION:-3.11}
+VERSION=${VERSION:-4.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
diff --git a/office/gnucash-docs/gnucash-docs.info b/office/gnucash-docs/gnucash-docs.info
index e2e666940f..eddcb897b2 100644
--- a/office/gnucash-docs/gnucash-docs.info
+++ b/office/gnucash-docs/gnucash-docs.info
@@ -1,8 +1,8 @@
PRGNAM="gnucash-docs"
-VERSION="3.11"
+VERSION="4.1"
HOMEPAGE="http://www.gnucash.org"
-DOWNLOAD="http://downloads.sourceforge.net/gnucash/gnucash-docs-3.11.tar.gz"
-MD5SUM="1886563b1fc7b2582a19a96484609581"
+DOWNLOAD="http://downloads.sourceforge.net/gnucash/gnucash-docs-4.1.tar.gz"
+MD5SUM="c9e4a2e5673b890cc4adfcdd429bbc47"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="gnucash rarian yelp"
diff --git a/office/gnucash-legacy/gnucash-legacy.info b/office/gnucash-legacy/gnucash-legacy.info
index 7c4ad9d1f9..5449ab2e68 100644
--- a/office/gnucash-legacy/gnucash-legacy.info
+++ b/office/gnucash-legacy/gnucash-legacy.info
@@ -5,6 +5,6 @@ DOWNLOAD="http://downloads.sourceforge.net/gnucash/gnucash-2.6.21.tar.bz2"
MD5SUM="63226e9b49e11dc0d7106bd15c09996b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="libgnomecanvas goffice0.8 webkitgtk"
+REQUIRES="libgnomecanvas goffice0.8 guile1.8 webkitgtk"
MAINTAINER="Lenard Spencer"
EMAIL="lenardrspencer@gmail.com"
diff --git a/office/gnucash/gnucash.SlackBuild b/office/gnucash/gnucash.SlackBuild
index 1257563bab..eb1ad38ec2 100644
--- a/office/gnucash/gnucash.SlackBuild
+++ b/office/gnucash/gnucash.SlackBuild
@@ -24,7 +24,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=gnucash
-VERSION=${VERSION:-3.11}
+VERSION=${VERSION:-4.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
diff --git a/office/gnucash/gnucash.info b/office/gnucash/gnucash.info
index c899627c28..ba2de04591 100644
--- a/office/gnucash/gnucash.info
+++ b/office/gnucash/gnucash.info
@@ -1,8 +1,8 @@
PRGNAM="gnucash"
-VERSION="3.11"
+VERSION="4.4"
HOMEPAGE="http://www.gnucash.org/"
-DOWNLOAD="http://downloads.sourceforge.net/gnucash/gnucash-3.11.tar.bz2"
-MD5SUM="391f07eb0934618154d9e9c7d717d8e6"
+DOWNLOAD="http://downloads.sourceforge.net/gnucash/gnucash-4.4.tar.bz2"
+MD5SUM="5a1a1703c1e887074be695a10b7aee02"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="webkit2gtk pygobject3-python3 gtest"
diff --git a/office/gnumeric/gnumeric.SlackBuild b/office/gnumeric/gnumeric.SlackBuild
index 0a5d0ee899..e87c652629 100644
--- a/office/gnumeric/gnumeric.SlackBuild
+++ b/office/gnumeric/gnumeric.SlackBuild
@@ -66,6 +66,10 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Avoid the cs help or build will break
+sed -i "s|cs\ de\ es|de es|" doc/Makefile.am || exit 1
+autoreconf -fi
+
# Thanks to mancha for this gem :-)
# The docs will still be missing, but at least we can build the app itself
touch doc/C/gnumeric-C.omf.out
diff --git a/office/goldendict/goldendict.SlackBuild b/office/goldendict/goldendict.SlackBuild
index 2d1e6b478f..71a698c559 100644
--- a/office/goldendict/goldendict.SlackBuild
+++ b/office/goldendict/goldendict.SlackBuild
@@ -53,9 +53,16 @@ cd $TMP
rm -rf $PRGNAM-$SRCVER
tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
cd $PRGNAM-$SRCVER
-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 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-$(type -p qmake-qt5 || echo qmake) PREFIX=/usr \
+# archlinux, thanks for all the patches!
+for i in $CWD/patches/* ; do patch -p1 < $i ; done
+
+qmake-qt5 PREFIX=/usr \
CONFIG+=no_epwing_support \
CONFIG+=zim_support \
DISABLE_INTERNAL_PLAYER=$DISABLE_INTERNAL_PLAYER
diff --git a/office/goldendict/patches/goldendict-ffmpeg4.patch b/office/goldendict/patches/goldendict-ffmpeg4.patch
new file mode 100644
index 0000000000..6e6d03675a
--- /dev/null
+++ b/office/goldendict/patches/goldendict-ffmpeg4.patch
@@ -0,0 +1,167 @@
+From 03bbe01b79a1f07a6780cb60f23a087104c5d77b Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Fri, 30 Mar 2018 22:53:24 +0300
+Subject: [PATCH] Fix warnings while compile with FFMpeg 3.4.2 (issue #978)
+
+---
+ ffmpegaudio.cc | 68 +++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 62 insertions(+), 6 deletions(-)
+
+diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
+index ed1172bd..56e8f788 100644
+--- a/ffmpegaudio.cc
++++ b/ffmpegaudio.cc
+@@ -91,6 +91,7 @@ struct DecoderContext
+ QByteArray audioData_;
+ QDataStream audioDataStream_;
+ AVFormatContext * formatContext_;
++ AVCodec * codec_;
+ AVCodecContext * codecContext_;
+ AVIOContext * avioContext_;
+ AVStream * audioStream_;
+@@ -114,6 +115,7 @@ DecoderContext::DecoderContext( QByteArray const & audioData, QAtomicInt & isCan
+ audioData_( audioData ),
+ audioDataStream_( audioData_ ),
+ formatContext_( NULL ),
++ codec_( NULL ),
+ codecContext_( NULL ),
+ avioContext_( NULL ),
+ audioStream_( NULL ),
+@@ -143,7 +145,11 @@ bool DecoderContext::openCodec( QString & errorString )
+ return false;
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 56 || ( LIBAVCODEC_VERSION_MAJOR == 56 && LIBAVCODEC_VERSION_MINOR < 56 )
+ unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
++#else
++ unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
++#endif
+ if ( !avioBuffer )
+ {
+ errorString = QObject::tr( "av_malloc() failed." );
+@@ -186,7 +192,11 @@ bool DecoderContext::openCodec( QString & errorString )
+ // Find audio stream, use the first audio stream if available
+ for ( unsigned i = 0; i < formatContext_->nb_streams; i++ )
+ {
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+ if ( formatContext_->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO )
++#else
++ if ( formatContext_->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO )
++#endif
+ {
+ audioStream_ = formatContext_->streams[i];
+ break;
+@@ -198,22 +208,38 @@ bool DecoderContext::openCodec( QString & errorString )
+ return false;
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 33 )
+ codecContext_ = audioStream_->codec;
+- AVCodec * codec = avcodec_find_decoder( codecContext_->codec_id );
+- if ( !codec )
++ codec_ = avcodec_find_decoder( codecContext_->codec_id );
++ if ( !codec_ )
+ {
+ errorString = QObject::tr( "Codec [id: %1] not found." ).arg( codecContext_->codec_id );
+ return false;
+ }
++#else
++ codec_ = avcodec_find_decoder( audioStream_->codecpar->codec_id );
++ if ( !codec_ )
++ {
++ errorString = QObject::tr( "Codec [id: %1] not found." ).arg( audioStream_->codecpar->codec_id );
++ return false;
++ }
++ codecContext_ = avcodec_alloc_context3( codec_ );
++ if ( !codecContext_ )
++ {
++ errorString = QObject::tr( "avcodec_alloc_context3() failed." );
++ return false;
++ }
++ avcodec_parameters_to_context( codecContext_, audioStream_->codecpar );
++#endif
+
+- ret = avcodec_open2( codecContext_, codec, NULL );
++ ret = avcodec_open2( codecContext_, codec_, NULL );
+ if ( ret < 0 )
+ {
+ errorString = QObject::tr( "avcodec_open2() failed: %1." ).arg( avErrorString( ret ) );
+ return false;
+ }
+
+- av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec->long_name,
++ av_log( NULL, AV_LOG_INFO, "Codec open: %s: channels: %d, rate: %d, format: %s\n", codec_->long_name,
+ codecContext_->channels, codecContext_->sample_rate, av_get_sample_fmt_name( codecContext_->sample_fmt ) );
+ return true;
+ }
+@@ -252,10 +278,13 @@ void DecoderContext::closeCodec()
+
+ // Closing a codec context without prior avcodec_open2() will result in
+ // a crash in ffmpeg
+- if ( audioStream_ && audioStream_->codec && audioStream_->codec->codec )
++ if ( audioStream_ && codecContext_ && codec_ )
+ {
+ audioStream_->discard = AVDISCARD_ALL;
+- avcodec_close( audioStream_->codec );
++ avcodec_close( codecContext_ );
++#if LIBAVCODEC_VERSION_MAJOR > 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR >= 33 )
++ avcodec_free_context( &codecContext_ );
++#endif
+ }
+
+ avformat_close_input( &formatContext_ );
+@@ -356,6 +385,7 @@ bool DecoderContext::play( QString & errorString )
+ if ( packet.stream_index == audioStream_->index )
+ {
+ AVPacket pack = packet;
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+ int gotFrame = 0;
+ do
+ {
+@@ -370,6 +400,19 @@ bool DecoderContext::play( QString & errorString )
+ pack.data += len;
+ }
+ while( pack.size > 0 );
++#else
++ int ret = avcodec_send_packet( codecContext_, &pack );
++ /* read all the output frames (in general there may be any number of them) */
++ while( ret >= 0 )
++ {
++ ret = avcodec_receive_frame( codecContext_, frame);
++
++ if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++ break;
++
++ playFrame( frame );
++ }
++#endif
+ }
+ // av_free_packet() must be called after each call to av_read_frame()
+ #if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 7 )
+@@ -379,6 +422,7 @@ bool DecoderContext::play( QString & errorString )
+ #endif
+ }
+
++#if LIBAVCODEC_VERSION_MAJOR < 57 || ( LIBAVCODEC_VERSION_MAJOR == 57 && LIBAVCODEC_VERSION_MINOR < 37 )
+ if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
+ codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+ {
+@@ -391,6 +435,18 @@ bool DecoderContext::play( QString & errorString )
+ playFrame( frame );
+ }
+ }
++#else
++ /* flush the decoder */
++ av_init_packet( &packet );
++ int ret = avcodec_send_packet(codecContext_, &packet );
++ while( ret >= 0 )
++ {
++ ret = avcodec_receive_frame(codecContext_, frame);
++ if ( Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) || ret < 0 )
++ break;
++ playFrame( frame );
++ }
++#endif
+
+ #if LIBAVCODEC_VERSION_MAJOR < 54
+ av_free( frame );
diff --git a/office/goldendict/patches/goldendict-qt-5.11-1.patch b/office/goldendict/patches/goldendict-qt-5.11-1.patch
new file mode 100644
index 0000000000..feb1b26e0b
--- /dev/null
+++ b/office/goldendict/patches/goldendict-qt-5.11-1.patch
@@ -0,0 +1,34 @@
+From 3d4a468b6c8cb154c88cf4592a5845973999dc29 Mon Sep 17 00:00:00 2001
+From: Abs62 <ottomann@yandex.ru>
+Date: Tue, 10 Apr 2018 18:44:43 +0300
+Subject: [PATCH] Qt5: Fix compilation with Qt 5.11 (issue #991)
+
+---
+ fulltextsearch.hh | 1 +
+ initializing.cc | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/fulltextsearch.hh b/fulltextsearch.hh
+index da7e2943..adf9619f 100644
+--- a/fulltextsearch.hh
++++ b/fulltextsearch.hh
+@@ -6,6 +6,7 @@
+ #include <QRegExp>
+ #include <QAbstractListModel>
+ #include <QList>
++#include <QAction>
+
+ #include "dictionary.hh"
+ #include "ui_fulltextsearch.h"
+diff --git a/initializing.cc b/initializing.cc
+index 0db6909b..59e605d6 100644
+--- a/initializing.cc
++++ b/initializing.cc
+@@ -1,6 +1,7 @@
+ /* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
+ * Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
+
++#include <QIcon>
+ #include "initializing.hh"
+ #include <QCloseEvent>
+
diff --git a/office/goldendict/patches/goldendict-qt-5.11-2.patch b/office/goldendict/patches/goldendict-qt-5.11-2.patch
new file mode 100644
index 0000000000..7410021651
--- /dev/null
+++ b/office/goldendict/patches/goldendict-qt-5.11-2.patch
@@ -0,0 +1,22 @@
+From a65967805ab424b299bdfa1d1f9c7ebb8a7fd517 Mon Sep 17 00:00:00 2001
+From: Perfect Gentleman <perfect007gentleman@gmail.com>
+Date: Wed, 11 Apr 2018 00:04:12 +0700
+Subject: [PATCH] Update groups_widgets.hh
+
+fixes https://github.com/goldendict/goldendict/issues/991
+---
+ groups_widgets.hh | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/groups_widgets.hh b/groups_widgets.hh
+index ce442fa2..2064e3bb 100644
+--- a/groups_widgets.hh
++++ b/groups_widgets.hh
+@@ -8,6 +8,7 @@
+
+ #include <vector>
+
++#include <QAction>
+ #include <QListWidget>
+ #include <QSortFilterProxyModel>
+
diff --git a/office/juffed/README b/office/juffed/README
deleted file mode 100644
index b322d42743..0000000000
--- a/office/juffed/README
+++ /dev/null
@@ -1,6 +0,0 @@
-JuffEd is a free, cross-platform text editor for programmers and
-advanced users. Has syntax highlighting for many languages, code
-folding, find/replace using plain text and regexps, code completion,
-multiple charsets and many other useful features.
-
-enca is an optional dependency (for auto language detection).
diff --git a/office/juffed/doinst.sh b/office/juffed/doinst.sh
deleted file mode 100644
index 5fb28930db..0000000000
--- a/office/juffed/doinst.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ -x /usr/bin/update-desktop-database ]; then
- /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
-fi
diff --git a/office/juffed/juffed.SlackBuild b/office/juffed/juffed.SlackBuild
deleted file mode 100644
index f37a401a21..0000000000
--- a/office/juffed/juffed.SlackBuild
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-
-# Slackware build script for juffed
-
-# Copyright 2011-2018 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
-# 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.
-
-PRGNAM=juffed
-VERSION=${VERSION:-20180114_9b7af21}
-BUILD=${BUILD:-1}
-TAG=${TAG:-_SBo}
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-$PRGNAM
-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
-
-DOCS="COPYING ChangeLog README"
-
-set -e
-
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
-cd $PRGNAM-$VERSION
-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 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-mkdir -p build
-cd build
- cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=$LIBDIRSUFFIX \
- -DCMAKE_BUILD_TYPE=Release ..
- make
- make install DESTDIR=$PKG
-cd ..
-
-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
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
-
-cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/office/juffed/juffed.info b/office/juffed/juffed.info
deleted file mode 100644
index 0b6740222a..0000000000
--- a/office/juffed/juffed.info
+++ /dev/null
@@ -1,10 +0,0 @@
-PRGNAM="juffed"
-VERSION="20180114_9b7af21"
-HOMEPAGE="http://juffed.com"
-DOWNLOAD="http://ponce.cc/slackware/sources/repo/juffed-20180114_9b7af21.tar.xz"
-MD5SUM="6b6c56fecdcfd408638a8023deda09cf"
-DOWNLOAD_x86_64=""
-MD5SUM_x86_64=""
-REQUIRES=""
-MAINTAINER="Matteo Bernardini"
-EMAIL="ponce@slackbuilds.org"
diff --git a/office/juffed/slack-desc b/office/juffed/slack-desc
deleted file mode 100644
index ae39cf2747..0000000000
--- a/office/juffed/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description.
-# Line up the first '|' above the ':' following the base package name, and
-# the '|' on the right side marks the last column you can put a character in.
-# You must make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':' except on otherwise blank lines.
-
- |-----handy-ruler------------------------------------------------------|
-juffed: juffed (light qt editor)
-juffed:
-juffed: JuffEd is a free, cross-platform text editor for programmers and
-juffed: advanced users. Has syntax highlighting for many languages, code
-juffed: folding, find/replace using plain text and regexps, code completion,
-juffed: multiple charsets and many other useful features.
-juffed:
-juffed: homepage: http://juffed.com
-juffed:
-juffed:
-juffed:
diff --git a/office/kbgoffice/gcc6.patch b/office/kbgoffice/gcc6.patch
new file mode 100644
index 0000000000..6e2d45e572
--- /dev/null
+++ b/office/kbgoffice/gcc6.patch
@@ -0,0 +1,17 @@
+diff -Naur kbgoffice-2.1.orig/src/translator_manager.cpp kbgoffice-2.1/src/translator_manager.cpp
+--- kbgoffice-2.1.orig/src/translator_manager.cpp 2010-04-30 14:37:42.000000000 +0200
++++ kbgoffice-2.1/src/translator_manager.cpp 2017-06-01 18:10:20.308920738 +0200
+@@ -141,11 +141,11 @@
+ isDataOk = isDataOk && tr->init(tr->BG_EN, string(string(dataDir) + prop->getString("data")).c_str());
+ } else {
+ cerr << "TranslatorManager::getTestDictionaryObject - Wrong description file: " << testDictionaries[index].file << "\n";
+- return false;
++ return NULL;
+ }
+ if (!isDataOk) {
+ cerr << "TranslatorManager::getTestDictionaryObject - Problem initialazing dictionary: " << testDictionaries[index].file << "\n";
+- return false;
++ return NULL;
+ }
+ char c[16];
+ sprintf(c, "%d", level);
diff --git a/office/kbgoffice/kbgoffice.SlackBuild b/office/kbgoffice/kbgoffice.SlackBuild
index c4f4cbb1af..91069ba041 100644
--- a/office/kbgoffice/kbgoffice.SlackBuild
+++ b/office/kbgoffice/kbgoffice.SlackBuild
@@ -52,6 +52,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Thanks debian
+patch -p1 < $CWD/gcc6.patch
+
cd src
sed "s:/usr/local:/usr:" -i.orig $PRGNAM.pro
sed "s:/usr/local:/usr:" -i.orig main.cpp
diff --git a/office/kbibtex/README b/office/kbibtex/README
index 5cbb1f1cb9..ab74bceefc 100644
--- a/office/kbibtex/README
+++ b/office/kbibtex/README
@@ -1,8 +1,7 @@
-KBibTeX is a BibTeX editor for KDE to edit bibliographies used with
-LaTeX. KBibTeX is released under the GNU Public License (GPL) version 2
-or any later version.
+The program KBibTeX is a bibliography editor by KDE. Its main purpose is
+to provide a user-friendly interface to BibTeX files.
-KBibTeX for KDE 4 is currently under development. KBibTeX for KDE 4 is
-mature for most daily tasks, but still lacks some features. It is
-recommended that you make backups of all your files before editing
-them with KBibTeX for KDE 4.
+This software, unless noted differently for individual files, materials,
+or contributions, is licensed under the terms of the GNU General Public
+License as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
diff --git a/office/kbibtex/kbibtex.SlackBuild b/office/kbibtex/kbibtex.SlackBuild
index 712fd85897..adb5694393 100644
--- a/office/kbibtex/kbibtex.SlackBuild
+++ b/office/kbibtex/kbibtex.SlackBuild
@@ -24,7 +24,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=kbibtex
-VERSION=${VERSION:-0.7}
+VERSION=${VERSION:-0.9.81}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -61,7 +61,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@@ -73,12 +73,11 @@ find -L . \
mkdir -p build
cd build
cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DMANDIR=/usr/man \
+ -DCMAKE_INSTALL_MANDIR=/usr/man \
-DCMAKE_BUILD_TYPE=Release \
+ -DKDE_INSTALL_DOCBUNDLEDIR=/usr/doc/HTML \
-Wno-dev \
..
@@ -92,7 +91,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a README LICENSE TODO $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.md LICENSE TODO.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/office/kbibtex/kbibtex.info b/office/kbibtex/kbibtex.info
index ce1fa76722..fa5b806cb5 100644
--- a/office/kbibtex/kbibtex.info
+++ b/office/kbibtex/kbibtex.info
@@ -1,8 +1,8 @@
PRGNAM="kbibtex"
-VERSION="0.7"
+VERSION="0.9.81"
HOMEPAGE="https://userbase.kde.org/KBibTeX"
-DOWNLOAD="https://github.com/KDE/kbibtex/archive/v0.7/kbibtex-0.7.tar.gz"
-MD5SUM="db8f045be7fdb7fdb3101b47dd9b1bd3"
+DOWNLOAD="https://download.kde.org/unstable/KBibTeX/kbibtex-0.9.81.tar.xz"
+MD5SUM="b8df8ebf61d4b2f75bbc9a764d8f8041"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/kbibtex/slack-desc b/office/kbibtex/slack-desc
index 9899f6105c..5357a566da 100644
--- a/office/kbibtex/slack-desc
+++ b/office/kbibtex/slack-desc
@@ -8,12 +8,12 @@
|-----handy-ruler------------------------------------------------------|
kbibtex: kbibtex (A BibTeX editor for KDE)
kbibtex:
-kbibtex: KBibTeX is a BibTeX editor for KDE to edit bibliographies used with
-kbibtex: LaTeX. KBibTeX is released under the GNU Public License (GPL) version
-kbibtex: 2 or any later version.
-kbibtex:
-kbibtex: KBibTeX for KDE 4 is currently under development. KBibTeX for KDE 4
-kbibtex: is mature for most daily tasks, but still lacks some features. It is
-kbibtex: recommended that you make backups of all your files before editing
-kbibtex: them with KBibTeX for KDE 4.
+kbibtex: The program KBibTeX is a bibliography editor by KDE. Its main purpose
+kbibtex: is to provide a user-friendly interface to BibTeX files.
+kbibtex:
+kbibtex: This software, unless noted differently for individual files,
+kbibtex: materials, or contributions, is licensed under the terms of the GNU
+kbibtex: General Public License as published by the Free Software Foundation;
+kbibtex: either version 2 of the License, or (at your option) any later
+kbibtex: version.
kbibtex:
diff --git a/office/kmymoney/README b/office/kmymoney/README
deleted file mode 100644
index 81bc1e7bdd..0000000000
--- a/office/kmymoney/README
+++ /dev/null
@@ -1,6 +0,0 @@
-KmyMoney is a simple financial accounting manager for KDE for personal or
-small-business use. It is a full double-entry accounting software package.
-libofx 0.9.4+ is an optional dependency to support ofxbanking.
-agbanking and gwenhywfar are optional dependencies to support Kbanking.
-
-p7zip is a build-time dependency. It is required to decompress the source file.
diff --git a/office/kmymoney/doinst.sh b/office/kmymoney/doinst.sh
deleted file mode 100644
index 4f59bd45f1..0000000000
--- a/office/kmymoney/doinst.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-if [ -x /usr/bin/update-desktop-database ]; then
- /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1
-fi
-
-if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
- if [ -x /usr/bin/gtk-update-icon-cache ]; then
- /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
- fi
-fi
-
-if [ -x /usr/bin/update-mime-database ]; then
- /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
-fi
diff --git a/office/kmymoney/kmymoney.SlackBuild b/office/kmymoney/kmymoney.SlackBuild
deleted file mode 100644
index 378a846bbb..0000000000
--- a/office/kmymoney/kmymoney.SlackBuild
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-
-# SlackBuild script for kmymoney
-
-# Copyright 2016-2019 Christophe Nguyen, France
-# Copyright 2010-2014 Gilcio Amaral <gilcio.amaral@gmail.com>
-# Copyright 2007-2008 Michiel van Wessem, Manchester, United Kingdom
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "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 COPYRIGHT
-# OWNER OR CONTRIBUTORS 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.
-
-PRGNAM=kmymoney
-VERSION=${VERSION:-4.8.4}
-BUILD=${BUILD:-1}
-TAG=${TAG:-_SBo}
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-$PRGNAM
-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
-
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-rm -rf $TMP/$PRGNAM-$VERSION
-cd $TMP
-7z x $CWD/$PRGNAM-$VERSION-src.7z
-cd $PRGNAM-$VERSION
-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 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-mkdir -p build
-cd build
- cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DCMAKE_BUILD_TYPE=Release ..
-
- make VERBOSE=1
- make install VERBOSE=1 DESTDIR=$PKG
-cd ..
-
-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
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS BUGS COPYING ChangeLog* INSTALL README* TODO $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-
-mkdir $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
-
-cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/office/kmymoney/kmymoney.info b/office/kmymoney/kmymoney.info
deleted file mode 100644
index f2c8ebc877..0000000000
--- a/office/kmymoney/kmymoney.info
+++ /dev/null
@@ -1,10 +0,0 @@
-PRGNAM="kmymoney"
-VERSION="4.8.4"
-HOMEPAGE="http://www.kmymoney.org"
-DOWNLOAD="https://download.kde.org/stable/kmymoney/4.8.4/src/kmymoney-4.8.4-src.7z"
-MD5SUM="b18a5714db7a098155f2c29dbf31b458"
-DOWNLOAD_x86_64=""
-MD5SUM_x86_64=""
-REQUIRES="p7zip libalkimia"
-MAINTAINER="Christophe Nguyen"
-EMAIL="cnguyenminhtan@free.fr"
diff --git a/office/kmymoney/slack-desc b/office/kmymoney/slack-desc
deleted file mode 100644
index 28064f3829..0000000000
--- a/office/kmymoney/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description.
-# Line up the first '|' above the ':' following the base package name, and
-# the '|' on the right side marks the last column you can put a character in.
-# You must make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':' except on otherwise blank lines.
-
- |-----handy-ruler------------------------------------------------------|
-kmymoney: kmymoney (simple financial accounting manager)
-kmymoney:
-kmymoney: KmyMoney is a simple financial accounting manager for KDE for
-kmymoney: personal or small-business use. It is a complete and full
-kmymoney: double-entry accounting software package.
-kmymoney:
-kmymoney:
-kmymoney: Homepage: http://kmymoney.org
-kmymoney:
-kmymoney:
-kmymoney:
diff --git a/office/mu/mu.SlackBuild b/office/mu/mu.SlackBuild
index 8f5a4a243d..3ecbd259ed 100644
--- a/office/mu/mu.SlackBuild
+++ b/office/mu/mu.SlackBuild
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=mu
-VERSION=${VERSION:-1.0}
+VERSION=${VERSION:-1.2.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -60,7 +60,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
diff --git a/office/mu/mu.info b/office/mu/mu.info
index 752e3ee3b5..181357533c 100644
--- a/office/mu/mu.info
+++ b/office/mu/mu.info
@@ -1,8 +1,8 @@
PRGNAM="mu"
-VERSION="1.0"
+VERSION="1.2.0"
HOMEPAGE="http://www.djcbsoftware.nl/code/mu/"
-DOWNLOAD="https://github.com/djcb/mu/archive/v1.0.tar.gz"
-MD5SUM="b415f84d4538cf05ec3360a449c1de4d"
+DOWNLOAD="https://github.com/djcb/mu/releases/download/1.2/mu-1.2.0.tar.xz"
+MD5SUM="e90fcd4abfed0e36ff97807d0194e9f9"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/pdfpc/pdfpc.SlackBuild b/office/pdfpc/pdfpc.SlackBuild
index 1db71999b5..005831788f 100644
--- a/office/pdfpc/pdfpc.SlackBuild
+++ b/office/pdfpc/pdfpc.SlackBuild
@@ -24,7 +24,7 @@
PRGNAM=pdfpc
-VERSION=${VERSION:-4.1.2}
+VERSION=${VERSION:-4.4.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -76,8 +76,8 @@ cd build
cmake \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DSYSCONFDIR=/etc \
- -DMANDIR=/usr/man \
+ -DCMAKE_INSTALL_SYSCONFDIR=/etc \
+ -DCMAKE_INSTALL_MANDIR=/usr/man \
-DCMAKE_BUILD_TYPE=Release \
..
make
diff --git a/office/pdfpc/pdfpc.info b/office/pdfpc/pdfpc.info
index ebe589cb97..8b7a1cf2dd 100644
--- a/office/pdfpc/pdfpc.info
+++ b/office/pdfpc/pdfpc.info
@@ -1,8 +1,8 @@
PRGNAM="pdfpc"
-VERSION="4.1.2"
+VERSION="4.4.1"
HOMEPAGE="https://pdfpc.github.io/"
-DOWNLOAD="https://github.com/pdfpc/pdfpc/archive/v4.1.2/pdfpc-4.1.2.tar.gz"
-MD5SUM="5b5fd7e78966ae604081631f38c6b1a1"
+DOWNLOAD="https://github.com/pdfpc/pdfpc/archive/v4.4.1/pdfpc-4.4.1.tar.gz"
+MD5SUM="76f0b9f1000ae77ca301011daa25ab4f"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="libgee"
diff --git a/office/pdftk/README b/office/pdftk/README
index c84c0b6589..6f0d6399e0 100644
--- a/office/pdftk/README
+++ b/office/pdftk/README
@@ -4,3 +4,10 @@ command-line tool for doing everyday things with PDF documents. Keep one
in the top drawer of your desktop and use it to merge PDF documents,
split PDF documents, apply watermarks, repair corrupt PDF, update PDF
metadata, and more. pdftk does not require Acrobat and is free software.
+
+NOTE: Starting with Slackware 15.0 pdftk compilation requires SBo gcc-5
+because gcc-java was dropped from the GNU Compiler Collection as of gcc-7:
+don't forget to source /etc/profile.d/gcc5.sh before starting to build
+this, like
+
+ . /etc/profile.d/gcc5.sh
diff --git a/office/pdftk/pdftk-1.44-add_custom_optflags.patch b/office/pdftk/pdftk-1.44-add_custom_optflags.patch
deleted file mode 100644
index 660073115f..0000000000
--- a/office/pdftk/pdftk-1.44-add_custom_optflags.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff -Nurp pdftk-1.44-dist-orig/pdftk/Makefile.Slackware-13.1 pdftk-1.44-dist/pdftk/Makefile.Slackware-13.1
---- pdftk-1.44-dist-orig/pdftk/Makefile.Slackware-13.1 2010-10-25 20:04:51.000000000 +0100
-+++ pdftk-1.44-dist/pdftk/Makefile.Slackware-13.1 2010-10-31 01:44:31.000000000 +0000
-@@ -34,7 +34,7 @@ export CXX= $(TOOLPATH)g++
- export GCJ= $(TOOLPATH)gcj
- export GCJH= $(TOOLPATH)gcjh
- export GJAR= $(TOOLPATH)gjar
--export LIBGCJ= /usr/share/java/libgcj$(VERSUFF).jar
-+export LIBGCJ= /usr/share/java
- export AR= ar
- export RM= rm
- export ARFLAGS= rs
-@@ -71,9 +71,10 @@ export RMFLAGS= -vf
- # only effects libraries following option on the command line
- #
- #
--export CPPFLAGS= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers
--export CXXFLAGS= -Wall -Wextra -Weffc++ -O2
--export GCJFLAGS= -Wall -fsource=1.3 -O2
-+export OPT= -O2
-+export CPPFLAGS= $(OPT) -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers
-+export CXXFLAGS= $(OPT) -Wall -Wextra -Weffc++
-+export GCJFLAGS= $(OPT) -Wall -fsource=1.3
- export GCJHFLAGS= -force
- export LDLIBS= -lgcj
-
diff --git a/office/pdftk/pdftk-2.02-use-gcc5.patch b/office/pdftk/pdftk-2.02-use-gcc5.patch
new file mode 100644
index 0000000000..d1e6e124de
--- /dev/null
+++ b/office/pdftk/pdftk-2.02-use-gcc5.patch
@@ -0,0 +1,15 @@
+# diff -Nurp pdftk/Makefile.Slackware-13.1.orig pdftk/Makefile.Slackware-13.1
+--- orig/pdftk/Makefile.Slackware-13.1 2013-07-24 13:27:46.000000000 -0500
++++ pdftk/Makefile.Slackware-13.1 2018-03-04 06:20:55.312900883 -0600
+@@ -21,8 +21,9 @@
+ # tools
+ # need direct path to libgcj for gcjh (starting in gcj 4.1.2 per Aurélien GÃRÃME)
+ TOOLPATH=
+-export VERSUFF=-4.4.4
+-export CXX= $(TOOLPATH)g++
++GCCMAJORTAG=-5 # kjh was here
++export VERSUFF=-5.5.0 # kjh was here
++export CXX= $(TOOLPATH)g++$(GCCMAJORTAG) # kjh was here
+ export GCJ= $(TOOLPATH)gcj
+ export GCJH= $(TOOLPATH)gcjh
+ export GJAR= $(TOOLPATH)gjar
diff --git a/office/pdftk/pdftk.SlackBuild b/office/pdftk/pdftk.SlackBuild
index aa5bad4885..854b6da935 100644
--- a/office/pdftk/pdftk.SlackBuild
+++ b/office/pdftk/pdftk.SlackBuild
@@ -30,7 +30,7 @@ TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -41,8 +41,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -68,10 +68,9 @@ find -L . \
\( -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 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-# Use our SLKCFLAGS
-patch -p1 < $CWD/pdftk-1.44-add_custom_optflags.patch
+patch -p1 < $CWD/pdftk-2.02-use-gcc5.patch
cd $PRGNAM
# Hardcode "-j1" since this fails with multiple make jobs
diff --git a/office/pdftk/pdftk.info b/office/pdftk/pdftk.info
index 01151c62f1..b4e36211a9 100644
--- a/office/pdftk/pdftk.info
+++ b/office/pdftk/pdftk.info
@@ -5,6 +5,6 @@ DOWNLOAD="https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip
MD5SUM="6534365fd6727724f288a556ede33faa"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
+REQUIRES="gcc5"
MAINTAINER="ArTourter"
EMAIL="artourter@gmail.com"
diff --git a/office/qpdfview-qt5/qpdfview-qt5.SlackBuild b/office/qpdfview-qt5/qpdfview-qt5.SlackBuild
index 9740486397..6665bfff69 100644
--- a/office/qpdfview-qt5/qpdfview-qt5.SlackBuild
+++ b/office/qpdfview-qt5/qpdfview-qt5.SlackBuild
@@ -72,6 +72,8 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+patch -p1 < $CWD/qt-5.15.patch
+
sed -i "s|/usr/lib/qpdfview|/usr/lib${LIBDIRSUFFIX}/qpdfview|" qpdfview.pri
# From Arch pkgbuild. Fix build with texlive in Slackware current.
diff --git a/office/qpdfview-qt5/qt-5.15.patch b/office/qpdfview-qt5/qt-5.15.patch
new file mode 100644
index 0000000000..ca48432b85
--- /dev/null
+++ b/office/qpdfview-qt5/qt-5.15.patch
@@ -0,0 +1,24 @@
+Index: qpdfview-0.4.18/sources/djvumodel.cpp
+===================================================================
+--- qpdfview-0.4.18.orig/sources/djvumodel.cpp
++++ qpdfview-0.4.18/sources/djvumodel.cpp
+@@ -29,6 +29,7 @@ along with qpdfview. If not, see <http:
+ #include <cstdio>
+
+ #include <QFile>
++#include <QPainterPath>
+ #include <qmath.h>
+
+ #if defined(Q_OS_WIN) && defined(DJVU_STATIC)
+Index: qpdfview-0.4.18/sources/model.h
+===================================================================
+--- qpdfview-0.4.18.orig/sources/model.h
++++ qpdfview-0.4.18/sources/model.h
+@@ -27,6 +27,7 @@ along with qpdfview. If not, see <http:
+ #include <QtPlugin>
+ #include <QWidget>
+ #include <QVector>
++#include <QPainterPath>
+
+ class QAbstractItemModel;
+ class QColor;
diff --git a/office/referencer/referencer-lib_path.patch b/office/referencer/referencer-lib_path.patch
new file mode 100644
index 0000000000..78a1952089
--- /dev/null
+++ b/office/referencer/referencer-lib_path.patch
@@ -0,0 +1,11 @@
+--- referencer-1.2.2/src/Document.C 2014-01-27 03:43:00.000000000 +0700
++++ referencer-1.2.2_/src/Document.C 2016-11-03 16:25:00.698676538 +0700
+@@ -297,7 +297,7 @@
+
+ lib_path = lib_path->get_parent();
+ up_dir_level += "../";
+- if (lib_path == 0) {
++ if (!lib_path) {
+ doc_is_relative_to_library = false;
+ break;
+ }
diff --git a/office/referencer/referencer.SlackBuild b/office/referencer/referencer.SlackBuild
index 8d279093fd..0a3da09354 100644
--- a/office/referencer/referencer.SlackBuild
+++ b/office/referencer/referencer.SlackBuild
@@ -69,6 +69,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# Fix comparison with zero - thanks archlinux
+patch -p1 < $CWD/referencer-lib_path.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS -std=c++11" \
./configure \
diff --git a/office/sc-im/README b/office/sc-im/README
deleted file mode 100644
index d63f9fca91..0000000000
--- a/office/sc-im/README
+++ /dev/null
@@ -1,2 +0,0 @@
-SC-IM - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program
-for terminal. SC-IM is a spreadsheet program that is based on SC.
diff --git a/office/sc-im/sc-im.SlackBuild b/office/sc-im/sc-im.SlackBuild
deleted file mode 100644
index b7d25c2915..0000000000
--- a/office/sc-im/sc-im.SlackBuild
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-
-# Slackware build script for sc-im
-
-# Copyright 2016-2018 Jostein Berntsen <jvbernts@online.no>
-# 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.
-
-PRGNAM=sc-im
-VERSION=${VERSION:-0.7.0}
-BUILD=${BUILD:-1}
-TAG=${TAG:-_SBo}
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-$PRGNAM
-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
-
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
-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 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-cd src/
-
-perl -pi -e 's#name = scim#name = sc-im#g|s#prefix = /usr/local#prefix = /usr#g' Makefile
-
-CFLAGS="-DXLS $SLKCFLAGS" \
-CXXFLAGS="-DXLS $SLKCFLAGS" \
-LDLIBS="-lxlsreader" \
-make
-make install DESTDIR=$PKG
-
-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
-
-mv $PKG/usr/share/man $PKG/usr
-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
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cd ..
-cp -a BUGS CHANGES HELP KNOWN_ISSUES LICENSE Readme.md USER_REQUESTS WIKI \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
-
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-
-cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/office/sc-im/sc-im.info b/office/sc-im/sc-im.info
deleted file mode 100644
index ffae38a071..0000000000
--- a/office/sc-im/sc-im.info
+++ /dev/null
@@ -1,10 +0,0 @@
-PRGNAM="sc-im"
-VERSION="0.7.0"
-HOMEPAGE="https://github.com/andmarti1424/sc-im"
-DOWNLOAD="https://github.com/andmarti1424/sc-im/archive/v0.7.0/sc-im-0.7.0.tar.gz"
-MD5SUM="2f270d957a215f0124d15d0a82c5abfa"
-DOWNLOAD_x86_64=""
-MD5SUM_x86_64=""
-REQUIRES="libxls libxlsxwriter"
-MAINTAINER="Jostein Berntsen"
-EMAIL="jvbernts@online.no"
diff --git a/office/sc-im/slack-desc b/office/sc-im/slack-desc
deleted file mode 100644
index d0321b449a..0000000000
--- a/office/sc-im/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description.
-# Line up the first '|' above the ':' following the base package name, and
-# the '|' on the right side marks the last column you can put a character in.
-# You must make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':' except on otherwise blank lines.
-
- |-----handy-ruler------------------------------------------------------|
-sc-im: sc-im (spreadsheet)
-sc-im:
-sc-im: SC-IM is a spreadsheet program that is based on SC
-sc-im:
-sc-im: SC-IM - Spreadsheet Calculator Improvised
-sc-im: An ncurses spreadsheet program for terminal
-sc-im:
-sc-im:
-sc-im: https://github.com/andmarti1424/sc-im
-sc-im:
-sc-im:
diff --git a/office/scribus/README b/office/scribus/README
index 2add995c89..8a9f355ec7 100644
--- a/office/scribus/README
+++ b/office/scribus/README
@@ -2,4 +2,5 @@ Scribus is an open-source program that brings award-winning professional page
layout to Linux/Unix, MacOS X and Windows desktops with a combination of
"press-ready" output and new approaches to page layout.
-podofo is an optional dependency used for embedded pdfs in AI files.
+podofo, libpagemaker, libfreehand, libcdr, libzmf, libqxp and libmspub are
+optional dependencies.
diff --git a/office/scribus/poppler-21.4.0.patch b/office/scribus/poppler-21.4.0.patch
new file mode 100644
index 0000000000..7eedbd73c9
--- /dev/null
+++ b/office/scribus/poppler-21.4.0.patch
@@ -0,0 +1,4347 @@
+diff -Naur scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.cpp scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.cpp
+--- scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.cpp 2020-11-14 23:37:11.000000000 +0100
++++ scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.cpp 2021-04-04 11:27:44.315404000 +0200
+@@ -2291,9 +2291,19 @@
+ return gTrue;
+ }
+
+-GBool SlaOutputDev::tilingPatternFill(GfxState *state, Gfx * /*gfx*/, Catalog *cat, Object *str, POPPLER_CONST_070 double *pmat, int paintType, int tilingType, Dict *resDict, POPPLER_CONST_070 double *mat, POPPLER_CONST_070 double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep)
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 3, 0)
++bool SlaOutputDev::tilingPatternFill(GfxState *state, Gfx * /*gfx*/, Catalog *cat, GfxTilingPattern *tPat, const double *mat, int x0, int y0, int x1, int y1, double xStep, double yStep)
++#else
++GBool SlaOutputDev::tilingPatternFill(GfxState *state, Gfx * /*gfx*/, Catalog *cat, Object *str, POPPLER_CONST_070 double *pmat, int /*paintType*/, int /*tilingType*/, Dict *resDict, POPPLER_CONST_070 double *mat, POPPLER_CONST_070 double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep)
++#endif
+ {
+ // qDebug() << "SlaOutputDev::tilingPatternFill";
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 3, 0)
++ const double *bbox = tPat->getBBox();
++ const double *pmat = tPat->getMatrix();
++ Dict *resDict = tPat->getResDict();
++#endif
++
+ PDFRectangle box;
+ Gfx *gfx;
+ QString id;
+@@ -2325,7 +2335,11 @@
+ // Unset the clip path as it is unrelated to the pattern's coordinate space.
+ QPainterPath savedClip = m_currentClipPath;
+ m_currentClipPath = QPainterPath();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 3, 0)
++ gfx->display(tPat->getContentStream());
++#else
+ gfx->display(str);
++#endif
+ m_currentClipPath = savedClip;
+ inPattern--;
+ gElements = m_groupStack.pop();
+diff -Naur scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.cpp.orig scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.cpp.orig
+--- scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.cpp.orig 1970-01-01 01:00:00.000000000 +0100
++++ scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.cpp.orig 2020-11-14 23:37:11.000000000 +0100
+@@ -0,0 +1,3898 @@
++/*
++For general Scribus (>=1.3.2) copyright and licensing information please refer
++to the COPYING file provided with the program. Following this notice may exist
++a copyright and/or license notice that predates the release of Scribus 1.3.2
++for which a new license (GPL+exception) is in place.
++*/
++
++#include "slaoutput.h"
++
++#include <poppler/GlobalParams.h>
++#include <poppler/poppler-config.h>
++#include <poppler/FileSpec.h>
++#include <poppler/fofi/FoFiTrueType.h>
++#include <QApplication>
++#include <QFile>
++#include "commonstrings.h"
++#include "loadsaveplugin.h"
++#include "sccolorengine.h"
++#include "util.h"
++#include "util_math.h"
++#include <tiffio.h>
++
++namespace
++{
++ // Compute the intersection of two paths while considering the fillrule of each of them.
++ // QPainterPath has the right interface to do the operation but is currently buggy.
++ // See for example https://bugreports.qt.io/browse/QTBUG-83102. Thus this function
++ // applies some heuristics to find the best result. As soon QPainterPath is fixed
++ // one can just use a.intersected(b) wherever this function is called.
++ // TODO: Find an alternative to QPainterPath that works for different fill rules.
++ QPainterPath intersection(QPainterPath const &a, QPainterPath const &b)
++ {
++ // An empty path is treated like the whole area.
++ if (a.elementCount() == 0)
++ return b;
++ if (b.elementCount() == 0)
++ return a;
++
++ QPainterPath ret_a = a.intersected(b);
++ QPainterPath ret_b = b.intersected(a);
++ // Sometimes the resulting paths are not closed even though they should.
++ // Close them now.
++ ret_a.closeSubpath();
++ ret_b.closeSubpath();
++
++ // Most of the time one of the two operations returns an empty path while the other
++ // gives us the desired result. Return the non-empty one.
++ if (ret_a.elementCount() == 0)
++ return ret_b;
++ if (ret_b.elementCount() == 0)
++ return ret_a;
++
++ // There are cases where both intersections are not empty but one of them is quite
++ // complicated with several subpaths, etc. We return the simpler one.
++ return (ret_a.elementCount() <= ret_b.elementCount()) ? ret_a : ret_b;
++ }
++
++ // Invert preblending matte values into the color values. Assuming that c and alpha are RGBA components
++ // between 0 and 255.
++ int unblendMatte(int c, int alpha, int matte)
++ {
++ if (alpha == 0)
++ return matte;
++ int ret = matte + ((c - matte) * 255) / alpha;
++ if (ret < 0)
++ return 0;
++ if (ret > 255)
++ return 255;
++ return ret;
++ }
++}
++
++LinkSubmitForm::LinkSubmitForm(Object *actionObj)
++{
++ if (!actionObj->isDict())
++ return;
++
++ Object obj1 = actionObj->dictLookup("F");
++ if (!obj1.isNull())
++ {
++ if (obj1.isDict())
++ {
++ Object obj3 = obj1.dictLookup("FS");
++ if (!obj3.isNull())
++ {
++ if (obj3.isName())
++ {
++ POPPLER_CONST char *name = obj3.getName();
++ if (!strcmp(name, "URL"))
++ {
++ Object obj2 = obj1.dictLookup("F");
++ if (!obj2.isNull())
++ fileName = obj2.getString()->copy();
++ }
++ }
++ }
++ }
++ }
++ obj1 = actionObj->dictLookup("Flags");
++ if (!obj1.isNull())
++ {
++ if (obj1.isNum())
++ m_flags = obj1.getInt();
++ }
++}
++
++LinkSubmitForm::~LinkSubmitForm()
++{
++ delete fileName;
++}
++
++LinkImportData::LinkImportData(Object *actionObj)
++{
++ if (!actionObj->isDict())
++ return;
++ Object obj1 = actionObj->dictLookup("F");
++ if (obj1.isNull())
++ return;
++
++ Object obj3 = getFileSpecNameForPlatform(&obj1);
++ if (!obj3.isNull())
++ fileName = obj3.getString()->copy();
++}
++
++LinkImportData::~LinkImportData()
++{
++ delete fileName;
++}
++
++AnoOutputDev::~AnoOutputDev()
++{
++ delete m_fontName;
++ delete m_itemText;
++}
++
++AnoOutputDev::AnoOutputDev(ScribusDoc* doc, QStringList *importedColors)
++{
++ m_doc = doc;
++ m_importedColors = importedColors;
++ CurrColorText = "Black";
++ CurrColorFill = CommonStrings::None;
++ CurrColorStroke = CommonStrings::None;
++}
++
++void AnoOutputDev::eoFill(GfxState *state)
++{
++ int shade = 100;
++ CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
++}
++
++void AnoOutputDev::fill(GfxState *state)
++{
++ int shade = 100;
++ CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
++}
++
++void AnoOutputDev::stroke(GfxState *state)
++{
++ int shade = 100;
++ CurrColorStroke = getColor(state->getStrokeColorSpace(), state->getStrokeColor(), &shade);
++}
++
++void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
++{
++ int shade = 100;
++ CurrColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
++ m_fontSize = state->getFontSize();
++ if (state->getFont())
++ m_fontName = state->getFont()->getName()->copy();
++ m_itemText = s->copy();
++}
++
++QString AnoOutputDev::getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade)
++{
++ QString fNam;
++ QString namPrefix = "FromPDF";
++ ScColor tmp;
++ tmp.setSpotColor(false);
++ tmp.setRegistrationColor(false);
++ *shade = 100;
++ if ((color_space->getMode() == csDeviceRGB) || (color_space->getMode() == csCalRGB))
++ {
++ GfxRGB rgb;
++ color_space->getRGB(color, &rgb);
++ double Rc = colToDbl(rgb.r);
++ double Gc = colToDbl(rgb.g);
++ double Bc = colToDbl(rgb.b);
++ tmp.setRgbColorF(Rc, Gc, Bc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color_space->getMode() == csDeviceCMYK)
++ {
++ GfxCMYK cmyk;
++ color_space->getCMYK(color, &cmyk);
++ double Cc = colToDbl(cmyk.c);
++ double Mc = colToDbl(cmyk.m);
++ double Yc = colToDbl(cmyk.y);
++ double Kc = colToDbl(cmyk.k);
++ tmp.setCmykColorF(Cc, Mc, Yc, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if ((color_space->getMode() == csCalGray) || (color_space->getMode() == csDeviceGray))
++ {
++ GfxGray gray;
++ color_space->getGray(color, &gray);
++ double Kc = 1.0 - colToDbl(gray);
++ tmp.setCmykColorF(0, 0, 0, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color_space->getMode() == csSeparation)
++ {
++ GfxSeparationColorSpace* sepColorSpace = (GfxSeparationColorSpace*)color_space;
++ GfxColorSpace* altColorSpace = sepColorSpace->getAlt();
++ QString name = QString(sepColorSpace->getName()->getCString());
++ bool isRegistrationColor = (name == "All");
++ if (isRegistrationColor)
++ {
++ tmp.setCmykColorF(1.0, 1.0, 1.0, 1.0);
++ tmp.setRegistrationColor(true);
++ name = "Registration";
++ }
++ else if ((altColorSpace->getMode() == csDeviceRGB) || (altColorSpace->getMode() == csCalRGB))
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setRgbColorF(comps[0], comps[1], comps[2]);
++ }
++ else if ((altColorSpace->getMode() == csCalGray) || (altColorSpace->getMode() == csDeviceGray))
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setCmykColorF(0.0, 0.0, 0.0, 1.0 - comps[0]);
++ }
++ else if (altColorSpace->getMode() == csLab)
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setLabColor(comps[0], comps[1], comps[2]);
++ }
++ else
++ {
++ GfxCMYK cmyk;
++ color_space->getCMYK(color, &cmyk);
++ double Cc = colToDbl(cmyk.c);
++ double Mc = colToDbl(cmyk.m);
++ double Yc = colToDbl(cmyk.y);
++ double Kc = colToDbl(cmyk.k);
++ tmp.setCmykColorF(Cc, Mc, Yc, Kc);
++ }
++ tmp.setSpotColor(true);
++
++ fNam = m_doc->PageColors.tryAddColor(name, tmp);
++ *shade = qRound(colToDbl(color->c[0]) * 100);
++ }
++ else
++ {
++ GfxRGB rgb;
++ color_space->getRGB(color, &rgb);
++ double Rc = colToDbl(rgb.r);
++ double Gc = colToDbl(rgb.g);
++ double Bc = colToDbl(rgb.b);
++ tmp.setRgbColorF(Rc, Gc, Bc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ // qDebug() << "update fill color other colorspace" << color_space->getMode() << "treating as rgb" << Rc << Gc << Bc;
++ }
++ if (fNam == namPrefix+tmp.name())
++ m_importedColors->append(fNam);
++ return fNam;
++}
++
++SlaOutputDev::SlaOutputDev(ScribusDoc* doc, QList<PageItem*> *Elements, QStringList *importedColors, int flags)
++{
++ m_doc = doc;
++ m_Elements = Elements;
++ pushGroup();
++ m_importedColors = importedColors;
++ CurrColorStroke = "Black";
++ CurrColorFill = "Black";
++ tmpSel = new Selection(m_doc, false);
++ importerFlags = flags;
++ currentLayer = m_doc->activeLayer();
++ layersSetByOCG = false;
++}
++
++SlaOutputDev::~SlaOutputDev()
++{
++ m_groupStack.clear();
++ tmpSel->clear();
++ delete tmpSel;
++ delete m_fontEngine;
++}
++
++/* get Actions not implemented by Poppler */
++LinkAction* SlaOutputDev::SC_getAction(AnnotWidget *ano)
++{
++ LinkAction *linkAction = nullptr;
++ Object obj;
++ Ref refa = ano->getRef();
++
++ obj = xref->fetch(refa.num, refa.gen);
++ if (obj.isDict())
++ {
++ Dict* adic = obj.getDict();
++ POPPLER_CONST_075 Object POPPLER_REF additionalActions = adic->lookupNF("A");
++ Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++ if (additionalActionsObject.isDict())
++ {
++ Object actionObject = additionalActionsObject.dictLookup("S");
++ if (actionObject.isName("ImportData"))
++ {
++ linkAction = new LinkImportData(&additionalActionsObject);
++ }
++ else if (actionObject.isName("SubmitForm"))
++ {
++ linkAction = new LinkSubmitForm(&additionalActionsObject);
++ }
++ }
++ }
++ return linkAction;
++}
++
++/* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
++{
++ std::unique_ptr<LinkAction> linkAction;
++#else
++LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
++{
++ LinkAction *linkAction = nullptr;
++#endif
++ Object obj;
++ Ref refa = ano->getRef();
++
++ obj = xref->fetch(refa.num, refa.gen);
++ if (obj.isDict())
++ {
++ Dict* adic = obj.getDict();
++ POPPLER_CONST_075 Object POPPLER_REF additionalActions = adic->lookupNF("AA");
++ Object additionalActionsObject = additionalActions.fetch(pdfDoc->getXRef());
++ if (additionalActionsObject.isDict())
++ {
++ Object actionObject = additionalActionsObject.dictLookup(key);
++ if (actionObject.isDict())
++ linkAction = LinkAction::parseAction(&actionObject, pdfDoc->getCatalog()->getBaseURI());
++ }
++ }
++ return linkAction;
++}
++
++GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
++{
++ SlaOutputDev *dev = (SlaOutputDev*)user_data;
++ PDFRectangle *box = annota->getRect();
++ double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
++ double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
++ double width = box->x2 - box->x1;
++ double height = box->y2 - box->y1;
++ if (dev->rotate == 90)
++ {
++ xCoor = dev->m_doc->currentPage()->xOffset() - dev->cropOffsetX + box->y2;
++ yCoor = dev->m_doc->currentPage()->yOffset() + dev->cropOffsetY + box->x1;
++ }
++ else if (dev->rotate == 180)
++ {
++ xCoor = dev->m_doc->currentPage()->xOffset() - dev->cropOffsetX + dev->m_doc->currentPage()->width() - box->x1;
++ yCoor = dev->m_doc->currentPage()->yOffset() + dev->cropOffsetY + box->y2;
++ }
++ else if (dev->rotate == 270)
++ {
++ xCoor = dev->m_doc->currentPage()->xOffset() - dev->cropOffsetX + dev->m_doc->currentPage()->width() - box->y2;
++ yCoor = dev->m_doc->currentPage()->yOffset() + dev->cropOffsetY + dev->m_doc->currentPage()->height() - box->x1;
++ }
++ bool retVal = true;
++ if (annota->getType() == Annot::typeText)
++ retVal = !dev->handleTextAnnot(annota, xCoor, yCoor, width, height);
++ else if (annota->getType() == Annot::typeLink)
++ retVal = !dev->handleLinkAnnot(annota, xCoor, yCoor, width, height);
++ else if (annota->getType() == Annot::typeWidget)
++ retVal = !dev->handleWidgetAnnot(annota, xCoor, yCoor, width, height);
++ return retVal;
++}
++
++bool SlaOutputDev::handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height)
++{
++ AnnotText *anl = (AnnotText*)annota;
++ int z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Rectangle, xCoor, yCoor, width, height, 0, CommonStrings::None, CommonStrings::None);
++ PageItem *ite = m_doc->Items->at(z);
++ int flg = annota->getFlags();
++ if (!(flg & 16))
++ ite->setRotation(rotate, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillEvenOdd(false);
++ ite->Clip = flattenPath(ite->PoLine, ite->Segments);
++ ite->ContourLine = ite->PoLine.copy();
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ ite->setIsAnnotation(true);
++ ite->AutoName = false;
++ ite->annotation().setType(Annotation::Text);
++ ite->annotation().setActionType(Annotation::Action_None);
++ ite->annotation().setAnOpen(anl->getOpen());
++ QString iconName = UnicodeParsedString(anl->getIcon());
++ if (iconName == "Note")
++ ite->annotation().setIcon(Annotation::Icon_Note);
++ else if (iconName == "Comment")
++ ite->annotation().setIcon(Annotation::Icon_Comment);
++ else if (iconName == "Key")
++ ite->annotation().setIcon(Annotation::Icon_Key);
++ else if (iconName == "Help")
++ ite->annotation().setIcon(Annotation::Icon_Help);
++ else if (iconName == "NewParagraph")
++ ite->annotation().setIcon(Annotation::Icon_NewParagraph);
++ else if (iconName == "Paragraph")
++ ite->annotation().setIcon(Annotation::Icon_Paragraph);
++ else if (iconName == "Insert")
++ ite->annotation().setIcon(Annotation::Icon_Insert);
++ else if (iconName == "Cross")
++ ite->annotation().setIcon(Annotation::Icon_Cross);
++ else if (iconName == "Circle")
++ ite->annotation().setIcon(Annotation::Icon_Circle);
++ else
++ ite->annotation().setIcon(Annotation::Icon_Note);
++ ite->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
++ ite->itemText.insertChars(UnicodeParsedString(annota->getContents()));
++ ite->itemText.trim();
++ return true;
++}
++
++bool SlaOutputDev::handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height)
++{
++ AnnotLink *anl = (AnnotLink*)annota;
++ LinkAction *act = anl->getAction();
++ if (!act)
++ return false;
++ bool validLink = false;
++ int pagNum = 0;
++ int xco = 0;
++ int yco = 0;
++ QString fileName = "";
++ if (act->getKind() == actionGoTo)
++ {
++ LinkGoTo *gto = (LinkGoTo*) act;
++ POPPLER_CONST LinkDest *dst = gto->getDest();
++ if (dst)
++ {
++ if (dst->getKind() == destXYZ)
++ {
++ if (dst->isPageRef())
++ {
++ Ref dstr = dst->getPageRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
++ pagNum = pdfDoc->findPage(dstr);
++#else
++ pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
++#endif
++ }
++ else
++ pagNum = dst->getPageNum();
++ xco = dst->getLeft();
++ yco = dst->getTop();
++ validLink = true;
++ }
++ }
++ else
++ {
++ POPPLER_CONST GooString *ndst = gto->getNamedDest();
++ if (ndst)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
++ if (dstn)
++ {
++ if (dstn->getKind() == destXYZ)
++ {
++ if (dstn->isPageRef())
++ {
++ Ref dstr = dstn->getPageRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
++ pagNum = pdfDoc->findPage(dstr);
++#else
++ pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
++#endif
++ }
++ else
++ pagNum = dstn->getPageNum();
++ xco = dstn->getLeft();
++ yco = dstn->getTop();
++ validLink = true;
++ }
++ }
++ }
++ }
++ }
++ else if (act->getKind() == actionGoToR)
++ {
++ LinkGoToR *gto = (LinkGoToR*)act;
++ fileName = UnicodeParsedString(gto->getFileName());
++ POPPLER_CONST LinkDest *dst = gto->getDest();
++ if (dst)
++ {
++ if (dst->getKind() == destXYZ)
++ {
++ pagNum = dst->getPageNum();
++ xco = dst->getLeft();
++ yco = dst->getTop();
++ validLink = true;
++ }
++ }
++ else
++ {
++ POPPLER_CONST GooString *ndst = gto->getNamedDest();
++ if (ndst)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
++ if (dstn)
++ {
++ if (dstn->getKind() == destXYZ)
++ {
++ pagNum = dstn->getPageNum();
++ xco = dstn->getLeft();
++ yco = dstn->getTop();
++ validLink = true;
++ }
++ }
++ }
++ }
++ }
++ else if (act->getKind() == actionURI)
++ {
++ LinkURI *gto = (LinkURI*)act;
++ validLink = true;
++ fileName = UnicodeParsedString(gto->getURI());
++ }
++ if (validLink)
++ {
++ int z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Rectangle, xCoor, yCoor, width, height, 0, CommonStrings::None, CommonStrings::None);
++ PageItem *ite = m_doc->Items->at(z);
++ int flg = annota->getFlags();
++ if (!(flg & 16))
++ ite->setRotation(rotate, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillEvenOdd(false);
++ ite->Clip = flattenPath(ite->PoLine, ite->Segments);
++ ite->ContourLine = ite->PoLine.copy();
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ ite->setIsAnnotation(true);
++ ite->AutoName = false;
++ if (act->getKind() == actionGoTo)
++ {
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(2);
++ }
++ else if (act->getKind() == actionGoToR)
++ {
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setExtern(fileName);
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(9);
++ }
++ else if (act->getKind() == actionURI)
++ {
++ ite->annotation().setAction("");
++ ite->annotation().setExtern(fileName);
++ ite->annotation().setActionType(8);
++ }
++ ite->annotation().setType(Annotation::Link);
++ ite->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
++ }
++ return validLink;
++}
++
++bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, double width, double height)
++{
++ bool retVal = false;
++ bool found = false;
++
++ if (!m_formWidgets)
++ return false;
++
++ int formcount = m_formWidgets->getNumWidgets();
++ for (int i = 0; i < formcount; ++i)
++ {
++ FormWidget *fm = m_formWidgets->getWidget(i);
++ if (!fm)
++ continue;
++ AnnotWidget *ano = fm->getWidgetAnnotation();
++ if (!ano)
++ continue;
++ if (ano != (AnnotWidget*) annota)
++ continue;
++ found = true;
++ int wtyp = -1;
++ if (fm->getType() == formButton)
++ {
++ FormWidgetButton *btn = (FormWidgetButton*)fm;
++ if (btn)
++ {
++ if (btn->getButtonType() == formButtonCheck)
++ {
++ wtyp = Annotation::Checkbox;
++ retVal = true;
++ }
++ else if (btn->getButtonType() == formButtonPush)
++ {
++ wtyp = Annotation::Button;
++ retVal = true;
++ }
++ else if (btn->getButtonType() == formButtonRadio)
++ {
++ wtyp = Annotation::RadioButton;
++ retVal = true;
++ }
++ }
++ }
++ else if (fm->getType() == formText)
++ {
++ wtyp = Annotation::Textfield;
++ retVal = true;
++ }
++ else if (fm->getType() == formChoice)
++ {
++ FormWidgetChoice *btn = (FormWidgetChoice*)fm;
++ if (btn)
++ {
++ if (btn->isCombo())
++ {
++ wtyp = Annotation::Combobox;
++ retVal = true;
++ }
++ else if (btn->isListBox())
++ {
++ wtyp = Annotation::Listbox;
++ retVal = true;
++ }
++ }
++ }
++ if (retVal)
++ {
++ AnnotAppearanceCharacs *achar = ano->getAppearCharacs();
++ bool fgFound = false;
++ bool bgFound = false;
++ if (achar)
++ {
++ POPPLER_CONST AnnotColor *bgCol = achar->getBackColor();
++ if (bgCol)
++ {
++ bgFound = true;
++ CurrColorFill = getAnnotationColor(bgCol);
++ }
++ else
++ CurrColorFill = CommonStrings::None;
++ POPPLER_CONST AnnotColor *fgCol = achar->getBorderColor();
++ if (fgCol)
++ {
++ fgFound = true;
++ CurrColorStroke = getAnnotationColor(fgCol);
++ }
++ else
++ {
++ fgCol = achar->getBackColor();
++ if (fgCol)
++ CurrColorStroke = getAnnotationColor(fgCol);
++ else
++ CurrColorStroke = CommonStrings::None;
++ }
++ }
++ QString CurrColorText = "Black";
++ double fontSize = 12;
++ QString fontName = "";
++ QString itemText = "";
++ AnnotAppearance *apa = annota->getAppearStreams();
++ if (apa || !achar)
++ {
++ AnoOutputDev *Adev = new AnoOutputDev(m_doc, m_importedColors);
++ Gfx *gfx = new Gfx(pdfDoc, Adev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
++ ano->draw(gfx, false);
++ if (!bgFound)
++ CurrColorFill = Adev->CurrColorFill;
++ if (!fgFound)
++ CurrColorStroke = Adev->CurrColorStroke;
++ CurrColorText = Adev->CurrColorText;
++ fontSize = Adev->m_fontSize;
++ fontName = UnicodeParsedString(Adev->m_fontName);
++ itemText = UnicodeParsedString(Adev->m_itemText);
++ delete gfx;
++ delete Adev;
++ }
++ int z = m_doc->itemAdd(PageItem::TextFrame, PageItem::Rectangle, xCoor, yCoor, width, height, 0, CurrColorFill, CommonStrings::None);
++ PageItem *ite = m_doc->Items->at(z);
++ int flg = annota->getFlags();
++ if (!(flg & 16))
++ ite->setRotation(rotate, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillEvenOdd(false);
++ ite->Clip = flattenPath(ite->PoLine, ite->Segments);
++ ite->ContourLine = ite->PoLine.copy();
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ ite->setIsAnnotation(true);
++ ite->AutoName = false;
++ AnnotBorder *brd = annota->getBorder();
++ if (brd)
++ {
++ int bsty = brd->getStyle();
++ if (bsty == AnnotBorder::borderDashed)
++ bsty = 1;
++ else if (bsty == AnnotBorder::borderBeveled)
++ bsty = 3;
++ else if (bsty == AnnotBorder::borderInset)
++ bsty = 4;
++ else if (bsty == AnnotBorder::borderUnderlined)
++ bsty = 2;
++ ite->annotation().setBorderStyle(bsty);
++ ite->annotation().setBorderColor(CurrColorStroke);
++ ite->annotation().setBorderWidth(qRound(brd->getWidth()));
++ }
++ else
++ {
++ ite->annotation().setBorderStyle(0);
++ ite->annotation().setBorderColor(CommonStrings::None);
++ ite->annotation().setBorderWidth(0);
++ }
++ QString tmTxt = "";
++ tmTxt = UnicodeParsedString(fm->getPartialName());
++ if (!tmTxt.isEmpty())
++ ite->setItemName(tmTxt);
++ tmTxt = "";
++ tmTxt = UnicodeParsedString(fm->getAlternateUiName());
++ if (!tmTxt.isEmpty())
++ ite->annotation().setToolTip(tmTxt);
++ tmTxt = "";
++ if (achar)
++ {
++ tmTxt = UnicodeParsedString(achar->getRolloverCaption());
++ if (!tmTxt.isEmpty())
++ ite->annotation().setRollOver(tmTxt);
++ tmTxt = "";
++ tmTxt = UnicodeParsedString(achar->getAlternateCaption());
++ if (!tmTxt.isEmpty())
++ ite->annotation().setDown(tmTxt);
++ }
++ ite->annotation().setType(wtyp);
++ ite->annotation().setFlag(0);
++ if (flg & 2)
++ ite->annotation().setVis(1);
++ if (flg & 32)
++ ite->annotation().setVis(3);
++ if (wtyp == Annotation::Button)
++ {
++ ite->setFillColor(CurrColorFill);
++ if (achar)
++ ite->itemText.insertChars(UnicodeParsedString(achar->getNormalCaption()));
++ else
++ ite->itemText.insertChars(itemText);
++ applyTextStyle(ite, fontName, CurrColorText, fontSize);
++ ite->annotation().addToFlag(Annotation::Flag_PushButton);
++ FormWidgetButton *btn = (FormWidgetButton*)fm;
++ if (!btn->isReadOnly())
++ ite->annotation().addToFlag(Annotation::Flag_Edit);
++ handleActions(ite, ano);
++ }
++ else if (wtyp == Annotation::Textfield)
++ {
++ FormWidgetText *btn = (FormWidgetText*)fm;
++ if (btn)
++ {
++ ite->itemText.insertChars(UnicodeParsedString(btn->getContent()));
++ applyTextStyle(ite, fontName, CurrColorText, fontSize);
++ ite->itemText.trim();
++ if (btn->isMultiline())
++ ite->annotation().addToFlag(Annotation::Flag_Multiline);
++ if (btn->isPassword())
++ ite->annotation().addToFlag(Annotation::Flag_Password);
++ if (btn->noSpellCheck())
++ ite->annotation().addToFlag(Annotation::Flag_DoNotSpellCheck);
++ if (btn->noScroll())
++ ite->annotation().addToFlag(Annotation::Flag_DoNotScroll);
++ int mxLen = btn->getMaxLen();
++ if (mxLen > 0)
++ ite->annotation().setMaxChar(mxLen);
++ else
++ ite->annotation().setMaxChar(-1);
++ if (!btn->isReadOnly())
++ ite->annotation().addToFlag(Annotation::Flag_Edit);
++ handleActions(ite, ano);
++ }
++ }
++ else if (wtyp == Annotation::Checkbox)
++ {
++ FormWidgetButton *btn = (FormWidgetButton*)fm;
++ if (btn)
++ {
++ ite->annotation().setIsChk(btn->getState());
++ ite->annotation().setCheckState(ite->annotation().IsChk());
++ handleActions(ite, ano);
++ if (itemText == "4")
++ ite->annotation().setChkStil(0);
++ else if (itemText == "5")
++ ite->annotation().setChkStil(1);
++ else if (itemText == "F")
++ ite->annotation().setChkStil(2);
++ else if (itemText == "l")
++ ite->annotation().setChkStil(3);
++ else if (itemText == "H")
++ ite->annotation().setChkStil(4);
++ else if (itemText == "n")
++ ite->annotation().setChkStil(5);
++ else
++ ite->annotation().setChkStil(0);
++ if (!btn->isReadOnly())
++ ite->annotation().addToFlag(Annotation::Flag_Edit);
++ }
++ }
++ else if ((wtyp == Annotation::Combobox) || (wtyp == Annotation::Listbox))
++ {
++ FormWidgetChoice *btn = (FormWidgetChoice*)fm;
++ if (btn)
++ {
++ if (wtyp == 5)
++ ite->annotation().addToFlag(Annotation::Flag_Combo);
++ int co = btn->getNumChoices();
++ if (co > 0)
++ {
++ QString inh = UnicodeParsedString(btn->getChoice(0));
++ for (int a = 1; a < co; a++)
++ {
++ inh += "\n" + UnicodeParsedString(btn->getChoice(a));
++ }
++ ite->itemText.insertChars(inh);
++ }
++ applyTextStyle(ite, fontName, CurrColorText, fontSize);
++ if (!btn->isReadOnly())
++ ite->annotation().addToFlag(Annotation::Flag_Edit);
++ handleActions(ite, ano);
++ }
++ }
++ else if (wtyp == Annotation::RadioButton)
++ {
++ FormWidgetButton *btn = (FormWidgetButton*)fm;
++ if (btn)
++ {
++ ite->setItemName( CommonStrings::itemName_RadioButton + QString("%1").arg(m_doc->TotalItems));
++ ite->annotation().setIsChk(btn->getState());
++ ite->annotation().setCheckState(ite->annotation().IsChk());
++ handleActions(ite, ano);
++ m_radioButtons.insert(annota->getRef().num, ite);
++ }
++ }
++ }
++ break;
++ }
++ if (!found)
++ {
++ Object obj1;
++ Ref refa = annota->getRef();
++ obj1 = xref->fetch(refa.num, refa.gen);
++ if (obj1.isDict())
++ {
++ Dict* dict = obj1.getDict();
++ Object obj2 = dict->lookup("Kids");
++ //childs
++ if (obj2.isArray())
++ {
++ // Load children
++ QList<int> radList;
++ for (int i = 0; i < obj2.arrayGetLength(); i++)
++ {
++ POPPLER_CONST_075 Object POPPLER_REF childRef = obj2.arrayGetNF(i);
++ if (!childRef.isRef())
++ continue;
++ Object childObj = obj2.arrayGet(i);
++ if (!childObj.isDict())
++ continue;
++ const Ref ref = childRef.getRef();
++ radList.append(ref.num);
++ }
++ QString tmTxt = UnicodeParsedString(annota->getName());
++ m_radioMap.insert(tmTxt, radList);
++ }
++ }
++ }
++ return retVal;
++}
++
++void SlaOutputDev::applyTextStyle(PageItem* ite, const QString& fontName, const QString& textColor, double fontSize)
++{
++ CharStyle newStyle;
++ newStyle.setFillColor(textColor);
++ newStyle.setFontSize(fontSize * 10);
++ if (!fontName.isEmpty())
++ {
++ SCFontsIterator it(*m_doc->AllFonts);
++ for ( ; it.hasNext() ; it.next())
++ {
++ ScFace& face(it.current());
++ if ((face.psName() == fontName) && (face.usable()) && (face.type() == ScFace::TTF))
++ {
++ newStyle.setFont(face);
++ break;
++ }
++ if ((face.family() == fontName) && (face.usable()) && (face.type() == ScFace::TTF))
++ {
++ newStyle.setFont(face);
++ break;
++ }
++ if ((face.scName() == fontName) && (face.usable()) && (face.type() == ScFace::TTF))
++ {
++ newStyle.setFont(face);
++ break;
++ }
++ }
++ }
++ ParagraphStyle dstyle(ite->itemText.defaultStyle());
++ dstyle.charStyle().applyCharStyle(newStyle);
++ ite->itemText.setDefaultStyle(dstyle);
++ ite->itemText.applyCharStyle(0, ite->itemText.length(), newStyle);
++ ite->invalid = true;
++}
++
++void SlaOutputDev::handleActions(PageItem* ite, AnnotWidget *ano)
++{
++ LinkAction *Lact = ano->getAction();
++ if (Lact)
++ {
++ if (Lact->getKind() == actionJavaScript)
++ {
++ LinkJavaScript *jsa = (LinkJavaScript*)Lact;
++ if (jsa->isOk())
++ {
++ ite->annotation().setActionType(1);
++ ite->annotation().setAction(UnicodeParsedString(jsa->getScript()));
++ }
++ }
++ else if (Lact->getKind() == actionGoTo)
++ {
++ int pagNum = 0;
++ int xco = 0;
++ int yco = 0;
++ LinkGoTo *gto = (LinkGoTo*)Lact;
++ POPPLER_CONST LinkDest *dst = gto->getDest();
++ if (dst)
++ {
++ if (dst->getKind() == destXYZ)
++ {
++ if (dst->isPageRef())
++ {
++ Ref dstr = dst->getPageRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
++ pagNum = pdfDoc->findPage(dstr);
++#else
++ pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
++#endif
++ }
++ else
++ pagNum = dst->getPageNum();
++ xco = dst->getLeft();
++ yco = dst->getTop();
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(2);
++ }
++ }
++ else
++ {
++ POPPLER_CONST GooString *ndst = gto->getNamedDest();
++ if (ndst)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
++ if (dstn)
++ {
++ if (dstn->getKind() == destXYZ)
++ {
++ if (dstn->isPageRef())
++ {
++ Ref dstr = dstn->getPageRef();
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
++ pagNum = pdfDoc->findPage(dstr);
++#else
++ pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
++#endif
++ }
++ else
++ pagNum = dstn->getPageNum();
++ xco = dstn->getLeft();
++ yco = dstn->getTop();
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(2);
++ }
++ }
++ }
++ }
++ }
++ else if (Lact->getKind() == actionGoToR)
++ {
++ int pagNum = 0;
++ int xco = 0;
++ int yco = 0;
++ LinkGoToR *gto = (LinkGoToR*)Lact;
++ QString fileName = UnicodeParsedString(gto->getFileName());
++ POPPLER_CONST LinkDest *dst = gto->getDest();
++ if (dst)
++ {
++ if (dst->getKind() == destXYZ)
++ {
++ pagNum = dst->getPageNum();
++ xco = dst->getLeft();
++ yco = dst->getTop();
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setExtern(fileName);
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(9);
++ }
++ }
++ else
++ {
++ POPPLER_CONST GooString *ndst = gto->getNamedDest();
++ if (ndst)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
++#else
++ LinkDest *dstn = pdfDoc->findDest(ndst);
++#endif
++ if (dstn)
++ {
++ if (dstn->getKind() == destXYZ)
++ {
++ pagNum = dstn->getPageNum();
++ xco = dstn->getLeft();
++ yco = dstn->getTop();
++ ite->annotation().setZiel((pagNum > 0) ? (pagNum - 1) : (m_actPage - 1));
++ ite->annotation().setExtern(fileName);
++ ite->annotation().setAction(QString("%1 %2").arg(xco).arg(yco));
++ ite->annotation().setActionType(9);
++ }
++ }
++ }
++ }
++ }
++ else if (Lact->getKind() == actionUnknown)
++ {
++ LinkUnknown *uno = (LinkUnknown*)Lact;
++ QString actString = UnicodeParsedString(uno->getAction());
++ if (actString == "ResetForm")
++ {
++ ite->annotation().setActionType(4);
++ }
++ else
++ {
++ LinkAction* scact = SC_getAction(ano);
++ if (scact)
++ {
++ if (actString == "ImportData")
++ {
++ LinkImportData *impo = (LinkImportData*)scact;
++ if (impo->isOk())
++ {
++ ite->annotation().setActionType(5);
++ ite->annotation().setAction(UnicodeParsedString(impo->getFileName()));
++ }
++ }
++ else if (actString == "SubmitForm")
++ {
++ LinkSubmitForm *impo = (LinkSubmitForm*)scact;
++ if (impo->isOk())
++ {
++ ite->annotation().setActionType(3);
++ ite->annotation().setAction(UnicodeParsedString(impo->getFileName()));
++ int fl = impo->getFlags();
++ if (fl == 0)
++ ite->annotation().setHTML(0);
++ else if (fl == 4)
++ ite->annotation().setHTML(1);
++ else if (fl == 64)
++ ite->annotation().setHTML(2);
++ else if (fl == 512)
++ ite->annotation().setHTML(3);
++ }
++ }
++ }
++ }
++ }
++ else if (Lact->getKind() == actionNamed)
++ {
++ LinkNamed *uno = (LinkNamed*)Lact;
++ ite->annotation().setActionType(10);
++ ite->annotation().setAction(UnicodeParsedString(uno->getName()));
++ }
++ else
++ qDebug() << "Found unsupported Action of type" << Lact->getKind();
++ }
++ auto Aact = SC_getAdditionalAction("D", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("E", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("X", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("Fo", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("Bl", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("C", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("F", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ ite->annotation().setFormat(5);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("K", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ ite->annotation().setFormat(5);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++ Aact = SC_getAdditionalAction("V", ano);
++ if (Aact)
++ {
++ if (Aact->getKind() == actionJavaScript)
++ {
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
++#else
++ LinkJavaScript *jsa = (LinkJavaScript*) Aact;
++#endif
++ if (jsa->isOk())
++ {
++ ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
++ ite->annotation().setAAact(true);
++ }
++ }
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ Aact.reset();
++#else
++ Aact = nullptr;
++#endif
++ }
++}
++
++void SlaOutputDev::startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA)
++{
++ xref = xrefA;
++ catalog = catA;
++ pdfDoc = doc;
++ updateGUICounter = 0;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
++ m_fontEngine = new SplashFontEngine(true, false, false, true);
++#else
++ m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), false, false, true);
++#endif
++}
++
++void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
++{
++ m_formWidgets = pdfDoc->getPage(pageNum)->getFormWidgets();
++ m_radioMap.clear();
++ m_radioButtons.clear();
++ m_actPage = pageNum;
++ m_groupStack.clear();
++ pushGroup();
++ m_currentClipPath = QPainterPath();
++ m_clipPaths.clear();
++}
++
++void SlaOutputDev::endPage()
++{
++ if (!m_radioMap.isEmpty())
++ {
++ for (auto it = m_radioMap.begin(); it != m_radioMap.end(); ++it)
++ {
++ tmpSel->clear();
++ QList<int> refList = it.value();
++ for (int a = 0; a < refList.count(); a++)
++ {
++ if (m_radioButtons.contains(refList[a]))
++ {
++ tmpSel->addItem(m_radioButtons[refList[a]], true);
++ m_Elements->removeAll(m_radioButtons[refList[a]]);
++ }
++ }
++ if (!tmpSel->isEmpty())
++ {
++ PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
++ ite->setItemName(it.key());
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ }
++ m_radioMap.clear();
++ m_radioButtons.clear();
++// qDebug() << "ending page";
++}
++
++void SlaOutputDev::saveState(GfxState *state)
++{
++ m_clipPaths.push(m_currentClipPath);
++ pushGroup();
++}
++
++void SlaOutputDev::restoreState(GfxState *state)
++{
++ if (m_groupStack.count() != 0)
++ {
++ groupEntry gElements = m_groupStack.pop();
++ if (gElements.Items.count() > 0)
++ {
++ if ((gElements.Items.count() > 1) && (checkClip()))
++ {
++ tmpSel->clear();
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ tmpSel->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
++ if (ite)
++ {
++ QPainterPath clippath = m_currentClipPath;
++ clippath.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
++ clippath.translate(-ite->xPos(), -ite->yPos());
++ ite->PoLine.fromQPainterPath(clippath, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ // Comment out temporarily, there are some bad interactions between adjustItemSize() and
++ // resizeGroupToContents() since fixing resizing of multiple selections
++ //m_doc->adjustItemSize(ite, true);
++ m_doc->resizeGroupToContents(ite);
++ ite->OldB2 = ite->width();
++ ite->OldH2 = ite->height();
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ applyMask(ite);
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ else
++ {
++ if (m_groupStack.count() != 0)
++ {
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ PageItem *ite = gElements.Items.at(dre);
++ applyMask(ite);
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ }
++ tmpSel->clear();
++ }
++ else
++ {
++ if (m_groupStack.count() != 0)
++ {
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ PageItem *ite = gElements.Items.at(dre);
++ applyMask(ite);
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ }
++ }
++ }
++ if (m_clipPaths.count() != 0)
++ m_currentClipPath = m_clipPaths.pop();
++}
++
++void SlaOutputDev::beginTransparencyGroup(GfxState *state, POPPLER_CONST_070 double *bbox, GfxColorSpace * /*blendingColorSpace*/, GBool isolated, GBool knockout, GBool forSoftMask)
++{
++// qDebug() << "SlaOutputDev::beginTransparencyGroup isolated:" << isolated << "knockout:" << knockout << "forSoftMask:" << forSoftMask;
++ pushGroup("", forSoftMask);
++ m_groupStack.top().isolated = isolated;
++}
++
++void SlaOutputDev::paintTransparencyGroup(GfxState *state, POPPLER_CONST_070 double *bbox)
++{
++// qDebug() << "SlaOutputDev::paintTransparencyGroup";
++ if (m_groupStack.count() != 0)
++ {
++ if ((m_groupStack.top().Items.count() != 0) && (!m_groupStack.top().forSoftMask))
++ {
++ PageItem *ite = m_groupStack.top().Items.last();
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ }
++ }
++}
++
++void SlaOutputDev::endTransparencyGroup(GfxState *state)
++{
++// qDebug() << "SlaOutputDev::endTransparencyGroup";
++ if (m_groupStack.count() <= 0)
++ return;
++
++ tmpSel->clear();
++
++ groupEntry gElements = m_groupStack.pop();
++ if (gElements.Items.count() <= 0)
++ return;
++
++ if (gElements.forSoftMask)
++ {
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ tmpSel->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ScPattern pat = ScPattern();
++ pat.setDoc(m_doc);
++ m_doc->DoDrawing = true;
++ pat.pattern = ite->DrawObj_toImage(qMin(qMax(ite->width(), ite->height()), 500.0));
++ pat.xoffset = 0;
++ pat.yoffset = 0;
++ m_doc->DoDrawing = false;
++ pat.width = ite->width();
++ pat.height = ite->height();
++ m_currentMaskPosition = QPointF(ite->xPos(), ite->yPos());
++ ite->gXpos = 0;
++ ite->gYpos = 0;
++ ite->setXYPos(ite->gXpos, ite->gYpos, true);
++ pat.items.append(ite);
++ m_doc->Items->removeAll(ite);
++ QString id = QString("Pattern_from_PDF_%1S").arg(m_doc->docPatterns.count() + 1);
++ m_doc->addPattern(id, pat);
++ m_currentMask = id;
++ tmpSel->clear();
++ return;
++ }
++ PageItem *ite;
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ tmpSel->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ if ((gElements.Items.count() != 1) || (gElements.isolated))
++ ite = m_doc->groupObjectsSelection(tmpSel);
++ else
++ ite = gElements.Items.first();
++ if (ite->isGroup())
++ {
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ if (checkClip())
++ {
++ QPainterPath clippath = m_currentClipPath;
++ clippath.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
++ clippath.translate(-ite->xPos(), -ite->yPos());
++ ite->PoLine.fromQPainterPath(clippath, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ // Comment out temporarily, there are some bad interactions between adjustItemSize() and
++ // resizeGroupToContents() since fixing resizing of multiple selections
++ //m_doc->adjustItemSize(ite, true);
++ m_doc->resizeGroupToContents(ite);
++ ite->OldB2 = ite->width();
++ ite->OldH2 = ite->height();
++ }
++ }
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ applyMask(ite);
++ m_groupStack.top().Items.append(ite);
++ }
++
++ tmpSel->clear();
++}
++
++void SlaOutputDev::setSoftMask(GfxState * /*state*/, POPPLER_CONST_070 double * bbox, GBool alpha, Function *transferFunc, GfxColor * /*backdropColor*/)
++{
++ if (m_groupStack.count() <= 0)
++ return;
++
++ double lum = 0;
++ double lum2 = 0;
++ if (transferFunc)
++ transferFunc->transform(&lum, &lum2);
++ else
++ lum2 = lum;
++ if (lum == lum2)
++ m_groupStack.top().inverted = false;
++ else
++ m_groupStack.top().inverted = true;
++ m_groupStack.top().maskName = m_currentMask;
++ // Remember the mask's position as it might not align with the image to which the mask is later assigned.
++ m_groupStack.top().maskPos = m_currentMaskPosition;
++ m_groupStack.top().alpha = alpha;
++ if (m_groupStack.top().Items.count() != 0)
++ applyMask(m_groupStack.top().Items.last());
++}
++
++void SlaOutputDev::clearSoftMask(GfxState * /*state*/)
++{
++ if (m_groupStack.count() != 0)
++ m_groupStack.top().maskName = "";
++}
++
++void SlaOutputDev::updateFillColor(GfxState *state)
++{
++ CurrFillShade = 100;
++ CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
++}
++
++void SlaOutputDev::updateStrokeColor(GfxState *state)
++{
++ CurrStrokeShade = 100;
++ CurrColorStroke = getColor(state->getStrokeColorSpace(), state->getStrokeColor(), &CurrStrokeShade);
++}
++
++void SlaOutputDev::clip(GfxState *state)
++{
++// qDebug() << "Clip";
++ adjustClip(state, Qt::WindingFill);
++}
++
++void SlaOutputDev::eoClip(GfxState *state)
++{
++// qDebug() << "EoClip";
++ adjustClip(state, Qt::OddEvenFill);
++}
++
++void SlaOutputDev::adjustClip(GfxState *state, Qt::FillRule fillRule)
++{
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ QString output = convertPath(state->getPath());
++ if (output.isEmpty())
++ return;
++ FPointArray out;
++ out.parseSVG(output);
++ out.svgClosePath();
++ out.map(m_ctm);
++ if (checkClip())
++ {
++ // "clip" (WindingFill) and "eoClip" (OddEvenFill) only the determine
++ // the fill rule of the new clipping path. The new clip should be the
++ // intersection of the old and new area. QPainterPath determines on
++ // its own which fill rule to use for the result. We should not loose
++ // this information.
++ QPainterPath pathN = out.toQPainterPath(false);
++ pathN.setFillRule(fillRule);
++ m_currentClipPath = intersection(pathN, m_currentClipPath);
++ }
++ else
++ m_currentClipPath = out.toQPainterPath(false);
++}
++
++void SlaOutputDev::stroke(GfxState *state)
++{
++// qDebug() << "Stroke";
++ const double *ctm;
++ ctm = state->getCTM();
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ QString output = convertPath(state->getPath());
++ getPenState(state);
++ if ((m_Elements->count() != 0) && (output == Coords)) // Path is the same as in last fill
++ {
++ PageItem* ite = m_Elements->last();
++ ite->setLineColor(CurrColorStroke);
++ ite->setLineShade(CurrStrokeShade);
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setLineWidth(state->getTransformedLineWidth());
++ ite->setDashes(DashValues);
++ ite->setDashOffset(DashOffset);
++ ite->setLineTransparency(1.0 - state->getStrokeOpacity());
++ }
++ else
++ {
++ FPointArray out;
++ out.parseSVG(output);
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ out.map(m_ctm);
++ FPoint wh = out.widthHeight();
++ if ((out.size() > 3) && ((wh.x() != 0.0) || (wh.y() != 0.0)))
++ {
++ CurrColorStroke = getColor(state->getStrokeColorSpace(), state->getStrokeColor(), &CurrStrokeShade);
++ int z;
++ if (pathIsClosed)
++ z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, state->getTransformedLineWidth(), CommonStrings::None, CurrColorStroke);
++ else
++ z = m_doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, xCoor, yCoor, 10, 10, state->getTransformedLineWidth(), CommonStrings::None, CurrColorStroke);
++ PageItem* ite = m_doc->Items->at(z);
++ ite->PoLine = out.copy();
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setWidthHeight(wh.x(), wh.y());
++ m_doc->adjustItemSize(ite);
++ if (m_Elements->count() != 0)
++ {
++ PageItem* lItem = m_Elements->last();
++ if ((lItem->lineColor() == CommonStrings::None) && (lItem->PoLine == ite->PoLine))
++ {
++ lItem->setLineColor(CurrColorStroke);
++ lItem->setLineWidth(state->getTransformedLineWidth());
++ lItem->setLineShade(CurrStrokeShade);
++ lItem->setLineTransparency(1.0 - state->getStrokeOpacity());
++ lItem->setLineBlendmode(getBlendMode(state));
++ lItem->setLineEnd(PLineEnd);
++ lItem->setLineJoin(PLineJoin);
++ lItem->setDashes(DashValues);
++ lItem->setDashOffset(DashOffset);
++ lItem->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_doc->Items->removeAll(ite);
++ }
++ else
++ {
++ ite->setLineShade(CurrStrokeShade);
++ ite->setLineTransparency(1.0 - state->getStrokeOpacity());
++ ite->setLineBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setDashes(DashValues);
++ ite->setDashOffset(DashOffset);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ else
++ {
++ ite->setLineShade(CurrStrokeShade);
++ ite->setLineTransparency(1.0 - state->getStrokeOpacity());
++ ite->setLineBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setDashes(DashValues);
++ ite->setDashOffset(DashOffset);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ m_groupStack.top().Items.append(ite);
++ }
++ }
++ }
++}
++
++void SlaOutputDev::fill(GfxState *state)
++{
++// qDebug() << "Fill";
++ createFillItem(state, Qt::WindingFill);
++}
++
++void SlaOutputDev::eoFill(GfxState *state)
++{
++// qDebug() << "EoFill";
++ createFillItem(state, Qt::OddEvenFill);
++}
++
++void SlaOutputDev::createFillItem(GfxState *state, Qt::FillRule fillRule)
++{
++ const double *ctm;
++ ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ FPointArray out;
++ QString output = convertPath(state->getPath());
++ out.parseSVG(output);
++ out.map(m_ctm);
++
++ // Clip the new path first and only add it if it is not empty.
++ QPainterPath path = out.toQPainterPath(false);
++ path.setFillRule(fillRule);
++ QPainterPath clippedPath = intersection(m_currentClipPath, path);
++
++ // Undo the rotation of the clipping path as it is rotated together with the item.
++ double angle = m_ctm.map(QLineF(0, 0, 1, 0)).angle();
++ QTransform mm;
++ mm.rotate(angle);
++ clippedPath = mm.map(clippedPath);
++
++ Coords = output;
++ QRectF bbox = clippedPath.boundingRect();
++ if (!clippedPath.isEmpty() && !bbox.isNull())
++ {
++ CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
++ int z;
++ if (pathIsClosed)
++ z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, CurrColorFill, CommonStrings::None);
++ else
++ z = m_doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, CurrColorFill, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ ite->PoLine.fromQPainterPath(clippedPath, true);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setRotation(-angle);
++ // Only the new path has to be interpreted according to fillRule. QPainterPath
++ // could decide to create a final path according to the other rule. Thus
++ // we have to set this from the final path.
++ ite->setFillEvenOdd(clippedPath.fillRule() == Qt::OddEvenFill);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setWidthHeight(bbox.width(),bbox.height());
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ }
++}
++
++GBool SlaOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax)
++{
++// qDebug() << "SlaOutputDev::axialShadedFill";
++ double GrStartX;
++ double GrStartY;
++ double GrEndX;
++ double GrEndY;
++ int shade = 100;
++ POPPLER_CONST_070 Function *func = shading->getFunc(0);
++ VGradient FillGradient = VGradient(VGradient::linear);
++ FillGradient.clearStops();
++ GfxColorSpace *color_space = shading->getColorSpace();
++ if (func->getType() == 3)
++ {
++ StitchingFunction *stitchingFunc = (StitchingFunction*)func;
++ const double *bounds = stitchingFunc->getBounds();
++ int num_funcs = stitchingFunc->getNumFuncs();
++ double domain_min = stitchingFunc->getDomainMin(0);
++ double domain_max = stitchingFunc->getDomainMax(0);
++ if (fabs(domain_max - domain_min) < 1e-6)
++ {
++ domain_min = 0.0;
++ domain_max = 1.0;
++ }
++ // Add stops from all the stitched functions
++ for (int i = 0 ; i <= num_funcs ; i++)
++ {
++ GfxColor temp;
++ shading->getColor(bounds[i], &temp);
++ QString stopColor = getColor(color_space, &temp, &shade);
++ double stopPoint = (bounds[i] - domain_min) / (domain_max - domain_min);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
++ }
++ }
++ else if ((func->getType() == 2) || (func->getType() == 0))
++ {
++ GfxColor stop1;
++ shading->getColor(0.0, &stop1);
++ QString stopColor1 = getColor(color_space, &stop1, &shade);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
++ GfxColor stop2;
++ shading->getColor(1.0, &stop2);
++ QString stopColor2 = getColor(color_space, &stop2, &shade);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
++ }
++ shading->getCoords(&GrStartX, &GrStartY, &GrEndX, &GrEndY);
++ double xmin, ymin, xmax, ymax;
++ // get the clip region bbox
++ state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
++ QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
++ crect = crect.normalized();
++ QPainterPath out;
++ out.addRect(crect);
++ if (checkClip())
++ {
++ // Apply the clip path early to adjust the gradient vector to the
++ // smaller boundign box.
++ out = intersection(m_currentClipPath, out);
++ crect = out.boundingRect();
++ }
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ FPointArray gr;
++ gr.addPoint(GrStartX, GrStartY);
++ gr.addPoint(GrEndX, GrEndY);
++ gr.map(m_ctm);
++ gr.translate(-crect.x(), -crect.y());
++
++ // Undo the rotation and translation of the gradient vector.
++ double angle = m_ctm.map(QLineF(0, 0, 1, 0)).angle();
++ QTransform mm;
++ mm.rotate(angle);
++ out.translate(-crect.x(), -crect.y());
++ out = mm.map(out);
++ QRectF bb = out.boundingRect();
++ gr.map(mm);
++ gr.translate(-bb.left(), -bb.top());
++ GrStartX = gr.point(0).x();
++ GrStartY = gr.point(0).y();
++ GrEndX = gr.point(1).x();
++ GrEndY = gr.point(1).y();
++
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ QString output = QString("M %1 %2").arg(0.0).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(0.0);
++ output += QString("Z");
++ pathIsClosed = true;
++ Coords = output;
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), bb.width(), bb.height(), 0, CurrColorFill, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ if (checkClip())
++ {
++ ite->PoLine.fromQPainterPath(out, true);
++ ite->setFillEvenOdd(out.fillRule() == Qt::OddEvenFill);
++ }
++ ite->setRotation(-angle);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ ite->GrType = 6;
++ if (!shading->getExtend0() || !shading->getExtend1())
++ {
++ FillGradient.setRepeatMethod(VGradient::none);
++ ite->setGradientExtend(VGradient::none);
++ }
++ else
++ {
++ FillGradient.setRepeatMethod(VGradient::pad);
++ ite->setGradientExtend(VGradient::pad);
++ }
++ ite->fill_gradient = FillGradient;
++ ite->setGradientVector(GrStartX, GrStartY, GrEndX, GrEndY, 0, 0, 1, 0);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ return gTrue;
++}
++
++GBool SlaOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax)
++{
++// qDebug() << "SlaOutputDev::radialShadedFill";
++ double GrStartX;
++ double GrStartY;
++ double GrEndX;
++ double GrEndY;
++ int shade = 100;
++ POPPLER_CONST_070 Function *func = shading->getFunc(0);
++ VGradient FillGradient = VGradient(VGradient::linear);
++ FillGradient.clearStops();
++ GfxColorSpace *color_space = shading->getColorSpace();
++ if (func->getType() == 3)
++ {
++ StitchingFunction *stitchingFunc = (StitchingFunction*)func;
++ const double *bounds = stitchingFunc->getBounds();
++ int num_funcs = stitchingFunc->getNumFuncs();
++ double domain_min = stitchingFunc->getDomainMin(0);
++ double domain_max = stitchingFunc->getDomainMax(0);
++ if (fabs(domain_max - domain_min) < 1e-6)
++ {
++ domain_min = 0.0;
++ domain_max = 1.0;
++ }
++ // Add stops from all the stitched functions
++ for (int i = 0 ; i <= num_funcs ; i++)
++ {
++ GfxColor temp;
++ shading->getColor(bounds[i], &temp);
++ QString stopColor = getColor(color_space, &temp, &shade);
++ double stopPoint = (bounds[i] - domain_min) / (domain_max - domain_min);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor], m_doc, shade), stopPoint, 0.5, 1.0, stopColor, shade );
++ }
++ }
++ else if ((func->getType() == 2) || (func->getType() == 0))
++ {
++ GfxColor stop1;
++ shading->getColor(0.0, &stop1);
++ QString stopColor1 = getColor(color_space, &stop1, &shade);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor1], m_doc, shade), 0.0, 0.5, 1.0, stopColor1, shade );
++ GfxColor stop2;
++ shading->getColor(1.0, &stop2);
++ QString stopColor2 = getColor(color_space, &stop2, &shade);
++ FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
++ }
++ double r0, x1, y1, r1;
++ shading->getCoords(&GrStartX, &GrStartY, &r0, &x1, &y1, &r1);
++ double xmin, ymin, xmax, ymax;
++ // get the clip region bbox
++ state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
++ QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
++ crect = crect.normalized();
++ double GrFocalX = x1;
++ double GrFocalY = y1;
++ GrEndX = GrFocalX + r1;
++ GrEndY = GrFocalY;
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ FPointArray gr;
++ gr.addPoint(GrStartX, GrStartY);
++ gr.addPoint(GrEndX, GrEndY);
++ gr.addPoint(GrFocalX, GrFocalY);
++ gr.map(m_ctm);
++ GrStartX = gr.point(0).x() - crect.x();
++ GrStartY = gr.point(0).y() - crect.y();
++ GrEndX = gr.point(1).x() - crect.x();
++ GrEndY = gr.point(1).y() - crect.y();
++ GrFocalX = gr.point(2).x() - crect.x();
++ GrFocalY = gr.point(2).y() - crect.y();
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ QString output = QString("M %1 %2").arg(0.0).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(0.0);
++ output += QString("Z");
++ pathIsClosed = true;
++ Coords = output;
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ if (checkClip())
++ {
++ QPainterPath out = m_currentClipPath;
++ out.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
++ out.translate(-ite->xPos(), -ite->yPos());
++ ite->PoLine.fromQPainterPath(out, true);
++ ite->setFillEvenOdd(out.fillRule() == Qt::OddEvenFill);
++ }
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ ite->GrType = 7;
++ if (!shading->getExtend0() || !shading->getExtend1())
++ {
++ FillGradient.setRepeatMethod(VGradient::none);
++ ite->setGradientExtend(VGradient::none);
++ }
++ else
++ {
++ FillGradient.setRepeatMethod(VGradient::pad);
++ ite->setGradientExtend(VGradient::pad);
++ }
++ ite->fill_gradient = FillGradient;
++ ite->setGradientVector(GrStartX, GrStartY, GrEndX, GrEndY, GrFocalX, GrFocalY, 1, 0);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ return gTrue;
++}
++
++GBool SlaOutputDev::gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading)
++{
++// qDebug() << "SlaOutputDev::gouraudTriangleShadedFill";
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ double xmin, ymin, xmax, ymax;
++ // get the clip region bbox
++ state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
++ QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
++ crect = crect.normalized();
++ QString output = QString("M %1 %2").arg(0.0).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(0.0);
++ output += QString("Z");
++ pathIsClosed = true;
++ Coords = output;
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setFillEvenOdd(false);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ GfxColor color[3];
++ double x0, y0, x1, y1, x2, y2;
++ for (int i = 0; i < shading->getNTriangles(); i++)
++ {
++ int shade = 100;
++ meshGradientPatch patchM;
++ shading->getTriangle(i, &x0, &y0, &color[0], &x1, &y1, &color[1], &x2, &y2, &color[2]);
++ patchM.BL.resetTo(FPoint(x0, y0));
++ patchM.BL.shade = 100;
++ patchM.BL.transparency = 1.0;
++ patchM.BL.colorName = getColor(shading->getColorSpace(), &color[0], &shade);
++ patchM.BL.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.BL.colorName], m_doc, shade);
++ patchM.TL.resetTo(FPoint(x1, y1));
++ patchM.TL.shade = 100;
++ patchM.TL.transparency = 1.0;
++ patchM.TL.colorName = getColor(shading->getColorSpace(), &color[1], &shade);
++ patchM.TL.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.TL.colorName], m_doc, shade);
++ patchM.TR.resetTo(FPoint(x2, y2));
++ patchM.TR.shade = 100;
++ patchM.TR.transparency = 1.0;
++ patchM.TR.colorName = getColor(shading->getColorSpace(), &color[2], &shade);
++ patchM.TR.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.TR.colorName], m_doc, shade);
++ patchM.BR.resetTo(FPoint(x0, y0));
++ patchM.BR.shade = 100;
++ patchM.BR.transparency = 1.0;
++ patchM.BR.colorName = getColor(shading->getColorSpace(), &color[0], &shade);
++ patchM.BR.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.BR.colorName], m_doc, shade);
++ patchM.TL.transform(m_ctm);
++ patchM.TL.moveRel(-crect.x(), -crect.y());
++ patchM.TR.transform(m_ctm);
++ patchM.TR.moveRel(-crect.x(), -crect.y());
++ patchM.BR.transform(m_ctm);
++ patchM.BR.moveRel(-crect.x(), -crect.y());
++ patchM.BL.transform(m_ctm);
++ patchM.BL.moveRel(-crect.x(), -crect.y());
++ ite->meshGradientPatches.append(patchM);
++ }
++ ite->GrType = 12;
++ return gTrue;
++}
++
++GBool SlaOutputDev::patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading)
++{
++// qDebug() << "SlaOutputDev::patchMeshShadedFill";
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ double xmin, ymin, xmax, ymax;
++ // get the clip region bbox
++ state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
++ QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
++ crect = crect.normalized();
++ QString output = QString("M %1 %2").arg(0.0).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(0.0);
++ output += QString("Z");
++ pathIsClosed = true;
++ Coords = output;
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setFillEvenOdd(false);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ ite->meshGradientPatches.clear();
++ for (int i = 0; i < shading->getNPatches(); i++)
++ {
++ int shade = 100;
++ const GfxPatch *patch = shading->getPatch(i);
++ GfxColor color;
++ meshGradientPatch patchM;
++ int u, v;
++ patchM.BL.resetTo(FPoint(patch->x[0][0], patch->y[0][0]));
++ patchM.BL.controlTop = FPoint(patch->x[0][1], patch->y[0][1]);
++ patchM.BL.controlRight = FPoint(patch->x[1][0], patch->y[1][0]);
++ patchM.BL.controlColor = FPoint(patch->x[1][1], patch->y[1][1]);
++ u = 0;
++ v = 0;
++ if (shading->isParameterized())
++ {
++ shading->getParameterizedColor (patch->color[u][v].c[0], &color);
++ }
++ else
++ {
++ for (int k = 0; k < shading->getColorSpace()->getNComps(); k++)
++ {
++ color.c[k] = GfxColorComp (patch->color[u][v].c[k]);
++ }
++ }
++ patchM.BL.colorName = getColor(shading->getColorSpace(), &color, &shade);
++ patchM.BL.shade = 100;
++ patchM.BL.transparency = 1.0;
++ patchM.BL.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.BL.colorName], m_doc, shade);
++
++ u = 0;
++ v = 1;
++ patchM.TL.resetTo(FPoint(patch->x[0][3], patch->y[0][3]));
++ patchM.TL.controlRight = FPoint(patch->x[1][3], patch->y[1][3]);
++ patchM.TL.controlBottom = FPoint(patch->x[0][2], patch->y[0][2]);
++ patchM.TL.controlColor = FPoint(patch->x[1][2], patch->y[1][2]);
++ if (shading->isParameterized())
++ {
++ shading->getParameterizedColor (patch->color[u][v].c[0], &color);
++ }
++ else
++ {
++ for (int k = 0; k < shading->getColorSpace()->getNComps(); k++)
++ {
++ color.c[k] = GfxColorComp (patch->color[u][v].c[k]);
++ }
++ }
++ patchM.TL.colorName = getColor(shading->getColorSpace(), &color, &shade);
++ patchM.TL.shade = 100;
++ patchM.TL.transparency = 1.0;
++ patchM.TL.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.TL.colorName], m_doc, shade);
++
++ u = 1;
++ v = 1;
++ patchM.TR.resetTo(FPoint(patch->x[3][3], patch->y[3][3]));
++ patchM.TR.controlBottom = FPoint(patch->x[3][2], patch->y[3][2]);
++ patchM.TR.controlLeft = FPoint(patch->x[2][3], patch->y[2][3]);
++ patchM.TR.controlColor = FPoint(patch->x[2][2], patch->y[2][2]);
++ if (shading->isParameterized())
++ {
++ shading->getParameterizedColor (patch->color[u][v].c[0], &color);
++ }
++ else
++ {
++ for (int k = 0; k < shading->getColorSpace()->getNComps(); k++)
++ {
++ color.c[k] = GfxColorComp (patch->color[u][v].c[k]);
++ }
++ }
++ patchM.TR.colorName = getColor(shading->getColorSpace(), &color, &shade);
++ patchM.TR.shade = 100;
++ patchM.TR.transparency = 1.0;
++ patchM.TR.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.TR.colorName], m_doc, shade);
++
++ u = 1;
++ v = 0;
++ patchM.BR.resetTo(FPoint(patch->x[3][0], patch->y[3][0]));
++ patchM.BR.controlLeft = FPoint(patch->x[2][0], patch->y[2][0]);
++ patchM.BR.controlTop = FPoint(patch->x[3][1], patch->y[3][1]);
++ patchM.BR.controlColor = FPoint(patch->x[2][1], patch->y[2][1]);
++ if (shading->isParameterized())
++ {
++ shading->getParameterizedColor (patch->color[u][v].c[0], &color);
++ }
++ else
++ {
++ for (int k = 0; k < shading->getColorSpace()->getNComps(); k++)
++ {
++ color.c[k] = GfxColorComp (patch->color[u][v].c[k]);
++ }
++ }
++ patchM.BR.colorName = getColor(shading->getColorSpace(), &color, &shade);
++ patchM.BR.shade = 100;
++ patchM.BR.transparency = 1.0;
++ patchM.BR.color = ScColorEngine::getShadeColorProof(m_doc->PageColors[patchM.BR.colorName], m_doc, shade);
++
++ patchM.TL.transform(m_ctm);
++ patchM.TL.moveRel(-crect.x(), -crect.y());
++ patchM.TR.transform(m_ctm);
++ patchM.TR.moveRel(-crect.x(), -crect.y());
++ patchM.BR.transform(m_ctm);
++ patchM.BR.moveRel(-crect.x(), -crect.y());
++ patchM.BL.transform(m_ctm);
++ patchM.BL.moveRel(-crect.x(), -crect.y());
++ ite->meshGradientPatches.append(patchM);
++ }
++ ite->GrType = 12;
++ return gTrue;
++}
++
++GBool SlaOutputDev::tilingPatternFill(GfxState *state, Gfx * /*gfx*/, Catalog *cat, Object *str, POPPLER_CONST_070 double *pmat, int paintType, int tilingType, Dict *resDict, POPPLER_CONST_070 double *mat, POPPLER_CONST_070 double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep)
++{
++// qDebug() << "SlaOutputDev::tilingPatternFill";
++ PDFRectangle box;
++ Gfx *gfx;
++ QString id;
++ PageItem *ite;
++ groupEntry gElements;
++ gElements.forSoftMask = gFalse;
++ gElements.alpha = gFalse;
++ gElements.inverted = false;
++ gElements.maskName = "";
++ gElements.Items.clear();
++ m_groupStack.push(gElements);
++ double width, height;
++ width = bbox[2] - bbox[0];
++ height = bbox[3] - bbox[1];
++ if (xStep != width || yStep != height)
++ return gFalse;
++ box.x1 = bbox[0];
++ box.y1 = bbox[1];
++ box.x2 = bbox[2];
++ box.y2 = bbox[3];
++
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ QTransform mm = QTransform(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
++ QTransform mmx = mm * m_ctm;
++
++ gfx = new Gfx(pdfDoc, this, resDict, &box, nullptr);
++ inPattern++;
++ // Unset the clip path as it is unrelated to the pattern's coordinate space.
++ QPainterPath savedClip = m_currentClipPath;
++ m_currentClipPath = QPainterPath();
++ gfx->display(str);
++ m_currentClipPath = savedClip;
++ inPattern--;
++ gElements = m_groupStack.pop();
++ m_doc->m_Selection->clear();
++// double pwidth = 0;
++// double pheight = 0;
++ if (gElements.Items.count() > 0)
++ {
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ m_doc->m_Selection->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ m_doc->itemSelection_FlipV();
++ PageItem *ite;
++ if (m_doc->m_Selection->count() > 1)
++ ite = m_doc->groupObjectsSelection();
++ else
++ ite = m_doc->m_Selection->itemAt(0);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ m_doc->m_Selection->clear();
++ ScPattern pat = ScPattern();
++ pat.setDoc(m_doc);
++ m_doc->DoDrawing = true;
++ pat.pattern = ite->DrawObj_toImage(qMin(qMax(ite->width(), ite->height()), 500.0));
++ pat.xoffset = 0;
++ pat.yoffset = 0;
++ m_doc->DoDrawing = false;
++ pat.width = ite->width();
++ pat.height = ite->height();
++ // pwidth = ite->width();
++ // pheight = ite->height();
++ ite->gXpos = 0;
++ ite->gYpos = 0;
++ ite->setXYPos(ite->gXpos, ite->gYpos, true);
++ pat.items.append(ite);
++ m_doc->Items->removeAll(ite);
++ id = QString("Pattern_from_PDF_%1").arg(m_doc->docPatterns.count() + 1);
++ m_doc->addPattern(id, pat);
++ }
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ double xmin, ymin, xmax, ymax;
++ // get the clip region bbox
++ state->getClipBBox(&xmin, &ymin, &xmax, &ymax);
++ QRectF crect = QRectF(QPointF(xmin, ymin), QPointF(xmax, ymax));
++ crect = crect.normalized();
++ QString output = QString("M %1 %2").arg(0.0).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(0.0);
++ output += QString("L %1 %2").arg(crect.width()).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(crect.height());
++ output += QString("L %1 %2").arg(0.0).arg(0.0);
++ output += QString("Z");
++ pathIsClosed = true;
++ Coords = output;
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, CurrColorFill, CommonStrings::None);
++ ite = m_doc->Items->at(z);
++
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ double angle = m_ctm.map(QLineF(0, 0, 1, 0)).angle();
++ ite->setRotation(-angle);
++ if (checkClip())
++ {
++ QPainterPath outline = m_currentClipPath;
++ outline.translate(xCoor - ite->xPos(), yCoor - ite->yPos());
++ // Undo the rotation of the clipping path as it is rotated together with the item.
++ QTransform mm;
++ mm.rotate(angle);
++ outline = mm.map(outline);
++ ite->PoLine.fromQPainterPath(outline, true);
++ ite->setFillEvenOdd(outline.fillRule() == Qt::OddEvenFill);
++ }
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setFillShade(CurrFillShade);
++ ite->setLineShade(100);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ ite->GrType = 8;
++ ite->setPattern(id);
++ ite->setPatternTransform(fabs(pmat[0]) * 100, fabs(pmat[3]) * 100, mmx.dx() - ctm[4], mmx.dy() - ctm[5], 0, -1 * pmat[1], pmat[2]);
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ delete gfx;
++ return gTrue;
++}
++
++void SlaOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg)
++{
++// qDebug() << "Draw Image Mask";
++ QImage * image = nullptr;
++ int invert_bit;
++ int row_stride;
++ int x, y, i, bit;
++ unsigned char *dest = nullptr;
++ unsigned char *buffer;
++ Guchar *pix;
++ ImageStream * imgStr = new ImageStream(str, width, 1, 1);
++ imgStr->reset();
++#ifdef WORDS_BIGENDIAN
++ image = new QImage(width, height, QImage::Format_Mono);
++#else
++ image = new QImage(width, height, QImage::Format_MonoLSB);
++#endif
++ if (image == nullptr || image->isNull())
++ {
++ delete imgStr;
++ delete image;
++ return;
++ }
++ invert_bit = invert ? 1 : 0;
++ buffer = image->bits();
++ row_stride = image->bytesPerLine();
++ for (y = 0; y < height; y++)
++ {
++ pix = imgStr->getLine();
++ dest = buffer + y * row_stride;
++ i = 0;
++ bit = 0;
++ for (x = 0; x < width; x++)
++ {
++ if (bit == 0)
++ dest[i] = 0;
++ if (!(pix[x] ^ invert_bit))
++ {
++#ifdef WORDS_BIGENDIAN
++ dest[i] |= (1 << (7 - bit));
++#else
++ dest[i] |= (1 << bit);
++#endif
++ }
++ bit++;
++ if (bit > 7)
++ {
++ bit = 0;
++ i++;
++ }
++ }
++ }
++ QColor backColor = ScColorEngine::getShadeColorProof(m_doc->PageColors[CurrColorFill], m_doc, CurrFillShade);
++ QImage res = QImage(width, height, QImage::Format_ARGB32);
++ res.fill(backColor.rgb());
++ unsigned char cc, cm, cy, ck;
++ for (int yi = 0; yi < res.height(); ++yi)
++ {
++ QRgb *t = (QRgb*)(res.scanLine( yi ));
++ for (int xi = 0; xi < res.width(); ++xi)
++ {
++ cc = qRed(*t);
++ cm = qGreen(*t);
++ cy = qBlue(*t);
++ ck = image->pixel(xi, yi);
++ if (ck == 0)
++ (*t) = qRgba(cc, cm, cy, 0);
++ else
++ (*t) = qRgba(cc, cm, cy, 255);
++ t++;
++ }
++ }
++
++ createImageFrame(res, state, 3);
++
++ imgStr->close();
++ delete imgStr;
++ delete image;
++}
++
++void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, Stream *maskStr, int maskWidth, int maskHeight,
++ GfxImageColorMap *maskColorMap, GBool maskInterpolate)
++{
++// qDebug() << "SlaOutputDev::drawSoftMaskedImage Masked Image Components" << colorMap->getNumPixelComps();
++ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
++ imgStr->reset();
++ unsigned int *dest = nullptr;
++ unsigned char * buffer = new unsigned char[width * height * 4];
++ QImage * image = nullptr;
++ for (int y = 0; y < height; y++)
++ {
++ dest = (unsigned int *)(buffer + y * 4 * width);
++ Guchar * pix = imgStr->getLine();
++ colorMap->getRGBLine(pix, dest, width);
++ }
++ image = new QImage(buffer, width, height, QImage::Format_RGB32);
++ if (image == nullptr || image->isNull())
++ {
++ delete imgStr;
++ delete[] buffer;
++ delete image;
++ return;
++ }
++ ImageStream *mskStr = new ImageStream(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits());
++ mskStr->reset();
++ Guchar *mdest = nullptr;
++ unsigned char * mbuffer = new unsigned char[maskWidth * maskHeight];
++ memset(mbuffer, 0, maskWidth * maskHeight);
++ for (int y = 0; y < maskHeight; y++)
++ {
++ mdest = (Guchar *)(mbuffer + y * maskWidth);
++ Guchar * pix = mskStr->getLine();
++ maskColorMap->getGrayLine(pix, mdest, maskWidth);
++ }
++ if ((maskWidth != width) || (maskHeight != height))
++ *image = image->scaled(maskWidth, maskHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
++ QImage res = image->convertToFormat(QImage::Format_ARGB32);
++
++ int matteRc, matteGc, matteBc;
++ POPPLER_CONST_070 GfxColor *matteColor = maskColorMap->getMatteColor();
++ if (matteColor != nullptr)
++ {
++ GfxRGB matteRgb;
++ colorMap->getColorSpace()->getRGB(matteColor, &matteRgb);
++ matteRc = qRound(colToDbl(matteRgb.r) * 255);
++ matteGc = qRound(colToDbl(matteRgb.g) * 255);
++ matteBc = qRound(colToDbl(matteRgb.b) * 255);
++ }
++
++ unsigned char cr, cg, cb, ca;
++ int s = 0;
++ for (int yi=0; yi < res.height(); ++yi)
++ {
++ QRgb *t = (QRgb*)(res.scanLine( yi ));
++ for (int xi=0; xi < res.width(); ++xi)
++ {
++ cr = qRed(*t);
++ cg = qGreen(*t);
++ cb = qBlue(*t);
++ ca = mbuffer[s];
++ if (matteColor != nullptr)
++ {
++ cr = unblendMatte(cr, ca, matteRc);
++ cg = unblendMatte(cg, ca, matteGc);
++ cb = unblendMatte(cb, ca, matteBc);
++ }
++ (*t) = qRgba(cr, cg, cb, ca);
++ s++;
++ t++;
++ }
++ }
++
++ createImageFrame(res, state, 3);
++
++ delete imgStr;
++ delete[] buffer;
++ delete image;
++ delete mskStr;
++ delete[] mbuffer;
++}
++
++void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GBool maskInvert, GBool maskInterpolate)
++{
++// qDebug() << "SlaOutputDev::drawMaskedImage";
++ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
++ imgStr->reset();
++ unsigned int *dest = nullptr;
++ unsigned char * buffer = new unsigned char[width * height * 4];
++ QImage * image = nullptr;
++ for (int y = 0; y < height; y++)
++ {
++ dest = (unsigned int *)(buffer + y * 4 * width);
++ Guchar * pix = imgStr->getLine();
++ colorMap->getRGBLine(pix, dest, width);
++ }
++ image = new QImage(buffer, width, height, QImage::Format_RGB32);
++ if (image == nullptr || image->isNull())
++ {
++ delete imgStr;
++ delete[] buffer;
++ delete image;
++ return;
++ }
++ ImageStream *mskStr = new ImageStream(maskStr, maskWidth, 1, 1);
++ mskStr->reset();
++ Guchar *mdest = nullptr;
++ int invert_bit = maskInvert ? 1 : 0;
++ unsigned char * mbuffer = new unsigned char[maskWidth * maskHeight];
++ memset(mbuffer, 0, maskWidth * maskHeight);
++ for (int y = 0; y < maskHeight; y++)
++ {
++ mdest = (Guchar *)(mbuffer + y * maskWidth);
++ Guchar * pix = mskStr->getLine();
++ for (int x = 0; x < maskWidth; x++)
++ {
++ if (pix[x] ^ invert_bit)
++ *mdest++ = 0;
++ else
++ *mdest++ = 255;
++ }
++ }
++ if ((maskWidth != width) || (maskHeight != height))
++ *image = image->scaled(maskWidth, maskHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
++ QImage res = image->convertToFormat(QImage::Format_ARGB32);
++ unsigned char cc, cm, cy, ck;
++ int s = 0;
++ for (int yi=0; yi < res.height(); ++yi)
++ {
++ QRgb *t = (QRgb*)(res.scanLine( yi ));
++ for (int xi=0; xi < res.width(); ++xi)
++ {
++ cc = qRed(*t);
++ cm = qGreen(*t);
++ cy = qBlue(*t);
++ ck = mbuffer[s];
++ (*t) = qRgba(cc, cm, cy, ck);
++ s++;
++ t++;
++ }
++ }
++
++ createImageFrame(res, state, colorMap->getNumPixelComps());
++
++ delete imgStr;
++ delete[] buffer;
++ delete image;
++ delete mskStr;
++ delete[] mbuffer;
++}
++
++void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int* maskColors, GBool inlineImg)
++{
++ ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
++// qDebug() << "SlaOutputDev::drawImage Image Components" << colorMap->getNumPixelComps() << "Mask" << maskColors;
++ imgStr->reset();
++ QImage* image = nullptr;
++ if (maskColors)
++ {
++ image = new QImage(width, height, QImage::Format_ARGB32);
++ for (int y = 0; y < height; y++)
++ {
++ QRgb *s = (QRgb*)(image->scanLine(y));
++ Guchar *pix = imgStr->getLine();
++ for (int x = 0; x < width; x++)
++ {
++ GfxRGB rgb;
++ colorMap->getRGB(pix, &rgb);
++ int Rc = qRound(colToDbl(rgb.r) * 255);
++ int Gc = qRound(colToDbl(rgb.g) * 255);
++ int Bc = qRound(colToDbl(rgb.b) * 255);
++ *s = qRgba(Rc, Gc, Bc, 255);
++ for (int i = 0; i < colorMap->getNumPixelComps(); ++i)
++ {
++ if (pix[i] < maskColors[2*i] * 255 || pix[i] > maskColors[2*i+1] * 255)
++ {
++ *s = *s | 0xff000000;
++ break;
++ }
++ }
++ s++;
++ pix += colorMap->getNumPixelComps();
++ }
++ }
++ }
++ else
++ {
++ image = new QImage(width, height, QImage::Format_ARGB32);
++ for (int y = 0; y < height; y++)
++ {
++ QRgb *s = (QRgb*)(image->scanLine(y));
++ Guchar *pix = imgStr->getLine();
++ for (int x = 0; x < width; x++)
++ {
++ if (colorMap->getNumPixelComps() == 4)
++ {
++ GfxCMYK cmyk;
++ colorMap->getCMYK(pix, &cmyk);
++ int Cc = qRound(colToDbl(cmyk.c) * 255);
++ int Mc = qRound(colToDbl(cmyk.m) * 255);
++ int Yc = qRound(colToDbl(cmyk.y) * 255);
++ int Kc = qRound(colToDbl(cmyk.k) * 255);
++ *s = qRgba(Yc, Mc, Cc, Kc);
++ }
++ else
++ {
++ GfxRGB rgb;
++ colorMap->getRGB(pix, &rgb);
++ int Rc = qRound(colToDbl(rgb.r) * 255);
++ int Gc = qRound(colToDbl(rgb.g) * 255);
++ int Bc = qRound(colToDbl(rgb.b) * 255);
++ *s = qRgba(Rc, Gc, Bc, 255);
++ }
++ s++;
++ pix += colorMap->getNumPixelComps();
++ }
++ }
++ }
++
++ if (image != nullptr && !image->isNull()) {
++ createImageFrame(*image, state, colorMap->getNumPixelComps());
++ }
++
++ delete imgStr;
++ delete image;
++}
++
++void SlaOutputDev::createImageFrame(QImage& image, GfxState *state, int numColorComponents)
++{
++// qDebug() << "SlaOutputDev::createImageFrame";
++ const double *ctm = state->getCTM();
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ double angle = m_ctm.map(QLineF(0, 0, 1, 0)).angle();
++ QPointF torigin;
++ // In PDF all images considered squares with unit length that are transformed into the proper
++ // dimensions by ctm.
++ // A positive determinant retains orientation. Thus orientation is the same as in the PDF
++ // coordinate system (y-axis increases upwards). As Scribus uses the inverse orientation the
++ // image needs to be flipped (a horizontal flip is applied later). For a flipped image the
++ // corner that will be origin in Scribus is the upper right corner (1, 1) of the image.
++ // A negative determinant changes the orientation such that the image is already in the Scribus
++ // coordinate orientation and no flip is necessary. The origin will be the upper left corner (0, 1).
++ if (m_ctm.determinant() > 0) {
++ torigin = m_ctm.map(QPointF(1, 1));
++ } else {
++ torigin = m_ctm.map(QPointF(0, 1));
++ }
++
++ // Determine the visible area of the picture after clipping it. If it is empty, no item
++ // needs to be created.
++ QPainterPath outline;
++ outline.addRect(0, 0, 1, 1);
++ outline = m_ctm.map(outline);
++ outline = intersection(outline, m_currentClipPath);
++
++ if ((inPattern == 0) && (outline.isEmpty() || outline.boundingRect().isNull()))
++ return;
++
++ // Determine the width and height of the image by undoing the rotation part
++ // of the CTM and applying the result to the unit square.
++ QTransform without_rotation;
++ without_rotation = m_ctm * without_rotation.rotate(angle);
++ QRectF trect_wr = without_rotation.mapRect(QRectF(0, 0, 1, 1));
++
++ int z = m_doc->itemAdd(PageItem::ImageFrame, PageItem::Rectangle, xCoor + torigin.x(), yCoor + torigin.y(), trect_wr.width(), trect_wr.height(), 0, CommonStrings::None, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ m_doc->setRedrawBounding(ite);
++ ite->Clip = flattenPath(ite->PoLine, ite->Segments);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ ite->setFillShade(100);
++ ite->setLineShade(100);
++ ite->setFillEvenOdd(false);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ if (m_ctm.determinant() > 0)
++ {
++ ite->setRotation(-(angle - 180));
++ ite->setImageFlippedH(true);
++ }
++ else
++ ite->setRotation(-angle);
++ m_doc->adjustItemSize(ite);
++
++ if (numColorComponents == 4)
++ {
++ QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.tif");
++ tempFile->setAutoRemove(false);
++ if (tempFile->open())
++ {
++ QString fileName = getLongPathName(tempFile->fileName());
++ if (!fileName.isEmpty())
++ {
++ tempFile->close();
++ ite->isInlineImage = true;
++ ite->isTempFile = true;
++ ite->AspectRatio = false;
++ ite->ScaleType = false;
++ TIFF* tif = TIFFOpen(fileName.toLocal8Bit().data(), "w");
++ if (tif)
++ {
++ TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, image.width());
++ TIFFSetField(tif, TIFFTAG_IMAGELENGTH, image.height());
++ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8);
++ TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 4);
++ TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
++ TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_SEPARATED);
++ TIFFSetField(tif, TIFFTAG_COMPRESSION, COMPRESSION_LZW);
++ for (int y = 0; y < image.height(); ++y)
++ {
++ TIFFWriteScanline(tif, image.scanLine(y), y);
++ }
++ TIFFClose(tif);
++ m_doc->loadPict(fileName, ite);
++ }
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ }
++ else
++ m_doc->Items->removeAll(ite);
++ }
++ delete tempFile;
++ }
++ else
++ {
++ QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_pdf_XXXXXX.png");
++ tempFile->setAutoRemove(false);
++ if (tempFile->open())
++ {
++ QString fileName = getLongPathName(tempFile->fileName());
++ if (!fileName.isEmpty())
++ {
++ tempFile->close();
++ ite->isInlineImage = true;
++ ite->isTempFile = true;
++ ite->AspectRatio = false;
++ ite->ScaleType = false;
++ image.save(fileName, "PNG");
++ m_doc->loadPict(fileName, ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ }
++ else
++ m_doc->Items->removeAll(ite);
++ }
++ delete tempFile;
++ }
++ if (inPattern == 0)
++ {
++ outline.translate(xCoor - ite->xPos(), yCoor - ite->yPos());
++ // Undo the rotation of the clipping path as it is rotated together with the iamge.
++ QTransform mm;
++ mm.rotate(-ite->rotation());
++ outline = mm.map(outline);
++ ite->PoLine.fromQPainterPath(outline, true);
++ ite->setFillEvenOdd(outline.fillRule() == Qt::OddEvenFill);
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ ite->ScaleType = true;
++ m_doc->adjustItemSize(ite);
++ ite->OldB2 = ite->width();
++ ite->OldH2 = ite->height();
++ ite->updateClip();
++ }
++}
++
++void SlaOutputDev::beginMarkedContent(POPPLER_CONST char *name, Object *dictRef)
++{
++ mContent mSte;
++ mSte.name = QString(name);
++ mSte.ocgName = "";
++ if (importerFlags & LoadSavePlugin::lfCreateDoc)
++ {
++ if (dictRef->isNull())
++ return;
++ Object dictObj;
++ Dict *dict;
++ Object dictType;
++ OCGs *contentConfig = catalog->getOptContentConfig();
++ OptionalContentGroup *oc;
++ if (dictRef->isRef())
++ {
++ oc = contentConfig->findOcgByRef(dictRef->getRef());
++ if (oc)
++ {
++// qDebug() << "Begin OCG Content (Ref) with Name " << QString(name) << "Layer" << UnicodeParsedString(oc->getName());
++ m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));
++ mSte.ocgName = UnicodeParsedString(oc->getName());
++ }
++ }
++ else
++ {
++ dictObj = dictRef->fetch(xref);
++ if (!dictObj.isDict())
++ return;
++ dict = dictObj.getDict();
++ dictType = dict->lookup("Type");
++ if (dictType.isName("OCG"))
++ {
++ oc = contentConfig->findOcgByRef(dictRef->getRef());
++ if (oc)
++ {
++ // qDebug() << "Begin OCG Content with Name " << UnicodeParsedString(oc->getName());
++ m_doc->setActiveLayer(UnicodeParsedString(oc->getName()));
++ mSte.ocgName = UnicodeParsedString(oc->getName());
++ }
++ }
++ }
++ }
++ m_mcStack.push(mSte);
++}
++
++void SlaOutputDev::beginMarkedContent(POPPLER_CONST char *name, Dict *properties)
++{
++// qDebug() << "Begin Marked Content with Name " << QString(name);
++ QString nam = QString(name);
++ mContent mSte;
++ mSte.name = nam;
++ mSte.ocgName = "";
++ m_mcStack.push(mSte);
++ if (importerFlags & LoadSavePlugin::lfCreateDoc)
++ {
++ if (nam == "Layer") // Handle Adobe Illustrator Layer command
++ {
++ if (layersSetByOCG)
++ return;
++ QString lName = QString("Layer_%1").arg(layerNum + 1);
++ Object obj = properties->lookup((char*) "Title");
++ if (obj.isString())
++ lName = QString(obj.getString()->getCString());
++ for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
++ {
++ if (it->Name == lName)
++ {
++ m_doc->setActiveLayer(lName);
++ return;
++ }
++ }
++ layerNum++;
++ if (!firstLayer)
++ currentLayer = m_doc->addLayer(lName, true);
++ firstLayer = false;
++
++ obj = properties->lookup((char*) "Visible");
++ if (obj.isBool())
++ m_doc->setLayerVisible(currentLayer, obj.getBool());
++ obj = properties->lookup((char*) "Editable");
++ if (obj.isBool())
++ m_doc->setLayerLocked(currentLayer, !obj.getBool());
++ obj = properties->lookup((char*) "Printed");
++ if (obj.isBool())
++ m_doc->setLayerPrintable(currentLayer, obj.getBool());
++ obj = properties->lookup((char*)"Color");
++ if (obj.isArray())
++ {
++ Object obj1;
++ obj1 = obj.arrayGet(0);
++ int r = obj1.getNum() / 256;
++ obj1 = obj.arrayGet(1);
++ int g = obj1.getNum() / 256;
++ obj1 = obj.arrayGet(2);
++ int b = obj1.getNum() / 256;
++ m_doc->setLayerMarker(currentLayer, QColor(r, g, b));
++ }
++ }
++ }
++}
++
++void SlaOutputDev::endMarkedContent(GfxState *state)
++{
++// qDebug() << "End Marked Content";
++ if (m_mcStack.count() > 0)
++ {
++ mContent mSte = m_mcStack.pop();
++ if (importerFlags & LoadSavePlugin::lfCreateDoc)
++ {
++ if (mSte.name == "OC")
++ {
++ for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
++ {
++ if (it->Name == mSte.ocgName)
++ {
++ m_doc->setActiveLayer(mSte.ocgName);
++ return;
++ }
++ }
++ }
++ }
++ }
++}
++
++void SlaOutputDev::markPoint(POPPLER_CONST char *name)
++{
++// qDebug() << "Begin Marked Point with Name " << QString(name);
++}
++
++void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
++{
++// qDebug() << "Begin Marked Point with Name " << QString(name) << "and Properties";
++ beginMarkedContent(name, properties);
++}
++
++void SlaOutputDev::updateFont(GfxState *state)
++{
++ GfxFont *gfxFont;
++ GfxFontLoc *fontLoc;
++ GfxFontType fontType;
++ SlaOutFontFileID *id;
++ SplashFontFile *fontFile;
++ SplashFontSrc *fontsrc = nullptr;
++ FoFiTrueType *ff;
++ Object refObj, strObj;
++ GooString *fileName;
++ char *tmpBuf;
++ int tmpBufLen = 0;
++ int *codeToGID;
++ const double *textMat;
++ double m11, m12, m21, m22, fontSize;
++ SplashCoord mat[4];
++ int n = 0;
++ int faceIndex = 0;
++ SplashCoord matrix[6];
++
++ m_font = nullptr;
++ fileName = nullptr;
++ tmpBuf = nullptr;
++ fontLoc = nullptr;
++
++ if (!(gfxFont = state->getFont())) {
++ goto err1;
++ }
++ fontType = gfxFont->getType();
++ if (fontType == fontType3) {
++ goto err1;
++ }
++
++ // check the font file cache
++ id = new SlaOutFontFileID(gfxFont->getID());
++ if ((fontFile = m_fontEngine->getFontFile(id)))
++ delete id;
++ else
++ {
++ if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
++ {
++ error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++
++ // embedded font
++ if (fontLoc->locType == gfxFontLocEmbedded)
++ {
++ // if there is an embedded font, read it to memory
++ tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
++ if (! tmpBuf)
++ goto err2;
++
++ // external font
++ }
++ else
++ { // gfxFontLocExternal
++ fileName = fontLoc->path;
++ fontType = fontLoc->fontType;
++ }
++
++ fontsrc = new SplashFontSrc;
++ if (fileName)
++ fontsrc->setFile(fileName, gFalse);
++ else
++ fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
++
++ // load the font file
++ switch (fontType) {
++ case fontType1:
++ if (!(fontFile = m_fontEngine->loadType1Font(
++ id,
++ fontsrc,
++ (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontType1C:
++ if (!(fontFile = m_fontEngine->loadType1CFont(
++ id,
++ fontsrc,
++ (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontType1COT:
++ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
++ id,
++ fontsrc,
++ (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontTrueType:
++ case fontTrueTypeOT:
++ if (fileName)
++ ff = FoFiTrueType::load(fileName->getCString());
++ else
++ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++ if (ff)
++ {
++ codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
++ n = 256;
++ delete ff;
++ }
++ else
++ {
++ codeToGID = nullptr;
++ n = 0;
++ }
++ if (!(fontFile = m_fontEngine->loadTrueTypeFont(
++ id,
++ fontsrc,
++ codeToGID, n)))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontCIDType0:
++ case fontCIDType0C:
++ if (!(fontFile = m_fontEngine->loadCIDFont(
++ id,
++ fontsrc)))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontCIDType0COT:
++ if (((GfxCIDFont *) gfxFont)->getCIDToGID())
++ {
++ n = ((GfxCIDFont *) gfxFont)->getCIDToGIDLen();
++ codeToGID = (int *) gmallocn(n, sizeof(*codeToGID));
++ memcpy(codeToGID, ((GfxCIDFont *) gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
++ }
++ else
++ {
++ codeToGID = nullptr;
++ n = 0;
++ }
++ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
++ id,
++ fontsrc,
++ codeToGID, n)))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ case fontCIDType2:
++ case fontCIDType2OT:
++ codeToGID = nullptr;
++ n = 0;
++ if (((GfxCIDFont *) gfxFont)->getCIDToGID())
++ {
++ n = ((GfxCIDFont *) gfxFont)->getCIDToGIDLen();
++ if (n)
++ {
++ codeToGID = (int *)gmallocn(n, sizeof(*codeToGID));
++ memcpy(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(), n * sizeof(*codeToGID));
++ }
++ }
++ else
++ {
++ if (fileName)
++ ff = FoFiTrueType::load(fileName->getCString());
++ else
++ ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
++ if (! ff)
++ goto err2;
++ codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
++ delete ff;
++ }
++ if (!(fontFile = m_fontEngine->loadTrueTypeFont(
++ id,
++ fontsrc,
++ codeToGID, n, faceIndex)))
++ {
++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
++ gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
++ goto err2;
++ }
++ break;
++ default:
++ // this shouldn't happen
++ goto err2;
++ }
++ }
++ // get the font matrix
++ textMat = state->getTextMat();
++ fontSize = state->getFontSize();
++ m11 = textMat[0] * fontSize * state->getHorizScaling();
++ m12 = textMat[1] * fontSize * state->getHorizScaling();
++ m21 = textMat[2] * fontSize;
++ m22 = textMat[3] * fontSize;
++ matrix[0] = 1;
++ matrix[1] = 0;
++ matrix[2] = 0;
++ matrix[3] = 1;
++ matrix[4] = 0;
++ matrix[5] = 0;
++ // create the scaled font
++ mat[0] = m11;
++ mat[1] = -m12;
++ mat[2] = m21;
++ mat[3] = -m22;
++ m_font = m_fontEngine->getFont(fontFile, mat, matrix);
++
++ delete fontLoc;
++ if (fontsrc && !fontsrc->isFile)
++ fontsrc->unref();
++ return;
++
++err2:
++ delete id;
++ delete fontLoc;
++err1:
++ if (fontsrc && !fontsrc->isFile)
++ fontsrc->unref();
++}
++
++void SlaOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, POPPLER_CONST_082 Unicode *u, int uLen)
++{
++// qDebug() << "SlaOutputDev::drawChar code:" << code << "bytes:" << nBytes << "Unicode:" << u << "ulen:" << uLen << "render:" << state->getRender();
++ double x1, y1, x2, y2;
++ updateFont(state);
++ if (!m_font)
++ return;
++
++ // PDF 1.7 Section 9.3.6 defines eight text rendering modes.
++ // 0 - Fill
++ // 1 - Stroke
++ // 2 - First fill and then stroke
++ // 3 - Invisible
++ // 4 - Fill and use as a clipping path
++ // 5 - Stroke and use as a clipping path
++ // 6 - First fill, then stroke and add as a clipping path
++ // 7 - Only use as a clipping path.
++ // TODO Implement the clipping operations. At least the characters are shown.
++ int textRenderingMode = state->getRender();
++ // Invisible or only used for clipping
++ if (textRenderingMode == 3)
++ return;
++ if (textRenderingMode < 8)
++ {
++ SplashPath * fontPath;
++ fontPath = m_font->getGlyphPath(code);
++ if (fontPath)
++ {
++ QPainterPath qPath;
++ qPath.setFillRule(Qt::WindingFill);
++ for (int i = 0; i < fontPath->getLength(); ++i)
++ {
++ Guchar f;
++ fontPath->getPoint(i, &x1, &y1, &f);
++ if (f & splashPathFirst)
++ qPath.moveTo(x1,y1);
++ else if (f & splashPathCurve)
++ {
++ double x3, y3;
++ ++i;
++ fontPath->getPoint(i, &x2, &y2, &f);
++ ++i;
++ fontPath->getPoint(i, &x3, &y3, &f);
++ qPath.cubicTo(x1,y1,x2,y2,x3,y3);
++ }
++ else
++ qPath.lineTo(x1,y1);
++ if (f & splashPathLast)
++ qPath.closeSubpath();
++ }
++ const double *ctm = state->getCTM();
++ m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
++ double xCoor = m_doc->currentPage()->xOffset();
++ double yCoor = m_doc->currentPage()->yOffset();
++ FPointArray textPath;
++ textPath.fromQPainterPath(qPath);
++ FPoint wh = textPath.widthHeight();
++ if (textRenderingMode > 3)
++ {
++ QTransform mm;
++ mm.scale(1, -1);
++ mm.translate(x, -y);
++ // Remember the glyph for later clipping
++ m_clipTextPath.addPath(m_ctm.map(mm.map(qPath)));
++ }
++ if ((textPath.size() > 3) && ((wh.x() != 0.0) || (wh.y() != 0.0)) && (textRenderingMode != 7))
++ {
++ int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, CommonStrings::None, CommonStrings::None);
++ PageItem* ite = m_doc->Items->at(z);
++ QTransform mm;
++ mm.scale(1, -1);
++ mm.translate(x, -y);
++ textPath.map(mm);
++ textPath.map(m_ctm);
++ ite->PoLine = textPath.copy();
++ ite->ClipEdited = true;
++ ite->FrameType = 3;
++ ite->setLineEnd(PLineEnd);
++ ite->setLineJoin(PLineJoin);
++ ite->setTextFlowMode(PageItem::TextFlowDisabled);
++ // Fill text rendering modes. See above
++ if (textRenderingMode == 0 || textRenderingMode == 2 || textRenderingMode == 4 || textRenderingMode == 6)
++ {
++ CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
++ ite->setFillColor(CurrColorFill);
++ ite->setFillShade(CurrFillShade);
++ ite->setFillEvenOdd(false);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ }
++ // Stroke text rendering modes. See above
++ if (textRenderingMode == 1 || textRenderingMode == 2 || textRenderingMode == 5 || textRenderingMode == 6)
++ {
++ CurrColorStroke = getColor(state->getStrokeColorSpace(), state->getStrokeColor(), &CurrStrokeShade);
++ ite->setLineColor(CurrColorStroke);
++ ite->setLineWidth(state->getTransformedLineWidth());
++ ite->setLineTransparency(1.0 - state->getStrokeOpacity());
++ ite->setLineBlendmode(getBlendMode(state));
++ ite->setLineShade(CurrStrokeShade);
++ }
++ m_doc->adjustItemSize(ite);
++ m_Elements->append(ite);
++ if (m_groupStack.count() != 0)
++ {
++ m_groupStack.top().Items.append(ite);
++ applyMask(ite);
++ }
++ delete fontPath;
++ }
++ }
++ }
++}
++
++GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
++{
++// qDebug() << "beginType3Char";
++ GfxFont *gfxFont;
++ if (!(gfxFont = state->getFont()))
++ return gTrue;
++ if (gfxFont->getType() != fontType3)
++ return gTrue;
++ F3Entry f3e;
++ f3e.colored = false;
++ m_F3Stack.push(f3e);
++ pushGroup();
++ return gFalse;
++}
++
++void SlaOutputDev::endType3Char(GfxState *state)
++{
++// qDebug() << "endType3Char";
++ F3Entry f3e = m_F3Stack.pop();
++ groupEntry gElements = m_groupStack.pop();
++ m_doc->m_Selection->clear();
++ if (gElements.Items.count() > 0)
++ {
++ m_doc->m_Selection->delaySignalsOn();
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ m_doc->m_Selection->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ PageItem *ite;
++ if (m_doc->m_Selection->count() > 1)
++ ite = m_doc->groupObjectsSelection();
++ else
++ ite = m_doc->m_Selection->itemAt(0);
++ if (!f3e.colored)
++ {
++ m_doc->itemSelection_SetItemBrush(CurrColorFill);
++ m_doc->itemSelection_SetItemBrushShade(CurrFillShade);
++ m_doc->itemSelection_SetItemFillTransparency(1.0 - state->getFillOpacity());
++ m_doc->itemSelection_SetItemFillBlend(getBlendMode(state));
++ }
++ m_Elements->append(ite);
++ m_doc->m_Selection->clear();
++ m_doc->m_Selection->delaySignalsOff();
++ }
++}
++
++void SlaOutputDev::type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/)
++{
++// qDebug() << "type3D0";
++ if (m_F3Stack.count() > 0)
++ m_F3Stack.top().colored = true;
++}
++
++void SlaOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury)
++{
++// qDebug() << "type3D1";
++ if (m_F3Stack.count() > 0)
++ m_F3Stack.top().colored = false;
++}
++
++void SlaOutputDev::beginTextObject(GfxState *state)
++{
++ pushGroup();
++}
++
++void SlaOutputDev::endTextObject(GfxState *state)
++{
++// qDebug() << "SlaOutputDev::endTextObject";
++ if (!m_clipTextPath.isEmpty())
++ {
++ m_currentClipPath = intersection(m_currentClipPath, m_clipTextPath);
++ m_clipTextPath = QPainterPath();
++ }
++ if (m_groupStack.count() != 0)
++ {
++ groupEntry gElements = m_groupStack.pop();
++ tmpSel->clear();
++ if (gElements.Items.count() > 0)
++ {
++ for (int dre = 0; dre < gElements.Items.count(); ++dre)
++ {
++ tmpSel->addItem(gElements.Items.at(dre), true);
++ m_Elements->removeAll(gElements.Items.at(dre));
++ }
++ PageItem *ite;
++ if (gElements.Items.count() != 1)
++ ite = m_doc->groupObjectsSelection(tmpSel);
++ else
++ ite = gElements.Items.first();
++ ite->setGroupClipping(false);
++ ite->setFillTransparency(1.0 - state->getFillOpacity());
++ ite->setFillBlendmode(getBlendMode(state));
++ for (int as = 0; as < tmpSel->count(); ++as)
++ {
++ m_Elements->append(tmpSel->itemAt(as));
++ }
++ if (m_groupStack.count() != 0)
++ applyMask(ite);
++ }
++ if (m_groupStack.count() != 0)
++ {
++ for (int as = 0; as < tmpSel->count(); ++as)
++ {
++ m_groupStack.top().Items.append(tmpSel->itemAt(as));
++ }
++ }
++ tmpSel->clear();
++ }
++}
++
++QString SlaOutputDev::getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade)
++{
++ QString fNam;
++ QString namPrefix = "FromPDF";
++ ScColor tmp;
++ tmp.setSpotColor(false);
++ tmp.setRegistrationColor(false);
++ *shade = 100;
++ /*if (m_F3Stack.count() > 0)
++ {
++ if (!m_F3Stack.top().colored)
++ return "Black";
++ }*/
++
++ if ((color_space->getMode() == csDeviceRGB) || (color_space->getMode() == csCalRGB))
++ {
++ GfxRGB rgb;
++ color_space->getRGB(color, &rgb);
++ double Rc = colToDbl(rgb.r);
++ double Gc = colToDbl(rgb.g);
++ double Bc = colToDbl(rgb.b);
++ tmp.setRgbColorF(Rc, Gc, Bc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color_space->getMode() == csDeviceCMYK)
++ {
++ GfxCMYK cmyk;
++ color_space->getCMYK(color, &cmyk);
++ double Cc = colToDbl(cmyk.c);
++ double Mc = colToDbl(cmyk.m);
++ double Yc = colToDbl(cmyk.y);
++ double Kc = colToDbl(cmyk.k);
++ tmp.setCmykColorF(Cc, Mc, Yc, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if ((color_space->getMode() == csCalGray) || (color_space->getMode() == csDeviceGray))
++ {
++ GfxGray gray;
++ color_space->getGray(color, &gray);
++ double Kc = 1.0 - colToDbl(gray);
++ tmp.setCmykColorF(0, 0, 0, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color_space->getMode() == csSeparation)
++ {
++ GfxSeparationColorSpace* sepColorSpace = (GfxSeparationColorSpace*) color_space;
++ GfxColorSpace* altColorSpace = sepColorSpace->getAlt();
++ QString name = QString(sepColorSpace->getName()->getCString());
++ bool isRegistrationColor = (name == "All");
++ if (isRegistrationColor)
++ {
++ tmp.setCmykColorF(1.0, 1.0, 1.0, 1.0);
++ tmp.setRegistrationColor(true);
++ name = "Registration";
++ }
++ else if ((altColorSpace->getMode() == csDeviceRGB) || (altColorSpace->getMode() == csCalRGB))
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setRgbColorF(comps[0], comps[1], comps[2]);
++ }
++ else if ((altColorSpace->getMode() == csCalGray) || (altColorSpace->getMode() == csDeviceGray))
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setCmykColorF(0.0, 0.0, 0.0, 1.0 - comps[0]);
++ }
++ else if (altColorSpace->getMode() == csLab)
++ {
++ double x = 1.0;
++ double comps[gfxColorMaxComps];
++ sepColorSpace->getFunc()->transform(&x, comps);
++ tmp.setLabColor(comps[0], comps[1], comps[2]);
++ }
++ else
++ {
++ GfxCMYK cmyk;
++ color_space->getCMYK(color, &cmyk);
++ double Cc = colToDbl(cmyk.c);
++ double Mc = colToDbl(cmyk.m);
++ double Yc = colToDbl(cmyk.y);
++ double Kc = colToDbl(cmyk.k);
++ tmp.setCmykColorF(Cc, Mc, Yc, Kc);
++ }
++ tmp.setSpotColor(true);
++
++ fNam = m_doc->PageColors.tryAddColor(name, tmp);
++ *shade = qRound(colToDbl(color->c[0]) * 100);
++ }
++ else
++ {
++ GfxRGB rgb;
++ color_space->getRGB(color, &rgb);
++ double Rc = colToDbl(rgb.r);
++ double Gc = colToDbl(rgb.g);
++ double Bc = colToDbl(rgb.b);
++ tmp.setRgbColorF(Rc, Gc, Bc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++// qDebug() << "update fill color other colorspace" << color_space->getMode() << "treating as rgb" << Rc << Gc << Bc;
++ }
++ if (fNam == namPrefix+tmp.name())
++ m_importedColors->append(fNam);
++ return fNam;
++}
++
++QString SlaOutputDev::getAnnotationColor(const AnnotColor *color)
++{
++ QString fNam;
++ QString namPrefix = "FromPDF";
++ ScColor tmp;
++ tmp.setSpotColor(false);
++ tmp.setRegistrationColor(false);
++ if (color->getSpace() == AnnotColor::colorTransparent)
++ return CommonStrings::None;
++ if (color->getSpace() == AnnotColor::colorRGB)
++ {
++ const double *color_data = color->getValues();
++ double Rc = color_data[0];
++ double Gc = color_data[1];
++ double Bc = color_data[2];
++ tmp.setRgbColorF(Rc, Gc, Bc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color->getSpace() == AnnotColor::colorCMYK)
++ {
++ const double *color_data = color->getValues();
++ double Cc = color_data[0];
++ double Mc = color_data[1];
++ double Yc = color_data[2];
++ double Kc = color_data[3];
++ tmp.setCmykColorF(Cc, Mc, Yc, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ else if (color->getSpace() == AnnotColor::colorGray)
++ {
++ const double *color_data = color->getValues();
++ double Kc = 1.0 - color_data[0];
++ tmp.setCmykColorF(0, 0, 0, Kc);
++ fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
++ }
++ if (fNam == namPrefix+tmp.name())
++ m_importedColors->append(fNam);
++ return fNam;
++}
++
++QString SlaOutputDev::convertPath(POPPLER_CONST_083 GfxPath *path)
++{
++// qDebug() << "SlaOutputDev::convertPath";
++ if (! path)
++ return QString();
++
++ QString output;
++ pathIsClosed = false;
++
++ for (int i = 0; i < path->getNumSubpaths(); ++i)
++ {
++ POPPLER_CONST_083 GfxSubpath * subpath = path->getSubpath(i);
++ if (subpath->getNumPoints() > 0)
++ {
++ output += QString("M %1 %2").arg(subpath->getX(0)).arg(subpath->getY(0));
++ int j = 1;
++ while (j < subpath->getNumPoints())
++ {
++ if (subpath->getCurve(j))
++ {
++ output += QString("C %1 %2 %3 %4 %5 %6")
++ .arg(subpath->getX(j)).arg(subpath->getY(j))
++ .arg(subpath->getX(j + 1)).arg(subpath->getY(j + 1))
++ .arg(subpath->getX(j + 2)).arg(subpath->getY(j + 2));
++ j += 3;
++ }
++ else
++ {
++ output += QString("L %1 %2").arg(subpath->getX(j)).arg(subpath->getY(j));
++ ++j;
++ }
++ }
++ if (subpath->isClosed())
++ {
++ output += QString("Z");
++ pathIsClosed = true;
++ }
++ }
++ }
++ return output;
++}
++
++void SlaOutputDev::getPenState(GfxState *state)
++{
++ switch (state->getLineCap())
++ {
++ case 0:
++ PLineEnd = Qt::FlatCap;
++ break;
++ case 1:
++ PLineEnd = Qt::RoundCap;
++ break;
++ case 2:
++ PLineEnd = Qt::SquareCap;
++ break;
++ }
++ switch (state->getLineJoin())
++ {
++ case 0:
++ PLineJoin = Qt::MiterJoin;
++ break;
++ case 1:
++ PLineJoin = Qt::RoundJoin;
++ break;
++ case 2:
++ PLineJoin = Qt::BevelJoin;
++ break;
++ }
++ double lw = state->getLineWidth();
++ double *dashPattern;
++ int dashLength;
++ state->getLineDash(&dashPattern, &dashLength, &DashOffset);
++ QVector<double> pattern(dashLength);
++ for (int i = 0; i < dashLength; ++i)
++ {
++ pattern[i] = dashPattern[i] / lw;
++ }
++ DashValues = pattern;
++}
++
++int SlaOutputDev::getBlendMode(GfxState *state)
++{
++ int mode = 0;
++ switch (state->getBlendMode())
++ {
++ default:
++ case gfxBlendNormal:
++ mode = 0;
++ break;
++ case gfxBlendDarken:
++ mode = 1;
++ break;
++ case gfxBlendLighten:
++ mode = 2;
++ break;
++ case gfxBlendMultiply:
++ mode = 3;
++ break;
++ case gfxBlendScreen:
++ mode = 4;
++ break;
++ case gfxBlendOverlay:
++ mode = 5;
++ break;
++ case gfxBlendHardLight:
++ mode = 6;
++ break;
++ case gfxBlendSoftLight:
++ mode = 7;
++ break;
++ case gfxBlendDifference:
++ mode = 8;
++ break;
++ case gfxBlendExclusion:
++ mode = 9;
++ break;
++ case gfxBlendColorDodge:
++ mode = 10;
++ break;
++ case gfxBlendColorBurn:
++ mode = 11;
++ break;
++ case gfxBlendHue:
++ mode = 12;
++ break;
++ case gfxBlendSaturation:
++ mode = 13;
++ break;
++ case gfxBlendColor:
++ mode = 14;
++ break;
++ case gfxBlendLuminosity:
++ mode = 15;
++ break;
++ }
++ return mode;
++}
++
++void SlaOutputDev::applyMask(PageItem *ite)
++{
++ if (m_groupStack.count() != 0)
++ {
++ if (!m_groupStack.top().maskName.isEmpty())
++ {
++ ite->setPatternMask(m_groupStack.top().maskName);
++ QPointF maskPos = m_groupStack.top().maskPos;
++ double sx, sy, px, py, r, shx, shy;
++ ite->maskTransform(sx, sy, px, py, r, shx, shy);
++ ite->setMaskTransform(sx, sy, maskPos.x() - ite->xPos(), maskPos.y() - ite->yPos(), r, shx, shy);
++ if (m_groupStack.top().alpha)
++ {
++ if (m_groupStack.top().inverted)
++ ite->setMaskType(8);
++ else
++ ite->setMaskType(3);
++ }
++ else
++ {
++ if (m_groupStack.top().inverted)
++ ite->setMaskType(7);
++ else
++ ite->setMaskType(6);
++ }
++ }
++ }
++ // Code for updating our Progressbar, needs to be called this way, as we have no
++ // possibility to get the current fileposition.
++ updateGUICounter++;
++ if (updateGUICounter > 20)
++ {
++ qApp->processEvents();
++ updateGUICounter = 0;
++ }
++}
++
++void SlaOutputDev::pushGroup(const QString& maskName, GBool forSoftMask, GBool alpha, bool inverted)
++{
++ groupEntry gElements;
++ gElements.forSoftMask = forSoftMask;
++ gElements.alpha = alpha;
++ gElements.inverted = inverted;
++ gElements.maskName = maskName;
++ m_groupStack.push(gElements);
++}
++
++QString SlaOutputDev::UnicodeParsedString(POPPLER_CONST GooString *s1)
++{
++ if ( !s1 || s1->getLength() == 0 )
++ return QString();
++ GBool isUnicode;
++ int i;
++ Unicode u;
++ QString result;
++ if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getLength() > 1 && (s1->getChar(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1->getLength() - 2) / 2);
++ }
++ else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1->getLength());
++ }
++ while (i < s1->getLength())
++ {
++ if (isUnicode)
++ {
++ u = ((s1->getChar(i) & 0xff) << 8) | (s1->getChar(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1->getChar(i) & 0xff;
++ ++i;
++ }
++ result += QChar( u );
++ }
++ return result;
++}
++
++QString SlaOutputDev::UnicodeParsedString(const std::string& s1)
++{
++ if (s1.length() == 0)
++ return QString();
++ GBool isUnicode;
++ size_t i;
++ Unicode u;
++ QString result;
++ if ((s1.at(0) & 0xff) == 0xfe && (s1.length() > 1 && (s1.at(1) & 0xff) == 0xff))
++ {
++ isUnicode = gTrue;
++ i = 2;
++ result.reserve((s1.length() - 2) / 2);
++ }
++ else
++ {
++ isUnicode = gFalse;
++ i = 0;
++ result.reserve(s1.length());
++ }
++ while (i < s1.length())
++ {
++ if (isUnicode)
++ {
++ u = ((s1.at(i) & 0xff) << 8) | (s1.at(i+1) & 0xff);
++ i += 2;
++ }
++ else
++ {
++ u = s1.at(i) & 0xff;
++ ++i;
++ }
++ // #15616: imagemagick may write unicode strings incorrectly in PDF
++ if (u == 0)
++ continue;
++ result += QChar(u);
++ }
++ return result;
++}
++
++bool SlaOutputDev::checkClip()
++{
++ bool ret = false;
++ if (!m_currentClipPath.isEmpty())
++ {
++ QRectF bbox = m_currentClipPath.boundingRect();
++ if ((bbox.width() > 0) && (bbox.height() > 0))
++ ret = true;
++ }
++ return ret;
++}
+diff -Naur scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.h scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.h
+--- scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.h 2020-11-14 23:37:11.000000000 +0100
++++ scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.h 2021-04-04 11:46:37.053404000 +0200
+@@ -196,7 +196,11 @@
+ void stroke(GfxState *state) override;
+ void fill(GfxState *state) override;
+ void eoFill(GfxState *state) override;
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 3, 0)
++ bool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, GfxTilingPattern *tPat, const double *mat, int x0, int y0, int x1, int y1, double xStep, double yStep) override;
++#else
+ GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str, POPPLER_CONST_070 double *pmat, int paintType, int tilingType, Dict *resDict, POPPLER_CONST_070 double *mat, POPPLER_CONST_070 double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) override;
++#endif
+ GBool functionShadedFill(GfxState * /*state*/, GfxFunctionShading * /*shading*/) override { qDebug() << "Function Shaded Fill"; return gFalse; }
+ GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
+ GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) override { return (shading->getExtend0() == shading->getExtend1()); }
+@@ -368,7 +372,11 @@
+ Catalog *catalog {nullptr};
+ SplashFontEngine *m_fontEngine {nullptr};
+ SplashFont *m_font {nullptr};
+- FormPageWidgets *m_formWidgets {nullptr};
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(21, 4, 0)
++ std::unique_ptr<FormPageWidgets> m_formWidgets {nullptr};
++#else
++ FormPageWidgets *m_formWidgets {nullptr};
++#endif
+ QHash<QString, QList<int> > m_radioMap;
+ QHash<int, PageItem*> m_radioButtons;
+ int m_actPage;
+diff -Naur scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.h.orig scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.h.orig
+--- scribus-1.5.6.1.orig/scribus/plugins/import/pdf/slaoutput.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ scribus-1.5.6.1/scribus/plugins/import/pdf/slaoutput.h.orig 2020-11-14 23:37:11.000000000 +0100
+@@ -0,0 +1,377 @@
++/*
++For general Scribus (>=1.3.2) copyright and licensing information please refer
++to the COPYING file provided with the program. Following this notice may exist
++a copyright and/or license notice that predates the release of Scribus 1.3.2
++for which a new license (GPL+exception) is in place.
++*/
++#ifndef SLAOUTPUT_H
++#define SLAOUTPUT_H
++
++#include <QBuffer>
++#include <QColor>
++#include <QBrush>
++#include <QDebug>
++#include <QImage>
++#include <QPen>
++#include <QList>
++#include <QSizeF>
++#include <QStack>
++#include <QString>
++#include <QTextStream>
++#include <QTransform>
++
++#include <memory>
++
++#include "fpointarray.h"
++#include "importpdfconfig.h"
++#include "pageitem.h"
++#include "scribusdoc.h"
++#include "scribusview.h"
++#include "selection.h"
++#include "vgradient.h"
++
++#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
++#include <poppler/goo/gtypes.h>
++#endif
++#include <poppler/Object.h>
++#include <poppler/OutputDev.h>
++#include <poppler/Gfx.h>
++#include <poppler/GfxState.h>
++#include <poppler/Stream.h>
++#include <poppler/GfxFont.h>
++#include <poppler/Link.h>
++#include <poppler/PDFDoc.h>
++#include <poppler/Error.h>
++#include <poppler/Form.h>
++#include <poppler/Page.h>
++#include <poppler/Catalog.h>
++#include <poppler/CharCodeToUnicode.h>
++#include <poppler/FontEncodingTables.h>
++#include <poppler/splash/SplashFontFileID.h>
++#include <poppler/splash/SplashFontFile.h>
++#include <poppler/splash/SplashFontEngine.h>
++#include <poppler/splash/SplashFont.h>
++#include <poppler/splash/SplashMath.h>
++#include <poppler/splash/SplashPath.h>
++#include <poppler/splash/SplashGlyphBitmap.h>
++
++//------------------------------------------------------------------------
++// LinkSubmitData
++//------------------------------------------------------------------------
++
++class LinkSubmitForm: public LinkAction
++{
++public:
++ // Build a LinkImportData from an action dictionary.
++ LinkSubmitForm(Object *actionObj);
++ // Destructor.
++ virtual ~LinkSubmitForm();
++
++ // Was the LinkImportData created successfully?
++ GBool isOk() POPPLER_CONST override { return fileName != nullptr; }
++ // Accessors.
++ LinkActionKind getKind() POPPLER_CONST override { return actionUnknown; }
++ GooString *getFileName() { return fileName; }
++ int getFlags() { return m_flags; }
++
++private:
++ GooString *fileName {nullptr}; // file name
++ int m_flags {0};
++};
++
++//------------------------------------------------------------------------
++// LinkImportData
++//------------------------------------------------------------------------
++
++class LinkImportData: public LinkAction
++{
++public:
++ // Build a LinkImportData from an action dictionary.
++ LinkImportData(Object *actionObj);
++ // Destructor.
++ virtual ~LinkImportData();
++
++ // Was the LinkImportData created successfully?
++ GBool isOk() POPPLER_CONST override { return fileName != nullptr; }
++ // Accessors.
++ LinkActionKind getKind() POPPLER_CONST override { return actionUnknown; }
++ GooString *getFileName() { return fileName; }
++
++private:
++ GooString *fileName {nullptr}; // file name
++};
++
++//------------------------------------------------------------------------
++// SlaOutFontFileID
++//------------------------------------------------------------------------
++
++class SlaOutFontFileID: public SplashFontFileID
++{
++public:
++ SlaOutFontFileID(const Ref *rA) { r = *rA; }
++ ~SlaOutFontFileID() {}
++
++ GBool matches(SplashFontFileID *id) override
++ {
++ return ((SlaOutFontFileID*) id)->r.num == r.num && ((SlaOutFontFileID *) id)->r.gen == r.gen;
++ }
++
++private:
++ Ref r;
++};
++
++
++class AnoOutputDev : public OutputDev
++{
++public:
++ AnoOutputDev(ScribusDoc* doc, QStringList *importedColors);
++ virtual ~AnoOutputDev();
++
++ GBool isOk() { return gTrue; }
++ GBool upsideDown() override { return gTrue; }
++ GBool useDrawChar() override { return gFalse; }
++ GBool interpretType3Chars() override { return gFalse; }
++ GBool useTilingPatternFill() override { return gFalse; }
++ GBool useShadedFills(int type) override { return gFalse; }
++ GBool useFillColorStop() override { return gFalse; }
++ GBool useDrawForm() override { return gFalse; }
++
++ void stroke(GfxState *state) override;
++ void eoFill(GfxState *state) override;
++ void fill(GfxState *state) override;
++ void drawString(GfxState *state, POPPLER_CONST GooString *s) override;
++
++ QString CurrColorText;
++ QString CurrColorFill;
++ QString CurrColorStroke;
++ double m_fontSize {12};
++ GooString *m_fontName {nullptr};
++ GooString *m_itemText {nullptr};
++
++private:
++ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
++ ScribusDoc* m_doc;
++ QStringList *m_importedColors;
++};
++
++
++class SlaOutputDev : public OutputDev
++{
++public:
++ SlaOutputDev(ScribusDoc* doc, QList<PageItem*> *Elements, QStringList *importedColors, int flags);
++ virtual ~SlaOutputDev();
++
++ LinkAction* SC_getAction(AnnotWidget *ano);
++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
++ std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#else
++ LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
++#endif
++ static GBool annotations_callback(Annot *annota, void *user_data);
++ bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
++ bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
++ bool handleWidgetAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
++ void applyTextStyle(PageItem* ite, const QString& fontName, const QString& textColor, double fontSize);
++ void handleActions(PageItem* ite, AnnotWidget *ano);
++ void startDoc(PDFDoc *doc, XRef *xrefA, Catalog *catA);
++
++ GBool isOk() { return gTrue; }
++ GBool upsideDown() override { return gTrue; }
++ GBool useDrawChar() override { return gTrue; }
++ GBool interpretType3Chars() override { return gTrue; }
++ GBool useTilingPatternFill() override { return gTrue; }
++ GBool useShadedFills(int type) override { return type <= 7; }
++ GBool useFillColorStop() override { return gTrue; }
++ GBool useDrawForm() override { return gFalse; }
++
++// virtual GBool needClipToCropBox() { return gTrue; }
++ void startPage(int pageNum, GfxState *, XRef *) override;
++ void endPage() override;
++
++ // graphics state
++ void saveState(GfxState *state) override;
++ void restoreState(GfxState *state) override;
++
++ //----- path painting
++ void stroke(GfxState *state) override;
++ void fill(GfxState *state) override;
++ void eoFill(GfxState *state) override;
++ GBool tilingPatternFill(GfxState *state, Gfx *gfx, Catalog *cat, Object *str, POPPLER_CONST_070 double *pmat, int paintType, int tilingType, Dict *resDict, POPPLER_CONST_070 double *mat, POPPLER_CONST_070 double *bbox, int x0, int y0, int x1, int y1, double xStep, double yStep) override;
++ GBool functionShadedFill(GfxState * /*state*/, GfxFunctionShading * /*shading*/) override { qDebug() << "Function Shaded Fill"; return gFalse; }
++ GBool axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax) override;
++ GBool axialShadedSupportExtend(GfxState *state, GfxAxialShading *shading) override { return (shading->getExtend0() == shading->getExtend1()); }
++ GBool radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax) override;
++ GBool radialShadedSupportExtend(GfxState *state, GfxRadialShading *shading) override { return (shading->getExtend0() == shading->getExtend1()); }
++ GBool gouraudTriangleShadedFill(GfxState *state, GfxGouraudTriangleShading *shading) override;
++ GBool patchMeshShadedFill(GfxState *state, GfxPatchMeshShading *shading) override;
++
++ //----- path clipping
++ void clip(GfxState *state) override;
++ void eoClip(GfxState *state) override;
++ void clipToStrokePath(GfxState * /*state*/) override { qDebug() << "Clip to StrokePath"; }
++ virtual GBool deviceHasTextClip(GfxState *state) { return gFalse; }
++
++ // If current colorspace is pattern,
++ // does this device support text in pattern colorspace?
++ virtual GBool supportTextCSPattern(GfxState *state)
++ {
++ return state->getFillColorSpace()->getMode() == csPattern;
++ }
++
++ // If current colorspace is pattern,
++ // need this device special handling for masks in pattern colorspace?
++ virtual GBool fillMaskCSPattern(GfxState * state)
++ {
++ return state->getFillColorSpace()->getMode() == csPattern;
++ }
++
++ virtual void endMaskClip(GfxState *state) { qDebug() << "End Mask Clip"; }
++
++ //----- grouping operators
++ void beginMarkedContent(POPPLER_CONST char *name, Dict *properties) override;
++ virtual void beginMarkedContent(POPPLER_CONST char *name, Object *dictRef);
++ void endMarkedContent(GfxState *state) override;
++ void markPoint(POPPLER_CONST char *name) override;
++ void markPoint(POPPLER_CONST char *name, Dict *properties) override;
++
++ //----- image drawing
++ void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg) override;
++ void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, POPPLER_CONST_082 int *maskColors, GBool inlineImg) override;
++ void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
++ int width, int height,
++ GfxImageColorMap *colorMap,
++ GBool interpolate,
++ Stream *maskStr,
++ int maskWidth, int maskHeight,
++ GfxImageColorMap *maskColorMap,
++ GBool maskInterpolate) override;
++
++ void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
++ int width, int height,
++ GfxImageColorMap *colorMap,
++ GBool interpolate,
++ Stream *maskStr,
++ int maskWidth, int maskHeight,
++ GBool maskInvert, GBool maskInterpolate) override; // { qDebug() << "Draw Masked Image"; }
++
++ //----- transparency groups and soft masks
++ void beginTransparencyGroup(GfxState *state, POPPLER_CONST_070 double *bbox, GfxColorSpace * /*blendingColorSpace*/, GBool /*isolated*/, GBool /*knockout*/, GBool /*forSoftMask*/) override;
++ void paintTransparencyGroup(GfxState *state, POPPLER_CONST_070 double *bbox) override;
++ void endTransparencyGroup(GfxState *state) override;
++ void setSoftMask(GfxState * /*state*/, POPPLER_CONST_070 double * /*bbox*/, GBool /*alpha*/, Function * /*transferFunc*/, GfxColor * /*backdropColor*/) override;
++ void clearSoftMask(GfxState * /*state*/) override;
++
++ void updateFillColor(GfxState *state) override;
++ void updateStrokeColor(GfxState *state) override;
++ void updateFont(GfxState *state) override;
++
++ //----- text drawing
++ void beginTextObject(GfxState *state) override;
++ void endTextObject(GfxState *state) override;
++ void drawChar(GfxState *state, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, double /*originX*/, double /*originY*/, CharCode /*code*/, int /*nBytes*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
++ GBool beginType3Char(GfxState * /*state*/, double /*x*/, double /*y*/, double /*dx*/, double /*dy*/, CharCode /*code*/, POPPLER_CONST_082 Unicode * /*u*/, int /*uLen*/) override;
++ void endType3Char(GfxState * /*state*/) override;
++ void type3D0(GfxState * /*state*/, double /*wx*/, double /*wy*/) override;
++ void type3D1(GfxState * /*state*/, double /*wx*/, double /*wy*/, double /*llx*/, double /*lly*/, double /*urx*/, double /*ury*/) override;
++
++ //----- form XObjects
++ void drawForm(Ref /*id*/) override { qDebug() << "Draw Form"; }
++
++ //----- links
++ void processLink(AnnotLink * /*link*/) override { qDebug() << "Draw Link"; }
++
++ bool layersSetByOCG;
++ double cropOffsetX {0.0};
++ double cropOffsetY {0.0};
++ int rotate;
++
++private:
++ void getPenState(GfxState *state);
++ QString getColor(GfxColorSpace *color_space, POPPLER_CONST_070 GfxColor *color, int *shade);
++ QString getAnnotationColor(const AnnotColor *color);
++ QString convertPath(POPPLER_CONST_083 GfxPath *path);
++ int getBlendMode(GfxState *state);
++ void applyMask(PageItem *ite);
++ void pushGroup(const QString& maskName = "", GBool forSoftMask = gFalse, GBool alpha = gFalse, bool inverted = false);
++ QString UnicodeParsedString(POPPLER_CONST GooString *s1);
++ QString UnicodeParsedString(const std::string& s1);
++ bool checkClip();
++
++ // Intersect the current clip path with the new path in state where filled areas
++ // are interpreted according to fillRule.
++ void adjustClip(GfxState *state, Qt::FillRule fillRule);
++
++ // Take the current path of state and interpret it according to fillRule,
++ // intersect it with the clipping path and create a new pageitem for it.
++ void createFillItem(GfxState *state, Qt::FillRule fillRule);
++
++ void createImageFrame(QImage& image, GfxState *state, int numColorComponents);
++
++ bool pathIsClosed {false};
++ QString CurrColorFill;
++ int CurrFillShade {100};
++ QString CurrColorStroke;
++ int CurrStrokeShade {100};
++ Qt::PenCapStyle PLineEnd {Qt::FlatCap};
++ Qt::PenJoinStyle PLineJoin {Qt::MiterJoin};
++ QVector<double> DashValues;
++ double DashOffset {0.0};
++ QString Coords;
++ // The currently visible area. If it is empty, everything is visible.
++ // QPainterPath has the drawback that it sometimes approximates Bezier curves
++ // by line segments for numerical stability. If available, a better class
++ // should be used. However, it is important that the used class knows which
++ // areas are covered and does not rely on external information about the fill
++ // rule to use.
++ QPainterPath m_currentClipPath;
++ QStack<QPainterPath> m_clipPaths;
++ // Collect the paths of character glyphs for clipping of a whole text group.
++ QPainterPath m_clipTextPath;
++
++ struct groupEntry
++ {
++ QList<PageItem*> Items;
++ GBool forSoftMask;
++ GBool isolated;
++ GBool alpha;
++ QString maskName;
++ QPointF maskPos;
++ bool inverted;
++ };
++ QStack<groupEntry> m_groupStack;
++ QString m_currentMask;
++ QPointF m_currentMaskPosition;
++ ScribusDoc* m_doc;
++ Selection* tmpSel;
++ QList<PageItem*> *m_Elements;
++ QStringList *m_importedColors;
++ QTransform m_ctm;
++ struct F3Entry
++ {
++ bool colored;
++ };
++ QStack<F3Entry> m_F3Stack;
++ struct mContent
++ {
++ QString name;
++ QString ocgName;
++ };
++ QStack<mContent> m_mcStack;
++ int inPattern {0};
++ int layerNum {1};
++ int currentLayer;
++ bool firstLayer {true};
++ int importerFlags;
++ int updateGUICounter {0};
++ XRef *xref {nullptr}; // xref table for current document
++ PDFDoc *pdfDoc {nullptr};
++ Catalog *catalog {nullptr};
++ SplashFontEngine *m_fontEngine {nullptr};
++ SplashFont *m_font {nullptr};
++ FormPageWidgets *m_formWidgets {nullptr};
++ QHash<QString, QList<int> > m_radioMap;
++ QHash<int, PageItem*> m_radioButtons;
++ int m_actPage;
++};
++
++#endif
diff --git a/office/scribus/scribus.SlackBuild b/office/scribus/scribus.SlackBuild
index 5842344c68..c3bdeacf40 100644
--- a/office/scribus/scribus.SlackBuild
+++ b/office/scribus/scribus.SlackBuild
@@ -27,13 +27,13 @@
# Including input by Yalla-One and some code cleanup by rworkman
PRGNAM=scribus
-VERSION=${VERSION:-1.4.6}
+VERSION=${VERSION:-1.5.6.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -44,8 +44,8 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -73,12 +73,14 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# thanks archlinux!
+patch -p1 < $CWD/poppler-21.4.0.patch
+
cmake \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
- -DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DRENDER_LIB=CAIRO
+ -DLIB_SUFFIX=${LIBDIRSUFFIX}
make
make install DESTDIR=$PKG
diff --git a/office/scribus/scribus.info b/office/scribus/scribus.info
index 10e5f6a05f..b5f450fb1e 100644
--- a/office/scribus/scribus.info
+++ b/office/scribus/scribus.info
@@ -1,8 +1,8 @@
PRGNAM="scribus"
-VERSION="1.4.6"
+VERSION="1.5.6.1"
HOMEPAGE="https://www.scribus.net"
-DOWNLOAD="https://downloads.sourceforge.net/scribus/scribus-1.4.6.tar.xz"
-MD5SUM="f6161785e24755ea77c8f14b319ff1aa"
+DOWNLOAD="https://downloads.sourceforge.net/scribus/scribus-1.5.6.1.tar.xz"
+MD5SUM="12700cd8c6f08ef02f50495d2ef2d3ce"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/teapot/teapot.SlackBuild b/office/teapot/teapot.SlackBuild
index 8eb69bb072..024b392383 100644
--- a/office/teapot/teapot.SlackBuild
+++ b/office/teapot/teapot.SlackBuild
@@ -98,7 +98,7 @@ sed -i "s,/usr/share/doc/$PRGNAM,/usr/doc/$PRGNAM-$VERSION,g" $PRGNAM.1
mkdir -p build
cd build
cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -I/usr/include/tirpc -Wl,-ltirpc" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_HELP=OFF \
diff --git a/office/tellico/tellico.SlackBuild b/office/tellico/tellico.SlackBuild
index 87b35d67d7..c08442cc47 100644
--- a/office/tellico/tellico.SlackBuild
+++ b/office/tellico/tellico.SlackBuild
@@ -27,7 +27,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=tellico
-VERSION=${VERSION:-2.3.12}
+VERSION=${VERSION:-3.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -64,7 +64,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
rm -rf $TMP/$PRGNAM-$VERSION
cd $TMP
-tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@@ -92,7 +92,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS COMPILING COPYING ChangeLog README $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS COMPILING COPYING ChangeLog README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir $PKG/install
diff --git a/office/tellico/tellico.info b/office/tellico/tellico.info
index 0e7fdd0310..bb95fec8cb 100644
--- a/office/tellico/tellico.info
+++ b/office/tellico/tellico.info
@@ -1,8 +1,8 @@
PRGNAM="tellico"
-VERSION="2.3.12"
+VERSION="3.4"
HOMEPAGE="https://tellico-project.org/"
-DOWNLOAD="https://tellico-project.org/files/tellico-2.3.12.tar.bz2"
-MD5SUM="607e94e0141aadf741aab7fa6db15a5c"
+DOWNLOAD="https://tellico-project.org/files/tellico-3.4.tar.xz"
+MD5SUM="f46ab546ac335a9107c2130faea1fb9d"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/texlive/README b/office/texlive/README
deleted file mode 100644
index d08796d591..0000000000
--- a/office/texlive/README
+++ /dev/null
@@ -1,14 +0,0 @@
-TeXLive (TeXLive binaries, support files, TeX formats)
-
-This package contains binaries and many support files, TeX formats and
-packages, and other files included in the TeXLive TeX distribution.
-This should be adequate for the needs of most TeX users.
-
-The remaining stuff can be found in texlive-extra and texlive-docs,
-all of which are also available at SlackBuilds.org.
-
-Have a look at the scripts in the prep/ directory to see how the texmf
-archives were created from the original Texlive netarchives.
-
-Note that this package conflicts with the tetex packages in Slackware,
-so you'll need to remove tetex and tetex-doc before installing TeXLive.
diff --git a/office/texlive/README.tlpkg b/office/texlive/README.tlpkg
deleted file mode 100644
index 7a6f790ca8..0000000000
--- a/office/texlive/README.tlpkg
+++ /dev/null
@@ -1,17 +0,0 @@
-The TeXLive Package Manager, i.e. tlmgr(1), is not shipped with this
-TeXLive package, as it's not expected to work properly (if at all).
-The general consensus from the TeXLive users mailing list is that
-distributions should not be shipping tlpkg.
-
-The *proper* way to upgrade the TeXLive Slackware package (or any
-part of it) is through your Slackware's package manager. If you
-elect to try tlmgr(1), and it doesn't work at all, or worse, it messes
-up part of your TeXLive installation, too bad. On the other hand,
-if you are able to document exactly what we need to do in order to
-make it:
- 1) work
- 2) put updates and such in a user-specific directory, i.e.
- *not* alter/replace system package contents
-then we would love to hear from you. :-)
-
---rworkman :-)
diff --git a/office/texlive/doinst.sh b/office/texlive/doinst.sh
deleted file mode 100644
index f864e767d6..0000000000
--- a/office/texlive/doinst.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-chroot . /usr/bin/mktexlsr 1>/dev/null 2>/dev/null
-printf "y\n" | chroot . /usr/bin/updmap-sys --syncwithtrees 1>/dev/null 2>/dev/null
-chroot . /usr/bin/updmap-sys 1>/dev/null 2>/dev/null
-chroot . /usr/bin/fmtutil-sys --all 1>/dev/null 2>/dev/null
-chroot . /usr/bin/mtxrun --generate 1>/dev/null 2>/dev/null
diff --git a/office/texlive/patches/tabu.sty.diff b/office/texlive/patches/tabu.sty.diff
deleted file mode 100644
index 8ebe034d18..0000000000
--- a/office/texlive/patches/tabu.sty.diff
+++ /dev/null
@@ -1,32 +0,0 @@
---- ./tabu.sty.orig 2019-01-14 16:10:48.000000000 -0600
-+++ ./tabu.sty 2019-06-30 16:24:01.975474339 -0500
-@@ -57,7 +57,7 @@
- %%
-
- \NeedsTeXFormat{LaTeX2e}
--\ProvidesPackage{tabu}[2019/01/11 v2.9 - flexible LaTeX tabulars (FC+tabu-fixed)]
-+\ProvidesPackage{tabu}[2019/01/11 v2.9 - flexible LaTeX tabulars (FC+tabu-fixed) + intermediate FMi]
- \RequirePackage{array}[2008/09/09]
- \RequirePackage{varwidth}[2009/03/30]
- \AtEndOfPackage{\tabu@AtEnd \let\tabu@AtEnd \@undefined}
-@@ -727,6 +727,10 @@
- \tabu@currentgrouptype\expandafter{\the\currentgrouptype}}%
- \fi
- }% \tabu@init
-+%%TABU-FIXED set up \tabu@currentgrouptype
-+%FMi cancel for nested arrays ...
-+\def\@tabarray{\m@th\def\tabu@currentgrouptype{\currentgrouptype}\@ifnextchar[\@array{\@array[c]}}
-+
- \def\tabu@indent{% correction for indentation
- \ifdim \parindent>\z@\ifx \linewidth\tabudefaulttarget
- \everypar\expandafter{%
-@@ -1663,6 +1667,9 @@
- \ifdim \tabu@temp\p@>\z@ \ifdim \tabu@temp\tabucolX<\tabu@target
- \tabu@target=\tabu@temp\tabucolX \fi\fi
- \setbox\tabu@box \hbox \bgroup
-+%%TABU-FIXED add \color@begingroup
-+%%FMi not yet understood why this one is also needed ...
-+ \color@begingroup
- \begin{varwidth}\tabu@target
- \let\FV@ListProcessLine \tabu@FV@ListProcessLine % \hbox to natural width...
- \narrowragged \arraybackslash \parfillskip \@flushglue
diff --git a/office/texlive/prep/texmf_get.sh b/office/texlive/prep/texmf_get.sh
deleted file mode 100644
index c66a71b7f2..0000000000
--- a/office/texlive/prep/texmf_get.sh
+++ /dev/null
@@ -1,1146 +0,0 @@
-#!/bin/bash
-
-# texmf_get.sh
-#
-# Copyright 2016 - 2020 Johannes Schoepfer, Germany, slackbuilds@schoepfer.info
-# 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.
-#
-# V 15.0.4
-#
-# Prepare xz-compressed tarballs of texlive-texmf-trees based on texlive.tlpdb
-# This script takes care of dependencies(as far as these are present in texlive.tlpdb)
-# of collections and packages, and that every texlive-package is included only once.
-# The editions(base/extra/docs) should contain no binaries(exception biber)
-# -base: the most usefull stuff, most binaries/scripts,
-# manpages for compiled binaries 65mb 2017-11-07
-# -docs: -base documentation only, no manpages/GNU infofiles
-# -extra: remaining stuff and corresponding docs
-#
-# texlive netarchive policy: Every package is included as dependency
-# in exactly one collection. A package may have dependencies on other
-# packages from any collection.
-
-#set -e
-MAJORVERSION=2020
-mirror="http://mirror.ctan.org/systems/texlive/tlnet/"
-TMP=${TMP:-$PWD/tmp}
-
-# Globally excluded packages, which are/contain
-# -useless without tlmgr-installer
-# -non-linux, e.g. texworks
-# -covered by an external package, e.g. asymptote on SBo
-# -obsolete, e.g. omega
-# -binaries provided already by texlive.Slackbuild
-# -binaries which texlive upstream recommends to build natively, e.g. dvisvgm on SBo
-# -only sources, e.g. metatype1, patch, ...
-
-global_exclude="
- 00texlive.config
- 00texlive.image
- 00texlive.installation
- 00texlive.installer
- aleph
- antomega
- asymptote
- bibtexu
- cslatex
- dviout.win32
- lambda
- ocherokee
- oinuit
- omega
- omegaware
- otibet
- texlive-common
- texlive-docindex
- texlive-msg-translations
- texosquery
- texworks
- tlcockpit
- tlshell
- wintools.win32
- dvisvgm
- "
-
- # special packages, move their type1 fonts(if metafonts are present)
- # and/or docs to -extra
-special_packages="
- koma-script
- velthuis
- armtex
- montex
- vntex
- pl
- cc-pl
- cs
- musixtex-fonts
- tipa
- cbfonts
- ptex-fonts
- uptex-fonts
- "
-#Todo: split type1 fonts, or keep subset of type1 fonts in base
-# cm-super
-
-# keep precompiled binaries, list binary, not package name
-keep_precompiled="
- biber
- "
-
-texmf_editions () {
-
- # "excludes from -base", also dependencies are excluded
- PACKAGES="
- cm-super
- biber
- bib2gls
- knitting
- pst-cox
- pst-poker
- pst-vectorian
- pst-geo
- bclogo
- texplate
- texliveonfly
- kerkis
- " texmfget extra || exit 1
-
- # packages/collections and their dependencies for -base
- PACKAGES="
- $(grep ^"name hyphen-.*" $db | cut -d' ' -f2 )
- $special_packages
- etoolbox
- memoir
- ptex
- platex
- revtex
- ucs
- uplatex
- uptex
- velthuis
- wasy
- xcolor
- xypic
- collection-basic
- collection-latex
- collection-metapost
- collection-plaingeneric
- collection-luatex
- collection-context
- collection-fontutils
- collection-langczechslovak
- collection-langeuropean
- collection-langenglish
- collection-langfrench
- collection-langgreek
- collection-langitalian
- collection-langpolish
- collection-langportuguese
- collection-langspanish
- collection-latexrecommended
- $(collection_by_size fontsextra 70000 || exit 1)
- $(collection_by_size latexextra 1000 || exit 1)
- $(collection_by_size langchinese 5000 || exit 1)
- $(collection_by_size langcjk 3000 || exit 1)
- $(collection_by_size pictures 100000 || exit 1)
- $(collection_by_size publishers 10000 || exit 1)
- " texmfget base
-
- # packages/collections and their dependencies for -extra
- PACKAGES="
- $(grep ^"name .*biblatex" $db | cut -d' ' -f2 )
- amiri
- arabi
- arabi-add
- arara
- arev
- bangorcsthesis
- beamer2thesis
- beamertheme-detlevcm
- beamertheme-epyt
- beamertheme-npbt
- beamertheme-saintpetersburg
- beebe
- bhcexam
- bxtexlogo
- collection-fontsextra
- collection-langchinese
- collection-langcjk
- collection-langjapanese
- collection-langkorean
- collection-pictures
- collection-publishers
- collection-texworks
- collection-wintools
- ctan-o-mat
- ctanify
- ctanupload
- dad
- duckuments
- ethiop-t1
- fibeamer
- fithesis
- ghsystem
- gregoriotex
- hustthesis
- ijsra
- iwhdp
- jpsj
- kerkis
- ketcindy
- kpfonts
- langsci
- latex2nemeth
- libertine
- lilyglyphs
- lni
- luatexko
- media9
- musuos
- mwe
- newtx
- nwejm
- padauk
- pdfwin
- pdfx
- powerdot-tuliplab
- powerdot-fuberlin
- quran
- quran-de
- realhats
- resumecls
- sanskrit-t1
- sapthesis
- sduthesis
- seuthesix
- simurgh
- skaknew
- stellenbosch
- suanpan
- texdoctk
- tudscr
- uantwerpendocs
- udesoftec
- universalis
- uowthesis
- wasy-type1
- xduthesis
- xetexko
- xq
- " texmfget extra || exit 1
-
- # What's left, for base again
- PACKAGES="
- collection-fontsrecommended
- collection-xetex
- collection-langcyrillic
- collection-langarabic
- collection-langgerman
- collection-langother
- collection-humanities
- collection-mathscience
- collection-pstricks
- collection-music
- collection-games
- collection-binextra
- collection-bibtexextra
- collection-formatsextra
- collection-latexextra
- " texmfget base || exit 1
-
-}
-
-# ==== Nothing to edit beyond this line ====
-
-usage () {
- echo
- echo "Generate texmf trees/editions based on collections/packages"
- echo "and their (hard)dependencies."
- echo "./texmf_get.sh [base|docs|extra|lint]"
- echo
- echo "-base: texfiles, no docs"
- echo "-docs: docs of -base"
- echo "-extra: remaining texfiles and docs"
- echo "[lint]: compare filename contents of all generated editions,"
- echo " to detect overlapping files"
- echo
- echo "Only new/updated/missing tex packages are downloaded."
- echo "The first run takes \"long\", tex packages(about 3Gb)"
- echo "need to be downloaded."
- echo "To check out a new version/release, delete"
- echo "$db"
- echo "A new ascii index file/database(texlive.tlpdb) is will be"
- echo "pulled on the next run, and a new version yymmdd will be set."
- echo
- echo "All generated tarballs, logs etc. are going to"
- echo "$TMP"
- echo
-}
-
-collection_by_size () {
- # from collection $1, pull packages smaller $2 bytes
- start_n="$(grep -n ^"name collection-$1"$ $db | cut -d':' -f1)"
- # find end of package/collection
- for emptyline in $emptylines
- do
- if [ "$emptyline" -gt "$start_n" ]
- then
- end_n=$emptyline
- break
- fi
- done
- extrapackages="$(sed "${start_n},${end_n}!d" $db | grep ^"depend " | grep -v ^"depend collection" | sed "s/^depend//g" )"
-
- # add if smaller than ...
- for checksize in $extrapackages
- do
- package_meta $checksize || exit 1
- size=$(grep ^"containersize " $texmf/$checksize.meta | cut -d' ' -f2)
- # for $2, e.g. 3000 means 3kb
- [ $size -lt $2 ] && echo $checksize
- done
-}
-
-package_meta () {
- if [ ! -s "$texmf/$1.meta" ]
- then
- # collection start linenumer
- start_n="$(grep -n ^"name ${1}"$ $db | cut -d':' -f1)"
- [ -z "$start_n" ] && echo "$1 was not found in $db, bye." && exit 1
- # find end of package/collection
- for emptyline in $emptylines
- do
- if [ "$emptyline" -gt "$start_n" ]
- then
- end_n=$emptyline
- break
- fi
- done
- # Don't handle collections as dependency of other collections
- sed "${start_n},${end_n}!d;/^depend collection/d" $db > $texmf/$1.meta
- fi
-}
-
-download () {
- # Download packages, if not already available. Not every packages has a corresponding .doc package.
- # Try multiple times if package isn't present or checksum fails
-
- unset checksum_ok
- if [ "$flavour" = ".doc" ]
- then
- sha512="$(grep ^doccontainerchecksum $texmf/$1.meta | cut -d' ' -f2 )"
- else
- sha512="$(grep ^containerchecksum $texmf/$1.meta | cut -d' ' -f2 )"
- fi
-
- cd $texmf
-
- for run in {1..8}
- do
- [ ! -s "${1}${flavour}.tar.xz" ] && \
- wget -q --show-progress -t1 -c ${mirror}archive/${1}${flavour}.tar.xz
- [ ! -s "${1}${flavour}.tar.xz" ] && continue
- if [ "$(sha512sum ${1}${flavour}.tar.xz | cut -d' ' -f1 )" != "$sha512" ]
- then
- echo "sha512sum of ${1}${flavour}.tar.xz doesn't match $texmf/$1.meta"
- echo "deleting ${1}${flavour}.tar.xz"
- rm ${1}${flavour}.tar.xz
- else
- checksum_ok=yes
- break
- fi
- done
-
- # If no success by downloading, write error log
- if [ -z "$checksum_ok" ]
- then
- echo "Downloading ${1}${flavour}.tar.xz or sh512sum check was not successful,\\
- writing to $errorlog"
- echo "Delete ${db}* and try again."
- echo "$VERSION" >> $errorlog
- echo "Error downloading ${1}${flavour}.tar.xz" >> $errorlog
- exit 1
- fi
-}
-
-untar () {
- # leave if $1 has no content
- if [ -s "$1" ]
- then
- while read package
- do
- echo "untar $package$flavour"
- # untar all packages, check for relocation, "relocate 1" -> untar in texmf-dist
- download $package || exit 1
- # untar package, relocate to texmf-dist if necessary, binary packages always need relocation
- relocated='.'
- [ -n "$(grep -w ^"relocated 1" $texmf/$package.meta)" -o -n "$(grep ^"binfiles " $texmf/$package.meta)" ] && relocated="texmf-dist"
- # if not .doc package, investigate files for dependencies/provides
- if [ -n "$flavour" ]
- then
- tar xf ${package}${flavour}.tar.xz --exclude tlpkg -C $relocated || exit 1
- else
- tar vxf ${package}${flavour}.tar.xz \
- --exclude tlpkg/tlpobj \
- -C $relocated | grep -E '\.sty$|\.bbx$|\.cls$' > $texmf/$package.deps
- if [ -n "$texmf/$package.deps" ]
- then
- unset provide
- unset depends
- for depfile in $(cat $texmf/$package.deps)
- do
- filename="$( echo $depfile | rev | cut -d'.' -f2- | cut -d'/' -f1 | rev)"
- # always add $filename as "ProvidesPackage", if it's a .sty
- echo $depfile | grep '\.sty'$ &>/dev/null
- [ $? = 0 ] && provide+="${filename},"
- # remove comments, if there are backslashes ignore that content, except it is \filename
- #provide+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -n "s/.*\\\ProvidesPackage{\([^}]*\)}.*/\1/p" | sed "s/\\\filename/$filename/g;/\\\/d" | sort -u | tr '\n' ',')"
- #sed -z "s/.*\\\Provides\(Package\|ExplPackage\|File\|Class\)*.\n//g" | sed "s/[[:space:]]//
- #provide+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -z "s/.*\\\Provides\(Package\|ExplPackage\|File\|Class\)*.\n//g" | sed "s/[[:space:]]// | sed -n "s/.*\\\Provides\(Package\|ExplPackage\|File\|Class\){\([^}]*\)}.*/\2/p" | sed "s/\\\filename/$filename/g;s/\\\ExplFileName/$filename/g;/\\\/d" | sed "s/\(\.sty$\|\.cls$\)//g" | sort -u | tr '\n' ',')"
- provide+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -z "s/\(Package\|ExplPackage\|File\|Class\)\n/\1/g" | sed "s/[[:space:]]//" | sed -n "s/.*\\\Provides\(Package\|ExplPackage\|File\|Class\){\([^}]*\)}.*/\2/p" | sed "s/\\\filename/$filename/g;s/\\\ExplFileName/$filename/g" | sed "s/\(\.sty$\|\.cls$\)//g" | sort -u | tr '\n' ',')"
- #depends+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -n "s/.*\(\\\require\|\\\use\)package{\([^}]*\)}.*/\2/p" | sed "/\\\/d" | sort -u | tr '\n' ',')"
- depends+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -n "s/.*\(\\\require\|\\\use\)package{\([^}]*\)}.*/\2/p" | sort -u | tr '\n' ',')"
- #depends+="$(sed "s/%.*//g" $texmf/$relocated/$depfile | sed -n "s/.*\\\\(require\|use\)package{\([^}]*\)}.*/\2/p" | sed "/\\\/d" | sort -u | tr '\n' ',')"
- done
- if [ -n "$provide" ]
- then
- echo "$package $provide" >> $TMP/provides.run.$edition
- fi
- if [ -n "$depends" ]
- then
- echo "$package $depends" >> $TMP/depends.run.$edition
- fi
- fi
- fi
-
- # Delete binaries, these are provided
- # by the buildscript, keep symlinks and scripts
-
- for arch in $platforms
- do
- if [ -d $texmf/texmf-dist/bin/$arch ]
- then
- [ ! -d $texmf/texmf-dist/linked_scripts ] && \
- mkdir $texmf/texmf-dist/linked_scripts
- # remove the unfortunate "man" link
- [ -L "$texmf/texmf-dist/bin/$arch/man" ] && \
- rm $texmf/texmf-dist/bin/$arch/man
- for link in $(find $texmf/texmf-dist/bin/$arch -type l)
- do
- link_valid_dest=$texmf/texmf-dist/linked_scripts/${link##*/}
- # move symlink to linked_scripts
- mv $link $link_valid_dest
- # some links have to dangle, because target binaries are coming from the buildscript
- # fix SELFAUTOPARENT in some scripts
- if [ -e "$link_valid_dest" ]
- then
- sed -i "s/kpsewhich -var-value=SELFAUTOPARENT/kpsewhich -var-value=TEXMFROOT/g" \
- $link_valid_dest || exit 1
- fi
- done
-
- # keep only binaries of special packages
- # remove xindy.mem(gzip compresses data) to prevent overwriting
- for bin in $(find $texmf/texmf-dist/bin/$arch -type f -exec file '{}' + | \
- grep -e "executable" -e "shared object" -e ELF -e "gzip compressed data" | cut -f 1 -d : )
- do
- for binary in $keep_precompiled
- do
- if [ "$(echo $bin | rev | cut -d'/' -f1 | rev)" != "$binary" ]
- then
- rm $bin
- echo -n "$package:" >> $binary_removed.$edition
- echo $bin | rev | cut -d'/' -f1 | rev >> $binary_removed.$edition
- fi
- done
- done
- # move scripts to linked-scripts
- for script in \
- $(find $texmf/texmf-dist/bin/$arch -type f -exec file '{}' + |\
- grep -wv ELF | cut -f 1 -d : )
- do
- echo "Moving script/bin $script to $texmf/texmf-dist/linked_scripts/"
- mv $script $texmf/texmf-dist/linked_scripts/
- done
- fi
- done
-
- for tlpkg_dir in $texmf/tlpkg $texmf/texmf-dist/tlpkg
- do
- if [ -d $tlpkg_dir ]
- then
- for bin in $(find $tlpkg_dir -type f -exec file '{}' + | \
- grep -e "executable" -e "shared object" -e ELF -e "gzip compressed data" | cut -f 1 -d : )
- do
- echo "Deleting binary $bin found in $tlpkg_dir"
- rm $bin
- echo -n "$package:" >> $binary_removed.$edition
- echo $bin | rev | cut -d'/' -f1 | rev >> $binary_removed.$edition
- done
- [ -d $tlpkg_dir/TeXLive ] && \
- mkdir -p $texmf/texmf-dist/scripts/texlive && \
- mv $tlpkg_dir/TeXLive $texmf/texmf-dist/scripts/texlive
- fi
- done
-
- if [ "$flavour" = ".doc" ]
- then
- size=$(grep ^doccontainersize $texmf/$package.meta | cut -d' ' -f2)
- else
- size=$(grep ^containersize $texmf/$package.meta | cut -d' ' -f2)
- # add maps to updmap.cfg, don't add special_packages map files to -base
- add_map=yes
- if [ $edition = base ]
- then
- for no_map in $special_packages
- do
- [ $no_map = $package ] && add_map=no && break
- done
- fi
- [ $add_map = yes ] && grep ^'execute ' $texmf/$package.meta | grep Map | cut -d' ' -f2- | sed "s/^add//g" >> $updmap.$edition
- fi
- shortdesc="$(grep ^shortdesc $texmf/$package.meta | cut -d' ' -f2- )"
- echo "$size byte, $package$flavour: $shortdesc" >> $output.meta
- # make index of uncompressed size of each package
- echo "$(xz -l --verbose ${package}${flavour}.tar.xz | grep "Uncompressed size" | \
- cut -d'(' -f2 | cut -d' ' -f1 ) byte, $package$flavour: $shortdesc" >> $output.meta.uncompressed
- done < $1
-
- # add a path to updmap
- if [ -s "$texmf/texmf-dist/linked_scripts/updmap" ]
- then
- sed -i '/unshift.*@INC.*/a unshift(@INC, "$TEXMFROOT/texmf-dist/scripts/texlive");' $texmf/texmf-dist/linked_scripts/updmap || exit 1
- fi
-
- # copy packages index to texmf-dist, to have a list of included packages in the final installation
- # don't list binary packages, as the binaries itself are not contained, only the symlinks.
- cat $output.meta | grep -v '\-linux:' >> $output.$edition.meta
- cat $output.meta.uncompressed | grep -v '\-linux:' >> $output.$edition.meta.uncompressed
-
- # cleanup
- [ -f $output.meta ] && rm $output.meta
- [ -f $output.meta.uncompressed ] && rm $output.meta.uncompressed
- fi
-}
-
-remove_cruft () {
- # Remove m$-stuff, ConTeXt single-user-system stuff, empty files/directories and pdf-manpages
- rm -rf $texmf/texmf-dist/source
- rm -rf $texmf/texmf-dist/scripts/context/stubs/source/
- find $texmf/texmf-dist/ -type d -name 'win32' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type d -name 'win64' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type d -name 'mswin' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type d -name 'win' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type d -name 'setup' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type d -name 'install' -exec rm -rf {} +
- find $texmf/texmf-dist/ -type f -name 'uninstall*.sh' -delete
- find $texmf/texmf-dist/ -type f -name '*.bat' -delete
- find $texmf/texmf-dist/ -type f -name '*.bat.w95' -delete
- find $texmf/texmf-dist/ -type f -name '*.vbs' -delete
- find $texmf/texmf-dist/ -type f -name '*win32*' -delete
- find $texmf/texmf-dist/ -type f -name 'winansi*' -delete
- find $texmf/texmf-dist/ -type f -name '*man1.pdf' -delete
- find $texmf/texmf-dist/ -type f -name '*man5.pdf' -delete
- find $texmf/texmf-dist/ -type f -empty -delete
- find $texmf/texmf-dist/ -type d -empty -delete
-}
-
-texmfget () {
- # make sure no package is added more than once.
- echo "Preparing index of packages to be added to -${1} ..."
- echo "$PACKAGES" | sed "s/[[:space:]]//g;/^$/d" > $collections_tobedone
- # Remove outputfile if already present
- >$output
- >$output_doc
-
- # Only do something if $collection wasn't already done before
- while [ -s $collections_tobedone ]
- do
- collection=$(tail -n1 $collections_tobedone)
-
- # continue with next collection if collection was already done
- if [ -s "$collections_done" ]
- then
- grep -w "^${collection}$" $collections_done &> /dev/null
- if [ $? = 0 ]
- then
- # remove from $collections_tobedone
- sed -i "/^$collection$/d" $collections_tobedone
- if [ -n "$(grep "^${collection} added to" $logfile)" ]
- then
- echo "$collection already added " >> $logfile
- fi
- continue
- fi
- fi
-
- package_meta $collection || exit 1
-
- # If $collection is a singel package(not a collection-), add it here
- if [ -n "$(head -n1 $texmf/$collection.meta | grep -v "name collection" )" ]
- then
- unset addpackage
- # if package contains docs, add to docs-packages
- if [ -n "$(grep ^docfiles $texmf/$collection.meta)" ]
- then
- echo "$collection" >> $output_doc
- echo "$collection added to docs $1" >> $logfile
- addpackage=yes
- fi
- # if package contains runfiles, binfiles or depend, add to edition
- if [ \
- -n "$(grep ^runfiles $texmf/$collection.meta)" -o \
- -n "$(grep ^binfiles $texmf/$collection.meta)" -o \
- -n "$(grep ^depend $texmf/$collection.meta)" \
- ]
- then
- echo "$collection" >> $output
- echo "$collection added to -$1" >> $logfile
- addpackage=yes
- fi
- # if package contains only srcfiles, don't add to a edition
- if [ -n "$(grep ^srcfiles $texmf/$collection.meta)" -a -z "$addpackage" ]
- then
- echo "$collection only contains srcfiles, added nowhere" >> $logfile
- addpackage=yes
- fi
- # abort if package seems broken
- if [ -z "$addpackage" ]
- then
- echo "$collection doesn't contain any docfiles/runfiles/binfiles/depends or srcfiles"
- echo "Please exclude package/report to upstream mailinglist tex-live@tug.org, bye."
- exit 1
- fi
- fi
-
- # Don't handle collections as dependency of other collections, as this destroys control over what packages to be added
- # add dependend packages, but no binary(ARCH) and no packages containing a '.'. Packges with dot indicate binary/texlive-manager/windows packages
-
- grep ^"depend " $texmf/$collection.meta | cut -d' ' -f2- > $dependencies
-
- if [ -s "$dependencies" ]
- then
- # check for .ARCH packages which may be binaries, scripts or links
- # Binaries should all come from the sourcebuild(exception biber)
- for dependency in $(cat $dependencies)
- do
- echo $dependency | grep '\.ARCH'$ &>/dev/null
- if [ $? = 0 ]
- then
- for arch in $platforms
- do
- archpackage="$(echo $dependency | sed "s/\.ARCH$/\.$arch/")"
- grep ^"name $archpackage"$ $db &>/dev/null && echo "$archpackage" >> $dependencies.verified_arch
- done
- else
- echo $dependency >> $dependencies.verified_arch
- fi
- done
- if [ -f $dependencies.verified_arch ]
- then
- mv $dependencies.verified_arch $dependencies
- else
- rm $dependencies
- fi
- fi
-
- if [ -s "$dependencies" ]
- then
- echo "----------------" >> $logfile
- echo "Dependencies of $collection: $(cat $dependencies | tr '\n' ' ')" >> $logfile
- for dependency in $(cat $dependencies)
- do
- if [ -n "$(grep ^"${dependency}"$ $collections_done)" ]
- then
- sed -i "/^${dependency}$/d" $dependencies
- continue
- else
- for exclude in $global_exclude
- do
- if [ "$exclude" = "$dependency" ]
- then
- sed -i "/^${exclude}$/d" $dependencies
- echo "$exclude excluded, see \$global_exclude" >> $logfile
- fi
- done
- fi
- done
- cat $dependencies >> $collections_tobedone
- echo "----------------" >> $logfile
- fi
-
- sed -i "/^${collection}$/d" $collections_tobedone
- echo "$collection" >> $collections_done
- done
- # handle package index list per edition
- cat $output >> $TMP/packages.$1
- # handle doc package index, one for each edition
- cat $output_doc >> $TMP/packages.$1.doc
-
- # untar only one $edition, untar docs together with -extra edition
- if [ "$1" = $edition -o docs = $edition ]
- then
- cd $texmf
- # Cleanup tar-directory
- [ -d $texmf/texmf-dist ] && rm -rf $texmf/texmf-dist
- mkdir $texmf/texmf-dist
-
- # Make tarball/checksum reproducible by setting mtime(clamp-mtime),
- # owner, group and sort content.
- # --clamp-mtime --mtime doesn't work with tar 1.13,
- # when makepkg creates the tarball:
- # tar-1.13: time_t value 9223372036854775808 too large (max=68719476735)
- echo "Adding files to $( echo $tarball | rev | cut -d'/' -f1 | rev ) ..."
- case $edition in
- base)
- unset flavour
- untar $output || exit 1
- remove_cruft || exit 1
- tar rf $tarball --owner=0 --group=0 --sort=name texmf-dist || exit 1
- rm -rf texmf-dist
- ;;
- extra)
- unset flavour
- untar $output || exit 1
- export flavour=".doc"
- untar $output_doc || exit 1
- remove_cruft || exit 1
- #tar vrf $tarball --clamp-mtime --mtime --owner=0 --group=0 --sort=name texmf-dist || exit 1
- tar rf $tarball --owner=0 --group=0 --sort=name texmf-dist || exit 1
- rm -rf texmf-dist
- ;;
- docs)
- export flavour=".doc"
- # only add -base docs to -docs
- if [ $1 = base ]
- then
- untar $output_doc || exit 1
- remove_cruft || exit 1
- #tar vrf $tarball --clamp-mtime --mtime --owner=0 --group=0 --sort=name texmf-dist || exit 1
- tar rf $tarball --owner=0 --group=0 --sort=name texmf-dist || exit 1
- rm -rf texmf-dist
- fi
- ;;
- esac
- fi
-}
-
-lint () {
-
-echo "Comparing content of all editions, this may take a while ..."
-cd $TMP
-# check if all editions of same VERSION are there, take -base as reference
-lint_version=$( ls texlive-base-*tar.xz | head -n1 | cut -d'.' -f2 || exit 1)
-if [ -s texlive-extra-$MAJORVERSION.$lint_version.tar.xz \
- -a -s texlive-docs-$MAJORVERSION.$lint_version.tar.xz ]
-then
- for edition in base extra docs
- do
- echo "Extracting index of texlive-${edition}-$MAJORVERSION.$lint_version.tar.xz ..."
- # don't list directories
- tar tf texlive-${edition}-$MAJORVERSION.$lint_version.tar.xz | grep -v '/'$ > $TMP/packages.$edition.lint
- done
-
- # compare content
- for edition in base extra docs
- do
- >$TMP/packages.$edition.lint.dup
- if [ $edition = base ]
- then
- echo "check if files of base are present in another edition"
- while read line
- do
- grep ^"$line"$ $TMP/packages.extra.lint >> $TMP/packages.base.lint.dup
- grep ^"$line"$ $TMP/packages.docs.lint >> $TMP/packages.base.lint.dup
- done < $TMP/packages.$edition.lint
- fi
- done
-else
- echo "Not all editions are present to lint them. Create them first by"
- echo "$0 [base|docs|extra]"
- echo "bye."
- exit 1
-fi
-
-exit 0
-
-}
-
-# Main
-
-LANG=C
-output=$TMP/packages
-output_doc=$TMP/packages.doc.tmp
-errorlog=$TMP/error.log
-texmf=$TMP/texmf
-db=$TMP/texlive.tlpdb
-tmpfile=$TMP/tmpfile
-collections_done=$TMP/done
-collections_tobedone=$TMP/tobedone
-allcollections=$TMP/allcollections
-binary_removed=$TMP/binaries.removed
-manpages=$TMP/manpages
-dependencies=$TMP/deps
-packages_base=$TMP/packages.base
-packages_extra=$TMP/packages.extra
-packages_manpages=$TMP/packages.manpages
-updmap=$TMP/updmap.cfg
-files_split=$TMP/files.split
-platforms="x86_64-linux i386-linux"
-
-mkdir -p $texmf
-cd $TMP
-
-case "$1" in
- base|docs|extra) edition=$1;;
- lint) lint ;;
- *) usage; exit 0 ;;
-esac
-
-echo "Building $edition tarball ..."
-
-# Set VERSION, get texlive.tlpdb and keep unshorten $db.orig
-if [ ! -s ${db}.orig -o ! -s $db -o ! -s VERSION ]
-then
- echo $MAJORVERSION.$(date +%y%m%d) > VERSION
- #wget -q --show-progress -c -O ${db}.orig ${mirror}tlpkg/texlive.tlpdb
- wget -q --show-progress -c -O ${db}.orig.xz ${mirror}tlpkg/texlive.tlpdb.xz
- unxz ${db}.orig.xz
-
- # remove most content from $db to be faster on later processing.
- # keep dependencies/manpages/binfiles/shortdesc/sizes
- grep -E \
- '^\S|^ RELOC/doc/man|^ texmf-dist/doc/man/man|^ RELOC/doc/info/|^ texmf-dist/doc/info/|^ bin|^$' \
- ${db}.orig | grep -v ^longdesc > $db
-
- # As $db might be renewed, remove the all package meta-files
- # to make them be created again based on (new) $db
- rm -rf $texmf/*.meta
-fi
-
-# Get linenumbers of empty lines from $db
-emptylines="$(grep -n ^$ $db | cut -d':' -f1)"
-
-# Make a list of all collections
-grep ^"name collection-" $db | cut -d' ' -f2 > $allcollections
-
-# translate .ARCH to platforms in excludes, to make .ARCH packages excludeable by $global_exclude
-for exclude in $global_exclude
-do
- if [ -n "$(echo $exclude | grep '\.ARCH'$ )" ]
- then
- for arch in $platforms
- do
- global_exclude+=" $(echo $exclude | sed "s/\.ARCH$/\.$arch/")"
- done
- global_exclude=${global_exclude/$exclude/}
- fi
-done
-
-VERSION=$(cat $TMP/VERSION)
-tarball=$TMP/texlive-$edition-$VERSION.tar
-# set logfile
-logfile=$TMP/$VERSION.log
-
-# reset some files
->$logfile
->$tarball
->$collections_done
->$files_split
->$manpages
->$packages_manpages
->$updmap.$edition
->$packages_base
->$packages_extra
->$packages_base.doc
->$packages_extra.doc
->$TMP/packages.$edition.meta
->$TMP/packages.$edition.meta.uncompressed
->$TMP/provides.run.$edition
->$TMP/depends.run.$edition
->$binary_removed.$edition
-
-# put the editions base/extra together
-texmf_editions || exit 1
-
-# Check if all collections are part in at least one edition
-while read collection
-do
- grep -w "$collection" $collections_done &> /dev/null
- if [ $? != 0 ]
- then
- echo "Error: $collection was not handled."
- echo "Edit packages/collections in the texmfget function." | tee -a $logfile
- exit 1
- fi
-done < $allcollections
-
-# cleanup
-rm $allcollections
-rm $collections_done
-rm $collections_tobedone
-rm $output
-rm $output_doc
-rm $dependencies
-
-# untar special- and manpage packages to be splitted/moved to other editions
-# splitting special packages, files index
-echo "Prepare index of to be splitted/moved files from -base"
-[ ! -d texmf-dist ] && mkdir texmf-dist
-for package in $special_packages
-do
- echo "Splitting $package"
- # special packages have to be in -base, as only here are special
- # tasks done to reduce size of -base edition
- if [ -z "$( grep ^"$package"$ $packages_base )" ]
- then
- echo "$package was not found to be part of -base"
- echo "Edit \$special_packages in $0,"
- echo "it should contain only packages from -base, bye."
- exit 1
- fi
- unset relocated
- pathprefix="texmf-dist/"
- [ -n "$(grep -w ^"relocated 1" $texmf/$package.meta)" ] && \
- relocated="-C texmf-dist" && unset pathprefix
- # avoid big pdf docs which are also present as html
- # move (big)type1 fonts to -extra
- # $files_split lists files to be moved from -base to -extra
- if [ $package = "cm-super" ]
- then
- # cm-super minimal for -base, create index of extended cm-super
- tar tf $texmf/$package.tar.xz | sed \
- "/1000\.pfb$/d;/^tlpkg/d;/\.sty$/d;/\.enc$/d;/\.GS$/d" \
- | tee -a $files_split > $files_split.tmp
- else
- tar tf $texmf/${package}.tar.xz | sed \
- -ne "/.*doc\/latex\/.*\.pdf$/p" \
- -ne "/.*fonts\/map\/.*\.map$/p" \
- -ne "/.*fonts\/enc\/.*\.enc$/p" \
- -ne "/.*fonts\/afm\/.*\.\(afm\|afm\.gz\)$/p" \
- -ne "/.*fonts\/type1\/.*\.pfb$/p" \
- -ne "/.*fonts\/vf\/.*\.vf$/p" \
- | tee -a $files_split > $files_split.tmp
- fi
-
- if [ $edition = base ]
- then
- # Calculate package-minimal size, uncompressed and compressed
- mkdir -p calculate/texmf-dist
- tar xf $texmf/$package.tar.xz -C calculate/texmf-dist --exclude-from=$files_split.tmp
- tar cf calculate/calc.tar.xz -I 'xz -9' calculate/texmf-dist
- size_minimal=$(du -bc calculate/calc.tar.xz | tail -n1 | sed "s/[[:space:]].*//")
- size_minimal_uncompressed="$(xz -l --verbose calculate/calc.tar.xz | grep "Uncompressed size" | cut -d'(' -f2 | cut -d' ' -f1 )"
- sed -i \
- -e "s/^[0-9]* byte, $package: /$size_minimal byte, $package-minimal: /" \
- $output.base.meta
- sed -i \
- -e "s/^[0-9]* byte, $package: /$size_minimal_uncompressed byte, $package-minimal: /" \
- $output.base.meta.uncompressed
- rm -rf calculate
- fi
-
- if [ $edition = extra ]
- then
- mkdir -p calculate/texmf-dist
- tar xf $texmf/${package}.tar.xz -C calculate/texmf-dist $(paste $files_split.tmp)
- tar cf calculate/calc.tar.xz -I 'xz -9' calculate/texmf-dist
- size_extended=$(du -bc calculate/calc.tar.xz | tail -n1 | sed "s/[[:space:]].*//")
- size_extended_uncompressed="$(xz -l --verbose calculate/calc.tar.xz | \
- grep "Uncompressed size" | cut -d'(' -f2 | cut -d' ' -f1 )"
-
- # put new sizes in package index uncompressed
- sed -i \
- -e "s/^[0-9]* byte, $package: /$size_extended byte, $package-extended: /" \
- $output.extra.meta
- sed -i \
- -e "s/^[0-9]* byte, $package: /$size_extended_uncompressed byte, $package-extended: /" \
- $output.extra.meta.uncompressed
- rm -rf calculate
-
- # put map files from splitted packages in -extra
- mkdir meta_tmp
- tar xf $texmf/${package}.tar.xz -C meta_tmp tlpkg/tlpobj/$package.tlpobj
- grep ^'execute ' meta_tmp/tlpkg/tlpobj/$package.tlpobj | \
- grep Map | cut -d' ' -f2- | sed "s/^add//g" >> $updmap.$edition
- rm -rf meta_tmp
- fi
-
- # untar to provide files for -extra
- tar xf $texmf/${package}.tar.xz $relocated $(paste $files_split.tmp)
- if [ $package = "cm-super" ]
- then
- # create cm-super- minimal config/maps with 10pt glyphs only
- sed "s/cm-super/cm-super-minimal/g" $texmf/texmf-dist/dvips/cm-super/config.cm-super \
- > $texmf/texmf-dist/dvips/cm-super/config-minimal.cm-super
- for map in t1 t2a t2b t2c ts1 x2
- do
- grep 1000 $texmf/texmf-dist/fonts/map/dvips/cm-super/cm-super-$map.map \
- > $texmf/texmf-dist/fonts/map/dvips/cm-super/cm-super-minimal-$map.map
- sed -i "/.*1000\.pfb/d" $texmf/texmf-dist/fonts/map/dvips/cm-super/cm-super-$map.map
- done
- fi
-done
-
-# cleanup
-rm $files_split.tmp
-
-# fix relocation in index for splitted packages
-sed -i \
- -e "s|^doc|texmf-dist\/doc|g" \
- -e "s|^fonts|texmf-dist\/fonts|g" \
- -e "s|^dvips|texmf-dist\/dvips|g" \
- $files_split
-
-# sort meta data about added packages
-sort -n $output.$edition.meta > $tmpfile
-mv $tmpfile $output.$edition.meta
-sort -n $output.$edition.meta.uncompressed > $tmpfile
-mv $tmpfile $output.$edition.meta.uncompressed
-
-sort -u $binary_removed.$edition > $tmpfile
-mv $tmpfile $binary_removed.$edition
-
-# include manpages/GNU infofiles in -base, write index for later exclusion from other editions.
-# In -extra/-docs there should not be any manpage left.
-echo "Looking for manpages/GNU infofiles to be included in -base ..."
-for package in $(paste -s $packages_base.doc | sort -u)
-do
- if [ -n "$(grep -E "(doc/man/man|doc/info/)" $texmf/$package.meta )" ]
- then
- echo "Adding manpage from $package.doc to -base"
- flavour=".doc" download $package || exit 1
- unset relocated
- pathprefix="texmf-dist/"
- [ -n "$(grep -w ^"relocated 1" $texmf/$package.meta)" ] \
- && relocated="-C texmf-dist" && unset pathprefix
- tar tf $texmf/${package}.doc.tar.xz | sed \
- -ne "/.*doc\/man\/.*\.1$/p" \
- -ne "/.*doc\/man\/.*\.5$/p" \
- -ne "/.*doc\/info\/.*\.info$/p" \
- | tee -a $manpages > $manpages.tmp
- # untar to provide files for -/extra/-docs
- tar xf $texmf/${package}.doc.tar.xz $relocated $(paste $manpages.tmp)
- echo "$package" >> $packages_manpages
- fi
-done
-# cleanup
-rm $manpages.tmp
-sed -i \
- -e "s/^doc/texmf-dist\/doc/g" \
- $manpages
-
-case $edition in
- base)
- # Content info
- cat << EOF | gzip -9 >> $texmf/texmf-dist/packages.$edition.gz
-Content of -$edition:
-$(sed "/-linux$/d" $packages_base | sort)
-EOF
- # create texdoc cache file
- if [ $(command -v texdoc) ]
- then
- mkdir -p texmf-dist/scripts/texdoc || exit 1
- TEXMFVAR=$texmf/texmf-dist \
- texdoc -c texlive_tlpdb=$TMP/texlive.tlpdb.orig \
- -DlM texlive-en >/dev/null 2>&1
- mv texmf-dist/texdoc/cache-tlpdb.lua \
- texmf-dist/scripts/texdoc/Data.tlpdb.lua || exit 1
- # add cache to tarball
- tar rf $tarball --owner=0 --group=0 --sort=name \
- texmf-dist/scripts/texdoc/Data.tlpdb.lua || exit 1
- else
- echo "WARNING: texdoc binary(comming with texlive) is not installed, the texdoc cache"
- echo "Data.tlpdb.lua can't be created and wont't be available."
- echo "Texdoc will not wotk without this."
- echo ""
- echo "Continue with any key or abort with ctrl-c"
- read -n1
- fi
-
- # prepare updmap.cfg
- tar xf $tarball texmf-dist/web2c/updmap.cfg
- end_n="$(grep -n 'end of updmap-hdr' texmf-dist/web2c/updmap.cfg | cut -d':' -f1)"
-
- sed "1,${end_n}!d" texmf-dist/web2c/updmap.cfg > $TMP/updmap.cfg.tmp
- cat $updmap.$edition >> $TMP/updmap.cfg.tmp
- mv $TMP/updmap.cfg.tmp texmf-dist/web2c/updmap.cfg
- tar f $tarball --delete texmf-dist/web2c/updmap.cfg
- tar rf $tarball --owner=0 --group=0 --sort=name \
- texmf-dist/web2c/updmap.cfg
-
-# add manpages/GNU infofiles to the tarball
- tar rf $tarball --owner=0 --group=0 --sort=name \
- texmf-dist/doc/man/ texmf-dist/doc/info/ \
- texmf-dist/packages.$edition.gz \
- || exit 1
-# # add cm-super minimal maps/config
-# tar rf $tarball --owner=0 --group=0 --sort=name \
-# texmf-dist/dvips/cm-super/config-minimal.cm-super \
-# --wildcards texmf-dist/fonts/map/dvips/cm-super/cm-super-minimal-*.map \
-# || exit 1
- echo "Removing files -from base, splitted from special packages to be included in -extra"
- tar f $tarball --delete $(paste $files_split) || exit 1
- ;;
- extra)
- echo "Removing manpages from $edition which now reside in -base"
- tar f $tarball --delete $(paste $manpages) 2>/dev/null
- # content info
- echo "Content of -$edition, including documentation:" > $texmf/texmf-dist/packages.$edition
- sed "/-linux$/d" $TMP/packages.$edition | sort >> $texmf/texmf-dist/packages.$edition
- gzip -9 $texmf/texmf-dist/packages.$edition
-# # remove cm-super minimal config, which resides in -base
-# rm \
-# $texmf/texmf-dist/dvips/cm-super/config-minimal.cm-super \
-# $texmf/texmf-dist/fonts/map/dvips/cm-super/cm-super-minimal-*.map
-
- # add -extra updmap.cfg
- mkdir -p $texmf/texmf-dist/web2c
- mv $updmap.$edition $texmf/texmf-dist/web2c
- tar rf $tarball --owner=0 --group=0 --sort=name \
- --exclude texmf-dist/doc \
- texmf-dist \
- || exit 1
- ;;
- docs)
- # add docs splittet from base from special packages, add packages index
- # content info, this edition contains all docs from -base
- echo "Content of -$edition, documentation for -base:" > $texmf/texmf-dist/packages.$edition
- sort $packages_base.doc >> $texmf/texmf-dist/packages.$edition
- gzip -9 $texmf/texmf-dist/packages.$edition
- tar rf $tarball --owner=0 --group=0 --sort=name \
- texmf-dist/doc/ \
- texmf-dist/packages.$edition.gz \
- || exit 1
- echo "Removing manpages from $edition which now reside in -base"
- tar f $tarball --delete $(paste $manpages) || exit 1
- ;;
-esac
-
-rm -rf texmf-dist
-[ -f $updmap.$edition ] && rm $updmap.$edition
-
-# compress the tarball as everything is in place now
-echo "Compressing $tarball ..."
-[ -f $tarball.xz ] && rm $tarball.xz
-xz -9 -T0 $tarball || exit 1
-md5sum $tarball.xz
-ls -lh $tarball.xz
-echo "Logfile: $logfile"
diff --git a/office/texlive/slack-desc b/office/texlive/slack-desc
deleted file mode 100644
index 5feea19c55..0000000000
--- a/office/texlive/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description.
-# Line up the first '|' above the ':' following the base package name, and
-# the '|' on the right side marks the last column you can put a character in.
-# You must make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':' except on otherwise blank lines.
-
- |-----handy-ruler------------------------------------------------------|
-texlive: texlive (TeX binaries, support files, and formats)
-texlive:
-texlive: This package contains binaries, support files, TeX formats and
-texlive: packages,and other files included in the TeXLive TeX distribution.
-texlive: Included are input files for TeX, runtime configuration files,
-texlive: hyphenation tables, manpages, and the computer modern fonts.
-texlive:
-texlive: SlackBuilds.org has more texmf files and documentation in the
-texlive: texlive-extra and texlive-docs packages.
-texlive:
-texlive:
diff --git a/office/texlive/texlive.SlackBuild b/office/texlive/texlive.SlackBuild
deleted file mode 100644
index f33177ed05..0000000000
--- a/office/texlive/texlive.SlackBuild
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/bin/sh
-
-# TeXLive build script for Slackware
-
-# Copyright 2009, 2017 - 2020 Patrick J. Volkerding, Sebeka, MN, USA
-# Copyright 2009 - 2014 Robby Workman, Northport, AL, USA
-# Copyright 2016 - 2017 Johannes Schoepfer, Germany
-# 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.
-
-# URL: ftp://tug.org/historic/systems/texlive/
-# Testrelease: ftp://tug.org/texlive/Images/test/
-# Upstream stable fixes: svn://tug.org/texlive/branches/branch2020/Build/source
-
-PRGNAM=texlive
-SOURCEVERSION=20200327
-VERSION=${VERSION:-2020.200608}
-BUILD=${BUILD:-2}
-TAG=${TAG:-_SBo}
-
-CWD=$(pwd)
-TMP=${TMP:-/tmp/SBo}
-PKG=$TMP/package-texlive
-OUTPUT=${OUTPUT:-/tmp}
-
-set -e
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
-TEXMFROOT=/usr/share
-
-# NOTE: Using the system version of poppler will require texlive to be
-# recompiled with pretty much every poppler update, as they almost always
-# bump the shared library version. But sometimes you do what you have
-# to do...
-SYSTEMPOPPLER=${SYSTEMPOPPLER:-NO}
-if [ "$SYSTEMPOPPLER" = "NO" ]; then
- POPPLER="--without-system-poppler --without-system-xpdf"
-else
- POPPLER="--with-system-poppler --with-system-xpdf"
-fi
-
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf texlive-$SOURCEVERSION-source
-tar xvf $CWD/texlive-${SOURCEVERSION}-source.tar.xz || exit 1
-cd texlive-$SOURCEVERSION-source || exit 1
-chown -R root:root .
-chmod -R u+w,go-w,a+rX-st .
-
-export LANG=C
-export PATH="$PKG/usr/bin:$PATH"
-export LD_LIBRARY_PATH="$PKG/usr/lib${LIBDIRSUFFIX}:$LD_LIBRARY_PATH"
-
-# set TEXMFROOT and TEXMFLOCAL
-sed -i \
- -e "s|^TEXMFROOT.*|TEXMFROOT = $TEXMFROOT|" \
- -e "s|^TEXMFLOCAL.*|TEXMFLOCAL = \$TEXMFROOT/texmf-local|" \
- texk/kpathsea/texmf.cnf
-
-# prevent compiling Xdvi with libXp
-sed -i 's|-lXp ||' texk/xdvik/configure
-
-mkdir build
-cd build
- CFLAGS="$SLKCFLAGS" \
- CXXFLAGS="$SLKCFLAGS -fpermissive" \
- ../configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --mandir=/usr/man \
- --infodir=/usr/info \
- --with-banner-add=' on Slackware (SlackBuilds.org)' \
- --disable-native-texlive-build \
- --enable-largefile \
- --enable-shared \
- --disable-static \
- --disable-missing \
- --disable-multiplatform \
- --disable-debug \
- --disable-dialog \
- --disable-bibtexu \
- --disable-xz \
- --with-x \
- --disable-dvisvgm \
- --enable-xindy \
- --disable-xindy-docs \
- --disable-xindy-rules \
- --with-clisp-runtime=system \
- --enable-gc=system \
- --with-system-zlib \
- --with-system-libpng \
- --with-system-t1lib \
- --with-system-gd \
- --with-system-freetype2 \
- --with-system-libgs \
- --with-system-icu \
- --with-system-pixman \
- --with-system-cairo \
- --with-system-gmp \
- --with-system-mpfr \
- --with-system-fontconfig \
- --with-system-ncurses \
- --without-system-harfbuzz \
- --disable-aleph \
- --disable-dump-share \
- --disable-linked-scripts \
- $POPPLER \
- --build=$ARCH-slackware-linux || exit 1
-
- make || exit 1
- #make check || exit 1
- make install-strip DESTDIR=$PKG || exit 1
-
-cd ..
-
-# Don't ship .la files:
-rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
-
-# Remove all files which are covered by tlnet
-rm -rf $PKG$TEXMFROOT $PKG/usr/man $PKG/usr/info
-
-# install the tlnet stuff
-mkdir -p $PKG$TEXMFROOT
-tar xvf $CWD/texlive-base-$VERSION.tar.xz -C $PKG$TEXMFROOT || exit 1
-chown -R root:root $PKG
-chmod -R u+w,go-w,a+rX-st $PKG
-
-# use symlinks/scripts from tlnet
-for link in $PKG$TEXMFROOT/texmf-dist/linked_scripts/* ;do \
- if [ -e "$link" ]; then
- ln -sf $TEXMFROOT/texmf-dist/linked_scripts/bin/${link##*/} $PKG/usr/bin/${link##*/}
- else
- mv $link $PKG/usr/bin/${link##*/}
- fi
-done
-mkdir -p $PKG$TEXMFROOT/texmf-dist/bin
-mv $PKG$TEXMFROOT/texmf-dist/linked_scripts/* $PKG$TEXMFROOT/texmf-dist/bin
-mv $PKG$TEXMFROOT/texmf-dist/bin $PKG$TEXMFROOT/texmf-dist/linked_scripts
-
-# set some paths
-sed -i \
- -e "s|^TEXMFROOT.*|TEXMFROOT = $TEXMFROOT|" \
- -e "s|^TEXMFLOCAL.*|TEXMFLOCAL = \$TEXMFROOT/texmf-local|" \
- -e "s|^OSFONTDIR.*|OSFONTDIR = ~/.fonts:/usr/share/fonts|" \
- $PKG$TEXMFROOT/texmf-dist/web2c/texmf.cnf
-
-# disable obsolete aleph/lamed/cslatex/pdfcslatex
-sed -i \
- -e 's|^aleph|#! aleph|' \
- -e 's|^lamed|#! lamed|' \
- -e 's|^cslatex|#! cslatex|' \
- -e 's|^pdfcslatex|#! pdfcslatex|' \
- $PKG$TEXMFROOT/texmf-dist/web2c/fmtutil.cnf
-
-# make ConTeXt work
-sed -i \
- -e "s|selfautoparent:|$TEXMFROOT/|g" \
- -e "s|\(TEXMFLOCAL[ ]*=[ ]*\)[^,]*|\1\"$TEXMFROOT/texmf-local\"|" \
- $PKG$TEXMFROOT/texmf-dist/web2c/texmfcnf.lua
-
-# provide texlive fonts optionally for other system apps
-mkdir -p $PKG/etc/fonts/conf.avail
-cat > $PKG/etc/fonts/conf.avail/09-texlive.conf << EOF
-<?xml version='1.0'?>
-<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
-<fontconfig>
- <dir>$TEXMFROOT/texmf-dist/fonts/opentype</dir>
- <dir>$TEXMFROOT/texmf-dist/fonts/truetype</dir>
-</fontconfig>
-EOF
-
-# Install the docs while we're still here
-mkdir -p $PKG/usr/doc/texlive-$VERSION
-cp -a ChangeLog README* $PKG/usr/doc/texlive-$VERSION
-# Install index of provided tex packages to the docs
-mv $PKG$TEXMFROOT/texmf-dist/packages.base.gz $PKG/usr/doc/texlive-$VERSION
-
-# Put a symlink to $TEXMFROOT/texmf-dist/doc in our Slackware docdir
-ln -sf $TEXMFROOT/texmf-dist/doc $PKG/usr/doc/texlive-$VERSION/doc
-
-# We won't make tlmgr easily available; it's still there, but
-# we'll make it harder to void the warranty :-)
-rm $PKG/usr/bin/tlmgr
-cat $CWD/README.tlpkg > $PKG/usr/doc/texlive-$VERSION/README.tlpkg
-
-# Create some directories to make it clear that they're owned by this package
-mkdir -p $PKG$TEXMFROOT/{texmf-config,texmf-var,texmf-local}
-
-# Use patch for tabu.sty from https://github.com/tabu-fixed/tabu to fix
-# breakage when compiling doxygen:
-( cd $PKG$TEXMFROOT/texmf-dist/tex/latex/tabu
- cat $CWD/patches/tabu.sty.diff | patch -p1 --verbose || exit 1
- ) || exit 1
-
-# Add texlive perl modules
-mkdir -p $PKG/usr/share/perl5
-mv $PKG$TEXMFROOT/texmf-dist/scripts/texlive/TeXLive $PKG/usr/share/perl5/
-
-# Move manual pages to the correct place
-mkdir $PKG/usr/man
-mv $PKG$TEXMFROOT/texmf-dist/doc/man/man1 $PKG/usr/man
-mv $PKG$TEXMFROOT/texmf-dist/doc/man/man5 $PKG/usr/man
-rmdir $PKG$TEXMFROOT/texmf-dist/doc/man
-
-# Handle the man pages
-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
-
-# Handle the GNU info pages
-mv $PKG$TEXMFROOT/texmf-dist/doc/info $PKG/usr
-gzip -9 $PKG/usr/info/*
-
-mkdir -p $PKG/install
-cat $CWD/doinst.sh > $PKG/install/doinst.sh
-cat $CWD/slack-desc > $PKG/install/slack-desc
-
-cd $PKG
-/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/office/texlive/texlive.info b/office/texlive/texlive.info
deleted file mode 100644
index af079541e7..0000000000
--- a/office/texlive/texlive.info
+++ /dev/null
@@ -1,12 +0,0 @@
-PRGNAM="texlive"
-VERSION="2020.200608"
-HOMEPAGE="https://tug.org/texlive/"
-DOWNLOAD="http://slackware.schoepfer.info/slackbuilds/texlive/texlive-20200327-source.tar.xz \
- http://slackware.schoepfer.info/slackbuilds/texlive/texlive-base-2020.200608.tar.xz"
-MD5SUM="02963bd8eae94b278407e86c9604e761 \
- 448c337b359fdfc44321cd7928176b74"
-DOWNLOAD_x86_64=""
-MD5SUM_x86_64=""
-REQUIRES=""
-MAINTAINER="Johannes Schoepfer"
-EMAIL="slackbuilds@schoepfer.info"