dev-qt/qtgraphicaleffects: arm64 stable wrt bug #719732
[gentoo.git] / dev-qt / qtcore / qtcore-5.14.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 QT5_MODULE="qtbase"
7 inherit linux-info qt5-build
8
9 DESCRIPTION="Cross-platform application development framework"
10 SLOT=5/$(ver_cut 1-3)
11
12 if [[ ${QT5_BUILD_TYPE} == release ]]; then
13         KEYWORDS="amd64 arm arm64 ~hppa ~ppc ppc64 ~sparc x86"
14 fi
15
16 IUSE="icu old-kernel systemd"
17
18 DEPEND="
19         dev-libs/double-conversion:=
20         dev-libs/glib:2
21         dev-libs/libpcre2[pcre16,unicode]
22         sys-libs/zlib:=
23         icu? ( dev-libs/icu:= )
24         !icu? ( virtual/libiconv )
25         systemd? ( sys-apps/systemd:= )
26 "
27 RDEPEND="${DEPEND}
28         !<dev-qt/qtcore-4.8.7-r4:4
29 "
30
31 QT5_TARGET_SUBDIRS=(
32         src/tools/bootstrap
33         src/tools/moc
34         src/tools/rcc
35         src/corelib
36         src/tools/qlalr
37         doc
38 )
39
40 QT5_GENTOO_PRIVATE_CONFIG=(
41         !:network
42         !:sql
43         !:testlib
44         !:xml
45 )
46
47 PATCHES=(
48         "${FILESDIR}/${PN}-5.14.1-cmake-macro-backward-compat.patch" # bug 703306
49         "${FILESDIR}/${P}-QLibrary-deadlock.patch" # QTBUG-83207
50 )
51
52 pkg_pretend() {
53         use kernel_linux || return
54         get_running_version
55         if kernel_is -lt 3 17 && ! use old-kernel; then
56                 ewarn "The running kernel is older than 3.17. USE=old-kernel is needed for"
57                 ewarn "dev-qt/qtcore to function on this kernel properly. See Bug #669994."
58         fi
59 }
60
61 src_prepare() {
62         # don't add -O3 to CXXFLAGS, bug 549140
63         sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die
64
65         # fix missing qt_version_tag symbol w/ LTO, bug 674382
66         sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die
67
68         qt5-build_src_prepare
69 }
70
71 src_configure() {
72         local myconf=(
73                 -no-feature-statx       # bug 672856
74                 $(qt_use icu)
75                 $(qt_use !icu iconv)
76                 $(qt_use systemd journald)
77         )
78         use old-kernel && myconf+=(
79                 -no-feature-renameat2 # needs Linux 3.16, bug 669994
80                 -no-feature-getentropy # needs Linux 3.17, bug 669994
81         )
82         qt5-build_src_configure
83 }
84
85 src_install() {
86         qt5-build_src_install
87
88         local flags=(
89                 DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG
90                 OPENGL OPENSSL SSL WIDGETS
91         )
92
93         for flag in ${flags[@]}; do
94                 cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die
95
96                         #if defined(QT_NO_${flag}) && defined(QT_${flag})
97                         # undef QT_NO_${flag}
98                         #elif !defined(QT_NO_${flag}) && !defined(QT_${flag})
99                         # define QT_NO_${flag}
100                         #endif
101                 _EOF_
102         done
103 }