1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PLOCALES
="ar_SA ay_BO be_BY bg_BG crowdin cs_CZ de_CH de_DE el_GR eo_UY es_AR es_BO es_ES fa_IR fi_FI fr_FR hi_IN ie_001 it_IT ja_JP jbo_EN ko_KR lt_LT mk_MK nl_NL pl_PL pt_BR pt_PT qt_extra_es qt_extra_it qt_extra_lt qtwebengine_zh_CN qu_PE ru_RU sk_SK sq_AL sr_SP sv_SE tg_TJ tk_TM tr_TR uk_UA vi_VN zh_CN zh_TW"
7 inherit desktop qmake-utils flag-o-matic xdg-utils plocale
9 MY_PV
="24.05.05-LiXia.ecd1138c"
11 DESCRIPTION
="Feature-rich dictionary lookup program (qtwebengine fork)"
12 HOMEPAGE
="https://xiaoyifang.github.io/goldendict-ng/"
13 SRC_URI
="https://github.com/xiaoyifang/goldendict-ng/archive/v${MY_PV}.tar.gz"
15 S
="${WORKDIR}/goldendict-ng-${MY_PV}"
19 IUSE
="debug ffmpeg opencc multimedia wayland xapian zim"
25 >=app-text/hunspell-1.2:=
28 dev-qt/qtbase:6[X,concurrent,gui,network,sql,widgets,xml]
32 dev-qt/qtwebengine:6[widgets]
33 dev-qt/qtdeclarative:6
44 opencc? ( app-i18n/opencc )
45 multimedia? ( dev-qt/qtmultimedia[gstreamer] )
46 xapian? ( dev-libs/xapian )
47 zim? ( app-arch/libzim )
51 dev-qt/qttools:6[assistant,linguist]
58 use wayland
&& eapply
"${FILESDIR}/remove-X11.patch"
61 sed -i -e '/git describe/s/^/#/' ${PN}.pro || die
64 echo "QMAKE_CXXFLAGS_RELEASE = ${CFLAGS}" >> goldendict.pro
65 echo "QMAKE_CFLAGS_RELEASE = ${CXXFLAGS}" >> goldendict.pro
67 local loc_dir
="${S}/locale"
68 plocale_find_changes
"${loc_dir}" "" ".ts"
70 rm -vf "locale/${1}.ts" || die
71 sed -i "/${1}.ts/d" ${PN}.pro || die
73 plocale_for_each_disabled_locale rm_loc
77 local myconf
=( CONFIG
+=use_iconv CONFIG
+=release
)
78 use opencc
&& myconf
+=( CONFIG
+=chinese_conversion_support
)
79 use ffmpeg || myconf
+=( CONFIG
+=no_ffmpeg_player
)
80 use multimedia || myconf
+=( CONFIG
+=no_qtmultimedia_player
)
81 use xapian
&& myconf
+=( CONFIG
+=use_xapian
)
82 use zim
&& myconf
+=( CONFIG
+=zim_support
)
84 # stack overfow & std::bad_alloc on musl
85 use elibc_musl
&& append-ldflags
-Wl,-z,stack-size
=2097152
87 eqmake6
"${myconf[@]}" PREFIX
="/usr" goldendict.pro
92 domenu redist
/io.github.xiaoyifang.goldendict_ng.desktop
93 doicon redist
/icons
/${PN}.png
95 insinto
/usr
/share
/${PN}/locale
100 xdg_icon_cache_update
101 xdg_desktop_database_update
105 xdg_icon_cache_update
106 xdg_desktop_database_update