dev-qt/qttranslations: x86 stable wrt bug #719732
[gentoo.git] / dev-qt / qtwebkit / qtwebkit-5.212.0_pre20200309-r1.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 if [[ ${PV} = *9999 ]]; then
7         EGIT_BRANCH="qtwebkit-5.212"
8         EGIT_REPO_URI="https://github.com/qtwebkit/qtwebkit.git"
9         inherit git-r3
10 else
11         MY_P="${PN}-${PV/_pre20200309/-alpha4}" # present as upgrade over previous snapshot
12         SRC_URI="https://github.com/annulen/webkit/releases/download/${MY_P}/${MY_P}.tar.xz"
13         KEYWORDS="amd64 arm arm64 ~ppc ppc64 x86"
14         S="${WORKDIR}/${MY_P}"
15 fi
16 PYTHON_COMPAT=( python3_{6,7,8} )
17 USE_RUBY="ruby25 ruby26 ruby27"
18 inherit check-reqs cmake flag-o-matic python-any-r1 qmake-utils ruby-single toolchain-funcs
19
20 DESCRIPTION="WebKit rendering library for the Qt5 framework (deprecated)"
21 HOMEPAGE="https://www.qt.io/"
22
23 LICENSE="BSD LGPL-2+"
24 SLOT="5/5.212"
25 IUSE="geolocation gles2-only +gstreamer +hyphen +jit multimedia nsplugin opengl orientation +printsupport qml webp X"
26
27 REQUIRED_USE="
28         nsplugin? ( X )
29         qml? ( opengl )
30         ?? ( gstreamer multimedia )
31 "
32
33 # Dependencies found at Source/cmake/OptionsQt.cmake
34 QT_MIN_VER="5.12.3:5"
35 BDEPEND="
36         ${PYTHON_DEPS}
37         ${RUBY_DEPS}
38         dev-lang/perl
39         dev-util/gperf
40         >=sys-devel/bison-2.4.3
41         sys-devel/flex
42         virtual/pkgconfig
43 "
44 DEPEND="
45         dev-db/sqlite:3
46         dev-libs/icu:=
47         dev-libs/libxml2
48         dev-libs/libxslt
49         >=dev-qt/qtcore-${QT_MIN_VER}
50         >=dev-qt/qtgui-${QT_MIN_VER}
51         >=dev-qt/qtnetwork-${QT_MIN_VER}
52         >=dev-qt/qtwidgets-${QT_MIN_VER}=
53         media-libs/libpng:0=
54         media-libs/woff2
55         virtual/jpeg:0
56         geolocation? ( >=dev-qt/qtpositioning-${QT_MIN_VER} )
57         gstreamer? (
58                 dev-libs/glib:2
59                 media-libs/gstreamer:1.0
60                 media-libs/gst-plugins-bad:1.0
61                 media-libs/gst-plugins-base:1.0
62         )
63         hyphen? ( dev-libs/hyphen )
64         multimedia? ( >=dev-qt/qtmultimedia-${QT_MIN_VER}[widgets] )
65         opengl? (
66                 >=dev-qt/qtgui-${QT_MIN_VER}[gles2-only=]
67                 >=dev-qt/qtopengl-${QT_MIN_VER}[gles2-only=]
68         )
69         orientation? ( >=dev-qt/qtsensors-${QT_MIN_VER} )
70         printsupport? ( >=dev-qt/qtprintsupport-${QT_MIN_VER} )
71         qml? (
72                 >=dev-qt/qtdeclarative-${QT_MIN_VER}
73                 >=dev-qt/qtwebchannel-${QT_MIN_VER}[qml]
74         )
75         webp? ( media-libs/libwebp:= )
76         X? (
77                 x11-libs/libX11
78                 x11-libs/libXcomposite
79                 x11-libs/libXrender
80         )
81 "
82 RDEPEND="${DEPEND}"
83
84 CHECKREQS_DISK_BUILD="16G" # bug 417307
85
86 _check_reqs() {
87         if [[ ${MERGE_TYPE} != binary ]] && is-flagq "-g*" && ! is-flagq "-g*0"; then
88                 einfo "Checking for sufficient disk space to build ${PN} with debugging flags"
89                 check-reqs_$1
90         fi
91 }
92
93 pkg_pretend() {
94         _check_reqs pkg_pretend
95 }
96
97 pkg_setup() {
98         _check_reqs pkg_setup
99         python-any-r1_pkg_setup
100 }
101
102 src_configure() {
103         # Respect CC, otherwise fails on prefix, bug #395875
104         tc-export CC
105
106         # Multiple rendering bugs on youtube, github, etc without this, bug #547224
107         append-flags $(test-flags -fno-strict-aliasing)
108
109         local mycmakeargs=(
110                 -DPORT=Qt
111                 -DENABLE_API_TESTS=OFF
112                 -DENABLE_TOOLS=OFF
113                 -DENABLE_GEOLOCATION=$(usex geolocation)
114                 -DUSE_GSTREAMER=$(usex gstreamer)
115                 -DUSE_LIBHYPHEN=$(usex hyphen)
116                 -DENABLE_JIT=$(usex jit)
117                 -DUSE_QT_MULTIMEDIA=$(usex multimedia)
118                 -DENABLE_NETSCAPE_PLUGIN_API=$(usex nsplugin)
119                 -DENABLE_OPENGL=$(usex opengl)
120                 -DENABLE_PRINT_SUPPORT=$(usex printsupport)
121                 -DENABLE_DEVICE_ORIENTATION=$(usex orientation)
122                 -DENABLE_WEBKIT2=$(usex qml)
123                 $(cmake_use_find_package webp WebP)
124                 -DENABLE_X11_TARGET=$(usex X)
125         )
126
127         if has_version "virtual/rubygems[ruby_targets_ruby27]"; then
128                 mycmakeargs+=( -DRUBY_EXECUTABLE=$(type -P ruby27) )
129         elif has_version "virtual/rubygems[ruby_targets_ruby26]"; then
130                 mycmakeargs+=( -DRUBY_EXECUTABLE=$(type -P ruby26) )
131         else
132                 mycmakeargs+=( -DRUBY_EXECUTABLE=$(type -P ruby25) )
133         fi
134
135         cmake_src_configure
136 }
137
138 src_install() {
139         cmake_src_install
140
141         # bug 572056
142         if [[ ! -f ${ED}$(qt5_get_libdir)/libQt5WebKit.so ]]; then
143                 eerror "${CATEGORY}/${PF} could not build due to a broken ruby environment."
144                 die 'Check "eselect ruby" and ensure you have a working ruby in your $PATH'
145         fi
146 }