qt5: fix armv6* by using more system libs
Use ffmpeg (libavcodec, libavformat, libavutil), libevent, jsoncpp, and protobuf system libraries instead of the ones shipped with qtwebengine and chromium. Now armv6* builds succeed because the problematic vp8 is handled by the system ffmpeg package, where it is disabled for armv6* Fix leaking of CFLAGS and LDFLAGS into the installed mkspecs. This should fix building qt5-webkit for cross targets.
This commit is contained in:
parent
7a66d31fc6
commit
394a9f4f5d
3 changed files with 99 additions and 13 deletions
14
srcpkgs/qt5/patches/qtwebengine-arm-no-yield.patch
Normal file
14
srcpkgs/qt5/patches/qtwebengine-arm-no-yield.patch
Normal file
|
@ -0,0 +1,14 @@
|
|||
--- qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/wtf/SpinLock.cpp 2017-01-03 10:28:53.000000000 +0100
|
||||
+++ qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/wtf/SpinLock.cpp 2017-03-05 16:31:09.299623422 +0100
|
||||
@@ -29,8 +29,10 @@
|
||||
#elif COMPILER(GCC) || COMPILER(CLANG)
|
||||
#if CPU(X86_64) || CPU(X86)
|
||||
#define YIELD_PROCESSOR __asm__ __volatile__("pause")
|
||||
-#elif CPU(ARM) || CPU(ARM64)
|
||||
+#elif CPU(ARM64)
|
||||
#define YIELD_PROCESSOR __asm__ __volatile__("yield")
|
||||
+#elif CPU(ARM)
|
||||
+#define YIELD_PROCESSOR __asm__ __volatile__("nop")
|
||||
#elif CPU(MIPS)
|
||||
// The MIPS32 docs state that the PAUSE instruction is a no-op on older
|
||||
// architectures (first added in MIPS32r2). To avoid assembler errors when
|
62
srcpkgs/qt5/patches/qtwebengine-system-libs.patch
Normal file
62
srcpkgs/qt5/patches/qtwebengine-system-libs.patch
Normal file
|
@ -0,0 +1,62 @@
|
|||
--- qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.h
|
||||
+++ qtwebengine/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.h
|
||||
@@ -21,10 +21,6 @@
|
||||
|
||||
// Include FFmpeg header files.
|
||||
extern "C" {
|
||||
-// Disable deprecated features which result in spammy compile warnings. This
|
||||
-// list of defines must mirror those in the 'defines' section of BUILD.gn file &
|
||||
-// ffmpeg.gyp file or the headers below will generate different structures!
|
||||
-#define FF_API_CONVERGENCE_DURATION 0
|
||||
// Upstream libavcodec/utils.c still uses the deprecated
|
||||
// av_dup_packet(), causing deprecation warnings.
|
||||
// The normal fix for such things is to disable the feature as below,
|
||||
@@ -39,7 +35,6 @@ MSVC_PUSH_DISABLE_WARNING(4244);
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#if !defined(USE_SYSTEM_FFMPEG)
|
||||
-#include <libavformat/internal.h>
|
||||
#endif
|
||||
#include <libavformat/avio.h>
|
||||
#include <libavutil/avutil.h>
|
||||
--- qtwebengine/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc
|
||||
+++ qtwebengine/src/3rdparty/chromium/media/filters/ffmpeg_demuxer.cc
|
||||
@@ -1036,24 +1036,6 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
|
||||
std::vector<base::TimeDelta> start_time_estimates(format_context->nb_streams,
|
||||
kInfiniteDuration());
|
||||
#if !defined(USE_SYSTEM_FFMPEG)
|
||||
- const AVFormatInternal* internal = format_context->internal;
|
||||
- if (internal && internal->packet_buffer &&
|
||||
- format_context->start_time != static_cast<int64_t>(AV_NOPTS_VALUE)) {
|
||||
- struct AVPacketList* packet_buffer = internal->packet_buffer;
|
||||
- while (packet_buffer != internal->packet_buffer_end) {
|
||||
- DCHECK_LT(static_cast<size_t>(packet_buffer->pkt.stream_index),
|
||||
- start_time_estimates.size());
|
||||
- const AVStream* stream =
|
||||
- format_context->streams[packet_buffer->pkt.stream_index];
|
||||
- if (packet_buffer->pkt.pts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
|
||||
- const base::TimeDelta packet_pts =
|
||||
- ConvertFromTimeBase(stream->time_base, packet_buffer->pkt.pts);
|
||||
- if (packet_pts < start_time_estimates[stream->index])
|
||||
- start_time_estimates[stream->index] = packet_pts;
|
||||
- }
|
||||
- packet_buffer = packet_buffer->next;
|
||||
- }
|
||||
- }
|
||||
#endif
|
||||
|
||||
AVStream* audio_stream = NULL;
|
||||
--- qtwebengine/src/core/config/linux.pri
|
||||
+++ qtwebengine/src/core/config/linux.pri
|
||||
@@ -21,6 +21,11 @@ GYP_CONFIG += \
|
||||
use_pango=0 \
|
||||
use_openssl=1
|
||||
|
||||
+GYP_CONFIG += \
|
||||
+ enable_webrtc=0 \
|
||||
+ use_system_ffmpeg=1 \
|
||||
+ use_system_nss=1
|
||||
+
|
||||
use?(nss) {
|
||||
GYP_CONFIG += use_nss_certs=1 \
|
||||
use_openssl_certs=0
|
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'qt5'
|
||||
pkgname=qt5
|
||||
version=5.8.0
|
||||
revision=1
|
||||
revision=2
|
||||
wrksrc="qt-everywhere-opensource-src-${version}"
|
||||
build_style=gnu-configure
|
||||
homepage="http://qt.io/"
|
||||
|
@ -14,13 +14,14 @@ checksum=0f4c54386d3dbac0606a936a7145cebb7b94b0ca2d29bc001ea49642984824b6
|
|||
if [ "${XBPS_MACHINE%%-musl}" = i686 ]; then
|
||||
nodebug=yes # prevent OOM
|
||||
fi
|
||||
hostmakedepends="flex ruby gperf git python perl pkg-config re2c"
|
||||
hostmakedepends="flex ruby gperf git python perl pkg-config protobuf re2c"
|
||||
makedepends="
|
||||
libressl-devel libpng-devel MesaLib-devel libXrender-devel unixodbc-devel
|
||||
fontconfig-devel libXi-devel libXv-devel libXinerama-devel libXrandr-devel
|
||||
libXcursor-devel libXScrnSaver-devel dbus-devel glib-devel icu-devel
|
||||
cups-devel libjpeg-turbo-devel sqlite-devel alsa-lib-devel tiff-devel
|
||||
libmng-devel libsrtp-devel snappy-devel minizip-devel
|
||||
libmng-devel libevent-devel ffmpeg-devel jsoncpp-devel
|
||||
libsrtp-devel protobuf-devel snappy-devel minizip-devel
|
||||
libxshmfence-devel libSM-devel xcb-util-keysyms-devel
|
||||
xcb-util-image-devel xcb-util-renderutil-devel xcb-util-wm-devel
|
||||
libXcomposite-devel libwebp-devel libxkbcommon-devel harfbuzz-devel gtk+-devel
|
||||
|
@ -36,13 +37,13 @@ replaces="qt5-doc<5.6.0 qt5-quick1<5.6.0 qt5-quick1-devel<5.6.0 qt5-webkit<5.6.0
|
|||
CFLAGS="-DOPENSSL_NO_SSL3_METHOD"
|
||||
CXXFLAGS="-DOPENSSL_NO_SSL3_METHOD -Wno-deprecated-declarations -fno-delete-null-pointer-checks"
|
||||
# Required for musl libc
|
||||
LDFLAGS="-pthread -fPIE"
|
||||
LDFLAGS="-pthread -ldl -fPIE"
|
||||
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
armv5*) # Cannot cross compile libvpx (?)
|
||||
makedepends+=" libvpx-devel"
|
||||
;;
|
||||
armv6*) # Cannot cross compile libvpx and is currently broken
|
||||
broken="Can't build vp8 for qtwebengine/chromium/ffmpeg)"
|
||||
armv6*) # Cannot cross compile libvpx
|
||||
;;
|
||||
armv7*) # Force use of neon and enable libvpx
|
||||
CXXFLAGS+=" -mfpu=neon"
|
||||
|
@ -195,9 +196,8 @@ pre_configure() {
|
|||
sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\)|\1 ${LDFLAGS}|" \
|
||||
qtbase/mkspecs/common/g++-unix.conf
|
||||
fi
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
arm*)
|
||||
esac
|
||||
sed -i qtwebengine/src/3rdparty/chromium/third_party/ffmpeg/ffmpeg.gyp \
|
||||
-e "s|'use_system_ffmpeg%': 0,|'use_system_ffmpeg%': 1,|"
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
|
@ -900,12 +900,22 @@ qt5-qmake_package() {
|
|||
vmove usr/lib/qt5/bin/qmake
|
||||
vmove usr/lib/qt5/mkspecs
|
||||
vmove usr/bin/qmake-qt5
|
||||
|
||||
# Change -isystem to -I to avoid "#include_next <stdlib.h>" errors
|
||||
sed -i ${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/gcc-base.conf \
|
||||
-e '/^QMAKE_CFLAGS_ISYSTEM/s;-isystem;-I;'
|
||||
# Remove -specs=/builddir/... from conf files
|
||||
sed -i ${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/*.conf \
|
||||
-e "s;-specs=/void-packages/common/environment/configure/gccspecs/hardened-ld ;;g" \
|
||||
-e "s;-specs=/void-packages/common/environment/configure/gccspecs/hardened-cc1 ;;g"
|
||||
|
||||
# Undo changes to mkspecs/common/gcc-base.conf and g++-unix.conf
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\) ${XBPS_CFLAGS}|\1|" \
|
||||
${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/gcc-base.conf
|
||||
sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\) ${XBPS_LDFLAGS}|\1|" \
|
||||
${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/g++-unix.conf
|
||||
else
|
||||
sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\) ${CFLAGS}|\1|" \
|
||||
${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/gcc-base.conf
|
||||
sed -i -e "s|^\(QMAKE_LFLAGS_RELEASE.*\) ${LDFLAGS}|\1|" \
|
||||
${PKGDESTDIR}/usr/lib/qt5/mkspecs/common/g++-unix.conf
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue