From 75e2d5b7b68844e5c485a117bcdcfdb29250c7ec Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 29 Jun 2017 04:41:36 +0300 Subject: mingw: upgrade windows python to 3.5.2 This adds support for 64bit windows toolchain with using different binary archives for the prebuild python when building i686 and x86_64 mingw toolchains. Task-number: QTBUG-58918 Change-Id: I1a02546749dd924fd3d2222bbbebf74b31dab07d Reviewed-by: Mikko Gronoff --- recipes/gdb/gdb-cross-canadian_7.%.bbappend | 25 +++++++-- ...01-Do-not-use-win32-specific-filehandling.patch | 24 +++++++++ recipes/python/nativesdk-prebuild-python.bb | 60 ---------------------- recipes/python/nativesdk-prebuild-python.inc | 57 ++++++++++++++++++++ recipes/python/nativesdk-prebuild-python_i686.bb | 37 +++++++++++++ recipes/python/nativesdk-prebuild-python_x86_64.bb | 37 +++++++++++++ 6 files changed, 175 insertions(+), 65 deletions(-) create mode 100644 recipes/gdb/gdb/0001-Do-not-use-win32-specific-filehandling.patch delete mode 100644 recipes/python/nativesdk-prebuild-python.bb create mode 100644 recipes/python/nativesdk-prebuild-python.inc create mode 100644 recipes/python/nativesdk-prebuild-python_i686.bb create mode 100644 recipes/python/nativesdk-prebuild-python_x86_64.bb (limited to 'recipes') diff --git a/recipes/gdb/gdb-cross-canadian_7.%.bbappend b/recipes/gdb/gdb-cross-canadian_7.%.bbappend index 0a8319c..a47bca7 100644 --- a/recipes/gdb/gdb-cross-canadian_7.%.bbappend +++ b/recipes/gdb/gdb-cross-canadian_7.%.bbappend @@ -27,14 +27,29 @@ ## ############################################################################ +FILESEXTRAPATHS_prepend_sdkmingw32 := "${THISDIR}/${BPN}:" +SRC_URI_append_sdkmingw32 = " file://0001-Do-not-use-win32-specific-filehandling.patch" + DEPENDS_append_sdkmingw32 = " nativesdk-prebuild-python" RDEPENDS_${PN}_append_sdkmingw32 = " nativesdk-prebuild-python" -EXTRA_OECONF_remove_sdkmingw32 = " --without-python" -EXTRA_OECONF_append_sdkmingw32 = " --with-python" +EXTRA_OECONF_remove_sdkmingw32 = "--without-python --with-python=no" +EXTRA_OECONF_append_sdkmingw32 = " --with-python=${WORKDIR}/python_win" CXXFLAGS_append_sdkmingw32 = " -D_hypot=hypot" +do_configure_prepend_sdkmingw32() { +cat > ${WORKDIR}/python_win << EOF +#! /bin/sh +case "\$2" in + --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}" ;; + --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -lpython35" ;; + --exec-prefix) echo "${exec_prefix}" ;; + *) exit 1 ;; +esac +exit 0 +EOF + chmod +x ${WORKDIR}/python_win +} + do_install_append_sdkmingw32() { - mkdir -p ${D}${bindir}/lib - cp -r ${STAGING_DIR_HOST}${exec_prefix}/lib/python2.7/* -d ${D}${bindir}/lib - cp ${STAGING_DIR_HOST}${exec_prefix}/bin/python27.dll ${D}${bindir} + ln -s ../python35.dll ${D}${bindir}/ } diff --git a/recipes/gdb/gdb/0001-Do-not-use-win32-specific-filehandling.patch b/recipes/gdb/gdb/0001-Do-not-use-win32-specific-filehandling.patch new file mode 100644 index 0000000..c9a20ed --- /dev/null +++ b/recipes/gdb/gdb/0001-Do-not-use-win32-specific-filehandling.patch @@ -0,0 +1,24 @@ +From 3c928a3bf8d873f6173a076da6e4c1bc85e9a3a0 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Wed, 28 Jun 2017 20:41:49 +0300 +Subject: [PATCH] Do not use win32 specific filehandling + +PyFile_FromString and PyFile_AsFile are no longer available in python3 +see https://sourceware.org/bugzilla/show_bug.cgi?id=15600 +--- + gdb/python/python.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/python/python.c b/gdb/python/python.c +index 9bccaa9..1d58dff 100644 +--- a/gdb/python/python.c ++++ b/gdb/python/python.c +@@ -374,7 +374,7 @@ python_interactive_command (char *arg, int from_tty) + static void + python_run_simple_file (FILE *file, const char *filename) + { +-#ifndef _WIN32 ++#ifdef _WIN32 + + PyRun_SimpleFile (file, filename); + diff --git a/recipes/python/nativesdk-prebuild-python.bb b/recipes/python/nativesdk-prebuild-python.bb deleted file mode 100644 index e8edb9e..0000000 --- a/recipes/python/nativesdk-prebuild-python.bb +++ /dev/null @@ -1,60 +0,0 @@ -############################################################################ -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Boot to Qt meta layer. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################ - -LICENSE = "PSFv2" - -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Python-2.0;md5=a5c8025e305fb49e6d405769358851f6" - -inherit bin_package nativesdk - -COMPATIBLE_HOST = ".*-mingw.*" - -SRC_URI[md5sum] = "6d37712f01fa836b1303141a6d4cabda" -SRC_URI[sha256sum] = "3835868c171dddb8cb68ed5578b6d4d639387a038e999a5b008f393b704d6ad7" -SRC_URI = "http://download.qt.io/development_releases/prebuilt/gdb/build-prerequisites/python.zip" - -S = "${WORKDIR}" - -do_install() { - install -d ${D}${bindir} - install ${WORKDIR}/python/python27.dll ${D}${bindir} - install -d ${D}${includedir} - install ${WORKDIR}/python/include/* ${D}${includedir} - install -d ${D}${libdir} - install ${WORKDIR}/python/libs/* ${D}${libdir} - install -d ${D}${libdir}/python2.7 - cp -r ${WORKDIR}/python/lib/* ${D}${libdir}/python2.7 -} - -sysroot_stage_dirs_append() { - sysroot_stage_dir $from${bindir} $to${bindir} -} - -# requires /usr/local/bin/python, but no providers found -INSANE_SKIP_${PN} += "file-rdeps" diff --git a/recipes/python/nativesdk-prebuild-python.inc b/recipes/python/nativesdk-prebuild-python.inc new file mode 100644 index 0000000..71e8e72 --- /dev/null +++ b/recipes/python/nativesdk-prebuild-python.inc @@ -0,0 +1,57 @@ +############################################################################ +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:GPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 or (at your option) any later version +## approved by the KDE Free Qt Foundation. The licenses are as published by +## the Free Software Foundation and appearing in the file LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################ + +LICENSE = "PSFv2" + +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4b8a9367e6bb2acb6f26dc08654f6ee5" + +do_unpack[depends] += "p7zip-native:do_populate_sysroot" + +DEPENDS = "unzip-native" + +inherit bin_package nativesdk python3-dir + +PV = "3.5.2" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}${includedir}/${PYTHON_DIR} + install -m 0644 ${S}/include/* ${D}${includedir}/${PYTHON_DIR} + + install -d ${D}${libdir} + install -m 0644 ${S}/libs/*.a ${D}${libdir} + + install -d ${D}${bindir} + install -m 0644 ${S}/python.exe ${D}${bindir} + install -m 0644 ${S}/python35.dll ${D}${bindir} + + install -d ${D}${libdir}/${PYTHON_DIR} + unzip ${S}/python35.zip -d ${D}${libdir}/${PYTHON_DIR} +} diff --git a/recipes/python/nativesdk-prebuild-python_i686.bb b/recipes/python/nativesdk-prebuild-python_i686.bb new file mode 100644 index 0000000..cf7204a --- /dev/null +++ b/recipes/python/nativesdk-prebuild-python_i686.bb @@ -0,0 +1,37 @@ +############################################################################ +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:GPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 or (at your option) any later version +## approved by the KDE Free Qt Foundation. The licenses are as published by +## the Free Software Foundation and appearing in the file LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################ + +require nativesdk-prebuild-python.inc + +COMPATIBLE_HOST = "i686.*-mingw.*" + +SRC_URI = "http://download.qt.io/development_releases/prebuilt/python/Python35-win-x86.7z" + +SRC_URI[md5sum] = "3da266445a4e6a93ff1949810141da8f" +SRC_URI[sha256sum] = "b60c49227c6e920904d784681c16ee3591a18824c3abb89613813f93fde1c1f2" diff --git a/recipes/python/nativesdk-prebuild-python_x86_64.bb b/recipes/python/nativesdk-prebuild-python_x86_64.bb new file mode 100644 index 0000000..f0cc4ca --- /dev/null +++ b/recipes/python/nativesdk-prebuild-python_x86_64.bb @@ -0,0 +1,37 @@ +############################################################################ +## +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the Boot to Qt meta layer. +## +## $QT_BEGIN_LICENSE:GPL$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 or (at your option) any later version +## approved by the KDE Free Qt Foundation. The licenses are as published by +## the Free Software Foundation and appearing in the file LICENSE.GPL3 +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################ + +require nativesdk-prebuild-python.inc + +COMPATIBLE_HOST = "x86_64.*-mingw.*" + +SRC_URI = "http://download.qt.io/development_releases/prebuilt/python/Python35-win-x64.7z" + +SRC_URI[md5sum] = "08766b13bcbdcf8217a98bfc291d549f" +SRC_URI[sha256sum] = "43e38c8a05dcbc2effd1915dbe2dc2be6e701ebf3eb00d6e45197ee773978124" -- cgit v1.2.3-54-g00ecf