summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author B. Watson2020-10-19 21:59:22 +0200
committer Willy Sudiarto Raharjo2020-10-24 03:14:58 +0200
commit149164419c465d313ee25b6a2f0d2fa559c2d116 (patch)
treeee034262151cf8f775be0a4b75b16eb9ed47e045
parentc94707c06d3ef8d856297bc919d6ca242c73ead2 (diff)
downloadslackbuilds-149164419c465d313ee25b6a2f0d2fa559c2d116.tar.gz
office/coolreader: Updated for version 3.2.49.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--office/coolreader/README12
-rw-r--r--office/coolreader/coolreader.SlackBuild101
-rw-r--r--office/coolreader/coolreader.info8
-rw-r--r--office/coolreader/cr3.185
-rw-r--r--office/coolreader/cr3.rst74
-rw-r--r--office/coolreader/inifile.diff21
-rw-r--r--office/coolreader/qt4_settings_ui.diff22
-rw-r--r--office/coolreader/slack-desc4
8 files changed, 262 insertions, 65 deletions
diff --git a/office/coolreader/README b/office/coolreader/README
index e12c827494..ca7de57c79 100644
--- a/office/coolreader/README
+++ b/office/coolreader/README
@@ -5,4 +5,14 @@ CoolReader is an e-book reader for various platforms.
Supported file formats include plain text, HTML, RTF, Microsoft Word
(.doc), Palm Pilot (.prc, .pdb, .pml, .mobi), FB2, and EPUB.
-Note: the executable and man page are called "cr3", not "coolreader".
+Optional dependencies: The default user interface is Qt4, which
+doesn't require anything extra. If you prefer Qt5 or wxWidgets:
+
+qt5 - install qt5, then run: GUI=qt5 ./coolreader.SlackBuild
+
+wx - install wxPython or wxGTK3 (last one installed 'wins'), then run:
+ GUI=wx ./coolreader.SlackBuild
+
+Note: coolreader is "chatty": it logs a lot of meaningless warnings
+and errors to stderr. Unless there's an actual problem with the
+application, you can ignore this stuff.
diff --git a/office/coolreader/coolreader.SlackBuild b/office/coolreader/coolreader.SlackBuild
index ce30ee6681..8bd2795b74 100644
--- a/office/coolreader/coolreader.SlackBuild
+++ b/office/coolreader/coolreader.SlackBuild
@@ -23,6 +23,11 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20201019 bkw:
+# - update for v3.2.49, new homepage.
+# - allow for building qt4, qt5, wx UIs.
+# - replace useless/inaccurate man page with our own.
+
# 20200126 bkw, BUILD=2:
# - take over maintenance
# - i486 => i586
@@ -32,15 +37,10 @@
# - save/load settings (.ini file) to ~/.cr3, not /usr/share/cr3.
PRGNAM=coolreader
-VERSION=${VERSION:-3.0.56}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-3.2.49}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-ORIG_PRGNAM=cr3
-ORIG_VERSION=$VERSION-7
-ORIG_DIRNAME=cr$ORIG_VERSION
-ORIG_FILENAME=${ORIG_PRGNAM}_$VERSION.orig.tar.gz
-
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
@@ -73,48 +73,75 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $ORIG_DIRNAME
-tar xvf $CWD/$ORIG_FILENAME
-cd $ORIG_DIRNAME
-chown -R root:root .
-
-# Fix upstream typo
-sed -i 's,documetn,document,g' cr3qt/src/*.ui cr3qt/src/i18n/*.ts
-
-# Don't try to load/save .ini file from /usr/share
-patch -p1 < $CWD/inifile.diff
+rm -rf $PRGNAM-cr$VERSION
+tar xvf $CWD/$PRGNAM-cr$VERSION.tar.gz
+cd $PRGNAM-cr$VERSION
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# Use bundled libunibreak, ours is too old (3.0).
+# Use bundled fribidi, Pat's is too old (0.19.7).
+sed -i -e '/find_package(libunibreak)/d' \
+ -e '/find_package(FriBidi)/d' \
+ CMakeLists.txt
+
+# Install the docs in the right place for Slackware.
+sed -i "s,share/doc/cr3,doc/$PRGNAM-$VERSION," cr3qt/CMakeLists.txt
+
+# The settings patch for qt4 was made by loading cr3qt/src/settings.ui
+# into Qt Designer and saving it again. Needed because upstream's
+# using a different (older?) version of qt4.
+
+GUI=${GUI:-QT}
+GUI="$( echo $GUI | tr a-z A-Z )"
+case "$GUI" in
+ QT) UI=Qt4
+ patch -p1 < $CWD/qt4_settings_ui.diff ;;
+ QT5) UI=Qt5 ;;
+ WX) # Either 2.8.x or 3.0.x works, be specific in the slack-desc.
+ UI="wxWidgets $( wx-config --version | cut -d. -f1,2)" ;;
+ *) echo "*** Unsupported GUI '$GUI', use one of: QT QT5 WX"
+ exit 1 ;;
+esac
+
+echo "=== Building $UI GUI"
mkdir -p build
cd build
-cmake \
- -D CMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -D CMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
- -D CMAKE_INSTALL_PREFIX=/usr \
- -D LIB_SUFFIX=${LIBDIRSUFFIX} \
- -D CMAKE_BUILD_TYPE=Release \
- -D MAX_IMAGE_SCALE_MUL=2 \
- -D DOC_DATA_COMPRESSION_LEVEL=3 \
- -D DOC_BUFFER_SIZE=0x1400000 \
- -D GUI=QT ..
-make VERBOSE=1
-make install DESTDIR=$PKG
+ cmake \
+ -D USE_UNRAR=1 \
+ -D CMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -D CMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -D CMAKE_INSTALL_PREFIX=/usr \
+ -D LIB_SUFFIX=${LIBDIRSUFFIX} \
+ -D CMAKE_BUILD_TYPE=Release \
+ -D MAX_IMAGE_SCALE_MUL=2 \
+ -D DOC_DATA_COMPRESSION_LEVEL=3 \
+ -D DOC_BUFFER_SIZE=0x1400000 \
+ -D GUI=$GUI ..
+ make VERBOSE=1
+ make install/strip DESTDIR=$PKG
cd ..
-strip $PKG/usr/bin/$ORIG_PRGNAM
-
-mkdir -p $PKG/usr/man
-mv $PKG/usr/share/man/* $PKG/usr/man
+# Upstream's man page doesn't document all the options, and incorrectly
+# refers to the (nonexistent) info page. It's also hardcoded to install
+# to /usr/share/man.
rm -rf $PKG/usr/share/man
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/cr3.1 > $PKG/usr/man/man1/cr3.1.gz
-sed -i '/Icon/s|\.png||' $PKG/usr/share/applications/$ORIG_PRGNAM.desktop
+# Tired of having to remember the binary's called something other than
+# the package and source name.
+ln -s cr3 $PKG/usr/bin/$PRGNAM
+ln -s cr3.1.gz $PKG/usr/man/man1/$PRGNAM.1.gz
+# This dir already exists with GUI=QT or QT5, but not WX.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-mv $PKG/usr/share/doc/$ORIG_PRGNAM/* $PKG/usr/doc/$PRGNAM-$VERSION
-rm -rf $PKG/usr/share/doc
+cp -a README.md cr3gui/COPYING $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
+sed "s,@UI@,$UI," $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
diff --git a/office/coolreader/coolreader.info b/office/coolreader/coolreader.info
index 2a462222f6..93eab170aa 100644
--- a/office/coolreader/coolreader.info
+++ b/office/coolreader/coolreader.info
@@ -1,8 +1,8 @@
PRGNAM="coolreader"
-VERSION="3.0.56"
-HOMEPAGE="https://sourceforge.net/projects/crengine/"
-DOWNLOAD="https://downloads.sourceforge.net/crengine/CoolReader3/cr3_3.0.56.orig.tar.gz"
-MD5SUM="cc221a608a1b5fea2db5a519c14eeb39"
+VERSION="3.2.49"
+HOMEPAGE="https://github.com/buggins/coolreader"
+DOWNLOAD="https://github.com/buggins/coolreader/archive/cr3.2.49/coolreader-cr3.2.49.tar.gz"
+MD5SUM="0a1f72a2799ba454a47e846ad59825c3"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/office/coolreader/cr3.1 b/office/coolreader/cr3.1
new file mode 100644
index 0000000000..fda4cb2375
--- /dev/null
+++ b/office/coolreader/cr3.1
@@ -0,0 +1,85 @@
+.\" Man page generated from reStructuredText.
+.
+.TH CR3 1 "2020-10-19" "3.2.49" "SlackBuilds.org"
+.SH NAME
+cr3 \- coolreader (e-book reader)
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.\" RST source for cr3(1) man page. Convert with:
+.
+.\" rst2man.py cr3.rst > cr3.1
+.
+.\" rst2man.py comes from the SBo development/docutils package.
+.
+.SH SYNOPSIS
+.sp
+cr3 [\fI\-options\fP] [filename]
+.SH DESCRIPTION
+.sp
+CoolReader is an e\-book reader for various platforms.
+.sp
+Supported file formats include plain text, HTML, RTF, Microsoft Word
+(.doc), Palm Pilot (.prc, .pdb, .pml, .mobi), FB2, and EPUB.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B \-\-version
+Output version number.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-?, \-h, \-\-help
+Output usage string.
+.TP
+.B \-\-loglevel=ERROR|WARN|INFO|DEBUG|TRACE
+Set logging level.
+.TP
+.B \-\-logfile=<filename>|stdout|stderr
+Set log file. Default is stderr.
+.UNINDENT
+.SH FILES
+.INDENT 0.0
+.TP
+.B ~/.cr3/
+Per\-user configuration, cache, and bookmarks. It\(aqs not recommended to
+edit \fBcr3.ini\fP by hand.
+.UNINDENT
+.SH COPYRIGHT
+.sp
+See the file /usr/doc/coolreader\-3.2.49/COPYING for license information.
+.SH AUTHORS
+.sp
+cr3 was written by Vadim Lopatin, aka buggins.
+.sp
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+.SH SEE ALSO
+.sp
+The cr3 homepage: \fI\%https://github.com/buggins/coolreader\fP
+.\" Generated by docutils manpage writer.
+.
diff --git a/office/coolreader/cr3.rst b/office/coolreader/cr3.rst
new file mode 100644
index 0000000000..04b3abe02e
--- /dev/null
+++ b/office/coolreader/cr3.rst
@@ -0,0 +1,74 @@
+.. RST source for cr3(1) man page. Convert with:
+.. rst2man.py cr3.rst > cr3.1
+.. rst2man.py comes from the SBo development/docutils package.
+
+.. Note to SBo admins: Please don't include this file in the doc dir
+.. in the package. It's here because it's the source for the man page.
+
+.. |version| replace:: 3.2.49
+.. |date| date::
+
+===
+cr3
+===
+
+--------------------------
+coolreader (e-book reader)
+--------------------------
+
+:Manual section: 1
+:Manual group: SlackBuilds.org
+:Date: |date|
+:Version: |version|
+
+SYNOPSIS
+========
+
+cr3 [*-options*] [filename]
+
+DESCRIPTION
+===========
+
+CoolReader is an e-book reader for various platforms.
+
+Supported file formats include plain text, HTML, RTF, Microsoft Word
+(.doc), Palm Pilot (.prc, .pdb, .pml, .mobi), FB2, and EPUB.
+
+OPTIONS
+=======
+
+--version Output version number.
+
+-?, -h, --help
+ Output usage string.
+
+--loglevel=ERROR|WARN|INFO|DEBUG|TRACE
+ Set logging level.
+
+--logfile=<filename>|stdout|stderr
+ Set log file. Default is stderr.
+
+FILES
+=====
+
+~/.cr3/
+ Per-user configuration, cache, and bookmarks. It's not recommended to
+ edit **cr3.ini** by hand.
+
+COPYRIGHT
+=========
+
+See the file /usr/doc/coolreader-|version|/COPYING for license information.
+
+AUTHORS
+=======
+
+cr3 was written by Vadim Lopatin, aka buggins.
+
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+
+SEE ALSO
+========
+
+The cr3 homepage: https://github.com/buggins/coolreader
diff --git a/office/coolreader/inifile.diff b/office/coolreader/inifile.diff
deleted file mode 100644
index 9290599e69..0000000000
--- a/office/coolreader/inifile.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naur cr3.0.56-7/cr3qt/src/mainwindow.cpp cr3.0.56-7.patched/cr3qt/src/mainwindow.cpp
---- cr3.0.56-7/cr3qt/src/mainwindow.cpp 2012-03-21 01:39:19.000000000 -0400
-+++ cr3.0.56-7.patched/cr3qt/src/mainwindow.cpp 2020-01-26 19:26:09.590595122 -0500
-@@ -79,7 +79,6 @@
- QString bookmarksDir = homeDir + "bookmarks";
- QString histFile = exeDir + "cr3hist.bmk";
- QString histFile2 = homeDir + "cr3hist.bmk";
-- QString iniFile2 = exeDir + "cr3.ini";
- QString iniFile = homeDir + "cr3.ini";
- QString cssFile = homeDir + "fb2.css";
- QString cssFile2 = exeDir + "fb2.css";
-@@ -91,8 +90,7 @@
-
- ldomDocCache::init( qt2cr( cacheDir ), DOC_CACHE_SIZE );
- ui->view->setPropsChangeCallback( this );
-- if ( !ui->view->loadSettings( iniFile ) )
-- ui->view->loadSettings( iniFile2 );
-+ ui->view->loadSettings( iniFile );
- if ( !ui->view->loadHistory( histFile ) )
- ui->view->loadHistory( histFile2 );
- if ( !ui->view->loadCSS( cssFile ) )
diff --git a/office/coolreader/qt4_settings_ui.diff b/office/coolreader/qt4_settings_ui.diff
new file mode 100644
index 0000000000..cf95520bd9
--- /dev/null
+++ b/office/coolreader/qt4_settings_ui.diff
@@ -0,0 +1,22 @@
+--- coolreader-cr3.2.49/cr3qt/src/settings.ui 2020-09-11 07:17:23.000000000 -0400
++++ settings.ui 2020-10-19 12:30:04.557739030 -0400
+@@ -1566,7 +1566,7 @@
+ </item>
+ <item row="12" column="1">
+ <widget class="QComboBox" name="cbFontShaping">
+- <property name="currentText">
++ <property name="currentText" stdset="0">
+ <string>Simple (FreeType only, fastest)</string>
+ </property>
+ <item>
+@@ -1733,8 +1733,8 @@
+ <rect>
+ <x>0</x>
+ <y>0</y>
+- <width>393</width>
+- <height>620</height>
++ <width>387</width>
++ <height>625</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
diff --git a/office/coolreader/slack-desc b/office/coolreader/slack-desc
index ed6f84a707..655f530274 100644
--- a/office/coolreader/slack-desc
+++ b/office/coolreader/slack-desc
@@ -13,7 +13,7 @@ coolreader:
coolreader: Supported file formats include plain text, HTML, RTF, Microsoft Word
coolreader: (.doc), Palm Pilot (.prc, .pdb, .pml, .mobi), FB2, and EPUB.
coolreader:
-coolreader: Homepage: https://sourceforge.net/projects/crengine/
-coolreader:
+coolreader: This package built with the @UI@ user interface.
coolreader:
+coolreader: Homepage: https://sourceforge.net/projects/crengine/
coolreader: