Merge pull request #3921 from MilhouseVH/le10_goodbye_python2

Python2: Bye bye.
This commit is contained in:
Matthias Reichl 2019-10-29 15:42:22 +01:00 committed by GitHub
commit c2145eaae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
78 changed files with 1743 additions and 1069 deletions

View File

@ -494,7 +494,7 @@ reset_pkg_vars() {
PKG_LICENSE="unknown"
PKG_TOOLCHAIN="auto"
PKG_IS_ADDON="no"
PKG_PYTHON_VERSION="python2.7"
PKG_PYTHON_VERSION="${DEFAULT_PYTHON_VERSION}"
}
set_debug_depends() {
@ -1046,6 +1046,36 @@ source_package() {
fi
}
# arg1: file, or directory to recursively compile.
python_compile() {
local path="${1:-${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}}"
${TOOLCHAIN}/bin/python3 -Wi -t -B ${TOOLCHAIN}/lib/${PKG_PYTHON_VERSION}/compileall.py -f -d "${path#${INSTALL}}" "${path}"
python_remove_source "${path}"
}
# arg1: file, or directory from which to recursively remove all py source code
python_remove_source() {
local path="${1:-${INSTALL}/usr/lib/${PKG_PYTHON_VERSION}}"
if [ -d "${path}" ]; then
find "${path}" -type f -name '*.py' -delete
else
rm -f "${path}"
fi
}
# arg1: directory to process recursively
# strip incorrect build-host ABI from native Python3 modules (see PEP3149)
python_fix_abi() {
local pymodule pyname
for pymodule in $(find ${1} -type f -name '*.cpython-*.so' 2>/dev/null); do
pyname=${pymodule##*/}
pyname=${pyname%.so} # strip extension
pyname=${pyname%.*} # strip incorrect ABI
echo "python_fix_abi: Removing ABI from ${pymodule} -> ${pyname}.so"
mv ${pymodule} ${pymodule%/*}/${pyname}.so
done
}
### KERNEL HELPERS ###
kernel_path() {
@ -1248,6 +1278,7 @@ install_addon_files() {
install_addon_source "$1"
install_addon_images "$1"
create_addon_xml "$1"
python_fix_abi "$1"
}
install_driver_addon_files() {

View File

@ -106,5 +106,9 @@ check_config
# If the package caches are unset, then populate them
init_package_cache
if [ -z "${DEFAULT_PYTHON_VERSION+set}" ]; then
export DEFAULT_PYTHON_VERSION="$(get_pkg_variable Python3 PKG_PYTHON_VERSION)"
fi
# set package metadata
source_package "${1}"

View File

@ -7,7 +7,7 @@ PKG_SHA256="2f81a9a6b7b7f46b79faa5b01df0c25fa5f16af80842d74e35b5fbf01ab0c619"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the ADS1015 and ADS1115 analog to digital converters with a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="22ec0fc6679cc3e9b5f0aff5cfeef34cbbf13e59aecfb829c2f0dc2d90b5fb8b"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the ADXL345 triple-axis accelerometer over I2C with a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="e5e140c34e312f6a00c62b1bd47ebe3f1857009b1c202c18c7b092ebb2e1eb9c"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python library for accessing the BMP series pressure and temperature sensors like the BMP085/BMP180 on a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="eae4b446162feb533a469a9dacf6e750250f925561c9f7983a11d340e1dd98d4"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python library for accessing Adafruit character LCDs from a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,7 +7,7 @@ PKG_SHA256="9125f8f42b4874db257a45184b866e8b424aa67230d2ffbc734b53686da7817f"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi."
PKG_TOOLCHAIN="manual"
@ -28,5 +28,5 @@ make_target() {
PKG_RPI_VERSION=""
esac
python setup.py build $PKG_RPI_VERSION --cross-compile
python3 setup.py build $PKG_RPI_VERSION --cross-compile
}

View File

@ -7,6 +7,6 @@ PKG_SHA256="d3cb74fd033ebe5aea1786a584d64ef5eb8082ef2bf0a568b01691612cd04e88"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Library to provide a cross-platform GPIO interface on the Raspberry Pi ."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="244d2625cdaebdc68e299fedde276efa5c9f7c143681c4ee056fb8350a4f7167"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python library for controlling LED backpack displays."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="609591f2add15e849d3bba320417c705a50a3ed077632baf20c12c8b740d5331"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the LSM303 accelerometer & magnetometer with Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="f5e4c847a87716c16f0209df95c281b5071549644a79a143a77b212f25c464dc"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the MCP3008 analog to digital converter with a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="6ebbd1f76807b01dc2b723064e52b0c82fc45388265b8ec867e0a42a46a6e926"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the MCP4725 digital to analog converter with a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="46e11dcfbfaab5756ddeb6ab31740cf8c7419ec1d32be2519f19882e7d86e426"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the PCA9685 PWM servo/LED controller with a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="891a4d077fe6610de6aa4b0dc5b9933a6c7db3492072df60c0383662f28c2ae9"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Pure python access to Linux IO including I2C and SPI."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="0238b2c01cfbb2890ae78468d2fc19c815748fc94860a4eb92b649d074476264"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/THP-JOE/Python_SI1145"
PKG_URL="https://github.com/THP-JOE/Python_SI1145/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python library for accessing the SI1145 temperature sensor on a Raspberry Pi"
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="ed1163dee2fe6c0c2065a429e1d93cff7397a309071ff83714c84566739680a2"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="f2c3218551da55d7fdbe2499a6ffa3a0b8ed1709e4402c6b0e0f37b17d4aa81f"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the TCS34725 color sensor with the Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="78346836965562720248138203a4af9dc6aa18815bda2a5b7842e3b9af9d1ea8"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to use the VCNL4000 & VCNL4010 proximity sensors with the Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -7,6 +7,6 @@ PKG_SHA256="6219edb5c1d767ff950f5020bacdfb5ba608b4995eb14d6073fdec2f17f584cb"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/adafruit/${PKG_NAME}"
PKG_URL="https://github.com/adafruit/${PKG_NAME}/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="Python code to control WS2801 and similar SPI interface addressable RGB LED strips on a Raspberry Pi."
PKG_TOOLCHAIN="manual"

View File

@ -8,7 +8,7 @@ PKG_ARCH="arm"
PKG_LICENSE="MIT"
PKG_SITE="http://sourceforge.net/p/raspberry-gpio-python/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="A module to control Raspberry Pi GPIO channels."
PKG_TOOLCHAIN="manual"
@ -19,5 +19,5 @@ pre_configure_target() {
}
make_target() {
python setup.py build
python3 setup.py build
}

View File

@ -8,6 +8,6 @@ PKG_ARCH="arm"
PKG_LICENSE="BSD"
PKG_SITE="https://github.com/waveform80/picamera"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host bcm2835-driver"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host bcm2835-driver"
PKG_LONGDESC="A python and shell interface for the Raspberry Pi camera module."
PKG_TOOLCHAIN="manual"

View File

@ -7,7 +7,7 @@ PKG_SHA256="2b2f4ef3a0d1dc6d0a4bc2f54a57ba6f1e278333881a07df7e55aec502a48c7c"
PKG_LICENSE="GPL"
PKG_SITE="http://dag.wiee.rs/home-made/dstat"
PKG_URL="https://github.com/dagwieers/dstat/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2"
PKG_DEPENDS_TARGET="toolchain Python3"
PKG_LONGDESC="Versatile resource statistics tool."
PKG_TOOLCHAIN="manual"

View File

@ -7,7 +7,7 @@ PKG_SHA256="f939a6242c03950cc568d0efdfa3db7a9c29e0e8f5abd01f2908bdd344c054ff"
PKG_LICENSE="GPL"
PKG_SITE="http://www.lm-sensors.org/wiki/I2CTools"
PKG_URL="http://fossies.org/linux/misc/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="A heterogeneous set of I2C tools for Linux."
pre_make_target() {

View File

@ -11,7 +11,7 @@ PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/hyperion-project/hyperion"
PKG_URL="https://github.com/hyperion-project/hyperion/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 libusb qtbase protobuf rpi_ws281x"
PKG_DEPENDS_TARGET="toolchain Python3 libusb qtbase protobuf rpi_ws281x"
PKG_SECTION="service"
PKG_SHORTDESC="Hyperion: an AmbiLight controller"
PKG_LONGDESC="Hyperion($PKG_VERSION_DATE) is an modern opensource AmbiLight implementation."

View File

@ -11,7 +11,7 @@ PKG_LICENSE="GPL"
PKG_SITE="http://www.tvheadend.org"
PKG_URL="https://github.com/tvheadend/tvheadend/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain avahi comskip curl dvb-apps ffmpegx libdvbcsa libhdhomerun \
libiconv openssl pngquant:host Python2:host tvh-dtv-scan-tables"
libiconv openssl pngquant:host Python3:host tvh-dtv-scan-tables"
PKG_SECTION="service"
PKG_SHORTDESC="Tvheadend: a TV streaming server for Linux"
PKG_LONGDESC="Tvheadend ($PKG_VERSION_NUMBER): is a TV streaming server for Linux supporting DVB-S/S2, DVB-C, DVB-T/T2, IPTV, SAT>IP, ATSC and ISDB-T"

View File

@ -1,13 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="boost"
PKG_VERSION="1_65_1"
PKG_SHA256="9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81"
PKG_VERSION="1.71.0"
PKG_SHA256="d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee"
PKG_LICENSE="OSS"
PKG_SITE="http://www.boost.org/"
PKG_URL="$SOURCEFORGE_SRC/boost/boost/1.65.1/${PKG_NAME}_${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain boost:host Python2 zlib bzip2"
PKG_URL="https://dl.bintray.com/boostorg/release/${PKG_VERSION}/source/${PKG_NAME}_${PKG_VERSION//./_}.tar.bz2"
PKG_DEPENDS_TARGET="toolchain boost:host Python3 zlib bzip2"
PKG_LONGDESC="boost: Peer-reviewed STL style libraries for C++"
PKG_TOOLCHAIN="manual"
PKG_BUILD_FLAGS="+pic"
@ -19,7 +20,7 @@ make_host() {
makeinstall_host() {
mkdir -p $TOOLCHAIN/bin
cp bin.*/bjam $TOOLCHAIN/bin
cp bjam $TOOLCHAIN/bin
}
pre_configure_target() {

View File

@ -8,7 +8,7 @@ PKG_SHA256="f7d414d0914abb0e151a276b4de22cf4977fd6c28bd9ecdd990407b1138a945c"
PKG_LICENSE="BSD-3c"
PKG_SITE="http://www.h5l.org/"
PKG_URL="https://github.com/heimdal/heimdal/archive/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="toolchain:host e2fsprogs:host Python2:host ncurses:host"
PKG_DEPENDS_HOST="toolchain:host Python3:host ncurses:host"
PKG_LONGDESC="Kerberos 5, PKIX, CMS, GSS-API, SPNEGO, NTLM, Digest-MD5 and, SASL implementation."
PKG_TOOLCHAIN="autotools"
PKG_BUILD_FLAGS="-parallel"
@ -29,5 +29,6 @@ PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared \
makeinstall_host() {
mkdir -p $TOOLCHAIN/bin
cp -PR lib/asn1/asn1_compile $TOOLCHAIN/bin
cp -PR lib/asn1/asn1_compile $TOOLCHAIN/bin/heimdal_asn1_compile
cp -PR lib/com_err/compile_et $TOOLCHAIN/bin/heimdal_compile_et
}

View File

@ -27,7 +27,7 @@ make_target() {
PTR64="1"
fi
make REGENIE=1 VERBOSE=1 NOWERROR=1 PYTHON_EXECUTABLE=python2 CONFIG=libretro \
make REGENIE=1 VERBOSE=1 NOWERROR=1 PYTHON_EXECUTABLE=python3 CONFIG=libretro \
LIBRETRO_OS="unix" ARCH="" PROJECT="" LIBRETRO_CPU="$ARCH" DISTRO="debian-stable" \
CROSS_BUILD="1" OVERRIDE_CC="$CC" OVERRIDE_CXX="$CXX" \
PTR64="$PTR64" TARGET="mame" \

View File

@ -28,7 +28,7 @@ make_target() {
PKG_PTR64="0"
fi
make REGENIE=1 VERBOSE=1 NOWERROR=1 PYTHON_EXECUTABLE=python2 CONFIG=libretro \
make REGENIE=1 VERBOSE=1 NOWERROR=1 PYTHON_EXECUTABLE=python3 CONFIG=libretro \
LIBRETRO_OS="unix" ARCH="" PROJECT="" LIBRETRO_CPU="${ARCH}" DISTRO="debian-stable" \
CROSS_BUILD="1" OVERRIDE_CC="${CC}" OVERRIDE_CXX="${CXX}" \
PTR64="${PKG_PTR64}" NOASM="${PKG_NOASM}" TARGET="mame" \

View File

@ -1,123 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="Python2"
# When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION!
PKG_VERSION="2.7.16"
PKG_SHA256="f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7"
PKG_LICENSE="OSS"
PKG_SITE="http://www.python.org/"
PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/${PKG_NAME::-1}-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="zlib:host bzip2:host sqlite:host"
PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl libffi Python2:host ncurses readline"
PKG_LONGDESC="Python2 is an interpreted object-oriented programming language."
PKG_TOOLCHAIN="autotools"
PKG_BUILD_FLAGS="-parallel +lto-parallel"
PKG_PY_DISABLED_MODULES="_tkinter nis gdbm bsddb ossaudiodev"
PKG_CONFIGURE_OPTS_HOST="--cache-file=config.cache \
--without-cxx-main \
--with-threads \
--enable-unicode=ucs4"
PKG_CONFIGURE_OPTS_TARGET="ac_cv_file_dev_ptc=no \
ac_cv_file_dev_ptmx=yes \
ac_cv_func_lchflags_works=no \
ac_cv_func_chflags_works=no \
ac_cv_func_printf_zd=yes \
ac_cv_buggy_getaddrinfo=no \
ac_cv_header_bluetooth_bluetooth_h=no \
ac_cv_header_bluetooth_h=no \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--with-threads \
--enable-unicode=ucs4 \
--enable-ipv6 \
--disable-profiling \
--without-pydebug \
--without-doc-strings \
--without-tsc \
--with-pymalloc \
--without-fpectl \
--without-cxx-main \
--with-system-ffi \
--with-system-expat"
post_patch() {
# This is needed to make sure the Python build process doesn't try to
# regenerate those files with the pgen program. Otherwise, it builds
# pgen for the target, and tries to run it on the host.
touch $PKG_BUILD/Include/graminit.h
touch $PKG_BUILD/Python/graminit.c
}
make_host() {
make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \
PYTHON_MODULES_LIB="$HOST_LIBDIR" \
PYTHON_DISABLE_MODULES="readline _curses _curses_panel $PKG_PY_DISABLED_MODULES"
# python distutils per default adds -L$LIBDIR when linking binary extensions
sed -e "s|^ 'LIBDIR':.*| 'LIBDIR': '/usr/lib',|g" -i $(cat pybuilddir.txt)/_sysconfigdata.py
}
makeinstall_host() {
make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \
PYTHON_MODULES_LIB="$HOST_LIBDIR" \
PYTHON_DISABLE_MODULES="readline _curses _curses_panel $PKG_PY_DISABLED_MODULES" \
install
}
post_makeinstall_host() {
rm -fr $PKG_BUILD/.$HOST_NAME/build/temp.*
}
pre_configure_target() {
export PYTHON_FOR_BUILD=$TOOLCHAIN/bin/python
}
make_target() {
make CC="$CC" LDFLAGS="$TARGET_LDFLAGS -L." \
PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR"
}
makeinstall_target() {
make CC="$CC" DESTDIR=$SYSROOT_PREFIX \
PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install
make CC="$CC" DESTDIR=$INSTALL \
PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install
}
post_makeinstall_target() {
rm -fr $PKG_BUILD/.$TARGET_NAME/build/temp.*
for dir in bsddb idlelib lib-tk lib2to3 msilib pydoc_data test unittest; do
rm -rf $INSTALL/usr/lib/python*/$dir
done
rm -rf $INSTALL/usr/lib/python*/config
rm -rf $INSTALL/usr/bin/2to3
rm -rf $INSTALL/usr/bin/idle
rm -rf $INSTALL/usr/bin/pydoc
rm -rf $INSTALL/usr/bin/smtpd.py
rm -rf $INSTALL/usr/bin/python*-config
cd $INSTALL/usr/lib/$PKG_PYTHON_VERSION
$TOOLCHAIN/bin/python -Wi -t -B $PKG_BUILD/Lib/compileall.py -d /usr/lib/$PKG_PYTHON_VERSION -f .
find $INSTALL/usr/lib/$PKG_PYTHON_VERSION -name "*.py" -exec rm -f {} \; &>/dev/null
# strip
chmod u+w $INSTALL/usr/lib/libpython*.so.*
debug_strip $INSTALL/usr
}

View File

@ -1,50 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index bcd83bf..5e54a0d 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -461,6 +463,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
esac; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
# Build static library
@@ -1142,7 +1145,9 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff --git a/setup.py b/setup.py
index a46bf35..528e9df 100644
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@
from distutils.command.install_lib import install_lib
from distutils.spawn import find_executable
-cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
+cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('PYTHONXCPREFIX' in os.environ)
def get_platform():
# cross build
@@ -292,6 +292,14 @@ class PyBuildExt(build_ext):
(ext.name, sys.exc_info()[1]))
self.failed.append(ext.name)
return
+
+ # Inport check will not work when cross-compiling.
+ if os.environ.has_key('PYTHONXCPREFIX'):
+ self.announce(
+ 'WARNING: skipping inport check for cross-compiled: "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:

View File

@ -1,16 +0,0 @@
diff --git a/setup.py b/setup.py
index a46bf35..d6ef5be 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,10 @@ host_platform = get_platform()
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+try:
+ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
+except KeyError:
+ disabled_module_list = []
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if

View File

@ -1,24 +0,0 @@
diff --git a/setup.py b/setup.py
index 07af0b6..6426b22 100644
--- a/setup.py
+++ b/setup.py
@@ -2030,10 +2030,18 @@ class PyBuildExt(build_ext):
if not self.verbose:
config_args.append("-q")
+
+ #NOTE: best solution is to add to configure script
+ # as config subdirectory and to exclude darwin
+ # (see configure_ctypes_darwin).
+ #FIXME: lets for now pass all top configure arguments
+ #and do not modify configure script.
+ config_args = sysconfig.get_config_var("CONFIG_ARGS")
+
# Pass empty CFLAGS because we'll just append the resulting
# CFLAGS to Python's; -g or -O2 is to be avoided.
cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
- % (ffi_builddir, ffi_srcdir, " ".join(config_args))
+ % (ffi_builddir, ffi_srcdir, config_args)
res = os.system(cmd)
if res or not os.path.exists(ffi_configfile):

View File

@ -1,29 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 918f210..c82366c 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1011,24 +1011,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \

View File

@ -1,12 +0,0 @@
diff -Naur Python-2.7.10.orig/configure Python-2.7.10/configure
--- Python-2.7.10.orig/configure 2015-08-18 12:24:03.016649265 -0700
+++ Python-2.7.10/configure 2015-08-18 12:23:41.716695873 -0700
@@ -14215,7 +14215,7 @@
# first curses configure check
ac_save_cppflags="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
+CPPFLAGS="$CPPFLAGS -I${prefix}/usr/include/ncursesw"
for ac_header in curses.h ncurses.h
do :

View File

@ -1,54 +0,0 @@
Adjust library/header paths for cross-compilation
When cross-compiling third-party extensions, the get_python_inc() or
get_python_lib() can be called, to return the path to headers or
libraries. However, they use the sys.prefix of the host Python, which
returns incorrect paths when cross-compiling (paths pointing to host
headers and libraries).
In order to fix this, we introduce the _python_sysroot, _python_prefix
and _python_exec_prefix variables, that allow to override these
values, and get correct header/library paths when cross-compiling
third-party Python modules.
The _python_sysroot variable is also used to prefix the LIBDIR value
taken from the sysconfigdata module.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/Lib/distutils/sysconfig.py
===================================================================
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -19,8 +19,13 @@
from distutils.errors import DistutilsPlatformError
# These are needed in a couple of spots, so just compute them once.
-PREFIX = os.path.normpath(sys.prefix)
-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+if "_python_sysroot" in os.environ:
+ _sysroot=os.environ.get('_python_sysroot')
+ PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_prefix'))
+ EXEC_PREFIX = os.path.normpath(_sysroot + os.environ.get('_python_exec_prefix'))
+else:
+ PREFIX = os.path.normpath(sys.prefix)
+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
# Path to the base directory of the project. On Windows the binary may
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
Index: b/Lib/distutils/command/build_ext.py
===================================================================
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -237,7 +237,10 @@
if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
if not sysconfig.python_build:
# building third party extensions
- self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
+ libdir = sysconfig.get_config_var('LIBDIR')
+ if "_python_sysroot" in os.environ:
+ libdir = os.environ.get("_python_sysroot") + libdir
+ self.library_dirs.append(libdir)
else:
# building python standard extensions
self.library_dirs.append('.')

View File

@ -1,34 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index bf3aed7..7ff5c79 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -464,6 +464,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
+ CONFIG_ARGS="$(CONFIG_ARGS)" \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
libpython$(VERSION).so: $(LIBRARY_OBJS)
@@ -1104,6 +1105,7 @@ libainstall: all python-config
# This goes into $(exec_prefix)
sharedinstall: sharedmods
CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ CONFIG_ARGS="$(CONFIG_ARGS)" \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
--skip-build \
--prefix=$(prefix) \
diff --git a/setup.py b/setup.py
index 6426b22..d2776dd 100644
--- a/setup.py
+++ b/setup.py
@@ -32,6 +32,9 @@ host_platform = get_platform()
# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
+sysconfig.get_config_vars()
+sysconfig._CONFIG_VARS.update(os.environ)
+
# This global variable is used to hold the list of modules to be disabled.
try:
disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()

View File

@ -1,21 +0,0 @@
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 2aa1cb1..529e2d4 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -83,6 +83,16 @@ class UnixCCompiler(CCompiler):
if sys.platform == "cygwin":
exe_extension = ".exe"
+ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
+ """Remove standard library path from rpath"""
+ libraries, library_dirs, runtime_library_dirs = \
+ CCompiler._fix_lib_args(self, libraries, library_dirs,
+ runtime_library_dirs)
+ libdir = sysconfig.get_config_var('LIBDIR')
+ if runtime_library_dirs and (libdir in runtime_library_dirs):
+ runtime_library_dirs.remove(libdir)
+ return libraries, library_dirs, runtime_library_dirs
+
def preprocess(self, source,
output_file=None, macros=None, include_dirs=None,
extra_preargs=None, extra_postargs=None):

View File

@ -1,208 +0,0 @@
Add a backport of http://bugs.python.org/issue16235 so we can use
python-config for cross builds.
This basically replaces the python version of python-config with a pure-shell
version that's already preprocessed when installed and doesn't depend
on the sysconfig import that usually leads to bad data/results.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Index: b/configure.ac
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -885,6 +885,7 @@
# Other platforms follow
if test $enable_shared = "yes"; then
+ PY_ENABLE_SHARED=1
AC_DEFINE(Py_ENABLE_SHARED, 1, [Defined if Python is built as a shared library.])
case $ac_sys_system in
BeOS*)
@@ -945,6 +946,7 @@
esac
else # shared is disabled
+ PY_ENABLE_SHARED=0
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
@@ -1921,6 +1923,9 @@
AC_SUBST(BLDSHARED)
AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED)
+AC_SUBST(PY_ENABLE_SHARED)
+LIBPL="${prefix}/lib/python${VERSION}/config"
+AC_SUBST(LIBPL)
# SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX, .dll on Cygwin
AC_MSG_CHECKING(SO)
@@ -4588,7 +4593,7 @@
AC_SUBST(ENSUREPIP)
# generate output files
-AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
+AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh)
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
AC_OUTPUT
Index: b/Makefile.pre.in
===================================================================
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -166,7 +166,7 @@
SUBDIRSTOO= Include Lib Misc Demo
# Files and directories to be distributed
-CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
+CONFIGFILES= configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Misc/python-config.sh
DISTFILES= README ChangeLog $(CONFIGFILES)
DISTDIRS= $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST= $(DISTFILES) $(DISTDIRS)
@@ -410,7 +410,7 @@
# Default target
all: @DEF_MAKE_ALL_RULE@
-build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
+build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks python-config
# Compile a binary with gcc profile guided optimization.
profile-opt:
@@ -1101,10 +1101,12 @@
fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
-python-config: $(srcdir)/Misc/python-config.in
+python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
- sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
+ sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
+ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
+ sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' Misc/python-config.sh >python-config
# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@@ -1163,7 +1165,7 @@
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
- rm python-config
+ $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
@if [ -s Modules/python.exp -a \
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
echo; echo "Installing support files for building shared extension modules on AIX:"; \
@@ -1345,6 +1347,7 @@
config.cache config.log pyconfig.h Modules/config.c
-rm -rf build platform
-rm -rf $(PYTHONFRAMEWORKDIR)
+ -rm -f python-config.py python-config
# Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre]
Index: b/Misc/python-config.sh.in
===================================================================
--- /dev/null
+++ b/Misc/python-config.sh.in
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+exit_with_usage ()
+{
+ echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--configdir"
+ exit $1
+}
+
+if [ "$1" = "" ] ; then
+ exit_with_usage 1
+fi
+
+# Returns the actual prefix where this script was installed to.
+installed_prefix ()
+{
+ RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
+ if which readlink >/dev/null 2>&1 ; then
+ RESULT=$(readlink -f "$RESULT")
+ fi
+ echo $RESULT
+}
+
+prefix_build="@prefix@"
+prefix_real=$(installed_prefix "$0")
+
+# Use sed to fix paths from their built to locations to their installed to locations.
+prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
+exec_prefix_build="@exec_prefix@"
+exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
+includedir=$(echo "@includedir@")
+libdir=$(echo "@libdir@")
+CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#")
+VERSION="@VERSION@"
+LIBM="@LIBM@"
+LIBC="@LIBC@"
+SYSLIBS="$LIBM $LIBC"
+LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}"
+BASECFLAGS="@BASECFLAGS@"
+LDLIBRARY="@LDLIBRARY@"
+LINKFORSHARED="@LINKFORSHARED@"
+OPT="@OPT@"
+PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
+LDVERSION="@LDVERSION@"
+LIBDEST=${prefix}/lib/python${VERSION}
+LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
+SO="@SO@"
+PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
+INCDIR="-I$includedir/python${VERSION}"
+PLATINCDIR="-I$includedir/python${VERSION}"
+
+# Scan for --help or unknown argument.
+for ARG in $*
+do
+ case $ARG in
+ --help)
+ exit_with_usage 0
+ ;;
+ --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
+ ;;
+ *)
+ exit_with_usage 1
+ ;;
+esac
+done
+
+for ARG in "$@"
+do
+ case "$ARG" in
+ --prefix)
+ echo "$prefix"
+ ;;
+ --exec-prefix)
+ echo "$exec_prefix"
+ ;;
+ --includes)
+ echo "$INCDIR $PLATINCDIR"
+ ;;
+ --cflags)
+ echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
+ ;;
+ --libs)
+ echo "$LIBS"
+ ;;
+ --ldflags)
+ LINKFORSHAREDUSED=
+ if [ -z "$PYTHONFRAMEWORK" ] ; then
+ LINKFORSHAREDUSED=$LINKFORSHARED
+ fi
+ LIBPLUSED=
+ if [ "$PY_ENABLE_SHARED" = "0" ] ; then
+ LIBPLUSED="-L$LIBPL"
+ fi
+ echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
+ ;;
+ --extension-suffix)
+ echo "$SO"
+ ;;
+ --configdir)
+ echo "$LIBPL"
+ ;;
+esac
+done

View File

@ -1,21 +0,0 @@
Abort on failed module build
When building a Python module fails, the setup.py script currently
doesn't exit with an error, and simply continues. This is not a really
nice behavior, so this patch changes setup.py to abort with an error,
so that the build issue is clearly noticeable.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -283,6 +283,7 @@
print "Failed to build these modules:"
print_three_column(failed)
print
+ sys.exit(1)
def build_extension(self, ext):

View File

@ -1,51 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 918f210..eb9ee6b 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -438,7 +438,7 @@ coverage:
# Build the interpreter
-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
+$(BUILDPYTHON): Modules/python.o $(LDLIBRARY)
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
@@ -465,18 +465,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library
-# avoid long command lines, same as LIBRARY_OBJS
-$(LIBRARY): $(LIBRARY_OBJS)
- -rm -f $@
- $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o
- $(AR) $(ARFLAGS) $@ $(PARSER_OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS)
- $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS)
- $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS)
- $(AR) $(ARFLAGS) $@ $(MODOBJS)
- $(RANLIB) $@
-
libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
@@ -1090,18 +1078,6 @@ libainstall: all python-config
else true; \
fi; \
done
- @if test -d $(LIBRARY); then :; else \
- if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
- if test "$(SO)" = .dll; then \
- $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \
- else \
- $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
- $(RANLIB) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \
- fi; \
- else \
- echo Skip install of $(LIBRARY) - use make frameworkinstall; \
- fi; \
- fi
$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in

View File

@ -1,13 +0,0 @@
diff --git a/Python/compile.c b/Python/compile.c
index 1cf53f9..25665b5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -32,7 +32,7 @@
#include "symtable.h"
#include "opcode.h"
-int Py_OptimizeFlag = 0;
+int Py_OptimizeFlag = 1;
#define DEFAULT_BLOCK_SIZE 16
#define DEFAULT_BLOCKS 8

View File

@ -1,12 +0,0 @@
diff --git a/setup.py b/setup.py
index 69b76e7..7a50cc3 100644
--- a/setup.py
+++ b/setup.py
@@ -2315,7 +2315,6 @@ def main():
# Scripts to install
scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
- 'Tools/scripts/2to3',
'Lib/smtpd.py']
)

View File

@ -1,13 +0,0 @@
diff -Naur Python-2.7.13.orig/Lib/platform.py Python-2.7.13/Lib/platform.py
--- Python-2.7.13.orig/Lib/platform.py 2017-01-08 11:57:36.615886244 +0100
+++ Python-2.7.13/Lib/platform.py 2017-01-08 12:12:44.567848271 +0100
@@ -1250,6 +1250,9 @@
system = 'Windows'
release = 'Vista'
+ if machine == 'aarch64' and architecture()[0] == '32bit':
+ machine = 'armv7l'
+
_uname_cache = system,node,release,version,machine,processor
return _uname_cache

View File

@ -3,19 +3,20 @@
PKG_NAME="Python3"
# When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION!
PKG_VERSION="3.7.3"
PKG_SHA256="da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318"
PKG_VERSION="3.7.5"
PKG_SHA256="e85a76ea9f3d6c485ec1780fca4e500725a4a7bbc63c78ebc44170de9b619d94"
PKG_LICENSE="OSS"
PKG_SITE="http://www.python.org/"
PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/${PKG_NAME::-1}-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="zlib:host bzip2:host libffi:host util-linux:host xz:host"
PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl Python3:host readline ncurses"
PKG_DEPENDS_TARGET="toolchain Python3:host sqlite expat zlib bzip2 xz openssl libffi readline ncurses"
PKG_LONGDESC="Python3 is an interpreted object-oriented programming language."
PKG_PYTHON_VERSION=python3.7
PKG_TOOLCHAIN="autotools"
PKG_PYTHON_VERSION="python3.7"
PKG_PY_DISABLED_MODULES="_tkinter nis gdbm bsddb ossaudiodev"
PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false
ac_cv_prog_SVNVERSION=/bin/false
--disable-pyc-build
@ -39,6 +40,7 @@ PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false
--with-expat=builtin
--with-libmpdec=none
--with-doc-strings
--with-system-ffi
--without-pymalloc
--without-ensurepip
"
@ -65,7 +67,7 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false
--enable-readline
--enable-bzip2
--enable-zlib
--disable-xz
--enable-xz
--disable-tk
--enable-curses
--disable-pydoc
@ -76,22 +78,26 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false
--with-expat=system
--with-libmpdec=none
--with-doc-strings
--with-system-ffi
--without-pymalloc
--without-ensurepip
--with-threads
--enable-ipv6
"
post_unpack() {
# This is needed to make sure the Python build process doesn't try to
# regenerate those files with the pgen program. Otherwise, it builds
# pgen for the target, and tries to run it on the host.
touch $PKG_BUILD/Include/graminit.h
touch $PKG_BUILD/Python/graminit.c
pre_configure_host() {
export PYTHON_MODULES_INCLUDE="$HOST_INCDIR"
export PYTHON_MODULES_LIB="$HOST_LIBDIR"
export DISABLED_EXTENSIONS="readline _curses _curses_panel $PKG_PY_DISABLED_MODULES"
}
post_make_host() {
# python distutils per default adds -L$LIBDIR when linking binary extensions
sed -e "s|^ 'LIBDIR':.*| 'LIBDIR': '/usr/lib',|g" -i $(find $PKG_BUILD/.$HOST_NAME -not -path '*/__pycache__/*' -name '_sysconfigdata__*.py')
}
post_makeinstall_host() {
rm -f $TOOLCHAIN/bin/python*-config
ln -sf $PKG_PYTHON_VERSION $TOOLCHAIN/bin/python
rm -f $TOOLCHAIN/bin/smtpd.py*
rm -f $TOOLCHAIN/bin/pyvenv
rm -f $TOOLCHAIN/bin/pydoc*
@ -101,7 +107,15 @@ post_makeinstall_host() {
cp $PKG_BUILD/Tools/scripts/reindent.py $TOOLCHAIN/lib/$PKG_PYTHON_VERSION
}
pre_configure_target() {
export PYTHON_MODULES_INCLUDE="$TARGET_INCDIR"
export PYTHON_MODULES_LIB="$TARGET_LIBDIR"
export DISABLED_EXTENSIONS="$PKG_PY_DISABLED_MODULES"
}
post_makeinstall_target() {
ln -sf $PKG_PYTHON_VERSION $INSTALL/usr/bin/python
rm -fr $PKG_BUILD/.$TARGET_NAME/build/temp.*
PKG_INSTALL_PATH_LIB=$INSTALL/usr/lib/$PKG_PYTHON_VERSION
@ -110,12 +124,13 @@ post_makeinstall_target() {
rm -rf $PKG_INSTALL_PATH_LIB/$dir
done
rm -rf $PKG_INSTALL_PATH_LIB/distutils/command/*.exe
rm -rf $INSTALL/usr/bin/pyvenv
rm -rf $INSTALL/usr/bin/python*-config
rm -rf $INSTALL/usr/bin/smtpd.py $INSTALL/usr/bin/smtpd.py.*
$TOOLCHAIN/bin/python3 -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py -d ${PKG_INSTALL_PATH_LIB#${INSTALL}} -b -f $PKG_INSTALL_PATH_LIB
find $PKG_INSTALL_PATH_LIB -name "*.py" -exec rm -f {} \; &>/dev/null
python_compile $PKG_INSTALL_PATH_LIB
# strip
chmod u+w $INSTALL/usr/lib/libpython*.so.*

View File

@ -1,14 +1,18 @@
From 722c059f586ffd26bb3c447c56cb4d2601d9f94c Mon Sep 17 00:00:00 2001
From 34116c8ab386aa1fb29f1819ee44b4e89260a1f1 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Sat, 8 Sep 2018 06:24:14 +0100
Subject: [PATCH] Default is optimized
Date: Thu, 17 Oct 2019 00:18:30 +0100
Subject: [PATCH] Enable optimization by default
Do *not* enable Py_OptimizeFlag=2 (or higher) as this will stop
__doc__ output from being generated which will prevent the qemu
package for Generic from building.
---
Python/pylifecycle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index fdb759f..432119e 100644
index 55d1ba5..fe6e082 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -115,7 +115,7 @@ int Py_VerboseFlag = 0; /* Needed by import.c */
@ -16,7 +20,7 @@ index fdb759f..432119e 100644
int Py_InteractiveFlag = 0; /* Needed by Py_FdIsInteractive() below */
int Py_InspectFlag = 0; /* Needed to determine whether to exit at SystemExit */
-int Py_OptimizeFlag = 0; /* Needed by compile.c */
+int Py_OptimizeFlag = 2; /* Needed by compile.c */
+int Py_OptimizeFlag = 1; /* Needed by compile.c */
int Py_NoSiteFlag = 0; /* Suppress 'import site' */
int Py_BytesWarningFlag = 0; /* Warn on str(bytes) and str(buffer) */
int Py_FrozenFlag = 0; /* Needed by getpath.c */

View File

@ -0,0 +1,68 @@
From 3f91ffafa84bccf04ac0cfecb37f96bbcee6173e Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Wed, 16 Oct 2019 23:11:57 +0100
Subject: [PATCH] 001-xcompile.patch
---
Makefile.pre.in | 4 ++++
setup.py | 9 ++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 31dc7c3..db3a9f6 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -622,10 +622,12 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
esac; \
echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
@@ -1592,8 +1594,10 @@ libainstall: @DEF_MAKE_RULE@ python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff --git a/setup.py b/setup.py
index 94a327b..8a1279d 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@ from distutils.command.install_lib import install_lib
from distutils.command.build_scripts import build_scripts
from distutils.spawn import find_executable
-cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
+cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('PYTHONXCPREFIX' in os.environ)
# Set common compiler and linker flags derived from the Makefile,
# reserved for building the interpreter and the stdlib modules.
@@ -445,6 +445,13 @@ class PyBuildExt(build_ext):
ext.name, level=1)
return
+ # Inport check will not work when cross-compiling.
+ if 'PYTHONXCPREFIX' in os.environ:
+ self.announce(
+ 'WARNING: skipping inport check for cross-compiled: "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:
--
2.7.4

View File

@ -1,18 +1,26 @@
From 3a68797fe5615ed12797597b28dd2cbf4dbcf2af Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Thu, 17 Oct 2019 12:53:04 +0100
Subject: [PATCH] 002-xcompile.patch
---
setup.py | 33 ++++++++++++---------------------
1 file changed, 12 insertions(+), 21 deletions(-)
diff --git a/setup.py b/setup.py
index d6ef5be..7a0d8f2 100644
index 8a1279d..8e2b536 100644
--- a/setup.py
+++ b/setup.py
@@ -439,13 +439,19 @@ class PyBuildExt(build_ext):
@@ -593,16 +593,19 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile)
def detect_modules(self):
- # Ensure that /usr/local is always used
- # Ensure that /usr/local is always used, but the local build
- # directories (i.e. '.' and 'Include') must be first. See issue
- # 10520.
- if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- if cross_compiling:
- self.add_gcc_paths()
- self.add_multiarch_paths()
+ try:
+ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
+ except KeyError:
@ -21,20 +29,24 @@ index d6ef5be..7a0d8f2 100644
+ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split()
+ except KeyError:
+ modules_lib_dirs = ['/usr/lib']
+ self.add_multiarch_paths()
self.add_multiarch_paths()
- # only change this for cross builds for 3.3, issues on Mageia
- if cross_compiling:
- self.add_gcc_paths()
+ for dir in modules_include_dirs:
+ add_dir_to_list(self.compiler.include_dirs, dir)
+ add_dir_to_list(self.compiler.include_dirs, dir)
+ for dir in modules_lib_dirs:
+ add_dir_to_list(self.compiler.library_dirs, dir)
+ add_dir_to_list(self.compiler.library_dirs, dir)
# Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files.
@@ -481,17 +487,6 @@ class PyBuildExt(build_ext):
@@ -638,18 +641,6 @@ class PyBuildExt(build_ext):
for directory in reversed(options.dirs):
add_dir_to_list(dir_list, directory)
- if os.path.normpath(sys.prefix) != '/usr' \
- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
- if (not cross_compiling and
- os.path.normpath(sys.base_prefix) != '/usr' and
- not sysconfig.get_config_var('PYTHONFRAMEWORK')):
- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
- # building a framework with different architectures than
@ -44,6 +56,9 @@ index d6ef5be..7a0d8f2 100644
- add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR"))
-
try:
have_unicode = unicode
except NameError:
system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
system_include_dirs = ['/usr/include']
# lib_dirs and inc_dirs are used to search for files;
--
2.7.4

View File

@ -0,0 +1,42 @@
From dc39d0d93427a92c387e3c1944368d7f08299c06 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Sun, 20 Oct 2019 02:32:03 +0100
Subject: [PATCH] Always generate legacy bytecode (allows removal of py source
code)
We want to create compiled bytecode for modules in the read-only
squashfs, and we also want to avoid distributing the py source code
which is a waste of space.
Unfortunately, after PEP3147, it's no longer possible to distribute
pyc bytecode without the corresponding py source code unless the
bytecode is generated using the "legacy" layout (ie. not using __pycache__).
Since all packages process their Python source code in different ways,
but ultimately all compile it via a call to py_compile.compile(), the
easiest solution is to patch py_compile.compile() so that it only
generates legacy bytecode.
https://www.python.org/dev/peps/pep-3147/#case-4-legacy-pyc-files-and-source-less-imports
---
Lib/py_compile.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 8e9dd57..d4b7f4f 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -119,6 +119,10 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1,
the resulting file would be regular and thus not the same type of file as
it was previously.
"""
+
+ if cfile:
+ cfile = file + 'c'
+
if invalidation_mode is None:
invalidation_mode = _get_default_invalidation_mode()
if cfile is None:
--
2.7.4

View File

@ -8,7 +8,7 @@ PKG_SHA256="d72329051ac748cb6764597b36b2a6ed965f9b95c11a224b1a92ddf27db721be"
PKG_LICENSE="GPL"
PKG_SITE="https://libreelec.tv"
PKG_URL="https://github.com/LibreELEC/service.libreelec.settings/archive/$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 connman pygobject dbus-python"
PKG_DEPENDS_TARGET="toolchain Python3 connman pygobject dbus-python"
PKG_LONGDESC="LibreELEC-settings: is a settings dialog for LibreELEC"
PKG_MAKE_OPTS_TARGET="DISTRONAME=$DISTRONAME ROOT_PASSWORD=$ROOT_PASSWORD"
@ -25,11 +25,9 @@ post_makeinstall_target() {
ADDON_INSTALL_DIR=$INSTALL/usr/share/kodi/addons/service.libreelec.settings
$TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_INSTALL_DIR/resources/lib/ -f
rm -rf $(find $ADDON_INSTALL_DIR/resources/lib/ -name "*.py")
#python_compile $ADDON_INSTALL_DIR/resources/lib/
$TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_INSTALL_DIR/oe.py -f
rm -rf $ADDON_INSTALL_DIR/oe.py
#python_compile $ADDON_INSTALL_DIR/oe.py
}
post_install() {

View File

@ -5,7 +5,7 @@
PKG_NAME="kodi"
PKG_LICENSE="GPL"
PKG_SITE="http://www.kodi.tv"
PKG_DEPENDS_TARGET="toolchain JsonSchemaBuilder:host TexturePacker:host Python2 zlib systemd lzo pcre swig:host libass curl fontconfig fribidi tinyxml libjpeg-turbo freetype libcdio taglib libxml2 libxslt rapidjson sqlite ffmpeg crossguid giflib libdvdnav libhdhomerun libfmt lirc libfstrcmp flatbuffers:host flatbuffers"
PKG_DEPENDS_TARGET="toolchain JsonSchemaBuilder:host TexturePacker:host Python3 zlib systemd lzo pcre swig:host libass curl fontconfig fribidi tinyxml libjpeg-turbo freetype libcdio taglib libxml2 libxslt rapidjson sqlite ffmpeg crossguid giflib libdvdnav libhdhomerun libfmt lirc libfstrcmp flatbuffers:host flatbuffers"
PKG_LONGDESC="A free and open source cross-platform media player."
PKG_BUILD_FLAGS="+speed"
@ -25,8 +25,8 @@ case $KODI_VENDOR in
PKG_SOURCE_NAME="kodi-$KODI_VENDOR-$PKG_VERSION.tar.gz"
;;
*)
PKG_VERSION="e31d257e4b6a9c5a622bb280d4abc4e44dc9eca5" # kodi19-pre-python3
PKG_SHA256="d8647c883661685bbcae6fd9f3312298636f4cacfb1b2ee53d4d349028579ffa"
PKG_VERSION="29f64ce850040abc9972fcf015a02a3804bdf8c6"
PKG_SHA256="1ee23b6d1b72f4224f9b0011195c65357cdab88579144e852967f6d3dd298c6c"
PKG_URL="https://github.com/xbmc/xbmc/archive/$PKG_VERSION.tar.gz"
PKG_SOURCE_NAME="kodi-$PKG_VERSION.tar.gz"
;;
@ -352,6 +352,9 @@ post_makeinstall_target() {
cp $PKG_DIR/fonts/*.ttf $INSTALL/usr/share/kodi/media/Fonts
fi
# Compile kodi Python site-packages to .pyc bytecode, and remove .py source code
python_compile $INSTALL/usr/lib/$PKG_PYTHON_VERSION/site-packages/kodi
debug_strip $INSTALL/usr/lib/kodi/kodi.bin
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3
# taken from http://stackoverflow.com/a/14879370 with minor modifications
@ -18,17 +18,19 @@ class hashabledict(dict):
class XMLCombiner(object):
def __init__(self, filenames):
if len(filenames) == 0:
raise Exception('No filenames!')
raise Exception('No filenames!')
try:
self.roots = [et.parse(f).getroot() for f in filenames]
self.roots = []
for f in filenames:
self.roots.append(et.parse(f).getroot())
except xml.etree.ElementTree.ParseError:
printerr("ERROR: Unable to parse XML file %s" % f)
raise
printerr("ERROR: Unable to parse XML file %s" % f)
raise
def prettyPrint(self, etree_xml):
minidom = xml.dom.minidom.parseString(et.tostring(etree_xml))
return "\n".join([line for line in minidom.toprettyxml(indent=" ", encoding="utf-8").split('\n') if line.strip() != ""])
return "\n".join([line for line in minidom.toprettyxml(indent=" ", encoding="utf-8").decode('utf-8').split('\n') if line.strip() != ""])
def combine(self):
for r in self.roots[1:]:

View File

@ -17,7 +17,6 @@
name resolve order = host bcast
printcap name = /dev/null
load printers = no
encrypt passwords = true
enable core files = no
passdb backend = smbpasswd
smb encrypt = disabled
@ -45,8 +44,6 @@
# Force this to "no" in case "yes" becomes the default in future
strict allocate = no
allocation roundup size = 0
# Using the following configurations as a template allows you to add
# writeable shares of disks and paths under /storage

View File

@ -3,18 +3,18 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="samba"
PKG_VERSION="4.9.14"
PKG_SHA256="14d249bd02f0227156dd77cf98e57cfef8fc5a9ec85e03873737cea7c386350a"
PKG_VERSION="4.11.2"
PKG_SHA256="d27bf1b7cf5f25fb5587896fccb73747a705f7cf7ee352b5cbab82841db09f1f"
PKG_LICENSE="GPLv3+"
PKG_SITE="https://www.samba.org"
PKG_URL="https://download.samba.org/pub/samba/stable/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain attr heimdal:host e2fsprogs Python2 zlib readline popt libaio connman"
PKG_DEPENDS_TARGET="toolchain attr heimdal:host e2fsprogs Python3 zlib readline popt libaio connman gnutls"
PKG_NEED_UNPACK="$(get_pkg_directory heimdal) $(get_pkg_directory e2fsprogs)"
PKG_LONGDESC="A free SMB / CIFS fileserver and client."
PKG_BUILD_FLAGS="-gold"
configure_package() {
PKG_MAKE_OPTS_TARGET="V=1"
#PKG_WAF_VERBOSE="-v"
if [ "$AVAHI_DAEMON" = yes ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET avahi"
@ -32,7 +32,7 @@ configure_package() {
PKG_CONFIGURE_OPTS="--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-lockdir=/var/lock \
--with-lockdir=/var/lock-samba \
--with-logfilebase=/var/log \
--with-piddir=/run/samba \
--with-privatedir=/run/samba \
@ -54,7 +54,6 @@ configure_package() {
$SMB_AESNI \
--disable-cups \
--disable-iprint \
--disable-gnutls \
--with-relro \
--with-sendfile-support \
--without-acl-support \
@ -79,7 +78,7 @@ configure_package() {
--bundled-libraries='ALL,!asn1_compile,!compile_et,!zlib' \
--without-quotas \
--with-syslog \
--without-json-audit \
--without-json \
--without-ldb-lmdb \
--nopyc --nopyo"
@ -96,7 +95,7 @@ pre_configure_target() {
rm -rf .$TARGET_NAME
# work around link issues
export LDFLAGS="$LDFLAGS -lreadline"
export LDFLAGS="$LDFLAGS -lreadline -lncurses"
# support 64-bit offsets and seeks on 32-bit platforms
if [ "$TARGET_ARCH" = "arm" ]; then
@ -108,21 +107,54 @@ configure_target() {
cp $PKG_DIR/config/samba4-cache.txt $PKG_BUILD/cache.txt
echo "Checking uname machine type: \"$TARGET_ARCH\"" >> $PKG_BUILD/cache.txt
PYTHON_CONFIG="$SYSROOT_PREFIX/usr/bin/python-config" \
export COMPILE_ET=$TOOLCHAIN/bin/heimdal_compile_et
export ASN1_COMPILE=$TOOLCHAIN/bin/heimdal_asn1_compile
PYTHON_CONFIG="$SYSROOT_PREFIX/usr/bin/python3-config" \
python_LDFLAGS="" python_LIBDIR="" \
./configure $PKG_CONFIGURE_OPTS
PYTHON=${TOOLCHAIN}/bin/python3 ./configure $PKG_CONFIGURE_OPTS
}
make_target() {
./buildtools/bin/waf build --targets=$PKG_SAMBA_TARGET -j$CONCURRENCY_MAKE_LEVEL
./buildtools/bin/waf build ${PKG_WAF_VERBOSE} --targets=$PKG_SAMBA_TARGET -j$CONCURRENCY_MAKE_LEVEL
}
makeinstall_target() {
./buildtools/bin/waf install --destdir=$SYSROOT_PREFIX --targets=smbclient -j$CONCURRENCY_MAKE_LEVEL
./buildtools/bin/waf install --destdir=$INSTALL --targets=$PKG_SAMBA_TARGET -j$CONCURRENCY_MAKE_LEVEL
./buildtools/bin/waf install ${PKG_WAF_VERBOSE} --destdir=$SYSROOT_PREFIX --targets=smbclient -j$CONCURRENCY_MAKE_LEVEL
./buildtools/bin/waf install ${PKG_WAF_VERBOSE} --destdir=$INSTALL --targets=$PKG_SAMBA_TARGET -j$CONCURRENCY_MAKE_LEVEL
}
copy_directory_of_links() {
local _tmp link
for link in "${1}/"*.so*; do
if [ -L ${link} ]; then
_tmp="$(readlink -m "${link}")"
cp -P ${_tmp} ${2}
cp -P ${_tmp}.* ${2} 2>/dev/null || true
else
cp -P ${link} ${2}
fi
done
}
perform_manual_install() {
mkdir -p ${SYSROOT_PREFIX}/usr/lib
copy_directory_of_links ${PKG_BUILD}/bin/shared ${SYSROOT_PREFIX}/usr/lib
mkdir -p ${INSTALL}/usr/lib
copy_directory_of_links ${PKG_BUILD}/bin/shared ${INSTALL}/usr/lib
copy_directory_of_links ${PKG_BUILD}/bin/shared/private ${INSTALL}/usr/lib
if [ "$SAMBA_SERVER" = "yes" ]; then
mkdir -p ${INSTALL}/usr/sbin
cp -L ${PKG_BUILD}/bin/smbd ${INSTALL}/usr/sbin
cp -L ${PKG_BUILD}/bin/nmbd ${INSTALL}/usr/sbin
fi
}
post_makeinstall_target() {
perform_manual_install
rm -rf $INSTALL/usr/bin
rm -rf $INSTALL/usr/lib/python*
rm -rf $INSTALL/usr/share/perl*

View File

@ -0,0 +1,31 @@
From 189440643157fbc872a1670b3e30b6c459dbd930 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Sun, 21 Jul 2019 15:12:03 +0200
Subject: [PATCH] heimdal_build/wscript_build: do not add host include
patch
Fixes cross-compile.
Upstream bug report: https://bugzilla.samba.org/show_bug.cgi?id=13856
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
source4/heimdal_build/wscript_build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index 45938b88315..e896c3e9454 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -131,7 +131,7 @@ def HEIMDAL_ASN1(name, source,
samba_cflags = CURRENT_CFLAGS(bld, name, ''),
depends_on = '',
samba_deps = to_list('roken replace'),
- samba_includes = includes + ["/usr/include/heimdal"],
+ samba_includes = includes,
local_include = True)
--
2.20.1

View File

@ -0,0 +1,933 @@
From 0f97300a0492caf46b1b07dd153d569eea8ff20b Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Mon, 7 Oct 2019 00:36:42 +0300
Subject: [PATCH 1/5] waf: upgrade to 2.0.18
This is required to get the new test_args parameter to conf.check, which
facilitates passing arguments to configuration test programs.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
Signed-off-by: Uri Simchoni <uri@samba.org>
---
buildtools/bin/waf | 2 +-
buildtools/wafsamba/wafsamba.py | 2 +-
third_party/waf/waflib/Configure.py | 20 +-
third_party/waf/waflib/Context.py | 6 +-
third_party/waf/waflib/Scripting.py | 7 +-
third_party/waf/waflib/TaskGen.py | 2 +-
third_party/waf/waflib/Tools/asm.py | 37 +++-
third_party/waf/waflib/Tools/c_aliases.py | 6 +-
third_party/waf/waflib/Tools/c_config.py | 9 +-
third_party/waf/waflib/Tools/c_tests.py | 3 +-
third_party/waf/waflib/Tools/gas.py | 1 +
third_party/waf/waflib/Tools/javaw.py | 2 +-
third_party/waf/waflib/Tools/nasm.py | 5 +
third_party/waf/waflib/Tools/python.py | 27 ++-
third_party/waf/waflib/extras/doxygen.py | 11 +-
third_party/waf/waflib/extras/fast_partial.py | 28 ++-
third_party/waf/waflib/extras/genpybind.py | 194 ++++++++++++++++++
third_party/waf/waflib/extras/local_rpath.py | 8 +-
third_party/waf/waflib/extras/objcopy.py | 9 +-
19 files changed, 329 insertions(+), 50 deletions(-)
create mode 100644 third_party/waf/waflib/extras/genpybind.py
diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 8413f2332b7..11ce8e7480a 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
import os, sys, inspect
-VERSION="2.0.17"
+VERSION="2.0.18"
REVISION="x"
GIT="x"
INSTALL="x"
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 76d65ebfcb6..205d5b4ac32 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -38,7 +38,7 @@ LIB_PATH="shared"
os.environ['PYTHONUNBUFFERED'] = '1'
-if Context.HEXVERSION not in (0x2001100,):
+if Context.HEXVERSION not in (0x2001200,):
Logs.error('''
Please use the version of waf that comes with Samba, not
a system installed version. See http://wiki.samba.org/index.php/Waf
diff --git a/third_party/waf/waflib/Configure.py b/third_party/waf/waflib/Configure.py
index db09c0e3a40..5762eb66954 100644
--- a/third_party/waf/waflib/Configure.py
+++ b/third_party/waf/waflib/Configure.py
@@ -524,7 +524,7 @@ def run_build(self, *k, **kw):
Though this function returns *0* by default, the build may set an attribute named *retval* on the
build context object to return a particular value. See :py:func:`waflib.Tools.c_config.test_exec_fun` for example.
- This function also provides a limited cache. To use it, provide the following option::
+ This function also features a cache which can be enabled by the following option::
def options(opt):
opt.add_option('--confcache', dest='confcache', default=0,
@@ -535,10 +535,21 @@ def run_build(self, *k, **kw):
$ waf configure --confcache
"""
- lst = [str(v) for (p, v) in kw.items() if p != 'env']
- h = Utils.h_list(lst)
+ buf = []
+ for key in sorted(kw.keys()):
+ v = kw[key]
+ if hasattr(v, '__call__'):
+ buf.append(Utils.h_fun(v))
+ else:
+ buf.append(str(v))
+ h = Utils.h_list(buf)
dir = self.bldnode.abspath() + os.sep + (not Utils.is_win32 and '.' or '') + 'conf_check_' + Utils.to_hex(h)
+ cachemode = kw.get('confcache', getattr(Options.options, 'confcache', None))
+
+ if not cachemode and os.path.exists(dir):
+ shutil.rmtree(dir)
+
try:
os.makedirs(dir)
except OSError:
@@ -549,7 +560,6 @@ def run_build(self, *k, **kw):
except OSError:
self.fatal('cannot use the configuration test folder %r' % dir)
- cachemode = getattr(Options.options, 'confcache', None)
if cachemode == 1:
try:
proj = ConfigSet.ConfigSet(os.path.join(dir, 'cache_run_build'))
@@ -589,7 +599,7 @@ def run_build(self, *k, **kw):
else:
ret = getattr(bld, 'retval', 0)
finally:
- if cachemode == 1:
+ if cachemode:
# cache the results each time
proj = ConfigSet.ConfigSet()
proj['cache_run_build'] = ret
diff --git a/third_party/waf/waflib/Context.py b/third_party/waf/waflib/Context.py
index d0759aada58..e3305fa3341 100644
--- a/third_party/waf/waflib/Context.py
+++ b/third_party/waf/waflib/Context.py
@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs
import waflib.Node
# the following 3 constants are updated on each new release (do not touch)
-HEXVERSION=0x2001100
+HEXVERSION=0x2001200
"""Constant updated on new releases"""
-WAFVERSION="2.0.17"
+WAFVERSION="2.0.18"
"""Constant updated on new releases"""
-WAFREVISION="6bc6cb599c702e985780e9f705b291b812123693"
+WAFREVISION="314689b8994259a84f0de0aaef74d7ce91f541ad"
"""Git revision when the waf version is updated"""
ABI = 20
diff --git a/third_party/waf/waflib/Scripting.py b/third_party/waf/waflib/Scripting.py
index ae17a8b4503..68dccf29ce0 100644
--- a/third_party/waf/waflib/Scripting.py
+++ b/third_party/waf/waflib/Scripting.py
@@ -332,7 +332,12 @@ def distclean(ctx):
else:
remove_and_log(env.out_dir, shutil.rmtree)
- for k in (env.out_dir, env.top_dir, env.run_dir):
+ env_dirs = [env.out_dir]
+ if not ctx.options.no_lock_in_top:
+ env_dirs.append(env.top_dir)
+ if not ctx.options.no_lock_in_run:
+ env_dirs.append(env.run_dir)
+ for k in env_dirs:
p = os.path.join(k, Options.lockfile)
remove_and_log(p, os.remove)
diff --git a/third_party/waf/waflib/TaskGen.py b/third_party/waf/waflib/TaskGen.py
index 532b7d5cdb4..f8f92bd57c1 100644
--- a/third_party/waf/waflib/TaskGen.py
+++ b/third_party/waf/waflib/TaskGen.py
@@ -905,7 +905,7 @@ def process_subst(self):
# paranoid safety measure for the general case foo.in->foo.h with ambiguous dependencies
for xt in HEADER_EXTS:
if b.name.endswith(xt):
- tsk.ext_in = tsk.ext_in + ['.h']
+ tsk.ext_out = tsk.ext_out + ['.h']
break
inst_to = getattr(self, 'install_path', None)
diff --git a/third_party/waf/waflib/Tools/asm.py b/third_party/waf/waflib/Tools/asm.py
index b6f26fb3df3..a57e83bb5ec 100644
--- a/third_party/waf/waflib/Tools/asm.py
+++ b/third_party/waf/waflib/Tools/asm.py
@@ -34,9 +34,22 @@ Support for pure asm programs and libraries should also work::
target = 'asmtest')
"""
-from waflib import Task
+import re
+from waflib import Errors, Logs, Task
from waflib.Tools.ccroot import link_task, stlink_task
from waflib.TaskGen import extension
+from waflib.Tools import c_preproc
+
+re_lines = re.compile(
+ '^[ \t]*(?:%)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef)[ \t]*(.*)\r*$',
+ re.IGNORECASE | re.MULTILINE)
+
+class asm_parser(c_preproc.c_parser):
+ def filter_comments(self, node):
+ code = node.read()
+ code = c_preproc.re_nl.sub('', code)
+ code = c_preproc.re_cpp.sub(c_preproc.repl, code)
+ return re_lines.findall(code)
class asm(Task.Task):
"""
@@ -45,6 +58,28 @@ class asm(Task.Task):
color = 'BLUE'
run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
+ def scan(self):
+ if self.env.ASM_NAME == 'gas':
+ return c_preproc.scan(self)
+ Logs.warn('There is no dependency scanner for Nasm!')
+ return [[], []]
+ elif self.env.ASM_NAME == 'nasm':
+ Logs.warn('The Nasm dependency scanner is incomplete!')
+
+ try:
+ incn = self.generator.includes_nodes
+ except AttributeError:
+ raise Errors.WafError('%r is missing the "asm" feature' % self.generator)
+
+ if c_preproc.go_absolute:
+ nodepaths = incn
+ else:
+ nodepaths = [x for x in incn if x.is_child_of(x.ctx.srcnode) or x.is_child_of(x.ctx.bldnode)]
+
+ tmp = asm_parser(nodepaths)
+ tmp.start(self.inputs[0], self.env)
+ return (tmp.nodes, tmp.names)
+
@extension('.s', '.S', '.asm', '.ASM', '.spp', '.SPP')
def asm_hook(self, node):
"""
diff --git a/third_party/waf/waflib/Tools/c_aliases.py b/third_party/waf/waflib/Tools/c_aliases.py
index c9d53692e8f..985e048bdb7 100644
--- a/third_party/waf/waflib/Tools/c_aliases.py
+++ b/third_party/waf/waflib/Tools/c_aliases.py
@@ -47,10 +47,12 @@ def sniff_features(**kw):
if x in exts:
feats.append('cxx')
break
-
if 'c' in exts or 'vala' in exts or 'gs' in exts:
feats.append('c')
+ if 's' in exts or 'S' in exts:
+ feats.append('asm')
+
for x in 'f f90 F F90 for FOR'.split():
if x in exts:
feats.append('fc')
@@ -66,7 +68,7 @@ def sniff_features(**kw):
if typ in ('program', 'shlib', 'stlib'):
will_link = False
for x in feats:
- if x in ('cxx', 'd', 'fc', 'c'):
+ if x in ('cxx', 'd', 'fc', 'c', 'asm'):
feats.append(x + typ)
will_link = True
if not will_link and not kw.get('features', []):
diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py
index d546be95614..80580cc9fcb 100644
--- a/third_party/waf/waflib/Tools/c_config.py
+++ b/third_party/waf/waflib/Tools/c_config.py
@@ -659,20 +659,21 @@ class test_exec(Task.Task):
"""
color = 'PINK'
def run(self):
+ cmd = [self.inputs[0].abspath()] + getattr(self.generator, 'test_args', [])
if getattr(self.generator, 'rpath', None):
if getattr(self.generator, 'define_ret', False):
- self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()])
+ self.generator.bld.retval = self.generator.bld.cmd_and_log(cmd)
else:
- self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()])
+ self.generator.bld.retval = self.generator.bld.exec_command(cmd)
else:
env = self.env.env or {}
env.update(dict(os.environ))
for var in ('LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'PATH'):
env[var] = self.inputs[0].parent.abspath() + os.path.pathsep + env.get(var, '')
if getattr(self.generator, 'define_ret', False):
- self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()], env=env)
+ self.generator.bld.retval = self.generator.bld.cmd_and_log(cmd, env=env)
else:
- self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()], env=env)
+ self.generator.bld.retval = self.generator.bld.exec_command(cmd, env=env)
@feature('test_exec')
@after_method('apply_link')
diff --git a/third_party/waf/waflib/Tools/c_tests.py b/third_party/waf/waflib/Tools/c_tests.py
index f858df5763c..7a4094f2450 100644
--- a/third_party/waf/waflib/Tools/c_tests.py
+++ b/third_party/waf/waflib/Tools/c_tests.py
@@ -224,6 +224,7 @@ def check_endianness(self):
def check_msg(self):
return tmp[0]
self.check(fragment=ENDIAN_FRAGMENT, features='c grep_for_endianness',
- msg='Checking for endianness', define='ENDIANNESS', tmp=tmp, okmsg=check_msg)
+ msg='Checking for endianness', define='ENDIANNESS', tmp=tmp,
+ okmsg=check_msg, confcache=None)
return tmp[0]
diff --git a/third_party/waf/waflib/Tools/gas.py b/third_party/waf/waflib/Tools/gas.py
index 77afed7038f..4a8745afd7e 100644
--- a/third_party/waf/waflib/Tools/gas.py
+++ b/third_party/waf/waflib/Tools/gas.py
@@ -16,3 +16,4 @@ def configure(conf):
conf.env.ASLNK_TGT_F = ['-o']
conf.find_ar()
conf.load('asm')
+ conf.env.ASM_NAME = 'gas'
diff --git a/third_party/waf/waflib/Tools/javaw.py b/third_party/waf/waflib/Tools/javaw.py
index fd1cf469abf..ceb08c28c87 100644
--- a/third_party/waf/waflib/Tools/javaw.py
+++ b/third_party/waf/waflib/Tools/javaw.py
@@ -246,7 +246,7 @@ def use_javac_files(self):
self.javac_task.dep_nodes.extend(tg.jar_task.outputs)
else:
if hasattr(tg, 'outdir'):
- base_node = tg.outdir.abspath()
+ base_node = tg.outdir
else:
base_node = tg.path.get_bld()
diff --git a/third_party/waf/waflib/Tools/nasm.py b/third_party/waf/waflib/Tools/nasm.py
index 411d5826b5d..9c51c18de18 100644
--- a/third_party/waf/waflib/Tools/nasm.py
+++ b/third_party/waf/waflib/Tools/nasm.py
@@ -24,3 +24,8 @@ def configure(conf):
conf.env.ASLNK_TGT_F = ['-o']
conf.load('asm')
conf.env.ASMPATH_ST = '-I%s' + os.sep
+ txt = conf.cmd_and_log(conf.env.AS + ['--version'])
+ if 'yasm' in txt.lower():
+ conf.env.ASM_NAME = 'yasm'
+ else:
+ conf.env.ASM_NAME = 'nasm'
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
index 63a8917d7c1..7c45a76ffd2 100644
--- a/third_party/waf/waflib/Tools/python.py
+++ b/third_party/waf/waflib/Tools/python.py
@@ -79,14 +79,19 @@ def process_py(self, node):
"""
Add signature of .py file, so it will be byte-compiled when necessary
"""
- assert(hasattr(self, 'install_path')), 'add features="py"'
+ assert(hasattr(self, 'install_path')), 'add features="py" for target "%s" in "%s/wscript".' % (self.target, self.path.nice_path())
+ self.install_from = getattr(self, 'install_from', None)
+ relative_trick = getattr(self, 'relative_trick', True)
+ if self.install_from:
+ assert isinstance(self.install_from, Node.Node), \
+ 'add features="py" for target "%s" in "%s/wscript" (%s).' % (self.target, self.path.nice_path(), type(self.install_from))
# where to install the python file
if self.install_path:
if self.install_from:
- self.add_install_files(install_to=self.install_path, install_from=node, cwd=self.install_from, relative_trick=True)
+ self.add_install_files(install_to=self.install_path, install_from=node, cwd=self.install_from, relative_trick=relative_trick)
else:
- self.add_install_files(install_to=self.install_path, install_from=node, relative_trick=True)
+ self.add_install_files(install_to=self.install_path, install_from=node, relative_trick=relative_trick)
lst = []
if self.env.PYC:
@@ -96,9 +101,11 @@ def process_py(self, node):
if self.install_path:
if self.install_from:
- pyd = Utils.subst_vars("%s/%s" % (self.install_path, node.path_from(self.install_from)), self.env)
+ target_dir = node.path_from(self.install_from) if relative_trick else node.name
+ pyd = Utils.subst_vars("%s/%s" % (self.install_path, target_dir), self.env)
else:
- pyd = Utils.subst_vars("%s/%s" % (self.install_path, node.path_from(self.path)), self.env)
+ target_dir = node.path_from(self.path) if relative_trick else node.name
+ pyd = Utils.subst_vars("%s/%s" % (self.install_path, target_dir), self.env)
else:
pyd = node.abspath()
@@ -115,7 +122,7 @@ def process_py(self, node):
tsk.pyd = pyd
if self.install_path:
- self.add_install_files(install_to=os.path.dirname(pyd), install_from=pyobj, cwd=node.parent.get_bld(), relative_trick=True)
+ self.add_install_files(install_to=os.path.dirname(pyd), install_from=pyobj, cwd=node.parent.get_bld(), relative_trick=relative_trick)
class pyc(Task.Task):
"""
@@ -433,11 +440,11 @@ def check_python_headers(conf, features='pyembed pyext'):
# Code using the Python API needs to be compiled with -fno-strict-aliasing
if env.CC_NAME == 'gcc':
- env.append_value('CFLAGS_PYEMBED', ['-fno-strict-aliasing'])
- env.append_value('CFLAGS_PYEXT', ['-fno-strict-aliasing'])
+ env.append_unique('CFLAGS_PYEMBED', ['-fno-strict-aliasing'])
+ env.append_unique('CFLAGS_PYEXT', ['-fno-strict-aliasing'])
if env.CXX_NAME == 'gcc':
- env.append_value('CXXFLAGS_PYEMBED', ['-fno-strict-aliasing'])
- env.append_value('CXXFLAGS_PYEXT', ['-fno-strict-aliasing'])
+ env.append_unique('CXXFLAGS_PYEMBED', ['-fno-strict-aliasing'])
+ env.append_unique('CXXFLAGS_PYEXT', ['-fno-strict-aliasing'])
if env.CC_NAME == "msvc":
from distutils.msvccompiler import MSVCCompiler
diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py
index 423d8455025..20cd9e1a852 100644
--- a/third_party/waf/waflib/extras/doxygen.py
+++ b/third_party/waf/waflib/extras/doxygen.py
@@ -85,6 +85,12 @@ class doxygen(Task.Task):
if not getattr(self, 'pars', None):
txt = self.inputs[0].read()
self.pars = parse_doxy(txt)
+
+ # Override with any parameters passed to the task generator
+ if getattr(self.generator, 'pars', None):
+ for k, v in self.generator.pars.items():
+ self.pars[k] = v
+
if self.pars.get('OUTPUT_DIRECTORY'):
# Use the path parsed from the Doxyfile as an absolute path
output_node = self.inputs[0].parent.get_bld().make_node(self.pars['OUTPUT_DIRECTORY'])
@@ -94,11 +100,6 @@ class doxygen(Task.Task):
output_node.mkdir()
self.pars['OUTPUT_DIRECTORY'] = output_node.abspath()
- # Override with any parameters passed to the task generator
- if getattr(self.generator, 'pars', None):
- for k, v in self.generator.pars.items():
- self.pars[k] = v
-
self.doxy_inputs = getattr(self, 'doxy_inputs', [])
if not self.pars.get('INPUT'):
self.doxy_inputs.append(self.inputs[0].parent)
diff --git a/third_party/waf/waflib/extras/fast_partial.py b/third_party/waf/waflib/extras/fast_partial.py
index 71b8318eecb..90a94723bb8 100644
--- a/third_party/waf/waflib/extras/fast_partial.py
+++ b/third_party/waf/waflib/extras/fast_partial.py
@@ -18,6 +18,7 @@ Usage::
opt.load('fast_partial')
Assumptions:
+* Start with a clean build (run "waf distclean" after enabling)
* Mostly for C/C++/Fortran targets with link tasks (object-only targets are not handled)
try it in the folder generated by utils/genbench.py
* For full project builds: no --targets and no pruning from subfolders
@@ -131,12 +132,18 @@ class bld_proxy(object):
data[x] = getattr(self, x)
db = os.path.join(self.variant_dir, Context.DBFILE + self.store_key)
- try:
- waflib.Node.pickle_lock.acquire()
+ with waflib.Node.pickle_lock:
waflib.Node.Nod3 = self.node_class
- x = Build.cPickle.dumps(data, Build.PROTOCOL)
- finally:
- waflib.Node.pickle_lock.release()
+ try:
+ x = Build.cPickle.dumps(data, Build.PROTOCOL)
+ except Build.cPickle.PicklingError:
+ root = data['root']
+ for node_deps in data['node_deps'].values():
+ for idx, node in enumerate(node_deps):
+ # there may be more cross-context Node objects to fix,
+ # but this should be the main source
+ node_deps[idx] = root.find_node(node.abspath())
+ x = Build.cPickle.dumps(data, Build.PROTOCOL)
Logs.debug('rev_use: storing %s', db)
Utils.writef(db + '.tmp', x, m='wb')
@@ -393,12 +400,17 @@ def is_stale(self):
Logs.debug('rev_use: must post %r because this is a clean build')
return True
- # 3. check if the configuration changed
- if os.stat(self.bld.bldnode.find_node('c4che/build.config.py').abspath()).st_mtime > dbstat:
+ # 3.a check if the configuration exists
+ cache_node = self.bld.bldnode.find_node('c4che/build.config.py')
+ if not cache_node:
+ return True
+
+ # 3.b check if the configuration changed
+ if os.stat(cache_node.abspath()).st_mtime > dbstat:
Logs.debug('rev_use: must post %r because the configuration has changed', self.name)
return True
- # 3.a any tstamp data?
+ # 3.c any tstamp data?
try:
f_deps = self.bld.f_deps
except AttributeError:
diff --git a/third_party/waf/waflib/extras/genpybind.py b/third_party/waf/waflib/extras/genpybind.py
new file mode 100644
index 00000000000..ac206ee8a8b
--- /dev/null
+++ b/third_party/waf/waflib/extras/genpybind.py
@@ -0,0 +1,194 @@
+import os
+import pipes
+import subprocess
+import sys
+
+from waflib import Logs, Task, Context
+from waflib.Tools.c_preproc import scan as scan_impl
+# ^-- Note: waflib.extras.gccdeps.scan does not work for us,
+# due to its current implementation:
+# The -MD flag is injected into the {C,CXX}FLAGS environment variable and
+# dependencies are read out in a separate step after compiling by reading
+# the .d file saved alongside the object file.
+# As the genpybind task refers to a header file that is never compiled itself,
+# gccdeps will not be able to extract the list of dependencies.
+
+from waflib.TaskGen import feature, before_method
+
+
+def join_args(args):
+ return " ".join(pipes.quote(arg) for arg in args)
+
+
+def configure(cfg):
+ cfg.load("compiler_cxx")
+ cfg.load("python")
+ cfg.check_python_version(minver=(2, 7))
+ if not cfg.env.LLVM_CONFIG:
+ cfg.find_program("llvm-config", var="LLVM_CONFIG")
+ if not cfg.env.GENPYBIND:
+ cfg.find_program("genpybind", var="GENPYBIND")
+
+ # find clang reasource dir for builtin headers
+ cfg.env.GENPYBIND_RESOURCE_DIR = os.path.join(
+ cfg.cmd_and_log(cfg.env.LLVM_CONFIG + ["--libdir"]).strip(),
+ "clang",
+ cfg.cmd_and_log(cfg.env.LLVM_CONFIG + ["--version"]).strip())
+ if os.path.exists(cfg.env.GENPYBIND_RESOURCE_DIR):
+ cfg.msg("Checking clang resource dir", cfg.env.GENPYBIND_RESOURCE_DIR)
+ else:
+ cfg.fatal("Clang resource dir not found")
+
+
+@feature("genpybind")
+@before_method("process_source")
+def generate_genpybind_source(self):
+ """
+ Run genpybind on the headers provided in `source` and compile/link the
+ generated code instead. This works by generating the code on the fly and
+ swapping the source node before `process_source` is run.
+ """
+ # name of module defaults to name of target
+ module = getattr(self, "module", self.target)
+
+ # create temporary source file in build directory to hold generated code
+ out = "genpybind-%s.%d.cpp" % (module, self.idx)
+ out = self.path.get_bld().find_or_declare(out)
+
+ task = self.create_task("genpybind", self.to_nodes(self.source), out)
+ # used to detect whether CFLAGS or CXXFLAGS should be passed to genpybind
+ task.features = self.features
+ task.module = module
+ # can be used to select definitions to include in the current module
+ # (when header files are shared by more than one module)
+ task.genpybind_tags = self.to_list(getattr(self, "genpybind_tags", []))
+ # additional include directories
+ task.includes = self.to_list(getattr(self, "includes", []))
+ task.genpybind = self.env.GENPYBIND
+
+ # Tell waf to compile/link the generated code instead of the headers
+ # originally passed-in via the `source` parameter. (see `process_source`)
+ self.source = [out]
+
+
+class genpybind(Task.Task): # pylint: disable=invalid-name
+ """
+ Runs genpybind on headers provided as input to this task.
+ Generated code will be written to the first (and only) output node.
+ """
+ quiet = True
+ color = "PINK"
+ scan = scan_impl
+
+ @staticmethod
+ def keyword():
+ return "Analyzing"
+
+ def run(self):
+ if not self.inputs:
+ return
+
+ args = self.find_genpybind() + self._arguments(
+ resource_dir=self.env.GENPYBIND_RESOURCE_DIR)
+
+ output = self.run_genpybind(args)
+
+ # For debugging / log output
+ pasteable_command = join_args(args)
+
+ # write generated code to file in build directory
+ # (will be compiled during process_source stage)
+ (output_node,) = self.outputs
+ output_node.write("// {}\n{}\n".format(
+ pasteable_command.replace("\n", "\n// "), output))
+
+ def find_genpybind(self):
+ return self.genpybind
+
+ def run_genpybind(self, args):
+ bld = self.generator.bld
+
+ kwargs = dict(cwd=bld.variant_dir)
+ if hasattr(bld, "log_command"):
+ bld.log_command(args, kwargs)
+ else:
+ Logs.debug("runner: {!r}".format(args))
+ proc = subprocess.Popen(
+ args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs)
+ stdout, stderr = proc.communicate()
+
+ if not isinstance(stdout, str):
+ stdout = stdout.decode(sys.stdout.encoding, errors="replace")
+ if not isinstance(stderr, str):
+ stderr = stderr.decode(sys.stderr.encoding, errors="replace")
+
+ if proc.returncode != 0:
+ bld.fatal(
+ "genpybind returned {code} during the following call:"
+ "\n{command}\n\n{stdout}\n\n{stderr}".format(
+ code=proc.returncode,
+ command=join_args(args),
+ stdout=stdout,
+ stderr=stderr,
+ ))
+
+ if stderr.strip():
+ Logs.debug("non-fatal warnings during genpybind run:\n{}".format(stderr))
+
+ return stdout
+
+ def _include_paths(self):
+ return self.generator.to_incnodes(self.includes + self.env.INCLUDES)
+
+ def _inputs_as_relative_includes(self):
+ include_paths = self._include_paths()
+ relative_includes = []
+ for node in self.inputs:
+ for inc in include_paths:
+ if node.is_child_of(inc):
+ relative_includes.append(node.path_from(inc))
+ break
+ else:
+ self.generator.bld.fatal("could not resolve {}".format(node))
+ return relative_includes
+
+ def _arguments(self, genpybind_parse=None, resource_dir=None):
+ args = []
+ relative_includes = self._inputs_as_relative_includes()
+ is_cxx = "cxx" in self.features
+
+ # options for genpybind
+ args.extend(["--genpybind-module", self.module])
+ if self.genpybind_tags:
+ args.extend(["--genpybind-tag"] + self.genpybind_tags)
+ if relative_includes:
+ args.extend(["--genpybind-include"] + relative_includes)
+ if genpybind_parse:
+ args.extend(["--genpybind-parse", genpybind_parse])
+
+ args.append("--")
+
+ # headers to be processed by genpybind
+ args.extend(node.abspath() for node in self.inputs)
+
+ args.append("--")
+
+ # options for clang/genpybind-parse
+ args.append("-D__GENPYBIND__")
+ args.append("-xc++" if is_cxx else "-xc")
+ has_std_argument = False
+ for flag in self.env["CXXFLAGS" if is_cxx else "CFLAGS"]:
+ flag = flag.replace("-std=gnu", "-std=c")
+ if flag.startswith("-std=c"):
+ has_std_argument = True
+ args.append(flag)
+ if not has_std_argument:
+ args.append("-std=c++14")
+ args.extend("-I{}".format(n.abspath()) for n in self._include_paths())
+ args.extend("-D{}".format(p) for p in self.env.DEFINES)
+
+ # point to clang resource dir, if specified
+ if resource_dir:
+ args.append("-resource-dir={}".format(resource_dir))
+
+ return args
diff --git a/third_party/waf/waflib/extras/local_rpath.py b/third_party/waf/waflib/extras/local_rpath.py
index b2507e17a10..e3923d9b9d4 100644
--- a/third_party/waf/waflib/extras/local_rpath.py
+++ b/third_party/waf/waflib/extras/local_rpath.py
@@ -2,18 +2,20 @@
# encoding: utf-8
# Thomas Nagy, 2011 (ita)
+import copy
from waflib.TaskGen import after_method, feature
@after_method('propagate_uselib_vars')
@feature('cprogram', 'cshlib', 'cxxprogram', 'cxxshlib', 'fcprogram', 'fcshlib')
def add_rpath_stuff(self):
- all = self.to_list(getattr(self, 'use', []))
+ all = copy.copy(self.to_list(getattr(self, 'use', [])))
while all:
name = all.pop()
try:
tg = self.bld.get_tgen_by_name(name)
except:
continue
- self.env.append_value('RPATH', tg.link_task.outputs[0].parent.abspath())
- all.extend(self.to_list(getattr(tg, 'use', [])))
+ if hasattr(tg, 'link_task'):
+ self.env.append_value('RPATH', tg.link_task.outputs[0].parent.abspath())
+ all.extend(self.to_list(getattr(tg, 'use', [])))
diff --git a/third_party/waf/waflib/extras/objcopy.py b/third_party/waf/waflib/extras/objcopy.py
index 82d8359ecf7..bb7ca6ef224 100644
--- a/third_party/waf/waflib/extras/objcopy.py
+++ b/third_party/waf/waflib/extras/objcopy.py
@@ -15,7 +15,7 @@ objcopy_flags Additional flags passed to objcopy.
"""
from waflib.Utils import def_attrs
-from waflib import Task
+from waflib import Task, Options
from waflib.TaskGen import feature, after_method
class objcopy(Task.Task):
@@ -46,5 +46,8 @@ def map_objcopy(self):
self.add_install_files(install_to=self.objcopy_install_path, install_from=task.outputs[0])
def configure(ctx):
- ctx.find_program('objcopy', var='OBJCOPY', mandatory=True)
-
+ program_name = 'objcopy'
+ prefix = getattr(Options.options, 'cross_prefix', None)
+ if prefix:
+ program_name = '{}-{}'.format(prefix, program_name)
+ ctx.find_program(program_name, var='OBJCOPY', mandatory=True)
--
2.21.0
From a617ed134cd681fad7f11632bf2146141d135559 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Mon, 7 Oct 2019 00:37:17 +0300
Subject: [PATCH 2/5] wafsamba: use test_args instead of exec_args to support
cross-compilation
exec_args seems to have been a custom addition to Samba's copy of waf.
Upstream Waf has an identically-purposed parameter called test_args.
This parameter is being used for addiing runtime args to test programs that
are being run during configuration phases.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
Signed-off-by: Uri Simchoni <uri@samba.org>
---
buildtools/wafsamba/samba_autoconf.py | 6 +++---
buildtools/wafsamba/samba_cross.py | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 63664a41160..683f0d5316b 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -422,9 +422,9 @@ def CHECK_CODE(conf, code, define,
cflags.extend(ccflags)
if on_target:
- exec_args = conf.SAMBA_CROSS_ARGS(msg=msg)
+ test_args = conf.SAMBA_CROSS_ARGS(msg=msg)
else:
- exec_args = []
+ test_args = []
conf.COMPOUND_START(msg)
@@ -439,7 +439,7 @@ def CHECK_CODE(conf, code, define,
type=type,
msg=msg,
quote=quote,
- exec_args=exec_args,
+ test_args=test_args,
define_ret=define_ret)
except Exception:
if always:
diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
index 8863c2c53e7..60ddf967237 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -139,7 +139,7 @@ class cross_Popen(Utils.subprocess.Popen):
@conf
def SAMBA_CROSS_ARGS(conf, msg=None):
- '''get exec_args to pass when running cross compiled binaries'''
+ '''get test_args to pass when running cross compiled binaries'''
if not conf.env.CROSS_COMPILE:
return []
--
2.21.0
From e31112f990ce5c542f023c8ef77b3350c0254825 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Mon, 7 Oct 2019 00:37:31 +0300
Subject: [PATCH 3/5] wafsamba: avoid pre-forking if cross-compilation is
enabled
Waf supports pre-forking to run configuration tests, but this
doesn't play well with Samba's cross-compilation support, because
Samba monkey-patches the actual fork+exec, which doesn't happen
in a pre-forked process pool.
This patch emulates the impact of WAF_NO_PREFORK env var when
cross-compilation is enabled.
The blueprint for the solution has been suggested by Thomas Nagy
in https://bugzilla.samba.org/show_bug.cgi?id=13846#c7 (item #2)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
Signed-off-by: Uri Simchoni <uri@samba.org>
---
buildtools/wafsamba/samba_cross.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
index 60ddf967237..6fca470f2b7 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -147,6 +147,8 @@ def SAMBA_CROSS_ARGS(conf, msg=None):
if real_Popen is None:
real_Popen = Utils.subprocess.Popen
Utils.subprocess.Popen = cross_Popen
+ Utils.run_process = Utils.run_regular_process
+ Utils.get_process = Utils.alloc_process_pool = Utils.nada
ret = []
--
2.21.0
From cd3aa000f4df1c46c471b142a99fbfcbb08c4d3d Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Mon, 7 Oct 2019 00:37:41 +0300
Subject: [PATCH 4/5] wafsamba: pass environment to cross-execute tests
This can come in handy for cross-execute scripts in general, and
is particularly required by the samba-xc test for cross-answers /
cross-execute, because Samba sets LD_LIBRARY_PATH during rpath
checks, and the test program needs that in order to successfully
run.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
Signed-off-by: Uri Simchoni <uri@samba.org>
---
buildtools/wafsamba/samba_cross.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
index 6fca470f2b7..0868a855a0d 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -120,7 +120,8 @@ class cross_Popen(Utils.subprocess.Popen):
if use_answers:
p = real_Popen(newargs,
stdout=Utils.subprocess.PIPE,
- stderr=Utils.subprocess.PIPE)
+ stderr=Utils.subprocess.PIPE,
+ env=kw.get('env', {}))
ce_out, ce_err = p.communicate()
ans = (p.returncode, samba_utils.get_string(ce_out))
add_answer(ca_file, msg, ans)
--
2.21.0
From 02fdfc2016a54409b311d0cff993174c33b8a506 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Wed, 9 Oct 2019 21:53:43 +0300
Subject: [PATCH 5/5] autobuild: harden samba-xc test suite
Add more checks which directly test the behavior of
--cross-answers and --cross-execute.
Previous test tested things in a round-about way, checking
that running in all three modes (native, cross-execute,
cross-answers) yields the same result. It was vulnerable
to a degradation in which cross-compilation modes didn't
work at all and were running native tests, which is
what happened with the upgrade of waf.
The added tests check the following:
- That cross-excute with cross-answers sets the cross-answers file
- That the content of cross-answers file actually affects the build
configuration
- That a missing line in cross-answers fails the build
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
Signed-off-by: Uri Simchoni <uri@samba.org>
---
script/autobuild.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/script/autobuild.py b/script/autobuild.py
index 29e6234ded9..8c5603e931c 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -440,12 +440,22 @@ tasks = {
("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
("configure-cross-execute", "./configure.developer --out ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
" --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xe/ab" + samba_configure_params),
+ ("verify-cross-execute-output", "grep '^Checking value of NSIG' ./bin-xe/cross-answers.txt"),
("configure-cross-answers", "./configure.developer --out ./bin-xa --cross-compile" \
" --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa/ab" + samba_configure_params),
("compare-results", "script/compare_cc_results.py "
"./bin/c4che/default{} "
"./bin-xe/c4che/default{} "
"./bin-xa/c4che/default{}".format(*([CACHE_SUFFIX]*3))),
+ ("modify-cross-answers", "sed -i.bak -e 's/^\\(Checking value of NSIG:\\) .*/\\1 \"1234\"/' ./bin-xe/cross-answers.txt"),
+ ("configure-cross-answers-modified", "./configure.developer --out ./bin-xa2 --cross-compile" \
+ " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa2/ab" + samba_configure_params),
+ ("verify-cross-answers", "test $(sed -n -e 's/VALUEOF_NSIG = \\(.*\\)/\\1/p' ./bin-xa2/c4che/default{})" \
+ " = \"'1234'\"".format(CACHE_SUFFIX)),
+ ("invalidate-cross-answers", "sed -i.bak -e '/^Checking value of NSIG/d' ./bin-xe/cross-answers.txt"),
+ ("configure-cross-answers-fail", "./configure.developer --out ./bin-xa3 --cross-compile" \
+ " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa3/ab" + samba_configure_params + \
+ " ; test $? -ne 0"),
],
# test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environments
--
2.21.0

View File

@ -0,0 +1,85 @@
From b37110d0b380ec6b92a34c36ba39d73ae7590f92 Mon Sep 17 00:00:00 2001
From: Uri Simchoni <uri@samba.org>
Date: Sun, 20 Oct 2019 00:03:14 +0300
Subject: [PATCH] build: find pre-built heimdal build tools in case of embedded
heimdal
This patch fixes the case of finding asn1_compile and compile_et for
building embedded heimdal, by setting
--bundled-libraries='!asn1_compile,!compile_et' as configure flags.
The Heimdal build tools compile_et and asn1_compile are needed *only*
if we use the embedded heimdal (otherwise we don't build heimdal and
use headers that have been generated by those tools elsewhere).
For cross-compilation with embedded heimdal, it is vital to use host build
tools, and so asn1_compile and compile_et must be supplied and not
built. One way of doing this would be to set the COMPILE_ET and
ASN1_COMPILE env vars to the location of supplied binaries. Another way,
which is more commonly used, is to exclude asn1_compile and compile_et
from bundled packages via the switch
-bundled-libraries='!asn1_compile,!compile_et'. When this is done,
the build script searches the path for those tools and sets the
ASN1_COMPILE and COMPILE_ET vars accordingly. (this is admittedly
kind of a round-about way of doing things but this has become the
de-facto standard amongst embedded distro builders).
In commit 8061983d4882f3ba3f12da71443b035d7b672eec, this process of
finding the binaris has been moved to be carried out only in the
system heimdal case. As explained above, we only need these tools,
and hence the check, in bundled mode.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14164
Signed-off-by: Uri Simchoni <uri@samba.org>
---
wscript_configure_embedded_heimdal | 11 +++++++++++
wscript_configure_system_heimdal | 11 -----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/wscript_configure_embedded_heimdal b/wscript_configure_embedded_heimdal
index 8c55ae2a938..4fdae8062c5 100644
--- a/wscript_configure_embedded_heimdal
+++ b/wscript_configure_embedded_heimdal
@@ -1 +1,12 @@
conf.RECURSE('source4/heimdal_build')
+
+def check_system_heimdal_binary(name):
+ if conf.LIB_MAY_BE_BUNDLED(name):
+ return False
+ if not conf.find_program(name, var=name.upper()):
+ return False
+ conf.define('USING_SYSTEM_%s' % name.upper(), 1)
+ return True
+
+check_system_heimdal_binary("compile_et")
+check_system_heimdal_binary("asn1_compile")
diff --git a/wscript_configure_system_heimdal b/wscript_configure_system_heimdal
index 0ff6dad2f55..f77c177442f 100644
--- a/wscript_configure_system_heimdal
+++ b/wscript_configure_system_heimdal
@@ -36,14 +36,6 @@ def check_system_heimdal_lib(name, functions='', headers='', onlyif=None):
conf.define('USING_SYSTEM_%s' % name.upper(), 1)
return True
-def check_system_heimdal_binary(name):
- if conf.LIB_MAY_BE_BUNDLED(name):
- return False
- if not conf.find_program(name, var=name.upper()):
- return False
- conf.define('USING_SYSTEM_%s' % name.upper(), 1)
- return True
-
check_system_heimdal_lib("com_err", "com_right_r com_err", "com_err.h")
if check_system_heimdal_lib("roken", "rk_socket_set_reuseaddr", "roken.h"):
@@ -94,6 +86,3 @@ finally:
# With the proper checks in place we should be able to build against the system libtommath.
#if conf.CHECK_BUNDLED_SYSTEM('tommath', checkfunctions='mp_init', headers='tommath.h'):
# conf.define('USING_SYSTEM_TOMMATH', 1)
-
-check_system_heimdal_binary("compile_et")
-check_system_heimdal_binary("asn1_compile")
--
2.21.0

View File

@ -1,37 +1,48 @@
diff -Naur samba-4.5.5/buildtools/wafsamba/wafsamba.py samba-4.5.5.patch/buildtools/wafsamba/wafsamba.py
--- samba-4.5.5/buildtools/wafsamba/wafsamba.py 2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5.patch/buildtools/wafsamba/wafsamba.py 2017-02-17 15:33:36.453169574 +0100
@@ -330,9 +330,9 @@
if pc_files is not None and not private_library:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
From 0cb025d911dd3e2f9a9184293f571214192e3a54 Mon Sep 17 00:00:00 2001
From: MilhouseVH <milhouseVH.github@nmacleod.com>
Date: Tue, 19 Mar 2019 12:39:41 +0000
Subject: [PATCH] disable man pages
---
buildtools/wafsamba/wafsamba.py | 8 --------
docs-xml/wscript_build | 22 ----------------------
2 files changed, 30 deletions(-)
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index a077026..2a897d0 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -328,11 +328,6 @@ def SAMBA_LIBRARY(bld, libname, source,
else:
bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
- if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
- bld.env['XSLTPROC_MANPAGES']):
- bld.MANPAGES(manpages, install)
+# if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and
+# bld.env['XSLTPROC_MANPAGES']):
+# bld.MANPAGES(manpages, install)
-
-
Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY
@@ -437,8 +437,8 @@
@@ -437,9 +432,6 @@ def SAMBA_BINARY(bld, binname, source,
samba_ldflags = pie_ldflags
)
- if manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
- bld.MANPAGES(manpages, install)
+# if manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
+# bld.MANPAGES(manpages, install)
-
Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY
diff -Naur samba-4.5.5/docs-xml/wscript_build samba-4.5.5.patch/docs-xml/wscript_build
--- samba-4.5.5/docs-xml/wscript_build 2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5.patch/docs-xml/wscript_build 2017-02-17 15:44:45.142392019 +0100
@@ -127,23 +127,23 @@
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 86600ae..ba3c7e0 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -150,25 +150,3 @@ bld.SAMBA_GENERATOR(parameter_all,
target=parameter_all,
rule=smbdotconf_generate_parameter_list,
dep_vars=bld.dynconfig_varnames())
-
-def SMBDOTCONF_MANPAGE(bld, target):
- ''' assemble and build smb.conf.5 manual page'''
- bld.SAMBAMANPAGES(target, parameter_all)
@ -50,38 +61,9 @@ diff -Naur samba-4.5.5/docs-xml/wscript_build samba-4.5.5.patch/docs-xml/wscript
- if bld.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
- bld.SAMBAMANPAGES(krb5_localauth_manpages)
-
- if bld.SAMBA3_IS_ENABLED_MODULE('vfs_zfsacl'):
- bld.SAMBAMANPAGES('manpages/vfs_zfsacl.8')
+#def SMBDOTCONF_MANPAGE(bld, target):
+# ''' assemble and build smb.conf.5 manual page'''
+# bld.SAMBAMANPAGES(target, parameter_all)
+#
+#if ('XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']):
+#
+# SMBDOTCONF_MANPAGE(bld, 'manpages/smb.conf.5')
+# bld.SAMBAMANPAGES(manpages)
+#
+# if bld.CONFIG_SET('WITH_PAM_MODULES') and bld.CONFIG_SET('HAVE_PAM_START'):
+# bld.SAMBAMANPAGES(pam_winbind_manpages)
+#
+# if bld.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
+# bld.SAMBAMANPAGES(krb5_locator_manpages)
+#
+# if bld.CONFIG_SET('HAVE_KRB5_LOCALAUTH_PLUGIN_H'):
+# bld.SAMBAMANPAGES(krb5_localauth_manpages)
+#
+# if bld.SAMBA3_IS_ENABLED_MODULE('vfs_zfsacl'):
+# bld.SAMBAMANPAGES('manpages/vfs_zfsacl.8')
--- a/source4/scripting/wscript_build 2018-03-20 12:19:12.059332486 +0100
+++ b/source4/scripting/wscript_build 2018-03-20 12:19:32.087429756 +0100
@@ -12,8 +12,8 @@
bld.INSTALL_FILES('${SBINDIR}',
sbin_files,
chmod=MODE_755, python_fixup=True, flat=True)
- if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
- bld.MANPAGES(man_files, True)
+# if 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
+# bld.MANPAGES(man_files, True)
if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
bld.INSTALL_FILES('${BINDIR}',
- for manpage in vfs_module_manpages:
- if bld.SAMBA3_IS_ENABLED_MODULE(manpage):
- bld.SAMBAMANPAGES('manpages/%s.8' % manpage)
--
2.7.4

View File

@ -8,7 +8,7 @@ PKG_SHA256="4ed3fb427708c8a3ed5fe9c599532480f581078a1e0aec0e50f40eb58e9f0015"
PKG_LICENSE="GPL"
PKG_SITE="http://bitbucket.org/lambacck/distutilscross/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="Python2:host setuptools:host"
PKG_DEPENDS_HOST="Python3:host setuptools:host"
PKG_LONGDESC="distutilscross enhances distutils to support Cross Compile of Python extensions"
PKG_TOOLCHAIN="manual"

View File

@ -0,0 +1,57 @@
diff --git a/distutilscross/crosscompile.py b/distutilscross/crosscompile.py
index 31dfd6c..16b683e 100644
--- a/distutilscross/crosscompile.py
+++ b/distutilscross/crosscompile.py
@@ -13,7 +13,7 @@ class build(_build):
self.cross_compile = 0
def finalize_options(self):
- if self.cross_compile and os.environ.has_key('PYTHONXCPREFIX'):
+ if self.cross_compile and 'PYTHONXCPREFIX' in os.environ:
prefix = os.environ['PYTHONXCPREFIX']
sysconfig.get_python_lib = get_python_lib
sysconfig.PREFIX = prefix
@@ -31,8 +31,8 @@ class build(_build):
_get_python_lib = sysconfig.get_python_lib
def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
- if os.environ.has_key('PYTHONXCPREFIX'):
- print "Setting prefix"
+ if 'PYTHONXCPREFIX' in os.environ:
+ print("Setting prefix")
prefix = os.environ['PYTHONXCPREFIX']
return _get_python_lib(plat_specific, standard_lib, prefix)
@@ -50,24 +50,24 @@ def customize_compiler(compiler):
sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
'CCSHARED', 'LDSHARED', 'SO')
- if os.environ.has_key('CC'):
+ if 'CC' in os.environ:
cc = os.environ['CC']
- if os.environ.has_key('CXX'):
+ if 'CXX' in os.environ:
cxx = os.environ['CXX']
- if os.environ.has_key('LDSHARED'):
+ if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
- if os.environ.has_key('CPP'):
+ if 'CPP' in os.environ:
cpp = os.environ['CPP']
else:
cpp = cc + " -E" # not always
- if os.environ.has_key('LDFLAGS'):
+ if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
- if os.environ.has_key('OPT'):
+ if 'OPT' in os.environ:
opt = os.environ['OPT']
- if os.environ.has_key('CFLAGS'):
+ if 'CFLAGS' in os.environ:
cflags = opt + ' ' + os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
- if os.environ.has_key('CPPFLAGS'):
+ if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']

View File

@ -8,12 +8,12 @@ PKG_SHA256="5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9"
PKG_LICENSE="Apache"
PKG_SITE="http://martine.github.io/ninja/"
PKG_URL="https://github.com/ninja-build/ninja/archive/v$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="Python2:host"
PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="Small build system with a focus on speed"
PKG_TOOLCHAIN="manual"
make_host() {
python2 configure.py --bootstrap
python3 configure.py --bootstrap
}
makeinstall_host() {

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="pygobject"
PKG_VERSION="2.28.7"
@ -7,19 +8,18 @@ PKG_SHA256="bb9d25a3442ca7511385a7c01b057492095c263784ef31231ffe589d83a96a5a"
PKG_LICENSE="LGPL"
PKG_SITE="http://www.pygtk.org/"
PKG_URL="http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_TARGET="toolchain Python2 glib libffi"
PKG_DEPENDS_TARGET="toolchain Python3 glib libffi"
PKG_LONGDESC="A convenient wrapper for the GObject+ library for use in Python programs."
PKG_TOOLCHAIN="autotools"
PKG_CONFIGURE_OPTS_TARGET="--enable-thread --disable-introspection"
pre_configure_target() {
export PYTHON_INCLUDES="$($SYSROOT_PREFIX/usr/bin/python2-config --includes)"
export PYTHON_INCLUDES="$($SYSROOT_PREFIX/usr/bin/python3-config --includes)"
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
find $INSTALL/usr/lib -name "*.pyc" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/bin
rm -rf $INSTALL/usr/share/pygobject

View File

@ -3,21 +3,19 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="setuptools"
PKG_VERSION="39.2.0"
PKG_SHA256="ca8119dd5c2764a7d290518817de0b880d23d790913fcd797c02ad2aa39b8c41"
PKG_VERSION="41.4.0"
PKG_SHA256="185d519d6b283a10008427402cc3f834878759da279e5100b7810bc5f772ee1c"
PKG_LICENSE="OSS"
PKG_SITE="https://pypi.org/project/setuptools"
PKG_URL="https://github.com/pypa/setuptools/archive/v$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="Python2:host Python3:host"
PKG_DEPENDS_HOST="Python3:host"
PKG_LONGDESC="Replaces Setuptools as the standard method for working with Python module distributions."
PKG_TOOLCHAIN="manual"
make_host() {
python2 bootstrap.py
python3 bootstrap.py
}
makeinstall_host() {
exec_thread_safe python2 setup.py install --prefix=$TOOLCHAIN
exec_thread_safe python3 setup.py install --prefix=$TOOLCHAIN
}

View File

@ -3,12 +3,12 @@
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="Pillow"
PKG_VERSION="6.0.0"
PKG_SHA256="809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5"
PKG_VERSION="6.2.0"
PKG_SHA256="4548236844327a718ce3bb182ab32a16fa2050c61e334e959f554cac052fb0df"
PKG_LICENSE="BSD"
PKG_SITE="http://www.pythonware.com/products/pil/"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host zlib freetype libjpeg-turbo tiff"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host zlib freetype libjpeg-turbo tiff"
PKG_LONGDESC="The Python Imaging Library adds image processing capabilities to your Python interpreter."
PKG_TOOLCHAIN="manual"
@ -18,15 +18,15 @@ pre_make_target() {
}
make_target() {
python setup.py build --cross-compile
python3 setup.py build --cross-compile
}
makeinstall_target() {
python setup.py install --root=$INSTALL --prefix=/usr
python3 setup.py install --root=$INSTALL --prefix=/usr
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/bin
}

View File

@ -2,12 +2,12 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="pycryptodome"
PKG_VERSION="3.8.2"
PKG_SHA256="5bc40f8aa7ba8ca7f833ad2477b9d84e1bfd2630b22a46d9bbd221982f8c3ac0"
PKG_VERSION="3.9.0"
PKG_SHA256="dbeb08ad850056747aa7d5f33273b7ce0b9a77910604a1be7b7a6f2ef076213f"
PKG_LICENSE="BSD"
PKG_SITE="https://pypi.org/project/pycryptodome"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="PyCryptodome is a self-contained Python package of low-level cryptographic primitives."
PKG_TOOLCHAIN="manual"
@ -20,11 +20,11 @@ pre_configure_target() {
}
make_target() {
python setup.py build --cross-compile
python3 setup.py build --cross-compile
}
makeinstall_target() {
python setup.py install --root=$INSTALL --prefix=/usr
python3 setup.py install --root=$INSTALL --prefix=/usr
# Remove SelfTest bloat
find $INSTALL -type d -name SelfTest -exec rm -fr "{}" \; 2>/dev/null || true
@ -35,5 +35,5 @@ makeinstall_target() {
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
}

View File

@ -1,23 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="dbus-python"
PKG_VERSION="1.2.8"
PKG_SHA256="abf12bbb765e300bf8e2a1b2f32f85949eab06998dbda127952c31cb63957b6f"
PKG_VERSION="1.2.12"
PKG_SHA256="cdd4de2c4f5e58f287b12013ed7b41dee81d503c8d0d2397c5bd2fb01badf260"
PKG_LICENSE="GPL"
PKG_SITE="https://freedesktop.org/wiki/Software/dbus"
PKG_URL="https://dbus.freedesktop.org/releases/dbus-python/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 dbus dbus-glib"
PKG_DEPENDS_TARGET="toolchain Python3 dbus dbus-glib"
PKG_LONGDESC="D-BUS is a message bus, used for sending messages between applications."
PKG_BUILD_FLAGS="+lto"
pre_configure_target() {
export PYTHON_CONFIG="$SYSROOT_PREFIX/usr/bin/python2-config"
export PYTHON_INCLUDES="$($SYSROOT_PREFIX/usr/bin/python2-config --includes)"
export PYTHON_LIBS="$($SYSROOT_PREFIX/usr/bin/python2-config --ldflags)"
export PYTHON_CONFIG="$SYSROOT_PREFIX/usr/bin/python3-config"
export PYTHON_INCLUDES="$($SYSROOT_PREFIX/usr/bin/python3-config --includes)"
export PYTHON_LIBS="$($SYSROOT_PREFIX/usr/bin/python3-config --ldflags)"
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
find $INSTALL/usr/lib -name "*.pyc" -exec rm -rf "{}" ";"
python_remove_source
}

View File

@ -8,7 +8,7 @@ PKG_SHA256="b1f329139ba647a9548aa05fb95d046b4a677643070dc2afc05fa2e975d09ca5"
PKG_LICENSE="OSS"
PKG_SITE="http://pypi.org/project/simplejson"
PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host"
PKG_DEPENDS_TARGET="toolchain Python3 distutilscross:host"
PKG_LONGDESC="A simple, fast, complete, correct and extensible JSON encoder and decoder for Python 2.5+."
PKG_TOOLCHAIN="manual"
@ -17,14 +17,15 @@ pre_make_target() {
}
make_target() {
python setup.py build --cross-compile
python3 setup.py build --cross-compile
}
makeinstall_target() {
python setup.py install --root=$INSTALL --prefix=/usr
python3 setup.py install --root=$INSTALL --prefix=/usr
}
post_makeinstall_target() {
find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
python_remove_source
rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
}

View File

@ -33,7 +33,7 @@ To control the build behaviour of your package, use variables in the top-down or
| PKG_NEED_UNPACK | - | no | Space separated list of files or folders to include in package stamp calculation. If the stamp is invalidated through changes to package files or dependent files/folders the package is cleaned and rebuilt. e.g. `PKG_NEED_UNPACK="$(get_pkg_directory linux)"` will trigger clean/rebuild of a Linux kernel driver package when a change to the `linux` kernel package is detected. |
| PKG_TOOLCHAIN | auto | no | Control which build toolchain is used. For detailed information, see [reference](#toolchain-options). |
| PKG_BUILD_FLAGS | - | no | A space separated list of flags with which to fine-tune the build process. Flags can be enabled or disabled with a `+` or `-` prefix. For detailed information, see the [Reference](#build_flags-options). |
| PKG_PYTHON_VERSION | python2.7 | no | Define the Python version to be used. |
| PKG_PYTHON_VERSION | python3.7 | no | Define the Python version to be used. |
| PKG_IS_KERNEL_PKG | - | no | Set to `yes` for packages that include Linux kernel modules |
#### Meson Options

View File

@ -12,8 +12,6 @@ PKG_DEPENDS_TARGET="toolchain libftdi1 libusb-compat libxslt"
PKG_LONGDESC="LIRC is a package that allows you to decode and send infra-red signals."
PKG_TOOLCHAIN="autotools"
PKG_PYTHON_WANTED=Python2
PKG_CONFIGURE_OPTS_TARGET="ac_cv_header_alsa_asoundlib_h=no \
ac_cv_lib_asound_snd_async_del_handler=no \
--enable-devinput \

View File

@ -7,7 +7,7 @@ PKG_SHA256="13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469"
PKG_LICENSE="GPL"
PKG_SITE="http://wiki.qemu.org"
PKG_URL="https://download.qemu.org/qemu-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="toolchain:host glib:host pixman:host Python2:host zlib:host"
PKG_DEPENDS_HOST="toolchain:host glib:host pixman:host Python3:host zlib:host"
PKG_LONGDESC="QEMU is a generic and open source machine emulator and virtualizer."
pre_configure_host() {

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libxcb"
PKG_VERSION="1.13"
@ -7,7 +8,7 @@ PKG_SHA256="188c8752193c50ff2dbe89db4554c63df2e26a2e47b0fa415a70918b5b851daa"
PKG_LICENSE="OSS"
PKG_SITE="http://xcb.freedesktop.org"
PKG_URL="http://xcb.freedesktop.org/dist/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain util-macros Python2:host xcb-proto libpthread-stubs libXau"
PKG_DEPENDS_TARGET="toolchain util-macros Python3:host xcb-proto libpthread-stubs libXau"
PKG_LONGDESC="X C-language Bindings library."
PKG_BUILD_FLAGS="+pic"

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="xcb-proto"
PKG_VERSION="1.13"
@ -7,5 +8,9 @@ PKG_SHA256="7b98721e669be80284e9bbfeab02d2d0d54cd11172b72271e47a2fe875e2bde1"
PKG_LICENSE="OSS"
PKG_SITE="http://www.X.org"
PKG_URL="http://xcb.freedesktop.org/dist/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain util-macros Python2:host"
PKG_DEPENDS_TARGET="toolchain util-macros Python3:host"
PKG_LONGDESC="X C-language Bindings protocol headers."
post_makeinstall_target() {
python_remove_source
}

View File

@ -120,7 +120,7 @@ case "${UBOOT_SYSTEM}" in
$FIPDIR/fip_create --dump $DESTDIR/fip.bin
python2 $FIPDIR/acs_tool.pyc $DESTDIR/bl2.bin \
python3 $FIPDIR/acs_tool.pyc $DESTDIR/bl2.bin \
$DESTDIR/bl2_acs.bin \
$DESTDIR/acs.bin 0
@ -152,7 +152,7 @@ case "${UBOOT_SYSTEM}" in
$DESTDIR/bl301_zero.bin \
$DESTDIR/bl30_new.bin bl30
python2 $FIPDIR/acs_tool.pyc $DESTDIR/bl2.bin $DESTDIR/bl2_acs.bin $DESTDIR/acs.bin 0
python3 $FIPDIR/acs_tool.pyc $DESTDIR/bl2.bin $DESTDIR/bl2_acs.bin $DESTDIR/acs.bin 0
$FIPDIR/blx_fix.sh $DESTDIR/bl2_acs.bin \
$DESTDIR/zero_tmp \

View File

@ -91,7 +91,7 @@
GRAPHIC_DRIVERS=""
# Use a vendor specific KODI repo
KODI_VENDOR="raspberrypi"
# KODI_VENDOR="raspberrypi"
# KODI Player implementation to use (default / bcm2835-driver / mesa)
KODIPLAYER_DRIVER="bcm2835-driver"

View File

@ -47,7 +47,7 @@
GRAPHIC_DRIVERS=""
# Use a vendor specific KODI repo
KODI_VENDOR="rockchip"
# KODI_VENDOR="rockchip"
# KODI Player implementation to use (default / bcm2835-driver / libfslvpuwrap)
KODIPLAYER_DRIVER="$OPENGLES"

View File

@ -474,6 +474,8 @@ if [ "${TARGET}" = "target" -o "${TARGET}" = "init" ]; then
-exec rm -f {} \; 2>/dev/null || :
find ${INSTALL} -type d -exec rmdir -p {} \; 2>/dev/null || :
python_fix_abi "${INSTALL}"
if [ ! "${BUILD_WITH_DEBUG}" = "yes" ]; then
${STRIP} $(find ${INSTALL} \
-type f -name "*.so*" \

View File

@ -68,8 +68,8 @@ perl_mod=(JSON XML::Parser Thread::Queue)
case "${DISTRO}" in
fedora|centos|rhel)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python rpcgen)
deps_pkg+=(gcc-c++ xorg-x11-font-utils xorg-x11-font-utils xorg-x11-font-utils libxslt java-1.7.0-openjdk python2 rpcgen)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python3 rpcgen)
deps_pkg+=(gcc-c++ xorg-x11-font-utils xorg-x11-font-utils xorg-x11-font-utils libxslt java-1.7.0-openjdk python3 rpcgen)
if [[ ! $(rpm -qa glibc-static) ]]; then
deps+=(glibc-static)
deps_pkg+=(glibc-static)
@ -82,19 +82,19 @@ case "${DISTRO}" in
perl_pkg=(perl-JSON perl-XML-Parser perl-Thread-Queue)
;;
gentoo|sabayon)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python rpcgen)
deps_pkg+=("gcc[cxx]" mkfontscale mkfontdir bdftopcf libxslt virtual/jre python net-libs/rpcsvc-proto)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python3 rpcgen)
deps_pkg+=("gcc[cxx]" mkfontscale mkfontdir bdftopcf libxslt virtual/jre python3 net-libs/rpcsvc-proto)
files_pkg=(glibc ncurses)
perl_pkg=(JSON XML-Parser perl-Thread-Queue)
;;
arch)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python rpcgen)
deps_pkg+=(g++ xorg-mkfontscale xorg-mkfontdir xorg-bdftopcf libxslt "java-runtime-common jdk8-openjdk" python2 rpcsvc-proto)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python3 rpcgen)
deps_pkg+=(g++ xorg-mkfontscale xorg-mkfontdir xorg-bdftopcf libxslt "java-runtime-common jdk8-openjdk" python3 rpcsvc-proto)
perl_pkg=(perl-json perl-xml-parser perl)
;;
opensuse)
deps+=( g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
deps_pkg+=(gcc-c++ mkfontscale mkfontdir bdftopcf libxslt-tools java-1_8_0-openjdk python)
deps+=( g++ mkfontscale mkfontdir bdftopcf xsltproc java python3)
deps_pkg+=(gcc-c++ mkfontscale mkfontdir bdftopcf libxslt-tools java-1_8_0-openjdk python3)
if [[ ! $(rpm -qa glibc-devel-static) ]]; then
deps+=(glibc-devel-static)
deps_pkg+=(glibc-devel-static)
@ -102,8 +102,8 @@ case "${DISTRO}" in
perl_pkg=(perl-JSON perl-XML-Parser perl)
;;
*)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python)
deps_pkg+=(g++ xfonts-utils xfonts-utils xfonts-utils xsltproc default-jre python)
deps+=(g++ mkfontscale mkfontdir bdftopcf xsltproc java python3)
deps_pkg+=(g++ xfonts-utils xfonts-utils xfonts-utils xsltproc default-jre python3)
perl_pkg=(libjson-perl libxml-parser-perl perl)
;;
esac