Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 574464 - [qt overlay] app-text/goldendict-9999: add Qt5 support
Summary: [qt overlay] app-text/goldendict-9999: add Qt5 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-11 18:32 UTC by Gleb
Modified: 2020-12-12 07:01 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
GoldenDict ebuild with Qt5 support (goldendict-9999.ebuild,2.25 KB, text/plain)
2016-02-12 17:16 UTC, Gleb
Details
Patch for Qt5 build (goldendict-qtsingleapplication-unbundle-qt5.patch,414 bytes, patch)
2016-02-12 17:19 UTC, Gleb
Details | Diff
goldendict-9999 with qt5 support v2 (fixed deps) (goldendict-9999.ebuild,2.15 KB, text/plain)
2016-02-19 12:53 UTC, Gleb
Details
goldendict-9999 with qt5 support v3 (new ebuild w/o usex) (goldendict-9999.ebuild,2.01 KB, text/plain)
2016-08-28 11:12 UTC, Gleb
Details
goldendict-qtsingleapplication-unbundle for v3 ebuild (goldendict-qtsingleapplication-unbundle.patch,414 bytes, patch)
2016-08-28 11:14 UTC, Gleb
Details | Diff
goldendict-9999 with qt5 support v4 (libav support) (goldendict-9999.ebuild,2.25 KB, text/plain)
2016-09-10 08:19 UTC, Gleb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gleb 2016-02-11 18:32:40 UTC
Hello!

GoldenDict has a very strange way of developemnt. Version 1.5 is in RC stage since 2013. Current final version (1.0.1) supports only Qt4, but upstream version supports Qt5. It placed in different git branch named "qt4x5" (periodically merged from master), here's the URL:
https://github.com/goldendict/goldendict/tree/qt4x5

It would be great to have qt5 use flag, it also can help it future transition to a Qt5.

I found that Qt deps are pretty clear in goldendict.pro file:
https://github.com/goldendict/goldendict/blob/qt4x5/goldendict.pro
Comment 1 Gleb 2016-02-11 19:04:23 UTC
I built it without ebuild, just made a git clone of specific branch (qt4x5).

I have almost all amd64 stable pacakges with few exceptions, Qt 5.5.1, Kernel 4.4.1.

dev-qt/qtconcurrent-5.5.1
dev-qt/qtcore-5.5.1-r1
dev-qt/qtdbus-5.5.1
dev-qt/qtdeclarative-5.5.1-r1
dev-qt/qtgui-5.5.1
dev-qt/qthelp-5.5.1-r1
dev-qt/qtmultimedia-5.5.1-r2
dev-qt/qtnetwork-5.5.1
dev-qt/qtopengl-5.5.1
dev-qt/qtprintsupport-5.5.1
dev-qt/qtsql-5.5.1
dev-qt/qtsvg-5.5.1-r1
dev-qt/qttest-5.5.1
dev-qt/qtwebkit-5.5.1-r1
dev-qt/qtwidgets-5.5.1-r1
dev-qt/qtx11extras-5.5.1
dev-qt/qtxml-5.5.1
dev-qt/qtxmlpatterns-5.5.1-r1

I used qmake from /usr/lib64/qt5/bin/qmake

GoldenDict runs normally, old settings works OK, no huge issues that can be easily detected. Playing sound is also works.
Comment 2 Gleb 2016-02-12 17:16:25 UTC
Created attachment 425338 [details]
GoldenDict ebuild with Qt5 support
Comment 3 Gleb 2016-02-12 17:19:56 UTC
Created attachment 425340 [details, diff]
Patch for Qt5 build
Comment 4 Gleb 2016-02-12 17:20:02 UTC
Hello!

I created ebuilld for GoldenDict with Qt5 support, it also now properly handle linguas support (also it was extended to a full list that available in repository).

Locale handling code was taken from smtube ebuild (here: http://gentoo.tnnet.fi/gentoo-portage/media-video/smtube/smtube-16.1.0.ebuild), it looks pretty close to what I got.

It properly build and installs both Qt4 and Qt5 version. Also, new patch for qtsingleapplication for Qt5 versions is also attached.

I would like to have some feedback for this.
Comment 5 Gleb 2016-02-15 16:04:13 UTC
I forgot about Phonon in ebuild. It looks like it is no longer necessary for GoldenDict, instead app uses ffmpeg as internal player and has an option to set external player. There's also an option in build instructions which disables internal player. It also applies to Qt4 version.[1]

According to build manual, it should be done with:
    qmake "DISABLE_INTERNAL_PLAYER=1"

Othwerise, ffmpeg dependency is required.

Also, there's additional libraries and features that can be used with GoldenDict: libtiff, zim dictionaries (liblzma), Chinese conversion (libopencc).

[1]: https://github.com/goldendict/goldendict/pull/293
Comment 6 Gleb 2016-02-19 12:53:55 UTC
Created attachment 425908 [details]
goldendict-9999 with qt5 support v2 (fixed deps)

This is a new version where I removed phonon dependency from Qt5 version. It only may be required by Qt4 version. ffmpeg dependency added.
Comment 7 Michael Palimaka (kensington) gentoo-dev 2016-03-17 17:43:46 UTC
usex in global scope is banned in later EAPIs, so I suggest making the ebuild qt5-only. What do you think?
Comment 8 Gleb 2016-03-19 05:42:39 UTC
Well, if that's necessary, then it's OK. I have no problems with Qt5 build since I use this ebuild.
Comment 9 Gleb 2016-05-04 14:00:30 UTC
There's a big news in project development.

First of all, there's no separate branches for different Qt versions anymore. master branch should build on Qt4 or Qt5.

Second, it seems that project is moving to a new stable version 1.5 because new RC2 is appeared recently. I hope that it won't take additional 3 or more years to make final version.

Source: https://github.com/goldendict/goldendict/commit/b6622271b61af466bb58c2ed464556baea6a5a90
https://github.com/goldendict/goldendict/releases/tag/1.5.0-RC2

The only issue I see is that QtWebKit is deprecated already, but still is in use. I read comments on another website where developers discuss it, they said that QtWebEngine has some issues and it is not possible to migrate to it right now.
Comment 10 Perfect Gentleman 2016-05-05 09:09:07 UTC
(In reply to Gleb from comment #9)
> The only issue I see is that QtWebKit is deprecated already, but still is in
> use. I read comments on another website where developers discuss it, they
> said that QtWebEngine has some issues and it is not possible to migrate to
> it right now.

For now GoldenDict don't use qtwebengine
Comment 11 Gleb 2016-05-05 14:49:36 UTC
(In reply to Perfect Gentleman from comment #10)
> (In reply to Gleb from comment #9)
> > The only issue I see is that QtWebKit is deprecated already, but still is in
> > use. I read comments on another website where developers discuss it, they
> > said that QtWebEngine has some issues and it is not possible to migrate to
> > it right now.
> 
> For now GoldenDict don't use qtwebengine

This is exactly what I meant.
Comment 12 tman 2016-08-27 19:03:49 UTC
 # ebuild goldendict-9999.ebuild digest
 * ERROR: app-text/goldendict-9999::lokal failed (depend phase):
 *   usex() calls are not allowed in global scope
 * 
 * Call stack:
 *                ebuild.sh, line 606:  Called source '/mnt/portage/local/local-overlay/app-text/goldendict/goldendict-9999.ebuild'
 *   goldendict-9999.ebuild, line  13:  Called usex 'qt5' 'qt4x5' 'master'
 *            eutils.eclass, line  78:  Called die
 * The specific snippet of code:
 *   #			echo "${i}"
 * 
 * If you need support, post the output of `emerge --info '=app-text/goldendict-9999::lokal'`,
 * the complete build log and the output of `emerge -pqv '=app-text/goldendict-9999::lokal'`.
 * Working directory: '/usr/lib64/python3.4/site-packages'
 * S: '/var/tmp/portage/app-text/goldendict-9999/work/goldendict-9999
Comment 13 Gleb 2016-08-28 11:12:00 UTC
Created attachment 444310 [details]
goldendict-9999 with qt5 support v3 (new ebuild w/o usex)

Current master branch contains both qt4 and qt5 versions. Old ebuild depends on different branches so might not work because contains old version and not all changes. Here's new ebuild which is not using "usex" and depends on a single master branch.
Comment 14 Gleb 2016-08-28 11:14:30 UTC
Created attachment 444312 [details, diff]
goldendict-qtsingleapplication-unbundle for v3 ebuild

Latest patch for new v3 ebuild.
Comment 15 tman 2016-08-28 18:20:14 UTC
 # emerge goldendict -av

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] dev-libs/eb-4.4.1-r1::gentoo  USE="ipv6 nls -threads" 429 KiB
[ebuild  N     ] dev-qt/qthelp-5.6.1:5/5.6::gentoo  USE="-debug {-test}" 0 KiB
[ebuild  N     ] media-video/ffmpeg-2.8.7:0/54.56.56::gentoo  USE="X aac alsa bzip2 encode fontconfig gnutls gpl hardcoded-tables iconv jack jpeg2k libass mp3 network opengl oss postproc pulseaudio sdl theora threads truetype vaapi vdpau vorbis wavpack x264 xcb xvid zlib -aacplus (-altivec) -amr -amrenc (-armv5te) (-armv6) (-armv6t2) (-armvfp) -bluray -bs2b -cdio -celt -cpudetection -debug -doc -examples -faac -fdk -flite -frei0r -fribidi -gme -gsm -iec61883 -ieee1394 -ladspa -libcaca -libressl -librtmp -libsoxr -libv4l -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) -modplug (-neon) -openal -openssl -opus -pic -quvi -samba -schroedinger -snappy -speex -ssh -static-libs {-test} -twolame -v4l -vpx -webp -x265 -zvbi" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3 -3dnow -3dnowext -avx -avx2 -fma3 -fma4 -sse4_1 -sse4_2 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" 8.381 KiB
[ebuild  N    *] app-text/goldendict-9999::lokal  USE="qt5 -debug" LINGUAS="-ar_SA -ay_WI -be_BY -be_BY@latin -bg_BG -cs_CZ -de_DE -el_GR -es_AR -es_BO -es_ES -fa_IR -fr_FR -it_IT -ja_JP -ko_KR -lt_LT -mk_MK -nl_NL -pl_PL -pt_BR -qu_WI -ru_RU -sk_SK -sq_AL -sr_SR -sv_SE -tg_TJ -tk_TM -tr_TR -uk_UA -vi_VN -zh_CN -zh_TW" 0 KiB
[blocks B      ] media-video/ffmpeg:0 ("media-video/ffmpeg:0" is blocking media-video/libav-11.7, media-libs/libpostproc-10.20140517-r1)
[blocks B      ] media-libs/libpostproc ("media-libs/libpostproc" is blocking media-video/ffmpeg-2.8.7)

Total: 4 packages (4 new), Size of downloads: 8.809 KiB
Conflict: 2 blocks (2 unsatisfied)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (media-video/ffmpeg-2.8.7:0/54.56.56::gentoo, ebuild scheduled for merge) pulled in by
    media-video/ffmpeg required by (app-text/goldendict-9999:0/0::lokal, ebuild scheduled for merge)

  (media-video/libav-11.7:0/11::gentoo, installed) pulled in by
    media-video/libav:0/11= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-9:0/11=[x264,mp3,encode,theora,jpeg2k] required by (media-gfx/blender-2.76b:0/0::media-overlay, installed)
    media-video/libav:0/11=[encode,x264,xvid,vpx,mp3,theora] required by (media-libs/libopenshot-0.1.1:0/0::gentoo, installed)
    media-video/libav:=[encode,x264,xvid,vpx,mp3,theora] required by (media-libs/libopenshot-0.1.1:0/0::gentoo, installed)
    >=media-video/libav-11:0= required by (media-video/ffmpegthumbnailer-2.0.10:0/0::gentoo, installed)
    >=media-video/libav-9.12[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?,X?,encode?,gsm?,jpeg2k?,mp3?,opus?,sdl?,speex?,theora?,threads?,truetype?,vaapi?,vdpau?,x264?] (>=media-video/libav-9.12[abi_x86_32(-),abi_x86_64(-),X,encode,jpeg2k,mp3,sdl,theora,threads,truetype,vaapi,vdpau,x264]) required by (virtual/ffmpeg-9-r2:0/0::gentoo, installed)
    >=media-video/libav-11:0/11= required by (media-video/ffmpegthumbnailer-2.0.10:0/0::gentoo, installed)
    media-video/libav:0= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    media-video/libav:0=[vaapi] required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-11:0/11= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-9:0=[x264,mp3,encode,theora,jpeg2k?] (>=media-video/libav-9:0=[x264,mp3,encode,theora,jpeg2k]) required by (media-gfx/blender-2.76b:0/0::media-overlay, installed)
    media-video/libav:0/11=[vaapi] required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-11:0=[encode?,threads,vaapi?,vdpau?] (>=media-video/libav-11:0=[encode,threads,vaapi,vdpau]) required by (media-video/mpv-0.19.0:0/0::gentoo, installed)
    >=media-video/libav-10:0= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-11:0= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-11:0/11=[encode,threads,vaapi,vdpau] required by (media-video/mpv-0.19.0:0/0::gentoo, installed)
    >=media-video/libav-10:0/11= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    >=media-video/libav-0.8.2-r2:0/11= required by (media-libs/libpostproc-10.20140517-r1:0/0::gentoo, installed)
    >=media-video/libav-0.8.2-r2:0= required by (media-libs/libpostproc-10.20140517-r1:0/0::gentoo, installed)

  (media-libs/libpostproc-10.20140517-r1:0/0::gentoo, installed) pulled in by
    media-libs/libpostproc:0/0= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)
    media-libs/libpostproc:0= required by (media-video/vlc-2.2.4:0/5-8::gentoo, installed)


For more information about Blocked Packages, please refer to the following
section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

https://wiki.gentoo.org/wiki/Handbook:X86/Working/Portage#Blocked_packages

-----------------------------


can u modify something so it would works also with libav?
Comment 16 Gleb 2016-09-10 08:19:08 UTC
Created attachment 445390 [details]
goldendict-9999 with qt5 support v4 (libav support)

TL;DR: ffmpeg/libav use flags; external player w/o ffmpeg/libav useflags; clean sources before compiling in case of config changes.

Here's new ebuild with libav and ffmpeg use flags. It now can be compiled with internal player disabled (so ffmpeg/libav and libao won't be needed) if ffmpeg and libav useflags is NOT selected.

It has one problem which I didn't find how to solve: if first build was made without ffmpeg and libav, then git src directory with GoldenDict sources must be removed (actually `make clean` is required after config changes as homepage states). Is there a way to invoke `make clean` command in ebuild? This problem only relevant to git sources for 9999 ebuild.

If internal player is disabled then external player can be used (no deps here, default command is mplayer). Is it necessary to handle this in use flags? There's a lot of players such as mpv, mplayer, mplayer2, vlc, etc. If none of them are installed then message "command not found" appears.

I didn't check building with libav and cannot guarantee that it will work. If this won't work then simply disable libav and ffmpeg and use external player.

One more thing: libao required for internal player only, so I placed it inside ffmpeg/libav conditional statement. I'm not sure if this is corret way to handle so any advices would be helpful.
Comment 17 Michael Palimaka (kensington) gentoo-dev 2016-10-28 17:15:45 UTC
Thanks for your work, I've incorporated it along with some other changes into git.

https://gitweb.gentoo.org/proj/qt.git/commit/?id=1ea676d637f96fbf715e19c30e3dc8b4deb5f474