diff --git a/config/functions b/config/functions index dea1198531..1d57c71273 100644 --- a/config/functions +++ b/config/functions @@ -131,6 +131,7 @@ reset_pkg_vars() { PKG_LICENSE="unknown" PKG_AUTORECONF="no" PKG_IS_ADDON="no" + PKG_PYTHON_VERSION="python2.7" } kernel_path() { diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADS1x15/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADS1x15/package.mk index 01e6a41f9b..360e10fd20 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADS1x15/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADS1x15/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python ADS1x15 Library" PKG_LONGDESC="Python code to use the ADS1015 and ADS1115 analog to digital converters with a Raspberry Pi or BeagleBone black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADXL345/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADXL345/package.mk index e7a9b110ec..d4ac033bd1 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADXL345/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_ADXL345/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python ADXL345 Library" PKG_LONGDESC="Python code to use the ADXL345 triple-axis accelerometer over I2C with a Raspberry Pi or BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_BMP/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_BMP/package.mk index 53bd936a03..da8527d48a 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_BMP/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_BMP/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python BMP Library" PKG_LONGDESC="Python library for accessing the BMP series pressure and temperature sensors like the BMP085/BMP180 on a Raspberry Pi or Beaglebone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_CharLCD/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_CharLCD/package.mk index 66f62647f6..f3f7f48571 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_CharLCD/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_CharLCD/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python CharLCD Library" PKG_LONGDESC="Python library for accessing Adafruit character LCDs from a Raspberry Pi or BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_DHT/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_DHT/package.mk index 7c31f1b0d8..32d17a6241 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_DHT/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_DHT/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python DHT Library" PKG_LONGDESC="Python library to read the DHT series of humidity and temperature sensors on a Raspberry Pi or Beaglebone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_GPIO/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_GPIO/package.mk index 726e6f5dcc..4c8216d0ba 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_GPIO/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_GPIO/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python GPIO Library" PKG_LONGDESC="Library to provide a cross-platform GPIO interface on the Raspberry Pi and Beaglebone Black using the RPi.GPIO and Adafruit_BBIO librarie" diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LED_Backpack/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LED_Backpack/package.mk index 9e1f23d1b7..25ffdd7bb2 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LED_Backpack/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LED_Backpack/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Python library for controlling LED backpack displays." PKG_LONGDESC="Python library for controlling LED backpack displays such as 8x8 matrices, bar graphs, and 7/14-segment displays on a Raspberry Pi or BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LSM303/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LSM303/package.mk index cd31471332..bb196ef45d 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LSM303/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_LSM303/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python LSM303 Library" PKG_LONGDESC="Python code to use the LSM303 accelerometer & magnetometer with Raspberry Pi & BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP3008/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP3008/package.mk index 0d7aa48584..cac7e35db0 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP3008/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP3008/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python MCP3008 Library" PKG_LONGDESC="Python code to use the MCP3008 analog to digital converter with a Raspberry Pi or BeagleBone black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP4725/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP4725/package.mk index 7e632a2f42..c86e6b1e71 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP4725/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_MCP4725/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python MCP4725 Library" PKG_LONGDESC="Python code to use the MCP4725 digital to analog converter with a Raspberry Pi or BeagleBone black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PCA9685/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PCA9685/package.mk index 5628c9b100..854c4c2ce3 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PCA9685/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PCA9685/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python PCA9685 Library" PKG_LONGDESC="Python code to use the PCA9685 PWM servo/LED controller with a Raspberry Pi or BeagleBone black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PureIO/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PureIO/package.mk index b2e4588baa..dc937d1b01 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PureIO/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_PureIO/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Pure python access to Linux IO including I2C and SPI." PKG_LONGDESC="Pure python access to Linux IO including I2C and SPI. Drop in replacement for smbus and spidev modules." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SI1145/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SI1145/package.mk index c4d8f414ae..4de7bfa145 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SI1145/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SI1145/package.mk @@ -24,7 +24,7 @@ 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_SOURCE_DIR="Python_SI1145-$PKG_VERSION*" -PKG_DEPENDS_TARGET="toolchain Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Python library for the SI1145" PKG_LONGDESC="Python library for accessing the SI1145 temperature sensor on a Raspberry Pi" diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SSD1306/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SSD1306/package.mk index 6568e83335..61ed7f7ea1 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SSD1306/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_SSD1306/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python SSD1306 Library" PKG_LONGDESC="SSD1306 oled driver library for 'monochrome' 128x64 and 128x32 OLEDs." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_TCS34725/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_TCS34725/package.mk index 116a7b28ba..a7cbc1efd5 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_TCS34725/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_TCS34725/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python TCS34725 Library" PKG_LONGDESC="Python code to use the TCS34725 color sensor with the Raspberry Pi & BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_VCNL40xx/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_VCNL40xx/package.mk index e88efd2b10..36a2efa766 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_VCNL40xx/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_VCNL40xx/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python VCNL40xx Library" PKG_LONGDESC="Python code to use the VCNL4000 & VCNL4010 proximity sensors with the Raspberry Pi & BeagleBone Black." diff --git a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_WS2801/package.mk b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_WS2801/package.mk index 704a7bef95..695e9cddf5 100644 --- a/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_WS2801/package.mk +++ b/packages/addons/addon-depends/adafruit-libraries-depends/Adafruit_Python_WS2801/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="Adafruit Python WS2801 Library" PKG_LONGDESC="Python code to control WS2801 and similar SPI interface addressable RGB LED strips on a Raspberry Pi & BeagleBone Black." diff --git a/packages/addons/addon-depends/enum34/package.mk b/packages/addons/addon-depends/enum34/package.mk index 80c5015a9f..7bd5412551 100644 --- a/packages/addons/addon-depends/enum34/package.mk +++ b/packages/addons/addon-depends/enum34/package.mk @@ -24,7 +24,7 @@ PKG_LICENSE="BSD" PKG_SITE="https://bitbucket.org/stoneleaf/enum34" PKG_URL="https://bitbucket.org/stoneleaf/$PKG_NAME/get/$PKG_VERSION.tar.bz2" PKG_SOURCE_DIR="stoneleaf-enum34-*" -PKG_DEPENDS_TARGET="toolchain Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_PRIORITY="optional" PKG_SECTION="python" PKG_SHORTDESC="Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4" diff --git a/packages/addons/addon-depends/librespot-depends/pyalsaaudio/package.mk b/packages/addons/addon-depends/librespot-depends/pyalsaaudio/package.mk index 77fd93bab6..b10730defe 100644 --- a/packages/addons/addon-depends/librespot-depends/pyalsaaudio/package.mk +++ b/packages/addons/addon-depends/librespot-depends/pyalsaaudio/package.mk @@ -22,7 +22,7 @@ PKG_SHA256="84e8f8da544d7f4bd96479ce4a237600077984d9be1d7f16c1d9a492ecf50085" PKG_LICENSE="PSF" PKG_SITE="http://larsimmisch.github.io/pyalsaaudio/" PKG_URL="https://files.pythonhosted.org/packages/source/${PKG_NAME:0:1}/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz" -PKG_DEPENDS_TARGET="toolchain Python distutilscross:host alsa-lib" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host alsa-lib" PKG_LONGDESC="ALSA bindings" make_target() { diff --git a/packages/addons/addon-depends/ninja/package.mk b/packages/addons/addon-depends/ninja/package.mk index 8fca6372e6..ebdfb4854d 100644 --- a/packages/addons/addon-depends/ninja/package.mk +++ b/packages/addons/addon-depends/ninja/package.mk @@ -23,6 +23,7 @@ PKG_ARCH="any" 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="toolchain Python2:host" PKG_SECTION="devel" PKG_SHORTDESC="Small build system with a focus on speed" PKG_LONGDESC="Small build system with a focus on speed" diff --git a/packages/addons/addon-depends/python-libusb1/package.mk b/packages/addons/addon-depends/python-libusb1/package.mk index be0c459205..05494a0699 100644 --- a/packages/addons/addon-depends/python-libusb1/package.mk +++ b/packages/addons/addon-depends/python-libusb1/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" PKG_LICENSE="LGPL" PKG_SITE="https://github.com/vpelletier/python-libusb1" PKG_URL="https://github.com/vpelletier/$PKG_NAME/archive/$PKG_VERSION.tar.gz" -PKG_DEPENDS_TARGET="toolchain Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_PRIORITY="optional" PKG_SECTION="python" PKG_SHORTDESC="Pure-python wrapper for libusb-1.0" diff --git a/packages/addons/addon-depends/rpi-tools-depends/RPi.GPIO/package.mk b/packages/addons/addon-depends/rpi-tools-depends/RPi.GPIO/package.mk index 87ace6a6eb..c403523ee3 100644 --- a/packages/addons/addon-depends/rpi-tools-depends/RPi.GPIO/package.mk +++ b/packages/addons/addon-depends/rpi-tools-depends/RPi.GPIO/package.mk @@ -23,7 +23,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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python" PKG_SHORTDESC="A module to control Raspberry Pi GPIO channels" PKG_LONGDESC="A module to control Raspberry Pi GPIO channels" @@ -32,7 +32,7 @@ PKG_AUTORECONF="no" pre_configure_target() { export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr" export LDSHARED="$CC -shared" - export CPPFLAGS="$TARGET_CPPFLAGS -I${SYSROOT_PREFIX}/usr/include/python2.7" + export CPPFLAGS="$TARGET_CPPFLAGS -I${SYSROOT_PREFIX}/usr/include/$PKG_PYTHON_VERSION" } make_target() { diff --git a/packages/addons/addon-depends/rpi-tools-depends/picamera/package.mk b/packages/addons/addon-depends/rpi-tools-depends/picamera/package.mk index c70d5f267c..6180f8926a 100644 --- a/packages/addons/addon-depends/rpi-tools-depends/picamera/package.mk +++ b/packages/addons/addon-depends/rpi-tools-depends/picamera/package.mk @@ -23,7 +23,7 @@ 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 Python distutilscross:host bcm2835-driver" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host bcm2835-driver" PKG_SECTION="python" PKG_SHORTDESC="A python and shell interface for the Raspberry Pi camera module" PKG_LONGDESC="A python and shell interface for the Raspberry Pi camera module" diff --git a/packages/addons/addon-depends/system-tools-depends/dstat/package.mk b/packages/addons/addon-depends/system-tools-depends/dstat/package.mk index e46ffb0d72..8e66a68eb9 100644 --- a/packages/addons/addon-depends/system-tools-depends/dstat/package.mk +++ b/packages/addons/addon-depends/system-tools-depends/dstat/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python" +PKG_DEPENDS_TARGET="toolchain Python2" PKG_SECTION="tools" PKG_SHORTDESC="Versatile resource statistics tool" PKG_LONGDESC="Versatile resource statistics tool" diff --git a/packages/addons/addon-depends/system-tools-depends/i2c-tools/package.mk b/packages/addons/addon-depends/system-tools-depends/i2c-tools/package.mk index 2c101fe852..7e28ae322f 100644 --- a/packages/addons/addon-depends/system-tools-depends/i2c-tools/package.mk +++ b/packages/addons/addon-depends/system-tools-depends/i2c-tools/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="debug/tools" PKG_SHORTDESC="i2c-tools: bus probing tool, eeprom decoding/programming and SMBus python interface" PKG_LONGDESC="The i2c-tools package contains a heterogeneous set of I2C tools for Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers, EEPROM decoding scripts, EEPROM programming tools, and a python module for SMBus access." @@ -39,7 +39,7 @@ make_target() { CC="$CC" \ AR="$TARGET_AR" \ CFLAGS="$TARGET_CFLAGS" \ - CPPFLAGS="$TARGET_CPPFLAGS -I${SYSROOT_PREFIX}/usr/include/python2.7" + CPPFLAGS="$TARGET_CPPFLAGS -I${SYSROOT_PREFIX}/usr/include/$PKG_PYTHON_VERSION" } makeinstall_target() { diff --git a/packages/addons/driver/steamcontroller/package.mk b/packages/addons/driver/steamcontroller/package.mk index c104a771a8..be43ac11e1 100644 --- a/packages/addons/driver/steamcontroller/package.mk +++ b/packages/addons/driver/steamcontroller/package.mk @@ -24,7 +24,7 @@ PKG_ARCH="any" PKG_LICENSE="MIT" PKG_SITE="https://github.com/ynsta/steamcontroller" PKG_URL="https://github.com/ynsta/steamcontroller/archive/$PKG_VERSION.tar.gz" -PKG_DEPENDS_TARGET="toolchain Python distutilscross:host python-libusb1 enum34 linux:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host python-libusb1 enum34 linux:host" PKG_SECTION="driver" PKG_SHORTDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed." PKG_LONGDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed." @@ -62,6 +62,6 @@ addon() { fi cp $(get_build_dir linux)/usr/include/linux/input.h $ADDON_BUILD/$PKG_ADDON_ID/include/linux/ - python -Wi -t -B $TOOLCHAIN/lib/python2.7/compileall.py $ADDON_BUILD/$PKG_ADDON_ID/lib/ -f 1>/dev/null + $TOOLCHAIN/bin/python -Wi -t -B $TOOLCHAIN/lib/$PKG_PYTHON_VERSION/compileall.py $ADDON_BUILD/$PKG_ADDON_ID/lib/ -f 1>/dev/null find $ADDON_BUILD/$PKG_ADDON_ID/lib/ -name '*.py' -exec rm {} \; } diff --git a/packages/addons/service/hyperion/package.mk b/packages/addons/service/hyperion/package.mk index 1f562d120d..fd9d537d45 100644 --- a/packages/addons/service/hyperion/package.mk +++ b/packages/addons/service/hyperion/package.mk @@ -24,7 +24,7 @@ PKG_REV="106" 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 Python libusb qtbase protobuf rpi_ws281x" +PKG_DEPENDS_TARGET="toolchain Python2 libusb qtbase protobuf rpi_ws281x" PKG_SECTION="service" PKG_SHORTDESC="Hyperion: an AmbiLight controller" PKG_LONGDESC="Hyperion($PKG_VERSION) is an modern opensource AmbiLight implementation." diff --git a/packages/addons/service/librespot/package.mk b/packages/addons/service/librespot/package.mk index 953c2cd78b..2b68e62c84 100644 --- a/packages/addons/service/librespot/package.mk +++ b/packages/addons/service/librespot/package.mk @@ -55,7 +55,7 @@ makeinstall_target() { addon() { mkdir -p "$ADDON_BUILD/$PKG_ADDON_ID" - cp "$(get_build_dir pyalsaaudio)/.install_pkg/usr/lib/python2.7/site-packages/alsaaudio.so" \ + cp "$(get_build_dir pyalsaaudio)/.install_pkg/usr/lib/$PKG_PYTHON_VERSION/site-packages/alsaaudio.so" \ "$ADDON_BUILD/$PKG_ADDON_ID" mkdir -p "$ADDON_BUILD/$PKG_ADDON_ID/bin" diff --git a/packages/addons/service/tvheadend42/package.mk b/packages/addons/service/tvheadend42/package.mk index b45f9eff2a..b6031b367c 100644 --- a/packages/addons/service/tvheadend42/package.mk +++ b/packages/addons/service/tvheadend42/package.mk @@ -26,7 +26,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://www.tvheadend.org" PKG_URL="https://github.com/tvheadend/tvheadend/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="tvheadend-${PKG_VERSION}*" -PKG_DEPENDS_TARGET="toolchain curl dvb-tools libdvbcsa libiconv openssl pngquant:host Python:host yasm" +PKG_DEPENDS_TARGET="toolchain curl dvb-tools libdvbcsa libiconv openssl pngquant:host Python2:host yasm" 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" diff --git a/packages/devel/boost/package.mk b/packages/devel/boost/package.mk index 45fd9fb19a..121b2a5d68 100644 --- a/packages/devel/boost/package.mk +++ b/packages/devel/boost/package.mk @@ -25,7 +25,7 @@ PKG_SITE="http://www.boost.org/" PKG_URL="$SOURCEFORGE_SRC/boost/boost/1.61.0/${PKG_NAME}_${PKG_VERSION}.tar.bz2" PKG_SOURCE_DIR="${PKG_NAME}_${PKG_VERSION}" PKG_DEPENDS_HOST="" -PKG_DEPENDS_TARGET="toolchain boost:host Python:host zlib bzip2" +PKG_DEPENDS_TARGET="toolchain boost:host Python2:host zlib bzip2" PKG_SECTION="devel" PKG_SHORTDESC="boost: Peer-reviewed STL style libraries for C++" PKG_LONGDESC="Boost provides free peer-reviewed portable C++ source libraries. The emphasis is on libraries which work well with the C++ Standard Library. One goal is to establish existing practice and provide reference implementations so that the Boost libraries are suitable for eventual standardization. Some of the libraries have already been proposed for inclusion in the C++ Standards Committee's upcoming C++ Standard Library Technical Report." diff --git a/packages/devel/glib/package.mk b/packages/devel/glib/package.mk index b18f278171..bcdc6daed5 100644 --- a/packages/devel/glib/package.mk +++ b/packages/devel/glib/package.mk @@ -24,7 +24,7 @@ PKG_ARCH="any" PKG_LICENSE="LGPL" PKG_SITE="http://www.gtk.org/" PKG_URL="http://ftp.gnome.org/pub/gnome/sources/glib/${PKG_VERSION%.*}/$PKG_NAME-$PKG_VERSION.tar.xz" -PKG_DEPENDS_TARGET="toolchain zlib libffi Python:host util-linux" +PKG_DEPENDS_TARGET="toolchain zlib libffi Python2:host util-linux" PKG_DEPENDS_HOST="libffi:host pcre:host" PKG_SECTION="devel" PKG_SHORTDESC="glib: C support library" diff --git a/packages/devel/heimdal/package.mk b/packages/devel/heimdal/package.mk index 23fb2b14d2..06d534bcd6 100644 --- a/packages/devel/heimdal/package.mk +++ b/packages/devel/heimdal/package.mk @@ -24,7 +24,7 @@ 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_SOURCE_DIR="$PKG_NAME-$PKG_NAME-$PKG_VERSION" -PKG_DEPENDS_HOST="toolchain e2fsprogs:host" +PKG_DEPENDS_HOST="toolchain e2fsprogs:host Python2:host" PKG_SECTION="devel" PKG_SHORTDESC="heimdal: Kerberos 5, PKIX, CMS, GSS-API, SPNEGO, NTLM, Digest-MD5 and, SASL implementation." PKG_LONGDESC="Heimdal is an implementation of Kerberos 5 (and some more stuff) largely written in Sweden (which was important when we started writing it, less so now). It is freely available under a three clause BSD style license. " diff --git a/packages/devel/libcec/package.mk b/packages/devel/libcec/package.mk index e6a554f20a..9a91b43c69 100644 --- a/packages/devel/libcec/package.mk +++ b/packages/devel/libcec/package.mk @@ -68,7 +68,8 @@ pre_configure_target() { } post_makeinstall_target() { - if [ -d $INSTALL/usr/lib/python2.7/dist-packages ]; then - mv $INSTALL/usr/lib/python2.7/dist-packages $INSTALL/usr/lib/python2.7/site-packages + PYTHON_DIR=$INSTALL/usr/lib/$PKG_PYTHON_VERSION + if [ -d $PYTHON_DIR/dist-packages ]; then + mv $PYTHON_DIR/dist-packages $PYTHON_DIR/site-packages fi } diff --git a/packages/graphics/mesa/package.mk b/packages/graphics/mesa/package.mk index 029d5d3a0c..30962fe375 100644 --- a/packages/graphics/mesa/package.mk +++ b/packages/graphics/mesa/package.mk @@ -31,7 +31,7 @@ PKG_IS_ADDON="no" PKG_AUTORECONF="yes" if [ "$DISPLAYSERVER" = "x11" ]; then - PKG_DEPENDS_TARGET="toolchain Python:host expat glproto dri2proto presentproto libdrm libXext libXdamage libXfixes libXxf86vm libxcb libX11 systemd dri3proto libxshmfence openssl" + PKG_DEPENDS_TARGET="toolchain Python2:host expat glproto dri2proto presentproto libdrm libXext libXdamage libXfixes libXxf86vm libxcb libX11 systemd dri3proto libxshmfence openssl" export DRI_DRIVER_INSTALL_DIR=$XORG_PATH_DRI export DRI_DRIVER_SEARCH_DIR=$XORG_PATH_DRI @@ -40,7 +40,7 @@ if [ "$DISPLAYSERVER" = "x11" ]; then MESA_GLX="--enable-glx --enable-driglx-direct --enable-glx-tls" MESA_EGL_PLATFORMS="--with-platforms=x11,drm" else - PKG_DEPENDS_TARGET="toolchain Python:host expat libdrm" + PKG_DEPENDS_TARGET="toolchain Python2:host expat libdrm" MESA_DRI="--enable-dri --disable-dri3" MESA_GLX="--disable-glx --disable-driglx-direct --disable-glx-tls" MESA_EGL_PLATFORMS="--with-platforms=drm" diff --git a/packages/lang/Python/patches/Python-2.7.11-017-getentropy-linux.patch b/packages/lang/Python/patches/Python-2.7.11-017-getentropy-linux.patch deleted file mode 100644 index 38e53778dc..0000000000 --- a/packages/lang/Python/patches/Python-2.7.11-017-getentropy-linux.patch +++ /dev/null @@ -1,41 +0,0 @@ -Upstream-Status: Backport - -Signed-off-by: Andreas Oberritter - -From 905d1b30ac7cb0e31c57cec0533825c8f170b942 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Mon, 9 Jan 2017 11:10:41 +0100 -Subject: [PATCH] Don't use getentropy() on Linux - -Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function but -read from /dev/urandom to get random bytes, for example in os.urandom(). On -Linux, getentropy() is implemented which getrandom() is blocking mode, whereas -os.urandom() should not block. - -(cherry picked from commit 2687486756721e39164fa9f597e468c35d495227) ---- - Python/random.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/Python/random.c b/Python/random.c -index b4bc1f3..f3f5d14 100644 ---- a/Python/random.c -+++ b/Python/random.c -@@ -94,8 +94,15 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise) - } - - /* Issue #25003: Don't use getentropy() on Solaris (available since -- * Solaris 11.3), it is blocking whereas os.urandom() should not block. */ --#elif defined(HAVE_GETENTROPY) && !defined(sun) -+ Solaris 11.3), it is blocking whereas os.urandom() should not block. -+ -+ Issue #29188: Don't use getentropy() on Linux since the glibc 2.24 -+ implements it with the getrandom() syscall which can fail with ENOSYS, -+ and this error is not supported in py_getentropy() and getrandom() is called -+ with flags=0 which blocks until system urandom is initialized, which is not -+ the desired behaviour to seed the Python hash secret nor for os.urandom(): -+ see the PEP 524 which was only implemented in Python 3.6. */ -+#elif defined(HAVE_GETENTROPY) && !defined(sun) && !defined(linux) - #define PY_GETENTROPY 1 - - /* Fill buffer with size pseudo-random bytes generated by getentropy(). diff --git a/packages/lang/Python/package.mk b/packages/lang/Python2/package.mk similarity index 80% rename from packages/lang/Python/package.mk rename to packages/lang/Python2/package.mk index 16b9f075f2..ebeb2e2f27 100644 --- a/packages/lang/Python/package.mk +++ b/packages/lang/Python2/package.mk @@ -16,23 +16,23 @@ # along with OpenELEC. If not, see . ################################################################################ -PKG_NAME="Python" -PKG_VERSION="2.7.13" -PKG_SHA256="35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731" +PKG_NAME="Python2" +PKG_VERSION="2.7.14" +PKG_SHA256="71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66" PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://www.python.org/" -PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/${PKG_NAME::-1}-$PKG_VERSION.tar.xz" +PKG_SOURCE_DIR="${PKG_NAME::-1}-$PKG_VERSION*" PKG_DEPENDS_HOST="zlib:host bzip2:host sqlite:host" -PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl libffi Python:host" +PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl libffi Python2:host" PKG_SECTION="lang" -PKG_SHORTDESC="python: The Python programming language" -PKG_LONGDESC="Python is an interpreted object-oriented programming language, and is often compared with Tcl, Perl, Java or Scheme." +PKG_SHORTDESC="python2: The Python2 programming language" +PKG_LONGDESC="Python2 is an interpreted object-oriented programming language, and is often compared with Tcl, Perl, Java or Scheme." -PKG_IS_ADDON="no" PKG_AUTORECONF="yes" -PY_DISABLED_MODULES="_tkinter nis gdbm bsddb ossaudiodev" +PKG_PY_DISABLED_MODULES="_tkinter nis gdbm bsddb ossaudiodev" PKG_CONFIGURE_OPTS_HOST="--cache-file=config.cache \ --without-cxx-main \ @@ -74,7 +74,7 @@ post_patch() { make_host() { make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \ PYTHON_MODULES_LIB="$HOST_LIBDIR" \ - PYTHON_DISABLE_MODULES="readline _curses _curses_panel $PY_DISABLED_MODULES" + 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 @@ -83,7 +83,7 @@ make_host() { makeinstall_host() { make -j1 PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \ PYTHON_MODULES_LIB="$HOST_LIBDIR" \ - PYTHON_DISABLE_MODULES="readline _curses _curses_panel $PY_DISABLED_MODULES" \ + PYTHON_DISABLE_MODULES="readline _curses _curses_panel $PKG_PY_DISABLED_MODULES" \ install } @@ -93,28 +93,27 @@ pre_configure_target() { make_target() { make -j1 CC="$CC" LDFLAGS="$TARGET_LDFLAGS -L." \ - PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \ + PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \ PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \ PYTHON_MODULES_LIB="$TARGET_LIBDIR" } makeinstall_target() { make -j1 CC="$CC" DESTDIR=$SYSROOT_PREFIX \ - PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \ + PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \ PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \ PYTHON_MODULES_LIB="$TARGET_LIBDIR" \ install make -j1 CC="$CC" DESTDIR=$INSTALL \ - PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \ + PYTHON_DISABLE_MODULES="$PKG_PY_DISABLED_MODULES" \ PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \ PYTHON_MODULES_LIB="$TARGET_LIBDIR" \ install } post_makeinstall_target() { - EXCLUDE_DIRS="bsddb idlelib lib-tk lib2to3 msilib pydoc_data test unittest" - for dir in $EXCLUDE_DIRS; do + for dir in bsddb idlelib lib-tk lib2to3 msilib pydoc_data test unittest; do rm -rf $INSTALL/usr/lib/python*/$dir done @@ -125,9 +124,9 @@ post_makeinstall_target() { rm -rf $INSTALL/usr/bin/smtpd.py rm -rf $INSTALL/usr/bin/python*-config - cd $INSTALL/usr/lib/python2.7 - python -Wi -t -B $PKG_BUILD/Lib/compileall.py -d /usr/lib/python2.7 -f . - find $INSTALL/usr/lib/python2.7 -name "*.py" -exec rm -f {} \; &>/dev/null + 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.* diff --git a/packages/lang/Python/patches/Python-2.7.11-001_xcompile.patch b/packages/lang/Python2/patches/Python2-2.7.11-001_xcompile.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-001_xcompile.patch rename to packages/lang/Python2/patches/Python2-2.7.11-001_xcompile.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-002_xcompile_path.patch b/packages/lang/Python2/patches/Python2-2.7.11-002_xcompile_path.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-002_xcompile_path.patch rename to packages/lang/Python2/patches/Python2-2.7.11-002_xcompile_path.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-003_xcompile_disable_modules.patch b/packages/lang/Python2/patches/Python2-2.7.11-003_xcompile_disable_modules.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-003_xcompile_disable_modules.patch rename to packages/lang/Python2/patches/Python2-2.7.11-003_xcompile_disable_modules.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-004_xcompile_fix_libffi_configure.patch b/packages/lang/Python2/patches/Python2-2.7.11-004_xcompile_fix_libffi_configure.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-004_xcompile_fix_libffi_configure.patch rename to packages/lang/Python2/patches/Python2-2.7.11-004_xcompile_fix_libffi_configure.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-005_dont_generate_pyo_and_pyc_files.patch b/packages/lang/Python2/patches/Python2-2.7.11-005_dont_generate_pyo_and_pyc_files.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-005_dont_generate_pyo_and_pyc_files.patch rename to packages/lang/Python2/patches/Python2-2.7.11-005_dont_generate_pyo_and_pyc_files.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-006_fix_ncurse_cppflags.patch b/packages/lang/Python2/patches/Python2-2.7.11-006_fix_ncurse_cppflags.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-006_fix_ncurse_cppflags.patch rename to packages/lang/Python2/patches/Python2-2.7.11-006_fix_ncurse_cppflags.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-008-distutils-use-python-sysroot.patch b/packages/lang/Python2/patches/Python2-2.7.11-008-distutils-use-python-sysroot.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-008-distutils-use-python-sysroot.patch rename to packages/lang/Python2/patches/Python2-2.7.11-008-distutils-use-python-sysroot.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-008-reread-environment.patch b/packages/lang/Python2/patches/Python2-2.7.11-008-reread-environment.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-008-reread-environment.patch rename to packages/lang/Python2/patches/Python2-2.7.11-008-reread-environment.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-009-distutils-rpath.patch b/packages/lang/Python2/patches/Python2-2.7.11-009-distutils-rpath.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-009-distutils-rpath.patch rename to packages/lang/Python2/patches/Python2-2.7.11-009-distutils-rpath.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-010-fix-python-config.patch b/packages/lang/Python2/patches/Python2-2.7.11-010-fix-python-config.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-010-fix-python-config.patch rename to packages/lang/Python2/patches/Python2-2.7.11-010-fix-python-config.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-014-abort-on-failed-modules.patch b/packages/lang/Python2/patches/Python2-2.7.11-014-abort-on-failed-modules.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-014-abort-on-failed-modules.patch rename to packages/lang/Python2/patches/Python2-2.7.11-014-abort-on-failed-modules.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-015_no_static_lib.patch b/packages/lang/Python2/patches/Python2-2.7.11-015_no_static_lib.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-015_no_static_lib.patch rename to packages/lang/Python2/patches/Python2-2.7.11-015_no_static_lib.patch diff --git a/packages/lang/Python/patches/Python-2.7.11-016-default-is-optimized.patch b/packages/lang/Python2/patches/Python2-2.7.11-016-default-is-optimized.patch similarity index 100% rename from packages/lang/Python/patches/Python-2.7.11-016-default-is-optimized.patch rename to packages/lang/Python2/patches/Python2-2.7.11-016-default-is-optimized.patch diff --git a/packages/lang/Python3/package.mk b/packages/lang/Python3/package.mk new file mode 100644 index 0000000000..9b573e6e01 --- /dev/null +++ b/packages/lang/Python3/package.mk @@ -0,0 +1,137 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2017-present Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="Python3" +PKG_VERSION="3.6.3" +PKG_SHA256="cda7d967c9a4bfa52337cdf551bcc5cff026b6ac50a8834e568ce4a794ca81da" +PKG_ARCH="any" +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_SOURCE_DIR="${PKG_NAME::-1}-$PKG_VERSION*" +PKG_DEPENDS_HOST="zlib:host bzip2:host" +PKG_DEPENDS_TARGET="toolchain sqlite expat zlib bzip2 openssl Python3:host readline ncurses" +PKG_SECTION="lang" +PKG_SHORTDESC="python3: The Python3 programming language" +PKG_LONGDESC="Python3 is an interpreted object-oriented programming language, and is often compared with Tcl, Perl, Java or Scheme." + +PKG_PYTHON_VERSION=python3.6 + +PKG_AUTORECONF="yes" + +PKG_CONFIGURE_OPTS_HOST="ac_cv_prog_HAS_HG=/bin/false + ac_cv_prog_SVNVERSION=/bin/false + --disable-pyc-build + --disable-ossaudiodev + --disable-sqlite3 + --disable-codecs-cjk + --disable-nis + --enable-unicodedata + --enable-openssl + --disable-readline + --disable-bzip2 + --enable-zlib + --disable-xz + --disable-tk + --disable-curses + --disable-pydoc + --disable-test-modules + --enable-lib2to3 + --disable-idle3 + --without-cxx-main + --with-expat=builtin + --with-libmpdec=none + --with-doc-strings + --without-pymalloc + --without-ensurepi +" + +PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false + ac_cv_prog_SVNVERSION=/bin/false + ac_cv_file__dev_ptmx=no + ac_cv_file__dev_ptc=no + ac_cv_have_long_long_format=yes + ac_cv_working_tzset=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 + --disable-pyc-build + --disable-ossaudiodev + --enable-sqlite3 + --disable-codecs-cjk + --disable-nis + --enable-unicodedata + --enable-openssl + --enable-readline + --enable-bzip2 + --enable-zlib + --disable-xz + --disable-tk + --enable-curses + --disable-pydoc + --disable-test-modules + --disable-lib2to3 + --disable-idle3 + --without-cxx-main + --with-expat=system + --with-libmpdec=none + --with-doc-strings + --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 +} + +post_makeinstall_host() { + rm -f $TOOLCHAIN/bin/python*-config + rm -f $TOOLCHAIN/bin/smtpd.py* + rm -f $TOOLCHAIN/bin/pyvenv + rm -f $TOOLCHAIN/bin/pydoc* + + cp $PKG_BUILD/Tools/scripts/reindent.py $TOOLCHAIN/lib/$PKG_PYTHON_VERSION +} + +post_makeinstall_target() { + PKG_INSTALL_PATH_LIB=$INSTALL/usr/lib/$PKG_PYTHON_VERSION + + for dir in config compiler sysconfigdata lib-dynload/sysconfigdata lib2to3 test; do + rm -rf $PKG_INSTALL_PATH_LIB/$dir + done + + 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 + + # strip + chmod u+w $INSTALL/usr/lib/libpython*.so.* + debug_strip $INSTALL/usr +} diff --git a/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch b/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch new file mode 100644 index 0000000000..681dddb2db --- /dev/null +++ b/packages/lang/Python3/patches/Python3-0000-default-is-optimized.patch @@ -0,0 +1,13 @@ +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index 640271f..cad052e 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -82,7 +82,7 @@ int Py_VerboseFlag; /* Needed by import.c */ + int Py_QuietFlag; /* Needed by sysmodule.c */ + int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ + int Py_InspectFlag; /* 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_NoSiteFlag; /* Suppress 'import site' */ + int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */ + int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */ diff --git a/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch b/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch new file mode 100644 index 0000000000..e7d5a900d1 --- /dev/null +++ b/packages/lang/Python3/patches/Python3-0100-buildroot-patches.patch @@ -0,0 +1,1716 @@ +From 53400bbcc7078d0589cd6831adc2c8b2752c6e84 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 16:21:31 -0800 +Subject: [PATCH 01/29] Make the build of pyc files conditional + +This commit adds a new configure option --disable-pyc-build to disable +the compilation of pyc. + +Signed-off-by: Thomas Petazzoni +[ Andrey Smrinov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 2 ++ + configure.ac | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 82e8307..b38bd79 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1311,6 +1311,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c + $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ + $(DESTDIR)$(LIBDEST)/distutils/tests ; \ + fi ++ifeq (@PYC_BUILD@,yes) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ +@@ -1338,6 +1339,7 @@ libinstall: build_all $(srcdir)/Modules/xxmodule.c + $(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages ++endif + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +diff --git a/configure.ac b/configure.ac +index 9620067..a76b544 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1113,6 +1113,12 @@ fi + + AC_MSG_CHECKING(LDLIBRARY) + ++AC_SUBST(PYC_BUILD) ++ ++AC_ARG_ENABLE(pyc-build, ++ AS_HELP_STRING([--disable-pyc-build], [disable build of pyc files]), ++ [ PYC_BUILD="${enableval}" ], [ PYC_BUILD=yes ]) ++ + # MacOSX framework builds need more magic. LDLIBRARY is the dynamic + # library that we build, but we do not want to link against it (we + # will find it with a -framework option). For this reason there is an +-- +2.11.0 + + +From e571fe09b611227a15d3c15ef1f175e5b7aaacc9 Mon Sep 17 00:00:00 2001 +From: Vanya Sergeev +Date: Wed, 23 Dec 2015 11:30:33 +0100 +Subject: [PATCH 02/29] Disable buggy_getaddrinfo configure test when + cross-compiling with IPv6 support + +Signed-off-by: Vanya Sergeev +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index a76b544..5f87c4d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3939,7 +3939,7 @@ fi + + AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) + +-if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes ++if test $have_getaddrinfo = no || test "$cross_compiling" != "yes" -a "$ac_cv_buggy_getaddrinfo" = yes + then + if test $ipv6 = yes + then +-- +2.11.0 + + +From c00a2f3c52f71c11c5b383d91ea8624cf1003851 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 16:33:22 -0800 +Subject: [PATCH 03/29] Add infrastructure to disable the build of certain + extensions + +Some of the extensions part of the Python core have dependencies on +external libraries (sqlite, tk, etc.) or are relatively big and not +necessarly always useful (CJK codecs for example). By extensions, we +mean part of Python modules that are written in C and therefore +compiled to binary code. + +Therefore, we introduce a small infrastructure that allows to disable +some of those extensions. This can be done inside the configure.ac by +adding values to the DISABLED_EXTENSIONS variable (which is a +word-separated list of extensions). + +The implementation works as follow : + + * configure.ac defines a DISABLED_EXTENSIONS variable, which is + substituted (so that when Makefile.pre is generated from + Makefile.pre.in, the value of the variable is substituted). For + now, this DISABLED_EXTENSIONS variable is empty, later patches will + use it. + + * Makefile.pre.in passes the DISABLED_EXTENSIONS value down to the + variables passed in the environment when calling the setup.py + script that actually builds and installs those extensions. + + * setup.py is modified so that the existing "disabled_module_list" is + filled with those pre-disabled extensions listed in + DISABLED_EXTENSIONS. + +Patch ported to python2.7 by Maxime Ripard , and +then extended by Thomas Petazzoni +. + +Signed-off-by: Thomas Petazzoni +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 6 +++++- + configure.ac | 2 ++ + setup.py | 6 +++++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index b38bd79..4ce917a 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -190,6 +190,8 @@ FILEMODE= 644 + # configure script arguments + CONFIG_ARGS= @CONFIG_ARGS@ + ++# disabled extensions ++DISABLED_EXTENSIONS= @DISABLED_EXTENSIONS@ + + # Subdirectories with code + SRCDIRS= @SRCDIRS@ +@@ -575,6 +577,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o + esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ ++ DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + + +@@ -1436,7 +1439,8 @@ libainstall: @DEF_MAKE_RULE@ python-config + # Install the dynamically loadable modules + # This goes into $(exec_prefix) + sharedinstall: sharedmods +- $(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ ++ $(RUNSHARED) DISABLED_EXTENSIONS="$(DISABLED_EXTENSIONS)" \ ++ $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \ + --prefix=$(prefix) \ + --install-scripts=$(BINDIR) \ + --install-platlib=$(DESTSHARED) \ +diff --git a/configure.ac b/configure.ac +index 5f87c4d..d5ee2ae 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2810,6 +2810,8 @@ LIBS="$withval $LIBS" + + PKG_PROG_PKG_CONFIG + ++AC_SUBST(DISABLED_EXTENSIONS) ++ + # Check for use of the system expat library + AC_MSG_CHECKING(for --with-system-expat) + AC_ARG_WITH(system_expat, +diff --git a/setup.py b/setup.py +index fe47797..86643ae 100644 +--- a/setup.py ++++ b/setup.py +@@ -43,7 +43,11 @@ 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 = sysconfig.get_config_var("DISABLED_EXTENSIONS").split(" ") ++except KeyError: ++ disabled_module_list = list() ++ + + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (after any relative +-- +2.11.0 + + +From 2fcb53edf6f4545f56c513d26f88ffdd8904b35a Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:33:14 +0100 +Subject: [PATCH 04/29] 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. + +Signed-off-by: Thomas Petazzoni +--- + Lib/distutils/command/build_ext.py | 5 ++++- + Lib/distutils/sysconfig.py | 15 +++++++++++---- + 2 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py +index 74de782..d0c847b 100644 +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -233,7 +233,10 @@ class build_ext(Command): + 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('.') +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 2bcd1dd..422c13f 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -17,10 +17,17 @@ import sys + from .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) +-BASE_PREFIX = os.path.normpath(sys.base_prefix) +-BASE_EXEC_PREFIX = os.path.normpath(sys.base_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')) ++ BASE_PREFIX = PREFIX ++ BASE_EXEC_PREFIX = EXEC_PREFIX ++else: ++ PREFIX = os.path.normpath(sys.prefix) ++ EXEC_PREFIX = os.path.normpath(sys.exec_prefix) ++ BASE_PREFIX = os.path.normpath(sys.base_prefix) ++ BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix) + + # Path to the base directory of the project. On Windows the binary may + # live in project/PCBuild/win32 or project/PCBuild/amd64. +-- +2.11.0 + + +From 7d03fb519099ce471f28163dfb1309fbd8db66dd Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:36:00 +0100 +Subject: [PATCH 05/29] Don't look in /usr/lib/termcap for libraries + +Signed-off-by: Thomas Petazzoni +--- + setup.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/setup.py b/setup.py +index 86643ae..cd00fbd 100644 +--- a/setup.py ++++ b/setup.py +@@ -786,12 +786,9 @@ class PyBuildExt(build_ext): + pass # Issue 7384: Already linked against curses or tinfo. + elif curses_library: + readline_libs.append(curses_library) +- elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], +- 'termcap'): ++ elif self.compiler.find_library_file(lib_dirs, 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: +-- +2.11.0 + + +From 84e958a0164cd4c713a5d21c60f8d4c7fa5c4bbb Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:36:27 +0100 +Subject: [PATCH 06/29] Don't add multiarch paths + +The add_multiarch_paths() function leads, in certain build +environments, to the addition of host header paths to the CFLAGS, +which is not appropriate for cross-compilation. This patch fixes that +by simply removing the call to add_multiarch_paths() when we're +cross-compiling. + +Investigation done by David . + +Signed-off-by: Thomas Petazzoni +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index cd00fbd..c956fa0 100644 +--- a/setup.py ++++ b/setup.py +@@ -497,10 +497,10 @@ class PyBuildExt(build_ext): + 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') ++ self.add_multiarch_paths() + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: + self.add_gcc_paths() +- self.add_multiarch_paths() + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. +-- +2.11.0 + + +From 9761791ba9714639e1cee2d466beac5f199aa237 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:43:24 +0100 +Subject: [PATCH 07/29] 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 +--- + setup.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/setup.py b/setup.py +index c956fa0..b3add2b 100644 +--- a/setup.py ++++ b/setup.py +@@ -312,6 +312,7 @@ class PyBuildExt(build_ext): + print("Failed to build these modules:") + print_three_column(failed) + print() ++ sys.exit(1) + + if self.failed_on_import: + failed = self.failed_on_import[:] +-- +2.11.0 + + +From a6094130b3476c499e2b063a857913cfc7292d2a Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Wed, 23 Dec 2015 11:44:02 +0100 +Subject: [PATCH 08/29] Serial ioctl() workaround + +The ioctls.h of some architectures (notably xtensa) references structs from +linux/serial.h. Make sure to include this header as well. + +Also, undef TIOCTTYGSTRUCT that require reference to internal kernel tty_struct, +but isn't actually referenced in modern kernels. + +Signed-off-by: Baruch Siach +--- + Modules/termios.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Modules/termios.c b/Modules/termios.c +index b78d33e..58b0444 100644 +--- a/Modules/termios.c ++++ b/Modules/termios.c +@@ -9,7 +9,9 @@ + #endif + + #include ++#include + #include ++#undef TIOCTTYGSTRUCT + + /* HP-UX requires that this be included to pick up MDCD, MCTS, MDSR, + * MDTR, MRI, and MRTS (appearantly used internally by some things +-- +2.11.0 + + +From 5260336b011dafc6aec799c47b7267ce9e72960f Mon Sep 17 00:00:00 2001 +From: Christophe Vu-Brugier +Date: Wed, 23 Dec 2015 11:44:30 +0100 +Subject: [PATCH 09/29] Do not adjust the shebang of Python scripts for + cross-compilation + +The copy_scripts() method in distutils copies the scripts listed in +the setup file and adjusts the first line to refer to the current +Python interpreter. When cross-compiling, this means that the adjusted +shebang refers to the host Python interpreter. + +This patch modifies copy_scripts() to preserve the shebang when +cross-compilation is detected. + +Signed-off-by: Christophe Vu-Brugier +--- + Lib/distutils/command/build_scripts.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py +index ccc70e6..d6d5419 100644 +--- a/Lib/distutils/command/build_scripts.py ++++ b/Lib/distutils/command/build_scripts.py +@@ -91,7 +91,7 @@ class build_scripts(Command): + adjust = True + post_interp = match.group(1) or b'' + +- if adjust: ++ if adjust and not '_python_sysroot' in os.environ: + log.info("copying and adjusting %s -> %s", script, + self.build_dir) + updated_files.append(outfile) +-- +2.11.0 + + +From a7166d6e3eed0062b096c0a34e06c96a735d789c Mon Sep 17 00:00:00 2001 +From: Peter Korsgaard +Date: Thu, 20 Nov 2014 13:24:59 +0100 +Subject: [PATCH 10/29] Misc/python-config.sh.in: ensure sed invocations only + match beginning of strings + +The build/real prefix handling using sed breaks if build != real and the +standard include / lib directories are used ($prefix/include and $prefix/lib). + +E.G. + +prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include". + +If this gets installed with make DESTDIR="/foo" install, then we end up with +prefix_real = prefix = "/foo/usr" as expected, but +includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of +the double sed invocation (prefix is already expanded). Work around it by +ensuring we only match the beginning of the string. + +Submitted upstream: http://bugs.python.org/issue22907 + +Signed-off-by: Peter Korsgaard +--- + Misc/python-config.sh.in | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index 30c6927..f905a71 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -29,12 +29,12 @@ 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#") ++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@" | sed "s#$prefix_build#$prefix_real#") +-libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#") +-CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#") ++exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#") ++includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#") ++libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#") ++CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#") + VERSION="@VERSION@" + LIBM="@LIBM@" + LIBC="@LIBC@" +@@ -48,7 +48,7 @@ OPT="@OPT@" + PY_ENABLE_SHARED="@PY_ENABLE_SHARED@" + LDVERSION="@LDVERSION@" + LIBDEST=${prefix}/lib/python${VERSION} +-LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#") ++LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#") + SO="@EXT_SUFFIX@" + PYTHONFRAMEWORK="@PYTHONFRAMEWORK@" + INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}" +-- +2.11.0 + + +From 2d68f738170735e5fb01684f532850da536e1abb Mon Sep 17 00:00:00 2001 +From: Samuel Cabrero +Date: Wed, 23 Dec 2015 11:45:48 +0100 +Subject: [PATCH 11/29] Override system locale and set to default when adding + gcc paths + +Forces the use of the default locale in the function +add_gcc_paths, which is called when cross compiling to add the +include and library paths. This is necessary because otherwise +the gcc output is localized and the output parsing fails, which +results in no paths added and detect_modules not able to find +any system library (eg. libz, libssl, etc.) + +[Thomas: patch taken from https://bugs.python.org/issue23767.] + +Signed-off-by: Samuel Cabrero +Signed-off-by: Thomas Petazzoni +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index b3add2b..29bfd17 100644 +--- a/setup.py ++++ b/setup.py +@@ -457,7 +457,7 @@ class PyBuildExt(build_ext): + tmpfile = os.path.join(self.build_temp, 'gccpaths') + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) +- ret = os.system('%s -E -v - %s 1>/dev/null' % (gcc, tmpfile)) ++ ret = os.system('LC_ALL=C %s -E -v - %s 1>/dev/null' % (gcc, tmpfile)) + is_gcc = False + in_incdirs = False + inc_dirs = [] +-- +2.11.0 + + +From 755576f79f5ac13c36e4aedbd695745d0a104df7 Mon Sep 17 00:00:00 2001 +From: Christophe Vu-Brugier +Date: Wed, 22 Feb 2017 16:48:49 -0800 +Subject: [PATCH 12/29] Add importlib fix for PEP 3147 issue + +Python 3 has a new standard for installing .pyc file, called PEP +3147. Unfortunately, this standard requires both the .py and .pyc +files to be installed for a Python module to be found. This is quite +annoying on space-constrained embedded systems, since the .py file is +technically not required for execution. + +This patch changes cache_from_source() and source_from_cache() in +importlib to get rid of the "__pycache__" directory. +This effectively disables PEP 3147 for: + +* The python standard library +* Packages built with distutils or setuptools +* Packages built with automake that use the `py-compile` helper + +Signed-off-by: Christophe Vu-Brugier +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Lib/importlib/_bootstrap_external.py | 38 +++++------------------------------- + 1 file changed, 5 insertions(+), 33 deletions(-) + +diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py +index 9feec50..3550013 100644 +--- a/Lib/importlib/_bootstrap_external.py ++++ b/Lib/importlib/_bootstrap_external.py +@@ -275,8 +275,6 @@ def cache_from_source(path, debug_override=None, *, optimization=None): + a True value is the same as setting 'optimization' to the empty string + while a False value is equivalent to setting 'optimization' to '1'. + +- If sys.implementation.cache_tag is None then NotImplementedError is raised. +- + """ + if debug_override is not None: + _warnings.warn('the debug_override parameter is deprecated; use ' +@@ -288,10 +286,7 @@ def cache_from_source(path, debug_override=None, *, optimization=None): + path = _os.fspath(path) + head, tail = _path_split(path) + base, sep, rest = tail.rpartition('.') +- tag = sys.implementation.cache_tag +- if tag is None: +- raise NotImplementedError('sys.implementation.cache_tag is None') +- almost_filename = ''.join([(base if base else rest), sep, tag]) ++ almost_filename = ''.join([(base if base else rest)]) + if optimization is None: + if sys.flags.optimize == 0: + optimization = '' +@@ -302,40 +297,17 @@ def cache_from_source(path, debug_override=None, *, optimization=None): + if not optimization.isalnum(): + raise ValueError('{!r} is not alphanumeric'.format(optimization)) + almost_filename = '{}.{}{}'.format(almost_filename, _OPT, optimization) +- return _path_join(head, _PYCACHE, almost_filename + BYTECODE_SUFFIXES[0]) ++ return _path_join(head, almost_filename + BYTECODE_SUFFIXES[0]) + + + def source_from_cache(path): + """Given the path to a .pyc. file, return the path to its .py file. + + The .pyc file does not need to exist; this simply returns the path to +- the .py file calculated to correspond to the .pyc file. If path does +- not conform to PEP 3147/488 format, ValueError will be raised. If +- sys.implementation.cache_tag is None then NotImplementedError is raised. +- ++ the .py file calculated to correspond to the .pyc file. + """ +- if sys.implementation.cache_tag is None: +- raise NotImplementedError('sys.implementation.cache_tag is None') +- path = _os.fspath(path) +- head, pycache_filename = _path_split(path) +- head, pycache = _path_split(head) +- if pycache != _PYCACHE: +- raise ValueError('{} not bottom-level directory in ' +- '{!r}'.format(_PYCACHE, path)) +- dot_count = pycache_filename.count('.') +- if dot_count not in {2, 3}: +- raise ValueError('expected only 2 or 3 dots in ' +- '{!r}'.format(pycache_filename)) +- elif dot_count == 3: +- optimization = pycache_filename.rsplit('.', 2)[-2] +- if not optimization.startswith(_OPT): +- raise ValueError("optimization portion of filename does not start " +- "with {!r}".format(_OPT)) +- opt_level = optimization[len(_OPT):] +- if not opt_level.isalnum(): +- raise ValueError("optimization level {!r} is not an alphanumeric " +- "value".format(optimization)) +- base_filename = pycache_filename.partition('.')[0] ++ head, filename = _path_split(path) ++ base_filename = filename.partition('.')[0] + return _path_join(head, base_filename + SOURCE_SUFFIXES[0]) + + +-- +2.11.0 + + +From fc5d897b1fcc0dd313c6c1519150365826960e55 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:01:18 -0800 +Subject: [PATCH 13/29] Add an option to disable installation of test modules + +The Python standard distribution comes with many test modules, that +are not necessarly useful on embedded targets. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++------------------- + configure.ac | 5 +++++ + 2 files changed, 41 insertions(+), 19 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 4ce917a..4110fff 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1194,8 +1194,28 @@ maninstall: altmaninstall + + # Install the library + XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax +-LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ +- tkinter/test/test_ttk site-packages test \ ++ ++LIBSUBDIRS= tkinter site-packages \ ++ asyncio \ ++ collections concurrent concurrent/futures encodings \ ++ email email/mime \ ++ ensurepip ensurepip/_bundled \ ++ html json http dbm xmlrpc \ ++ sqlite3 \ ++ logging csv wsgiref urllib \ ++ lib2to3 lib2to3/fixes lib2to3/pgen2 \ ++ ctypes ctypes/macholib \ ++ idlelib idlelib/Icons \ ++ distutils distutils/command $(XMLLIBSUBDIRS) \ ++ importlib \ ++ turtledemo \ ++ multiprocessing multiprocessing/dummy \ ++ unittest \ ++ venv venv/scripts venv/scripts/common venv/scripts/posix \ ++ curses pydoc_data ++ ++TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ ++ tkinter/test/test_ttk test \ + test/audiodata \ + test/capath test/data \ + test/cjkencodings test/decimaltestdata test/xmltestdata \ +@@ -1229,29 +1249,26 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ + test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/namespace_pkgs/module_and_namespace_package \ + test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \ +- asyncio \ + test/test_asyncio \ +- collections concurrent concurrent/futures encodings \ +- email email/mime test/test_email test/test_email/data \ +- ensurepip ensurepip/_bundled \ +- html json test/test_json http dbm xmlrpc \ +- sqlite3 sqlite3/test \ +- logging csv wsgiref urllib \ +- lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \ ++ test/test_email test/test_email/data \ ++ test/test_json \ ++ sqlite3/test \ ++ lib2to3/tests \ + lib2to3/tests/data lib2to3/tests/data/fixers \ + lib2to3/tests/data/fixers/myfixes \ +- ctypes ctypes/test ctypes/macholib \ +- idlelib idlelib/Icons idlelib/idle_test \ +- distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ +- importlib test/test_importlib test/test_importlib/builtin \ ++ ctypes/test \ ++ idlelib/idle_test \ ++ distutils/tests \ ++ test/test_importlib test/test_importlib/builtin \ + test/test_importlib/extension test/test_importlib/frozen \ + test/test_importlib/import_ test/test_importlib/source \ + test/test_tools test/test_warnings test/test_warnings/data \ +- turtledemo \ +- multiprocessing multiprocessing/dummy \ +- unittest unittest/test unittest/test/testmock \ +- venv venv/scripts venv/scripts/common venv/scripts/posix \ +- curses pydoc_data ++ unittest/test unittest/test/testmock ++ ++ifeq (@TEST_MODULES@,yes) ++LIBSUBDIRS += $(TESTSUBDIRS) ++endif ++ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ +diff --git a/configure.ac b/configure.ac +index d5ee2ae..f924937 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3112,6 +3112,11 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_atfork) + fi + ++AC_SUBST(TEST_MODULES) ++ ++AC_ARG_ENABLE(test-modules, ++ AS_HELP_STRING([--disable-test-modules], [disable test modules]), ++ [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) + + # Check for enable-ipv6 + AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) +-- +2.11.0 + + +From 9ba352418daeded77feabeec008cb6e7c63342db Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:07:56 -0800 +Subject: [PATCH 14/29] Add an option to disable pydoc + +It removes 0.5 MB of data from the target plus the pydoc script +itself. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 8 +++++++- + configure.ac | 6 ++++++ + setup.py | 9 +++++++-- + 3 files changed, 20 insertions(+), 3 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 4110fff..badb2af 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1164,7 +1164,9 @@ bininstall: altbininstall + -rm -f $(DESTDIR)$(BINDIR)/idle3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) + -rm -f $(DESTDIR)$(BINDIR)/pydoc3 ++ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) ++endif + -rm -f $(DESTDIR)$(BINDIR)/2to3 + (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) + -rm -f $(DESTDIR)$(BINDIR)/pyvenv +@@ -1212,7 +1214,7 @@ LIBSUBDIRS= tkinter site-packages \ + multiprocessing multiprocessing/dummy \ + unittest \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ +- curses pydoc_data ++ curses + + TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk test \ +@@ -1269,6 +1271,10 @@ ifeq (@TEST_MODULES@,yes) + LIBSUBDIRS += $(TESTSUBDIRS) + endif + ++ifeq (@PYDOC@,yes) ++LIBSUBDIRS += pydoc_data ++endif ++ + libinstall: build_all $(srcdir)/Modules/xxmodule.c + @for i in $(SCRIPTDIR) $(LIBDEST); \ + do \ +diff --git a/configure.ac b/configure.ac +index f924937..1621fa1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3112,6 +3112,12 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_atfork) + fi + ++AC_SUBST(PYDOC) ++ ++AC_ARG_ENABLE(pydoc, ++ AS_HELP_STRING([--disable-pydoc], [disable pydoc]), ++ [ PYDOC="${enableval}" ], [ PYDOC=yes ]) ++ + AC_SUBST(TEST_MODULES) + + AC_ARG_ENABLE(test-modules, +diff --git a/setup.py b/setup.py +index 29bfd17..94dd337 100644 +--- a/setup.py ++++ b/setup.py +@@ -2281,6 +2281,12 @@ def main(): + # turn off warnings when deprecated modules are imported + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) ++ ++ scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', ++ 'Lib/smtpd.py'] ++ if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/pydoc3' ] ++ + setup(# PyPI Metadata (PEP 301) + name = "Python", + version = sys.version.split()[0], +@@ -2305,8 +2311,7 @@ def main(): + # If you change the scripts installed here, you also need to + # check the PyBuildScripts command above, and change the links + # created by the bininstall target in Makefile.pre.in +- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", +- "Tools/scripts/2to3", "Tools/scripts/pyvenv"] ++ scripts = scripts + ) + + # --install-platlib +-- +2.11.0 + + +From 83a7fcf8bdd163f2bfcaed1b8493ccb8f5db960f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:15:31 -0800 +Subject: [PATCH 15/29] Add an option to disable lib2to3 + +lib2to3 is a library to convert Python 2.x code to Python 3.x. As +such, it is probably not very useful on embedded system targets. + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 16 ++++++++++++---- + configure.ac | 6 ++++++ + setup.py | 5 +++-- + 3 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index badb2af..931cc3e 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1168,7 +1168,9 @@ ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) + endif + -rm -f $(DESTDIR)$(BINDIR)/2to3 ++ifeq (@LIB2TO3@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3) ++endif + -rm -f $(DESTDIR)$(BINDIR)/pyvenv + (cd $(DESTDIR)$(BINDIR); $(LN) -s pyvenv-$(VERSION) pyvenv) + if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \ +@@ -1205,7 +1207,6 @@ LIBSUBDIRS= tkinter site-packages \ + html json http dbm xmlrpc \ + sqlite3 \ + logging csv wsgiref urllib \ +- lib2to3 lib2to3/fixes lib2to3/pgen2 \ + ctypes ctypes/macholib \ + idlelib idlelib/Icons \ + distutils distutils/command $(XMLLIBSUBDIRS) \ +@@ -1255,9 +1256,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + test/test_email test/test_email/data \ + test/test_json \ + sqlite3/test \ +- lib2to3/tests \ +- lib2to3/tests/data lib2to3/tests/data/fixers \ +- lib2to3/tests/data/fixers/myfixes \ + ctypes/test \ + idlelib/idle_test \ + distutils/tests \ +@@ -1267,6 +1265,14 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + test/test_tools test/test_warnings test/test_warnings/data \ + unittest/test unittest/test/testmock + ++ifeq (@LIB2TO3@,yes) ++LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 ++TESTSUBDIRS += lib2to3/tests \ ++ lib2to3/tests/data \ ++ lib2to3/tests/data/fixers \ ++ lib2to3/tests/data/fixers/myfixes ++endif ++ + ifeq (@TEST_MODULES@,yes) + LIBSUBDIRS += $(TESTSUBDIRS) + endif +@@ -1366,10 +1372,12 @@ ifeq (@PYC_BUILD@,yes) + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + endif ++ifeq (@LIB2TO3@,yes) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt ++endif + + python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + # Substitution happens here, as the completely-expanded BINDIR +diff --git a/configure.ac b/configure.ac +index 1621fa1..13b2edf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3124,6 +3124,12 @@ AC_ARG_ENABLE(test-modules, + AS_HELP_STRING([--disable-test-modules], [disable test modules]), + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ]) + ++AC_SUBST(LIB2TO3) ++ ++AC_ARG_ENABLE(lib2to3, ++ AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), ++ [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) ++ + # Check for enable-ipv6 + AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) + AC_MSG_CHECKING([if --enable-ipv6 is specified]) +diff --git a/setup.py b/setup.py +index 94dd337..76429e1 100644 +--- a/setup.py ++++ b/setup.py +@@ -2282,10 +2282,11 @@ def main(): + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) + +- scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3', +- 'Lib/smtpd.py'] ++ scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/pydoc3' ] ++ if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/2to3' ] + + setup(# PyPI Metadata (PEP 301) + name = "Python", +-- +2.11.0 + + +From 72bcd78208f9b53c1af0508c56d0fb87d02e6447 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:20:45 -0800 +Subject: [PATCH 16/29] Add option to disable the sqlite3 module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 7 +++++-- + configure.ac | 9 +++++++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 931cc3e..a1ce071 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1205,7 +1205,6 @@ LIBSUBDIRS= tkinter site-packages \ + email email/mime \ + ensurepip ensurepip/_bundled \ + html json http dbm xmlrpc \ +- sqlite3 \ + logging csv wsgiref urllib \ + ctypes ctypes/macholib \ + idlelib idlelib/Icons \ +@@ -1255,7 +1254,6 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + test/test_asyncio \ + test/test_email test/test_email/data \ + test/test_json \ +- sqlite3/test \ + ctypes/test \ + idlelib/idle_test \ + distutils/tests \ +@@ -1273,6 +1271,11 @@ TESTSUBDIRS += lib2to3/tests \ + lib2to3/tests/data/fixers/myfixes + endif + ++ifeq (@SQLITE3@,yes) ++LIBSUBDIRS += sqlite3 ++TESTSUBDIRS += sqlite3/test ++endif ++ + ifeq (@TEST_MODULES@,yes) + LIBSUBDIRS += $(TESTSUBDIRS) + endif +diff --git a/configure.ac b/configure.ac +index 13b2edf..d7582cf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3112,6 +3112,15 @@ if test "$posix_threads" = "yes"; then + AC_CHECK_FUNCS(pthread_atfork) + fi + ++AC_SUBST(SQLITE3) ++AC_ARG_ENABLE(sqlite3, ++ AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]), ++ [ SQLITE3="${enableval}" ], [ SQLITE3=yes ]) ++ ++if test "$SQLITE3" = "no" ; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.11.0 + + +From 1451f9d151c787ea9e82945b8ce545adfb89356a Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:23:42 -0800 +Subject: [PATCH 17/29] Add an option to disable the tk module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 11 ++++++++--- + configure.ac | 9 +++++++++ + 2 files changed, 17 insertions(+), 3 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index a1ce071..dc1e917 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1199,7 +1199,7 @@ maninstall: altmaninstall + # Install the library + XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax + +-LIBSUBDIRS= tkinter site-packages \ ++LIBSUBDIRS= site-packages \ + asyncio \ + collections concurrent concurrent/futures encodings \ + email email/mime \ +@@ -1216,8 +1216,7 @@ LIBSUBDIRS= tkinter site-packages \ + venv venv/scripts venv/scripts/common venv/scripts/posix \ + curses + +-TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ +- tkinter/test/test_ttk test \ ++TESTSUBDIRS= test \ + test/audiodata \ + test/capath test/data \ + test/cjkencodings test/decimaltestdata test/xmltestdata \ +@@ -1263,6 +1262,12 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \ + test/test_tools test/test_warnings test/test_warnings/data \ + unittest/test unittest/test/testmock + ++ifeq (@TK@,yes) ++LIBSUBDIRS += tkinter ++TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ ++ tkinter/test/test_ttk ++endif ++ + ifeq (@LIB2TO3@,yes) + LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 + TESTSUBDIRS += lib2to3/tests \ +diff --git a/configure.ac b/configure.ac +index d7582cf..6a56a5b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3121,6 +3121,15 @@ if test "$SQLITE3" = "no" ; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" + fi + ++AC_SUBST(TK) ++AC_ARG_ENABLE(tk, ++ AS_HELP_STRING([--disable-tk], [disable tk]), ++ [ TK="${enableval}" ], [ TK=yes ]) ++ ++if test "$TK" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.11.0 + + +From 703aaff814d8433dd742e95e98e523de2490d2d9 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:31:51 -0800 +Subject: [PATCH 18/29] Add an option to disable the curses module + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 7 +++++-- + configure.ac | 9 +++++++++ + 2 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index dc1e917..6a6bc08 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1213,8 +1213,7 @@ LIBSUBDIRS= site-packages \ + turtledemo \ + multiprocessing multiprocessing/dummy \ + unittest \ +- venv venv/scripts venv/scripts/common venv/scripts/posix \ +- curses ++ venv venv/scripts venv/scripts/common venv/scripts/posix + + TESTSUBDIRS= test \ + test/audiodata \ +@@ -1268,6 +1267,10 @@ TESTSUBDIRS += tkinter/test tkinter/test/test_tkinter \ + tkinter/test/test_ttk + endif + ++ifeq (@CURSES@,yes) ++LIBSUBDIRS += curses ++endif ++ + ifeq (@LIB2TO3@,yes) + LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 + TESTSUBDIRS += lib2to3/tests \ +diff --git a/configure.ac b/configure.ac +index 6a56a5b..5896b39 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3130,6 +3130,15 @@ if test "$TK" = "no"; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _tkinter" + fi + ++AC_SUBST(CURSES) ++AC_ARG_ENABLE(curses, ++ AS_HELP_STRING([--disable-curses], [disable curses]), ++ [ CURSES="${enableval}" ], [ CURSES=yes ]) ++ ++if test "$CURSES" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" ++fi ++ + AC_SUBST(PYDOC) + + AC_ARG_ENABLE(pydoc, +-- +2.11.0 + + +From d6f3165356840c8ea03538b38078b478c2fd1c5d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:40:45 -0800 +Subject: [PATCH 19/29] Add an option to disable expat + +This patch replaces the existing --with-system-expat option with a +--with-expat={system,builtin,none} option, which allows to tell Python +whether we want to use the system expat (already installed), the expat +builtin the Python sources, or no expat at all (which disables the +installation of XML modules). + +Signed-off-by: Thomas Petazzoni +Signed-off-by: Samuel Martin +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 6 +++++- + configure.ac | 18 +++++++++++++----- + setup.py | 2 +- + 3 files changed, 19 insertions(+), 7 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 6a6bc08..dc4b92b 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1208,7 +1208,7 @@ LIBSUBDIRS= site-packages \ + logging csv wsgiref urllib \ + ctypes ctypes/macholib \ + idlelib idlelib/Icons \ +- distutils distutils/command $(XMLLIBSUBDIRS) \ ++ distutils distutils/command \ + importlib \ + turtledemo \ + multiprocessing multiprocessing/dummy \ +@@ -1271,6 +1271,10 @@ ifeq (@CURSES@,yes) + LIBSUBDIRS += curses + endif + ++ifeq (@EXPAT@,yes) ++LIBSUBDIRS += $(XMLLIBSUBDIRS) ++endif ++ + ifeq (@LIB2TO3@,yes) + LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 + TESTSUBDIRS += lib2to3/tests \ +diff --git a/configure.ac b/configure.ac +index 5896b39..6f21482 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2813,13 +2813,21 @@ PKG_PROG_PKG_CONFIG + AC_SUBST(DISABLED_EXTENSIONS) + + # Check for use of the system expat library +-AC_MSG_CHECKING(for --with-system-expat) +-AC_ARG_WITH(system_expat, +- AS_HELP_STRING([--with-system-expat], [build pyexpat module using an installed expat library]), ++AC_MSG_CHECKING(for --with-expat) ++AC_ARG_WITH(expat, ++ AS_HELP_STRING([--with-expat], [select which expat version to use: system, builtin, none]), + [], +- [with_system_expat="no"]) ++ [with_expat="builtin"]) + +-AC_MSG_RESULT($with_system_expat) ++AC_MSG_RESULT($with_expat) ++ ++if test "$with_expat" != "none"; then ++ EXPAT=yes ++else ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} pyexpat" ++ EXPAT=no ++fi ++AC_SUBST(EXPAT) + + # Check for use of the system libffi library + AC_MSG_CHECKING(for --with-system-ffi) +diff --git a/setup.py b/setup.py +index 76429e1..38aa5e6 100644 +--- a/setup.py ++++ b/setup.py +@@ -1495,7 +1495,7 @@ class PyBuildExt(build_ext): + # + # More information on Expat can be found at www.libexpat.org. + # +- if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"): ++ if '--with-expat=system' in sysconfig.get_config_var("CONFIG_ARGS"): + expat_inc = [] + define_macros = [] + expat_lib = ['expat'] +-- +2.11.0 + + +From 847e684c0c280be1dd6c734837db78e3a6e3d94d Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:49:55 +0100 +Subject: [PATCH 20/29] Add an option to disable CJK codecs + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 6f21482..c7742fa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3129,6 +3129,12 @@ if test "$SQLITE3" = "no" ; then + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3" + fi + ++AC_ARG_ENABLE(codecs-cjk, ++ AS_HELP_STRING([--disable-codecs-cjk], [disable CJK codecs]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + + +From f05d7c051207b17d8568ab8fdc6bed3edfb253c5 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:50:11 +0100 +Subject: [PATCH 21/29] Add an option to disable NIS + +NIS is not necessarily available in uClibc, so we need an option to +not compile support for it. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index c7742fa..42a871b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3135,6 +3135,12 @@ AC_ARG_ENABLE(codecs-cjk, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _codecs_kr _codecs_jp _codecs_cn _codecs_tw _codecs_hk _codecs_iso2022" + fi]) + ++AC_ARG_ENABLE(nis, ++ AS_HELP_STRING([--disable-nis], [disable NIS]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + + +From 28bef549b43643d779c281e2840a16d9c79d7c5a Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:50:27 +0100 +Subject: [PATCH 22/29] Add an option to disable unicodedata + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 42a871b..1d610e1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3141,6 +3141,12 @@ AC_ARG_ENABLE(nis, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} nis" + fi]) + ++AC_ARG_ENABLE(unicodedata, ++ AS_HELP_STRING([--disable-unicodedata], [disable unicodedata]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + + +From 119dbb9d99934bbf6a10376862c5be71897f0245 Mon Sep 17 00:00:00 2001 +From: Maxime Ripard +Date: Wed, 22 Feb 2017 17:45:14 -0800 +Subject: [PATCH 23/29] Add an option to disable IDLE + +IDLE is an IDE embedded into python, written using Tk, so it doesn't make +much sense to have it into our build. + +Signed-off-by: Maxime Ripard +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 7 ++++++- + configure.ac | 6 ++++++ + setup.py | 4 +++- + 3 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index dc4b92b..3e43066 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1162,7 +1162,9 @@ bininstall: altbininstall + -rm -f $(DESTDIR)$(LIBPC)/python3.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) + -rm -f $(DESTDIR)$(BINDIR)/idle3 ++ifeq (@IDLE@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3) ++endif + -rm -f $(DESTDIR)$(BINDIR)/pydoc3 + ifeq (@PYDOC@,yes) + (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3) +@@ -1207,7 +1209,6 @@ LIBSUBDIRS= site-packages \ + html json http dbm xmlrpc \ + logging csv wsgiref urllib \ + ctypes ctypes/macholib \ +- idlelib idlelib/Icons \ + distutils distutils/command \ + importlib \ + turtledemo \ +@@ -1275,6 +1276,10 @@ ifeq (@EXPAT@,yes) + LIBSUBDIRS += $(XMLLIBSUBDIRS) + endif + ++ifeq (@IDLE@,yes) ++LIBSUBDIRS += idlelib idlelib/Icons ++endif ++ + ifeq (@LIB2TO3@,yes) + LIBSUBDIRS += lib2to3 lib2to3/fixes lib2to3/pgen2 + TESTSUBDIRS += lib2to3/tests \ +diff --git a/configure.ac b/configure.ac +index 1d610e1..2699e7c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3183,6 +3183,12 @@ AC_ARG_ENABLE(lib2to3, + AS_HELP_STRING([--disable-lib2to3], [disable lib2to3]), + [ LIB2TO3="${enableval}" ], [ LIB2TO3=yes ]) + ++AC_SUBST(IDLE) ++ ++AC_ARG_ENABLE(idle3, ++ AS_HELP_STRING([--disable-idle3], [disable idle3 IDE]), ++ [ IDLE="${enableval}" ], [ IDLE=yes ]) ++ + # Check for enable-ipv6 + AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified]) + AC_MSG_CHECKING([if --enable-ipv6 is specified]) +diff --git a/setup.py b/setup.py +index 38aa5e6..d642825 100644 +--- a/setup.py ++++ b/setup.py +@@ -2282,11 +2282,13 @@ def main(): + import warnings + warnings.filterwarnings("ignore",category=DeprecationWarning) + +- scripts = ['Tools/scripts/idle3', 'Lib/smtpd.py'] ++ scripts = [ 'Lib/smtpd.py'] + if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/pydoc3' ] + if not '--disable-lib2to3' in sysconfig.get_config_var("CONFIG_ARGS"): + scripts += [ 'Tools/scripts/2to3' ] ++ if not '--disable-idle3' in sysconfig.get_config_var("CONFIG_ARGS"): ++ scripts += [ 'Tools/scripts/idle3' ] + + setup(# PyPI Metadata (PEP 301) + name = "Python", +-- +2.11.0 + + +From 38737ed2625b882d7314dcb210bfc1ef6efe0bad Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:51:31 +0100 +Subject: [PATCH 24/29] Add an option to disable decimal + +This patch replaces the existing --with-system-libmpdec option with a +--with-libmpdec={system,builtin,none} option, which allows to tell +Python whether we want to use the system libmpdec (already installed), +the libmpdec builtin the Python sources, or no libmpdec at all. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 17 ++++++++++++----- + setup.py | 2 +- + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2699e7c..e2c3b6f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2862,13 +2862,20 @@ AC_SUBST(LIBFFI_INCLUDEDIR) + AC_MSG_RESULT($with_system_ffi) + + # Check for use of the system libmpdec library +-AC_MSG_CHECKING(for --with-system-libmpdec) +-AC_ARG_WITH(system_libmpdec, +- AS_HELP_STRING([--with-system-libmpdec], [build _decimal module using an installed libmpdec library]), ++AC_MSG_CHECKING(for --with-libmpdec) ++AC_ARG_WITH(libmpdec, ++ AS_HELP_STRING([--with-libmpdec], [select which libmpdec version to use: system, builtin, none]), + [], +- [with_system_libmpdec="no"]) ++ [with_libmpdec="builtin"]) + +-AC_MSG_RESULT($with_system_libmpdec) ++AC_MSG_RESULT($with_libmpdec) ++if test "$with_libmpdec" != "none"; then ++ MPDEC=yes ++else ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _decimal" ++ MPDEC=no ++fi ++AC_SUBST(MPDEC) + + # Check for support for loadable sqlite extensions + AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) +diff --git a/setup.py b/setup.py +index d642825..5b98255 100644 +--- a/setup.py ++++ b/setup.py +@@ -2058,7 +2058,7 @@ class PyBuildExt(build_ext): + def _decimal_ext(self): + extra_compile_args = [] + undef_macros = [] +- if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): ++ if '--with-libmpdec=system' in sysconfig.get_config_var("CONFIG_ARGS"): + include_dirs = [] + libraries = [':libmpdec.so.2'] + sources = ['_decimal/_decimal.c'] +-- +2.11.0 + + +From c7d30980dd5b8b4067bb1a0053ea0f8b761c669c Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 23 Dec 2015 11:51:58 +0100 +Subject: [PATCH 25/29] Add an option to disable the ossaudiodev module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index e2c3b6f..8e3dded 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2877,6 +2877,12 @@ else + fi + AC_SUBST(MPDEC) + ++AC_ARG_ENABLE(ossaudiodev, ++ AS_HELP_STRING([--disable-ossaudiodev], [disable OSSAUDIODEV]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ossaudiodev" ++ fi]) ++ + # Check for support for loadable sqlite extensions + AC_MSG_CHECKING(for --enable-loadable-sqlite-extensions) + AC_ARG_ENABLE(loadable-sqlite-extensions, +-- +2.11.0 + + +From 01818db0a7056c054e5170aefaae06a2d87980c6 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 22 Feb 2017 17:53:40 -0800 +Subject: [PATCH 26/29] Support PGEN_FOR_BUILD and FREEZE_IMPORTLIB_FOR_BUILD + +Signed-off-by: Thomas Petazzoni +[ Andrey Smirnov: ported to Python 3.6 ] +Signed-off-by: Andrey Smirnov +--- + Makefile.pre.in | 10 ++++++++++ + configure.ac | 3 +++ + 2 files changed, 13 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 3e43066..6aa0bd3 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -688,10 +688,15 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) + ############################################################################ + # Importlib + ++ifeq (@FREEZE_IMPORTLIB_FOR_BUILD@,) + Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile + + Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) + $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++else ++Programs/_freeze_importlib: @FREEZE_IMPORTLIB_FOR_BUILD@ ++ cp $^ $@ ++endif + + .PHONY: regen-importlib + regen-importlib: Programs/_freeze_importlib +@@ -769,8 +774,13 @@ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile + + $(IO_OBJS): $(IO_H) + ++ifeq (@PGEN_FOR_BUILD@,) + $(PGEN): $(PGENOBJS) + $(CC) $(OPT) $(PY_LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) ++else ++$(PGEN): @PGEN_FOR_BUILD@ ++ cp $^ $@ ++endif + + .PHONY: regen-grammar + regen-grammar: $(PGEN) +diff --git a/configure.ac b/configure.ac +index 8e3dded..1c7a3b5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -82,6 +82,9 @@ else + fi + AC_SUBST(PYTHON_FOR_BUILD) + ++AC_SUBST(PGEN_FOR_BUILD) ++AC_SUBST(FREEZE_IMPORTLIB_FOR_BUILD) ++ + dnl Ensure that if prefix is specified, it does not end in a slash. If + dnl it does, we get path names containing '//' which is both ugly and + dnl can cause trouble. +-- +2.11.0 + + +From 8b987f6996ee8b07410409888e08d0168b12dd23 Mon Sep 17 00:00:00 2001 +From: Nicolas Cavallari +Date: Wed, 22 Feb 2017 17:55:59 -0800 +Subject: [PATCH 27/29] Add an option to disable openssl support. + +Signed-off-by: Nicolas Cavallari +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 1c7a3b5..534a903 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3163,6 +3163,12 @@ AC_ARG_ENABLE(unicodedata, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} unicodedata" + fi]) + ++AC_ARG_ENABLE(openssl, ++ AS_HELP_STRING([--disable-openssl], [disable openssl support]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + + +From 06a41285075d146ab35090e899da91c2edf334f1 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 7 Mar 2017 23:29:05 +0100 +Subject: [PATCH 28/29] Add an option to disable the readline module + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 534a903..5df3b10 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3169,6 +3169,12 @@ AC_ARG_ENABLE(openssl, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} ssl _ssl _hashlib" + fi]) + ++AC_ARG_ENABLE(readline, ++ AS_HELP_STRING([--disable-readline], [disable readline]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + + +From df007a6f4f082f0abab53c95dc58b30b7a9d7336 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Tue, 7 Mar 2017 23:31:11 +0100 +Subject: [PATCH 29/29] Add options to disable zlib, bzip2 and xz modules + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 5df3b10..43290e3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3175,6 +3175,24 @@ AC_ARG_ENABLE(readline, + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} readline" + fi]) + ++AC_ARG_ENABLE(bzip2, ++ AS_HELP_STRING([--disable-bzip2], [disable bzip2]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _bz2" ++ fi]) ++ ++AC_ARG_ENABLE(zlib, ++ AS_HELP_STRING([--disable-zlib], [disable zlib]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} zlib" ++ fi]) ++ ++AC_ARG_ENABLE(xz, ++ AS_HELP_STRING([--disable-xz], [disable xz]), ++ [ if test "$enableval" = "no"; then ++ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _lzma" ++ fi]) ++ + AC_SUBST(TK) + AC_ARG_ENABLE(tk, + AS_HELP_STRING([--disable-tk], [disable tk]), +-- +2.11.0 + diff --git a/packages/mediacenter/LibreELEC-settings/package.mk b/packages/mediacenter/LibreELEC-settings/package.mk index 0cb9b0b1e0..d3cb923988 100644 --- a/packages/mediacenter/LibreELEC-settings/package.mk +++ b/packages/mediacenter/LibreELEC-settings/package.mk @@ -24,7 +24,7 @@ PKG_LICENSE="prop." PKG_SITE="https://libreelec.tv" PKG_URL="https://github.com/LibreELEC/service.libreelec.settings/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="service.libreelec.settings-$PKG_VERSION*" -PKG_DEPENDS_TARGET="toolchain Python connman pygobject dbus-python" +PKG_DEPENDS_TARGET="toolchain Python2 connman pygobject dbus-python" PKG_SECTION="" PKG_SHORTDESC="LibreELEC-settings: Settings dialog for LibreELEC" PKG_LONGDESC="LibreELEC-settings: is a settings dialog for LibreELEC" @@ -49,11 +49,13 @@ post_makeinstall_target() { # rm -f resources/lib/modules/bluetooth.py # fi - python -Wi -t -B $TOOLCHAIN/lib/python2.7/compileall.py $INSTALL/usr/share/kodi/addons/service.libreelec.settings/resources/lib/ -f - rm -rf `find $INSTALL/usr/share/kodi/addons/service.libreelec.settings/resources/lib/ -name "*.py"` + ADDON_INSTALL_DIR=$INSTALL/usr/share/kodi/addons/service.libreelec.settings - python -Wi -t -B $TOOLCHAIN/lib/python2.7/compileall.py $INSTALL/usr/share/kodi/addons/service.libreelec.settings/oe.py -f - rm -rf $INSTALL/usr/share/kodi/addons/service.libreelec.settings/oe.py + $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") + + $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 } post_install() { diff --git a/packages/mediacenter/kodi/package.mk b/packages/mediacenter/kodi/package.mk index 08692726a8..a368b353e6 100644 --- a/packages/mediacenter/kodi/package.mk +++ b/packages/mediacenter/kodi/package.mk @@ -24,7 +24,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://www.kodi.tv" PKG_URL="https://github.com/xbmc/xbmc/archive/$PKG_VERSION.tar.gz" PKG_SOURCE_DIR="xbmc-$PKG_VERSION*" -PKG_DEPENDS_TARGET="toolchain JsonSchemaBuilder:host TexturePacker:host Python zlib systemd pciutils lzo pcre swig:host libass curl fontconfig fribidi tinyxml libjpeg-turbo freetype libcdio taglib libxml2 libxslt rapidjson sqlite ffmpeg crossguid giflib libdvdnav libhdhomerun libfmt" +PKG_DEPENDS_TARGET="toolchain JsonSchemaBuilder:host TexturePacker:host Python2 zlib systemd pciutils lzo pcre swig:host libass curl fontconfig fribidi tinyxml libjpeg-turbo freetype libcdio taglib libxml2 libxslt rapidjson sqlite ffmpeg crossguid giflib libdvdnav libhdhomerun libfmt" PKG_SECTION="mediacenter" PKG_SHORTDESC="kodi: Kodi Mediacenter" PKG_LONGDESC="Kodi Media Center (which was formerly named Xbox Media Center or XBMC) is a free and open source cross-platform media player and home entertainment system software with a 10-foot user interface designed for the living-room TV. Its graphical user interface allows the user to easily manage video, photos, podcasts, and music from a computer, optical disk, local network, and the internet using a remote control." @@ -208,8 +208,8 @@ KODI_LIBDVD="$KODI_DVDCSS \ PKG_CMAKE_OPTS_TARGET="-DNATIVEPREFIX=$TOOLCHAIN \ -DWITH_TEXTUREPACKER=$TOOLCHAIN/bin/TexturePacker \ -DDEPENDS_PATH=$PKG_BUILD/depends \ - -DPYTHON_EXECUTABLE=$TOOLCHAIN/bin/python2.7 \ - -DPYTHON_INCLUDE_DIRS=$SYSROOT_PREFIX/usr/include/python2.7 \ + -DPYTHON_EXECUTABLE=$TOOLCHAIN/bin/$PKG_PYTHON_VERSION \ + -DPYTHON_INCLUDE_DIRS=$SYSROOT_PREFIX/usr/include/$PKG_PYTHON_VERSION \ -DGIT_VERSION=$PKG_VERSION \ -DWITH_FFMPEG=$(get_build_dir ffmpeg) \ -DENABLE_INTERNAL_FFMPEG=OFF \ diff --git a/packages/network/samba/package.mk b/packages/network/samba/package.mk index fbbbdd35f2..3d13e8af74 100644 --- a/packages/network/samba/package.mk +++ b/packages/network/samba/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 heimdal:host e2fsprogs Python zlib readline popt libaio connman" +PKG_DEPENDS_TARGET="toolchain heimdal:host e2fsprogs Python2 zlib readline popt libaio connman" PKG_NEED_UNPACK="$(get_pkg_directory heimdal) $(get_pkg_directory e2fsprogs)" PKG_SECTION="network" PKG_SHORTDESC="samba: The free SMB / CIFS fileserver and client" diff --git a/packages/python/devel/distutilscross/package.mk b/packages/python/devel/distutilscross/package.mk index 8e583da602..a05033b89f 100644 --- a/packages/python/devel/distutilscross/package.mk +++ b/packages/python/devel/distutilscross/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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="Python:host setuptools:host" +PKG_DEPENDS_HOST="Python2:host setuptools:host" PKG_SECTION="python/devel" PKG_SHORTDESC="distutilscross: Cross Compile Python Extensions" PKG_LONGDESC="distutilscross enhances distutils to support Cross Compile of Python extensions" diff --git a/packages/python/devel/pygobject/package.mk b/packages/python/devel/pygobject/package.mk index 8180ad163c..49d36868ac 100644 --- a/packages/python/devel/pygobject/package.mk +++ b/packages/python/devel/pygobject/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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.bz2" -PKG_DEPENDS_TARGET="toolchain Python glib libffi" +PKG_DEPENDS_TARGET="toolchain Python2 glib libffi" PKG_SECTION="python/devel" PKG_SHORTDESC="pygobject: The Python bindings for GObject" PKG_LONGDESC="PyGObject provides a convenient wrapper for the GObject+ library for use in Python programs, and takes care of many of the boring details such as managing memory and type casting. When combined with PyGTK, PyORBit and gnome-python, it can be used to write full featured Gnome applications." diff --git a/packages/python/devel/setuptools/package.mk b/packages/python/devel/setuptools/package.mk index eae1bd92e6..26bbc617a9 100644 --- a/packages/python/devel/setuptools/package.mk +++ b/packages/python/devel/setuptools/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="https://pypi.python.org/pypi/setuptools" PKG_URL="https://github.com/pypa/setuptools/archive/v$PKG_VERSION.tar.gz" -PKG_DEPENDS_HOST="Python:host" +PKG_DEPENDS_HOST="Python2:host" PKG_SECTION="python/devel" PKG_SHORTDESC="setuptools: A collection of enhancements to the Python distutils" PKG_LONGDESC="Distribute is intended to replace Setuptools as the standard method for working with Python module distributions. Packages built and distributed using distribute look to the user like ordinary Python packages based on the distutils. Your users don't need to install or even know about setuptools in order to use them, and you don't have to include the entire setuptools package in your distributions. By including just a single bootstrap module (a 7K .py file), your package will automatically download and install setuptools if the user is building your package from source and doesn't have a suitable version already installed." diff --git a/packages/python/graphics/Pillow/package.mk b/packages/python/graphics/Pillow/package.mk index 73f2574604..a36877c5e3 100644 --- a/packages/python/graphics/Pillow/package.mk +++ b/packages/python/graphics/Pillow/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python distutilscross:host zlib freetype libjpeg-turbo tiff" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host zlib freetype libjpeg-turbo tiff" PKG_SECTION="python" PKG_SHORTDESC="pil: Imaging handling/processing for Python" PKG_LONGDESC="The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities." diff --git a/packages/python/security/pycryptodome/package.mk b/packages/python/security/pycryptodome/package.mk index ec217fb73e..3f9ce79ef3 100644 --- a/packages/python/security/pycryptodome/package.mk +++ b/packages/python/security/pycryptodome/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" PKG_LICENSE="BSD" PKG_SITE="https://pypi.python.org/pypi/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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python/security" PKG_SHORTDESC="Cryptographic library for Python" PKG_LONGDESC="PyCryptodome is a self-contained Python package of low-level cryptographic primitives." @@ -51,7 +51,7 @@ makeinstall_target() { find $INSTALL -name SOURCES.txt -exec sed -i "/\/SelfTest\//d;" "{}" \; # Create Cryptodome as an alternative namespace to Crypto (Kodi addons may use either) - ln -sf /usr/lib/python2.7/site-packages/Crypto $INSTALL/usr/lib/python2.7/site-packages/Cryptodome + ln -sf /usr/lib/$PKG_PYTHON_VERSION/site-packages/Crypto $INSTALL/usr/lib/$PKG_PYTHON_VERSION/site-packages/Cryptodome } post_makeinstall_target() { diff --git a/packages/python/system/dbus-python/package.mk b/packages/python/system/dbus-python/package.mk index 46ba49709c..afb35259a6 100644 --- a/packages/python/system/dbus-python/package.mk +++ b/packages/python/system/dbus-python/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python dbus dbus-glib" +PKG_DEPENDS_TARGET="toolchain Python2 dbus dbus-glib" PKG_SECTION="python/system" PKG_SHORTDESC="dbus-python: A message bus system" PKG_LONGDESC="D-BUS is a message bus, used for sending messages between applications. Conceptually, it fits somewhere in between raw sockets and CORBA in terms of complexity. D-BUS supports broadcast messages, asynchronous messages (thus decreasing latency), authentication, and more. It is designed to be low-overhead; messages are sent using a binary protocol, not using XML. D-BUS also supports a method call mapping for its messages, but it is not required; this makes using the system quite simple." @@ -32,6 +32,7 @@ PKG_IS_ADDON="no" PKG_AUTORECONF="no" 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)" } diff --git a/packages/python/system/simplejson/package.mk b/packages/python/system/simplejson/package.mk index 1217cad28f..163d7c86af 100644 --- a/packages/python/system/simplejson/package.mk +++ b/packages/python/system/simplejson/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" PKG_LICENSE="OSS" PKG_SITE="http://pypi.python.org/pypi/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 Python distutilscross:host" +PKG_DEPENDS_TARGET="toolchain Python2 distutilscross:host" PKG_SECTION="python/system" PKG_SHORTDESC="simplejson: a simple, fast, complete, correct and extensible JSON encoder and decoder for Python 2.5+." PKG_LONGDESC="simplejson is a simple, fast, complete, correct and extensible JSON encoder and decoder for Python 2.5+. It is pure Python code with no dependencies, but includes an optional C extension for a serious speed boost." diff --git a/packages/sysutils/lirc/package.mk b/packages/sysutils/lirc/package.mk index 72d1261390..050cc0d2d4 100644 --- a/packages/sysutils/lirc/package.mk +++ b/packages/sysutils/lirc/package.mk @@ -30,6 +30,7 @@ PKG_LONGDESC="LIRC is a package that allows you to decode and send infra-red sig PKG_IS_ADDON="no" PKG_AUTORECONF="yes" +PKG_PYTHON_WANTED=Python2 PKG_CONFIGURE_OPTS_TARGET="--enable-devinput \ --localstatedir=/ \ @@ -40,6 +41,7 @@ pre_configure_target() { export HAVE_WORKING_POLL=yes export HAVE_UINPUT=yes export PYTHON=: + export PYTHON_VERSION=${PKG_PYTHON_VERSION#python} if [ -e ${SYSROOT_PREFIX}/usr/include/linux/input-event-codes.h ] ; then export DEVINPUT_HEADER=${SYSROOT_PREFIX}/usr/include/linux/input-event-codes.h else diff --git a/packages/tools/qemu/package.mk b/packages/tools/qemu/package.mk index 278a82f4b5..71adde28a7 100644 --- a/packages/tools/qemu/package.mk +++ b/packages/tools/qemu/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://wiki.qemu.org" PKG_URL="http://wiki.qemu-project.org/download/qemu-$PKG_VERSION.tar.bz2" -PKG_DEPENDS_HOST="toolchain Python:host zlib:host glib:host" +PKG_DEPENDS_HOST="toolchain Python2:host zlib:host glib:host" PKG_SECTION="tools" PKG_SHORTDESC="QEMU is a generic and open source machine emulator and virtualizer." PKG_LONGDESC="QEMU is a generic and open source machine emulator and virtualizer." diff --git a/packages/x11/lib/libxcb/package.mk b/packages/x11/lib/libxcb/package.mk index e7e241e4f1..26fc053025 100644 --- a/packages/x11/lib/libxcb/package.mk +++ b/packages/x11/lib/libxcb/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python:host xcb-proto libpthread-stubs libXau" +PKG_DEPENDS_TARGET="toolchain util-macros Python2:host xcb-proto libpthread-stubs libXau" PKG_SECTION="x11/lib" PKG_SHORTDESC="libxcb: X C-language Bindings library" PKG_LONGDESC="X C-language Bindings library." @@ -38,8 +38,8 @@ PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared \ --disable-xvmc" pre_configure_target() { - PYTHON_LIBDIR="`ls -d $SYSROOT_PREFIX/usr/lib/python*`" - PYTHON_TOOLCHAIN_PATH=`ls -d $PYTHON_LIBDIR/site-packages` + PYTHON_LIBDIR=$SYSROOT_PREFIX/usr/lib/$PKG_PYTHON_VERSION + PYTHON_TOOLCHAIN_PATH=$PYTHON_LIBDIR/site-packages PKG_CONFIG="$PKG_CONFIG --define-variable=pythondir=$PYTHON_TOOLCHAIN_PATH" PKG_CONFIG="$PKG_CONFIG --define-variable=xcbincludedir=$SYSROOT_PREFIX/usr/share/xcb" diff --git a/packages/x11/proto/xcb-proto/package.mk b/packages/x11/proto/xcb-proto/package.mk index 57b902778a..d8b48be7af 100644 --- a/packages/x11/proto/xcb-proto/package.mk +++ b/packages/x11/proto/xcb-proto/package.mk @@ -23,7 +23,7 @@ PKG_ARCH="any" 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 Python:host" +PKG_DEPENDS_TARGET="toolchain util-macros Python2:host" PKG_SECTION="x11/proto" PKG_SHORTDESC="xcb-proto: X C-language Bindings protocol headers" PKG_LONGDESC="X C-language Bindings protocol headers."