From 467f39094c783bf82b571ab8bc01c12feae47a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Sat, 14 Jan 2017 21:38:31 +0100 Subject: [PATCH] qt: cross build for desktop, not embedded --- srcpkgs/qt/patches/mips-sgidef.patch | 11 ++++++++ srcpkgs/qt/template | 42 +++++++++++++++++----------- 2 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 srcpkgs/qt/patches/mips-sgidef.patch diff --git a/srcpkgs/qt/patches/mips-sgidef.patch b/srcpkgs/qt/patches/mips-sgidef.patch new file mode 100644 index 00000000000..b0d8181182e --- /dev/null +++ b/srcpkgs/qt/patches/mips-sgidef.patch @@ -0,0 +1,11 @@ +--- qt.orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2015-05-07 16:14:48.000000000 +0200 ++++ qt/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h 2017-01-14 19:34:43.375000207 +0100 +@@ -336,7 +336,7 @@ + /* CPU(MIPS) - MIPS, any version */ + #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) + #define WTF_CPU_MIPS 1 +-#include ++#include + #if defined(__MIPSEB__) + #define WTF_CPU_BIG_ENDIAN 1 + #endif diff --git a/srcpkgs/qt/template b/srcpkgs/qt/template index ab14463465f..61ffc017e1f 100644 --- a/srcpkgs/qt/template +++ b/srcpkgs/qt/template @@ -1,7 +1,7 @@ # Template file for 'qt' pkgname=qt version=4.8.7 -revision=15 +revision=16 _distname=qt-everywhere-opensource-src patch_args="-Np1" wrksrc=${_distname}-${version} @@ -17,7 +17,7 @@ makedepends=" MesaLib-devel libressl-devel unixodbc-devel libXv-devel libXinerama-devel libXrandr-devel libXcursor-devel glib-devel icu-devel cups-devel sqlite-devel alsa-lib-devel libmng-devel libSM-devel gtk+-devel libnotify-devel - libmysqlclient-devel postgresql-libs-devel pulseaudio-devel" + libmysqlclient-devel postgresql-libs-devel pulseaudio-devel tslib-devel" depends="qtchooser hicolor-icon-theme icu-libs" replaces="qt-qtconfig>=0" @@ -54,55 +54,55 @@ do_configure() { _opts+=" -qt3support" case "$XBPS_TARGET_MACHINE" in armv5tel) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="arm-linux-gnueabi-c++" ;; armv6l) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="arm-linux-gnueabihf-c++" ;; armv6l-musl) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="arm-linux-musleabihf-c++" ;; armv7l) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="armv7l-linux-gnueabihf-c++" ;; armv7l-musl) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="armv7l-linux-musleabihf-c++" ;; aarch64) - _opts+=" -embedded aarch64" + _opts+=" -arch aarch64" _spec="aarch64-linux-gnu-c++" ;; aarch64-musl) - _opts+=" -embedded aarch64" + _opts+=" -arch aarch64" _spec="aarch64-linux-musl-c++" ;; mips-musl) - _opts+=" -embedded mips" + _opts+=" -arch mips" _spec="mips-linux-musl-c++" ;; mipsel-musl) - _opts+=" -embedded mips" + _opts+=" -arch mips" _spec="mipsel-linux-musl-c++" ;; mipselhf-musl) - _opts+=" -embedded mips" + _opts+=" -arch mips" _spec="mipsel-linux-muslhf-c++" ;; *-musl) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="${XBPS_TARGET_MACHINE}-linux-musl-c++" ;; *) - _opts+=" -embedded arm" + _opts+=" -arch arm" _spec="${XBPS_TARGET_MACHINE}-linux-gnu-c++" ;; esac - mkdir mkspecs/${_spec} + mkdir -p mkspecs/${_spec} cat > mkspecs/${_spec}/qmake.conf << _EOF # # qmake specification for ${_spec} @@ -154,7 +154,6 @@ _EOF export PKG_CONFIG_SYSROOT_DIR=${XBPS_CROSS_BASE} else - _opts+=" -graphicssystem raster" # qmake CFLAGS/LDFLAGS sed -i -e '/outpath\/qmake\".*\"\$MAKE\")/s/)/ QMAKE_CFLAGS="$CFLAGS" QMAKE_CXXFLAGS="$CXXFLAGS" QMAKE_LFLAGS="$LDFLAGS" )/' \ -e 's/\(setBootstrapVariable\s\+\|EXTRA_C\(XX\)\?FLAGS=.*\)QMAKE_C\(XX\)\?FLAGS_\(DEBUG\|RELEASE\).*/:/' \ @@ -168,6 +167,8 @@ _EOF _opts+=" -no-webkit" _opts+=" -gtkstyle" _opts+=" -system-sqlite" + _opts+=" -shared" + _opts+=" -graphicssystem raster" _opts+=" -no-openvg" _opts+=" -no-phonon" _opts+=" -no-phonon-backend" @@ -217,6 +218,11 @@ do_install() { make INSTALL_ROOT=${DESTDIR} install + # install missing qatomic_aarch64.h + # TODO: find better fix (add to install targets?) + install -D -m644 src/corelib/arch/qatomic_aarch64.h ${DESTDIR}/usr/include/QtCore/ + install -D -m644 src/corelib/arch/qatomic_aarch64.h ${DESTDIR}/usr/include/Qt/ + # delete tests rm -rf ${DESTDIR}/usr/tests @@ -248,6 +254,9 @@ do_install() { # Remove wrong stuff rm -rf ${DESTDIR}/usr/{examples,demos} + # Clean generated qmake.conf reference to builddir + find -name qmake.conf -exec sed -i "{}" -e"s; -Wl,-rpath,/builddir.*;;" \; + # For a cross build replace qmake with the target binary if [ -f ${wrksrc}/bin/qmake-target ]; then mv ${wrksrc}/bin/qmake-target ${DESTDIR}/usr/lib/qt/bin/qmake @@ -333,6 +342,7 @@ qt-devel_package() { fi done vmove usr/include + vmove "usr/lib/*.so" vmove "usr/lib/*.a" vmove "usr/lib/*.prl" vmove usr/lib/pkgconfig