summaryrefslogtreecommitdiff
path: root/app-text/fbreader
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-text/fbreader
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-text/fbreader')
-rw-r--r--app-text/fbreader/Manifest12
-rw-r--r--app-text/fbreader/fbreader-0.99.4-r3.ebuild95
-rw-r--r--app-text/fbreader/fbreader-0.99.4-r4.ebuild91
-rw-r--r--app-text/fbreader/fbreader-0.99.4-r5.ebuild84
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-combined.patch535
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-gcc6.patch11
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-ld-bfd.patch10
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-mimetypes.patch6
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-qreal-cast.patch13
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4-qt5.patch573
-rw-r--r--app-text/fbreader/files/fbreader-0.99.4.patch8
-rw-r--r--app-text/fbreader/metadata.xml10
12 files changed, 1448 insertions, 0 deletions
diff --git a/app-text/fbreader/Manifest b/app-text/fbreader/Manifest
new file mode 100644
index 000000000000..87002ed81ac6
--- /dev/null
+++ b/app-text/fbreader/Manifest
@@ -0,0 +1,12 @@
+AUX fbreader-0.99.4-combined.patch 23589 BLAKE2B 81cb00abe9ba0f40723e6c1cac626916f90eede960d8b191bcb48c8186be8fc3d1fb18954f62e3ba5f15de159034a6060dc7efaf94f9531aabad9f76b6f53658 SHA512 c4dd5237113fa9d54ae3e63a19a06841570e5751108befe4d18ae7b4730628d3a4a5613dd302bc426b14c280f2b5abf9e394aedca821de995efb45ae7b32f632
+AUX fbreader-0.99.4-gcc6.patch 512 BLAKE2B 16e930b4594abbf48879fdbd6f46415a46e10a73c1660bfe44f05922269531c58b11a7c351a3f4fc9b338ce9a1ae2f319eb3750802ddbfac76b09ebcc5a70fee SHA512 79c64750c250e10fa6530ed397a77ed9ebb2b76d12a6c0967cf8739b24f8381c76961e72388d0116f514c71c3cecc04a4945781dc87db3a30a18e4a1afc0315d
+AUX fbreader-0.99.4-ld-bfd.patch 532 BLAKE2B 50a964b7cb79211302e3804f1eae2e54194114d8387f889e8707269d4bba8d9a5acd0718c49593564bcf397c8c0afdbc2773070195dbb28fd3c394057d781f00 SHA512 77c6a0454706f68f5065333c1bbf8456aaf405ae8532019f1d557d5f66d7d0b633d409b320c8ffba50a78d04f4d64c7d655c3b0ee6f87fdf146aa5f04332167d
+AUX fbreader-0.99.4-mimetypes.patch 505 BLAKE2B 6877f9750ed6d4b30b10a83aed47c0e75b76fdb8d6c02a1d70568d3b7b1e24e7d67602c83ef5e5df5c2c3aa462b5800431ba20b9256f9908be79d690cfe5ec55 SHA512 03fd64a802be53bf33c9582d5c2804e0c67809a43db02a2bfbc3e5a15592346cae9ba44333f2f547bcc623bc1d9785ca7a10c77d58a23152a1d3f59328e75d7b
+AUX fbreader-0.99.4-qreal-cast.patch 950 BLAKE2B ae354d03bf2e6efcdb9f16a0bf2272cfe11c62d44683a1d774085eb09c2213482ad747521b38a7d7e7c8167cbf7a5f4bdc86b11530ddb72fe98118fcc19c939d SHA512 260e1966eb5f0bfd42fc3c28fdcdd92d37314d93b31f44e1ec0f94e81ad0084caeaadb69cbd16eb4e8f8b9359534449604845e1b79e63b0dd2eff96b342286d1
+AUX fbreader-0.99.4-qt5.patch 18697 BLAKE2B 241f103b97b87f084c4f35ffb137cc9b6ea3368ddf6f0b4df2037856c5a3401d3687ed809abb0efc2e224bdb3a8d382930681f7896299421ebb7bd0300e0cbca SHA512 9eb8319308a36cada28d6036ee0537433cea03cb59e648c6ad1dd8f4d10a1b05fb879ebd38b1f9b1e149e6a6544aaafb93c52d6a97f4c9fd8905e89b8cf7ae86
+AUX fbreader-0.99.4.patch 472 BLAKE2B a34f27d9f53f3faed5889dcb7a841a1c045e7bd4080f2ae6ae6a949d76e1bc99e31953cd552a1aa8afbe26d64262aead7463432f407532050db1eda5da1517a9 SHA512 486dc74e3cfc6f94f1bf95269e35e866465095efee0cd31b586592fbd780613d4d5d243b809e494da14a69da8e0c5e47e6dd2ca35619616c4497eb0a053ba09d
+DIST fbreader-sources-0.99.4.tgz 2345664 BLAKE2B 29d921a953df98def51740d9b7fed5a7164f5df6410c70daf03f30ba8f77e9aa898d6f50038945155dc46243165860ffaf13abc81f662abccdeb6dc91652b3d5 SHA512 d4b11d7ab03df002ad4212db805b10b80a24ea4384e92122b12c25a3f817a0eb343509ae30e31d68417fd4ce27f77e043235436f0081ff2c785a2830d6211dc7
+EBUILD fbreader-0.99.4-r3.ebuild 2279 BLAKE2B 1e22f5cbdc916be2543a79ccc95c753726e946c56c85e9dcd53c89b643fea39edefda496de67bc603d8c885858802a89e7d09c5d1a4d635fd5a32ff0333e0e24 SHA512 f93ebe20622e94f54b68ecd62d76520d3455595e3433b875d76654479939f34ba21ed80b580c1b46824473e9f927b4349e8a5df37e4b2f350daf824cb07eb27e
+EBUILD fbreader-0.99.4-r4.ebuild 2111 BLAKE2B 955873c4d80c35e8579e97140bc4eab256cff750ef844a68de99418666bb93f61824486c48983ed366993d8496e1d7396d4e8e2c5ebeb11f1513a3ddefb5e8bc SHA512 28195b8b7d246fd7057ba9c30835e263b37932206d07a26fa3f01d240b44c19a58196e575ffaf8fb4e4cdf76d50682ecf97a4b5bca2dc4c18582fdfdea2eb1a2
+EBUILD fbreader-0.99.4-r5.ebuild 1934 BLAKE2B e12e5cdb9714e1f97e6a375c3e64dc65aedd93b9214417e7d3b3f2dfb4b39f53a8cb540cf2636bed5940b202f64ab7f8817d541d32b212ac5a1835656e923fe9 SHA512 48a634082045cdc346d06473db3ac1b17e1ff91451fae50900ef7b19e5a7529b82c683d8ff93435b9d0053f69ccee8e924ec82854b06f213895657cec26aaad6
+MISC metadata.xml 320 BLAKE2B b537c430018e9035438033df51325115040dc2468f03721c678a60c40654ed99be77a154ba34bb6cc1b7afd54191912906a007a50924cefddb2b6bba908eceb8 SHA512 d215791adfc4cb16e4c25d0dfea7dcf6439fa12916d0c0e51be65d62dd8d48bd63c7e983080027101c6cac1220f4e622c580f7ced4dc895e8b4898f14e921539
diff --git a/app-text/fbreader/fbreader-0.99.4-r3.ebuild b/app-text/fbreader/fbreader-0.99.4-r3.ebuild
new file mode 100644
index 000000000000..ab2f47419e79
--- /dev/null
+++ b/app-text/fbreader/fbreader-0.99.4-r3.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib flag-o-matic
+
+DESCRIPTION="E-Book Reader. Supports many e-book formats"
+HOMEPAGE="http://www.fbreader.org/"
+SRC_URI="http://www.fbreader.org/files/desktop/${PN}-sources-${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc x86"
+IUSE="debug"
+
+RDEPEND="
+ app-arch/bzip2
+ dev-libs/expat
+ dev-libs/liblinebreak
+ dev-libs/fribidi
+ dev-db/sqlite
+ net-misc/curl
+ sys-libs/zlib
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtnetwork:5[ssl]
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # Still use linebreak instead of new unibreak
+ sed -e "s:-lunibreak:-llinebreak:" \
+ -i makefiles/config.mk zlibrary/text/Makefile || die "fixing libunibreak failed"
+
+ # Let portage decide about the compiler
+ sed -e "/^CC = /d" \
+ -i makefiles/arch/desktop.mk || die "removing CC line failed"
+
+ # let portage strip the binary
+ sed -e '/@strip/d' \
+ -i fbreader/desktop/Makefile || die
+
+ # Respect *FLAGS
+ sed -e "s/^CFLAGS = -pipe/CFLAGS +=/" \
+ -i makefiles/arch/desktop.mk || die "CFLAGS sed failed"
+ sed -e "/^ CFLAGS +=/ d" \
+ -i makefiles/config.mk || die "CFLAGS sed failed"
+ sed -e "/^ LDFLAGS += -s$/ d" \
+ -i makefiles/config.mk || die "sed failed"
+ sed -e "/^LDFLAGS =$/ d" \
+ -i makefiles/arch/desktop.mk || die "sed failed"
+
+ echo "TARGET_ARCH = desktop" > makefiles/target.mk
+ echo "LIBDIR = /usr/$(get_libdir)" >> makefiles/target.mk
+
+ echo "UI_TYPE = qt4" >> makefiles/target.mk
+ sed -e 's:MOC = moc-qt4:MOC = /usr/bin/moc:' \
+ -i makefiles/arch/desktop.mk || die "updating desktop.mk failed"
+
+ if use debug; then
+ echo "TARGET_STATUS = debug" >> makefiles/target.mk
+ else
+ echo "TARGET_STATUS = release" >> makefiles/target.mk
+ fi
+
+ # bug #452636
+ eapply "${FILESDIR}"/${P}.patch
+ # bug #515698
+ eapply "${FILESDIR}"/${P}-qreal-cast.patch
+ # bug #516794
+ eapply "${FILESDIR}"/${P}-mimetypes.patch
+ # bug #437262
+ eapply "${FILESDIR}"/${P}-ld-bfd.patch
+ # bug #592588
+ eapply -p0 "${FILESDIR}"/${P}-gcc6.patch
+
+ eapply "${FILESDIR}"/${P}-qt5.patch
+ append-cflags -std=c++11
+
+ eapply_user
+}
+
+src_compile() {
+ # bug #484516
+ emake -j1
+}
+
+src_install() {
+ default
+ dosym FBReader /usr/bin/fbreader
+}
diff --git a/app-text/fbreader/fbreader-0.99.4-r4.ebuild b/app-text/fbreader/fbreader-0.99.4-r4.ebuild
new file mode 100644
index 000000000000..a828ea2670c9
--- /dev/null
+++ b/app-text/fbreader/fbreader-0.99.4-r4.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib flag-o-matic
+
+DESCRIPTION="E-Book Reader. Supports many e-book formats"
+HOMEPAGE="http://www.fbreader.org/"
+SRC_URI="http://www.fbreader.org/files/desktop/${PN}-sources-${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
+IUSE="debug"
+
+RDEPEND="
+ app-arch/bzip2
+ dev-libs/expat
+ dev-libs/libunibreak
+ dev-libs/fribidi
+ dev-db/sqlite
+ net-misc/curl
+ sys-libs/zlib
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtnetwork:5[ssl]
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ # Let portage decide about the compiler
+ sed -e "/^CC = /d" \
+ -i makefiles/arch/desktop.mk || die "removing CC line failed"
+
+ # let portage strip the binary
+ sed -e '/@strip/d' \
+ -i fbreader/desktop/Makefile || die
+
+ # Respect *FLAGS
+ sed -e "s/^CFLAGS = -pipe/CFLAGS +=/" \
+ -i makefiles/arch/desktop.mk || die "CFLAGS sed failed"
+ sed -e "/^ CFLAGS +=/ d" \
+ -i makefiles/config.mk || die "CFLAGS sed failed"
+ sed -e "/^ LDFLAGS += -s$/ d" \
+ -i makefiles/config.mk || die "sed failed"
+ sed -e "/^LDFLAGS =$/ d" \
+ -i makefiles/arch/desktop.mk || die "sed failed"
+
+ echo "TARGET_ARCH = desktop" > makefiles/target.mk
+ echo "LIBDIR = /usr/$(get_libdir)" >> makefiles/target.mk
+
+ echo "UI_TYPE = qt4" >> makefiles/target.mk
+ sed -e 's:MOC = moc-qt4:MOC = /usr/bin/moc:' \
+ -i makefiles/arch/desktop.mk || die "updating desktop.mk failed"
+
+ if use debug; then
+ echo "TARGET_STATUS = debug" >> makefiles/target.mk
+ else
+ echo "TARGET_STATUS = release" >> makefiles/target.mk
+ fi
+
+ # bug #452636
+ eapply "${FILESDIR}"/${P}.patch
+ # bug #515698
+ eapply "${FILESDIR}"/${P}-qreal-cast.patch
+ # bug #516794
+ eapply "${FILESDIR}"/${P}-mimetypes.patch
+ # bug #437262
+ eapply "${FILESDIR}"/${P}-ld-bfd.patch
+ # bug #592588
+ eapply -p0 "${FILESDIR}"/${P}-gcc6.patch
+
+ eapply "${FILESDIR}"/${P}-qt5.patch
+ append-cflags -std=c++11
+
+ eapply_user
+}
+
+src_compile() {
+ # bug #484516
+ emake -j1
+}
+
+src_install() {
+ default
+ dosym FBReader /usr/bin/fbreader
+}
diff --git a/app-text/fbreader/fbreader-0.99.4-r5.ebuild b/app-text/fbreader/fbreader-0.99.4-r5.ebuild
new file mode 100644
index 000000000000..7c47fc4ac07a
--- /dev/null
+++ b/app-text/fbreader/fbreader-0.99.4-r5.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils multilib flag-o-matic qmake-utils
+
+DESCRIPTION="E-Book Reader. Supports many e-book formats"
+HOMEPAGE="http://www.fbreader.org/"
+SRC_URI="http://www.fbreader.org/files/desktop/${PN}-sources-${PV}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc x86"
+IUSE="debug"
+
+RDEPEND="
+ app-arch/bzip2
+ dev-libs/expat
+ dev-libs/libunibreak
+ dev-libs/fribidi
+ dev-db/sqlite
+ net-misc/curl
+ sys-libs/zlib
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtnetwork:5[ssl]
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+# bugs #452636, #515698, #516794, #437262, #592588
+PATCHES=( "${FILESDIR}"/${P}-combined.patch )
+
+src_prepare() {
+ default
+
+ append-cflags -std=c++11
+
+ # Let portage decide about the compiler
+ sed -e "/^CC = /d" \
+ -i makefiles/arch/desktop.mk || die "removing CC line failed"
+
+ # let portage strip the binary
+ sed -e '/@strip/d' \
+ -i fbreader/desktop/Makefile || die
+
+ # Respect *FLAGS
+ sed -e "s/^CFLAGS = -pipe/CFLAGS +=/" \
+ -i makefiles/arch/desktop.mk || die "CFLAGS sed failed"
+ sed -e "/^ CFLAGS +=/d" \
+ -i makefiles/config.mk || die "CFLAGS sed failed"
+ sed -e "/^ LDFLAGS += -s$/d" \
+ -i makefiles/config.mk || die "LDFLAGS sed failed"
+ sed -e "/^LDFLAGS =$/d" \
+ -i makefiles/arch/desktop.mk || die "LDFLAGS sed failed"
+
+ # Qt5 moc
+ sed -e "s:MOC = moc-qt4:MOC = $(qt5_get_bindir)/moc:" \
+ -i makefiles/arch/desktop.mk || die "updating desktop.mk failed"
+
+ echo "TARGET_ARCH = desktop" > makefiles/target.mk
+ echo "LIBDIR = /usr/$(get_libdir)" >> makefiles/target.mk
+
+ echo "UI_TYPE = qt4" >> makefiles/target.mk
+
+ if use debug; then
+ echo "TARGET_STATUS = debug" >> makefiles/target.mk
+ else
+ echo "TARGET_STATUS = release" >> makefiles/target.mk
+ fi
+}
+
+src_compile() {
+ # bug #484516
+ emake -j1
+}
+
+src_install() {
+ default
+ dosym FBReader /usr/bin/fbreader
+}
diff --git a/app-text/fbreader/files/fbreader-0.99.4-combined.patch b/app-text/fbreader/files/fbreader-0.99.4-combined.patch
new file mode 100644
index 000000000000..f75c0fdf1e2c
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-combined.patch
@@ -0,0 +1,535 @@
+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/fbreader/desktop/desktop fbreader-0.99.4/fbreader/desktop/desktop
+--- fbreader-0.99.4.orig/fbreader/desktop/desktop 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/fbreader/desktop/desktop 2018-01-11 22:13:58.401219117 +0700
+@@ -22,2 +22,3 @@
+ Icon=FBReader
+ Categories=Office;Viewer;Literature;
++MimeType=application/epub+zip;application/rtf;application/x-fictionbook+xml;application/x-zip-compressed-fb2;application/x-mobipocket-ebook;application/xhtml+xml;text/html;text/plain;
+diff -r -U2 fbreader-0.99.4.orig/fbreader/src/formats/doc/OleStorage.cpp fbreader-0.99.4/fbreader/src/formats/doc/OleStorage.cpp
+--- fbreader-0.99.4.orig/fbreader/src/formats/doc/OleStorage.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/fbreader/src/formats/doc/OleStorage.cpp 2018-01-11 22:18:33.000207569 +0700
+@@ -60,5 +60,5 @@
+ return false;
+ }
+- static const char OLE_SIGN[] = {0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0};
++ static const char OLE_SIGN[] = {(char)0xD0, (char)0xCF, (char)0x11, (char)0xE0, (char)0xA1, (char)0xB1, (char)0x1A, (char)0xE1, 0};
+ if (std::strncmp(oleBuf, OLE_SIGN, 8) != 0) {
+ clear();
+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/filesystem/ZLQtFSManager.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2018-01-11 22:13:28.444220377 +0700
+@@ -49,3 +49,4 @@
+ path = replacement + path.substr(1);
+ }
++ ZLUnixFSManager::normalizeRealPath(path);
+ }
+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/app-text/fbreader/files/fbreader-0.99.4-gcc6.patch b/app-text/fbreader/files/fbreader-0.99.4-gcc6.patch
new file mode 100644
index 000000000000..c6f87a292697
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-gcc6.patch
@@ -0,0 +1,11 @@
+--- fbreader/src/formats/doc/OleStorage.cpp 2012-11-30 13:41:25.000000000 +0100
++++ fbreader/src/formats/doc/OleStorage.cpp-new 2016-08-31 17:23:18.232536401 +0200
+@@ -59,7 +59,7 @@
+ clear();
+ return false;
+ }
+- static const char OLE_SIGN[] = {0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1, 0};
++ static const char OLE_SIGN[] = {(char)0xD0, (char)0xCF, (char)0x11, (char)0xE0, (char)0xA1, (char)0xB1, (char)0x1A, (char)0xE1, 0};
+ if (std::strncmp(oleBuf, OLE_SIGN, 8) != 0) {
+ clear();
+ return false;
diff --git a/app-text/fbreader/files/fbreader-0.99.4-ld-bfd.patch b/app-text/fbreader/files/fbreader-0.99.4-ld-bfd.patch
new file mode 100644
index 000000000000..ab872edf17cd
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-ld-bfd.patch
@@ -0,0 +1,10 @@
+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 2016-08-31 19:06:35.011708982 +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 --git a/app-text/fbreader/files/fbreader-0.99.4-mimetypes.patch b/app-text/fbreader/files/fbreader-0.99.4-mimetypes.patch
new file mode 100644
index 000000000000..0e4a2935d442
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-mimetypes.patch
@@ -0,0 +1,6 @@
+diff -r -U1 fbreader-0.99.4.orig/fbreader/desktop/desktop fbreader-0.99.4/fbreader/desktop/desktop
+--- fbreader-0.99.4.orig/fbreader/desktop/desktop 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/fbreader/desktop/desktop 2014-07-10 20:56:33.527638562 +0700
+@@ -23 +23,2 @@
+ Categories=Office;Viewer;Literature;
++MimeType=application/epub+zip;application/rtf;application/x-fictionbook+xml;application/x-zip-compressed-fb2;application/x-mobipocket-ebook;application/xhtml+xml;text/html;text/plain;
diff --git a/app-text/fbreader/files/fbreader-0.99.4-qreal-cast.patch b/app-text/fbreader/files/fbreader-0.99.4-qreal-cast.patch
new file mode 100644
index 000000000000..ffd21b2924f7
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-qreal-cast.patch
@@ -0,0 +1,13 @@
+diff -r -U1 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 2014-07-10 19:18:17.002886537 +0700
+@@ -88,3 +88,3 @@
+ 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));
+ }
+@@ -150,3 +150,3 @@
+ 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);
diff --git a/app-text/fbreader/files/fbreader-0.99.4-qt5.patch b/app-text/fbreader/files/fbreader-0.99.4-qt5.patch
new file mode 100644
index 000000000000..c88e6db79d3d
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4-qt5.patch
@@ -0,0 +1,573 @@
+diff --git a/makefiles/arch/desktop.mk b/makefiles/arch/desktop.mk
+index 4267113..3b46102 100644
+--- a/makefiles/arch/desktop.mk
++++ b/makefiles/arch/desktop.mk
+@@ -12,29 +12,11 @@ AR = ar rsu
+ LD = g++
+
+ CFLAGS += -fno-exceptions -Wall -Wno-ctor-dtor-privacy -W -DLIBICONV_PLUG
+-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 = /usr/lib/qt5/bin/moc
++QTINCLUDE = $(shell pkg-config --cflags Qt5Gui Qt5Widgets Qt5Network)
++UILIBS = $(shell pkg-config --libs Qt5Gui Qt5Widgets Qt5Network)
+
+ RM = rm -rvf
+ RM_QUIET = rm -rf
+diff --git a/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp b/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp
+index 47067d3..119a5ee 100644
+--- a/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp
++++ b/zlibrary/ui/src/qt4/network/ZLQtNetworkManager.cpp
+@@ -24,7 +24,9 @@
+ #include <QtCore/QDir>
+ #include <QtCore/QList>
+ #include <QtCore/QTimer>
++#include <QtCore/QUrlQuery>
+
++#include <QtNetwork/QNetworkCookie>
+ #include <QtNetwork/QNetworkRequest>
+ #include <QtNetwork/QNetworkReply>
+ #include <QtNetwork/QNetworkProxy>
+@@ -149,12 +151,12 @@ void ZLQtNetworkManager::prepareReply(ZLQtNetworkReplyScope &scope, QNetworkRequ
+ QNetworkReply *reply = NULL;
+ 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 {
+ reply = const_cast<QNetworkAccessManager&>(myManager).get(networkRequest);
+diff --git a/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp b/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp
+index a3e5b35..ab41684 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp
++++ b/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.cpp
+@@ -17,14 +17,14 @@
+ * 02110-1301, USA.
+ */
+
+-#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 --git a/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp b/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp
+index 472f05f..b9809c8 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp
++++ b/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.cpp
+@@ -17,10 +17,10 @@
+ * 02110-1301, USA.
+ */
+
+-#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 --git a/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp b/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp
+index 1cddaf9..2b65cc1 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp
++++ b/zlibrary/ui/src/qt4/tree/ZLQtSearchField.cpp
+@@ -18,9 +18,9 @@
+ */
+
+ #include <QtCore/QDebug>
+-#include <QtGui/QStyle>
+-#include <QtGui/QCompleter>
+-#include <QtGui/QStringListModel>
++#include <QtCore/QStringListModel>
++#include <QtWidgets/QStyle>
++#include <QtWidgets/QCompleter>
+
+ #include <ZLibrary.h>
+ #include <ZLFile.h>
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp
+index 6de2c72..d942d47 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.cpp
+@@ -19,12 +19,12 @@
+
+ #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>
+ #include <ZLibrary.h>
+diff --git a/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h b/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h
+index 4f09cfc..51f1545 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h
++++ b/zlibrary/ui/src/qt4/tree/ZLQtItemsListWidget.h
+@@ -20,12 +20,12 @@
+ #ifndef __ZLQTITEMSLISTWIDGET_H__
+ #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 --git a/zlibrary/ui/src/qt4/application/LineEditParameter.cpp b/zlibrary/ui/src/qt4/application/LineEditParameter.cpp
+index dfcbc0b..bd2689e 100644
+--- a/zlibrary/ui/src/qt4/application/LineEditParameter.cpp
++++ b/zlibrary/ui/src/qt4/application/LineEditParameter.cpp
+@@ -17,9 +17,9 @@
+ * 02110-1301, USA.
+ */
+
+-#include <QtGui/QBoxLayout>
+-#include <QtGui/QLineEdit>
+-#include <QtGui/QToolBar>
++#include <QtWidgets/QBoxLayout>
++#include <QtWidgets/QLineEdit>
++#include <QtWidgets/QToolBar>
+ #include <QtGui/QKeyEvent>
+
+ #include "ZLQtApplicationWindow.h"
+diff --git a/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp b/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp
+index 6241514..e0b143b 100644
+--- a/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp
++++ b/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.cpp
+@@ -17,17 +17,17 @@
+ * 02110-1301, USA.
+ */
+
+-#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>
+
+ #include <ZLibrary.h>
+diff --git a/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h b/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h
+index 3b4fd3a..42ff2c8 100644
+--- a/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h
++++ b/zlibrary/ui/src/qt4/application/ZLQtApplicationWindow.h
+@@ -22,8 +22,8 @@
+
+ #include <map>
+
+-#include <QtGui/QMainWindow>
+-#include <QtGui/QAction>
++#include <QtWidgets/QMainWindow>
++#include <QtWidgets/QAction>
+ #include <QtGui/QCursor>
+
+ class QDockWidget;
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp
+index 24eb897..c17e86c 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.cpp
+@@ -17,8 +17,8 @@
+ * 02110-1301, USA.
+ */
+
+-#include <QtGui/QApplication>
+-#include <QtGui/QPushButton>
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QPushButton>
+
+ #include <ZLDialogManager.h>
+
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h b/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h
+index 068039d..811cec8 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtDialog.h
+@@ -20,8 +20,8 @@
+ #ifndef __ZLQTDIALOG_H__
+ #define __ZLQTDIALOG_H__
+
+-#include <QtGui/QDialog>
+-#include <QtGui/QLayout>
++#include <QtWidgets/QDialog>
++#include <QtWidgets/QLayout>
+
+ #include <ZLDialog.h>
+
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp
+index e8ff422..352c350 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtDialogContent.cpp
+@@ -17,10 +17,10 @@
+ * 02110-1301, USA.
+ */
+
+-#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"
+ #include "ZLQtOptionView.h"
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp
+index d5eb4d4..2fc769b 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtDialogManager.cpp
+@@ -17,11 +17,11 @@
+ * 02110-1301, USA.
+ */
+
+-#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"
+ #include "ZLQtDialog.h"
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp
+index ec9e73c..a50a40d 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtOpenFileDialog.cpp
+@@ -17,7 +17,7 @@
+ * 02110-1301, USA.
+ */
+
+-#include <QtGui/QFileDialog>
++#include <QtWidgets/QFileDialog>
+
+ #include "ZLQtOpenFileDialog.h"
+
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp
+index 48a1b8f..90d50fb 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionView.cpp
+@@ -19,16 +19,16 @@
+
+ #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>
+ #include <ZLDialogManager.h>
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp
+index f6c36fb..7fe855a 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.cpp
+@@ -17,11 +17,11 @@
+ * 02110-1301, USA.
+ */
+
+-#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>
+
+ #include <ZLDialogManager.h>
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h
+index e38b62a..ad26fba 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtOptionsDialog.h
+@@ -20,9 +20,9 @@
+ #ifndef __ZLQTOPTIONSDIALOG_H__
+ #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 --git a/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp b/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp
+index 98e469e..5a1d574 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.cpp
+@@ -19,11 +19,11 @@
+
+ #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>
+
+ #include "../dialogs/ZLQtDialogManager.h"
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h b/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h
+index df6c73b..837bce5 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtProgressDialog.h
+@@ -22,11 +22,11 @@
+
+ #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>
+
+ #include <ZLProgressDialog.h>
+diff --git a/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h b/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h
+index 9cf7c47..03f1223 100644
+--- a/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h
++++ b/zlibrary/ui/src/qt4/dialogs/ZLQtTreeDialog.h
+@@ -24,12 +24,12 @@
+ #include <QtCore/QSet>
+ #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 --git a/zlibrary/ui/src/qt4/library/ZLQApplication.h b/zlibrary/ui/src/qt4/library/ZLQApplication.h
+index c08c536..a714fa9 100644
+--- a/zlibrary/ui/src/qt4/library/ZLQApplication.h
++++ b/zlibrary/ui/src/qt4/library/ZLQApplication.h
+@@ -20,7 +20,7 @@
+ #ifndef __ZLQAPPLICATION_H__
+ #define __ZLQAPPLICATION_H__
+
+-#include <QtGui/QApplication>
++#include <QtWidgets/QApplication>
+
+ class ZLQApplication : public QApplication {
+
+diff --git a/zlibrary/ui/src/qt4/library/ZLibrary.cpp b/zlibrary/ui/src/qt4/library/ZLibrary.cpp
+index 9648e95..a544031 100644
+--- a/zlibrary/ui/src/qt4/library/ZLibrary.cpp
++++ b/zlibrary/ui/src/qt4/library/ZLibrary.cpp
+@@ -19,7 +19,7 @@
+
+ #include <QtCore/QTextCodec>
+ #include <QtCore/QFile>
+-#include <QtGui/QApplication>
++#include <QtWidgets/QApplication>
+ #include <QtGui/QFileOpenEvent>
+
+ #include <ZLApplication.h>
+@@ -72,7 +72,7 @@ bool ZLQApplication::event(QEvent *e) {
+ void ZLQtLibraryImplementation::init(int &argc, char **&argv) {
+ new ZLQApplication(argc, argv);
+
+- QTextCodec::setCodecForCStrings(QTextCodec::codecForName("utf-8"));
++ QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
+
+ ZLibrary::parseArguments(argc, argv);
+
+diff --git a/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h b/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h
+index cdaef01..a259c65 100644
+--- a/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h
++++ b/zlibrary/ui/src/qt4/tree/QtWaitingSpinner.h
+@@ -3,7 +3,7 @@
+
+ #include <QtCore/QTimer>
+
+-#include <QtGui/QWidget>
++#include <QtWidgets/QWidget>
+ #include <QtGui/QColor>
+
+ class QtWaitingSpinner : public QWidget {
+diff --git a/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h b/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h
+index 1b8ebcc..6f3b4e3 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h
++++ b/zlibrary/ui/src/qt4/tree/ZLQtPreviewWidget.h
+@@ -20,11 +20,11 @@
+ #ifndef __ZLQTPREVIEWWIDGET_H__
+ #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>
+
+ #include <ZLTreePageNode.h>
+diff --git a/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h b/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h
+index f6e174c..c360965 100644
+--- a/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h
++++ b/zlibrary/ui/src/qt4/tree/ZLQtSearchField.h
+@@ -21,8 +21,8 @@
+ #define __ZLQTSEARCHFIELD_H__
+
+ #include <QtCore/QSet>
+-#include <QtGui/QLabel>
+-#include <QtGui/QLineEdit>
++#include <QtWidgets/QLabel>
++#include <QtWidgets/QLineEdit>
+
+ #include "QtWaitingSpinner.h"
+ #include "ZLQtItemsListWidget.h"
+diff --git a/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp b/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp
+index 4f5d196..615050c 100644
+--- a/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp
++++ b/zlibrary/ui/src/qt4/view/ZLQtViewWidget.cpp
+@@ -19,8 +19,8 @@
+
+ #include <algorithm>
+
+-#include <QtGui/QLayout>
+-#include <QtGui/QScrollBar>
++#include <QtWidgets/QLayout>
++#include <QtWidgets/QScrollBar>
+ #include <QtGui/QPainter>
+ #include <QtGui/QPixmap>
+ #include <QtGui/QMouseEvent>
+@@ -185,11 +185,11 @@ void ZLQtViewWidget::repaint() {
+
+ 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 --git a/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h b/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h
+index 6fabf00..ccec1e3 100644
+--- a/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h
++++ b/zlibrary/ui/src/qt4/view/ZLQtViewWidget.h
+@@ -20,7 +20,7 @@
+ #ifndef __ZLQTVIEWWIDGET_H__
+ #define __ZLQTVIEWWIDGET_H__
+
+-#include <QtGui/QWidget>
++#include <QtWidgets/QWidget>
+
+ #include "../../../../core/src/view/ZLViewWidget.h"
+ #include <ZLApplication.h>
diff --git a/app-text/fbreader/files/fbreader-0.99.4.patch b/app-text/fbreader/files/fbreader-0.99.4.patch
new file mode 100644
index 000000000000..deb90228301d
--- /dev/null
+++ b/app-text/fbreader/files/fbreader-0.99.4.patch
@@ -0,0 +1,8 @@
+diff -r -U2 fbreader-0.99.4.orig/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp
+--- fbreader-0.99.4.orig/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2012-11-30 19:41:25.000000000 +0700
++++ fbreader-0.99.4/zlibrary/ui/src/qt4/filesystem/ZLQtFSManager.cpp 2013-02-21 13:30:31.000000000 +0700
+@@ -49,3 +49,4 @@
+ path = replacement + path.substr(1);
+ }
++ ZLUnixFSManager::normalizeRealPath(path);
+ }
diff --git a/app-text/fbreader/metadata.xml b/app-text/fbreader/metadata.xml
new file mode 100644
index 000000000000..6eb5f614141b
--- /dev/null
+++ b/app-text/fbreader/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>grozin@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ FBReader is an e-book reader for various platforms.
+ </longdescription>
+</pkgmetadata>