From 817c7a1cda67d2db9a021eabfb9226fe696ab689 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Dec 06 2017 18:26:05 +0000 Subject: vars/build.vars:host_packages_deps: adds python3_host v3.5.1 & ${PKG_PYTHON}. vars/env.vars, subr/pkg_configure.subr: process ${PKG_PYTHON}. vars/python3_host.vars: create ${PREFIX}/bin/python ${LD_LIBRARY_PATH} wrapper. --- diff --git a/subr/pkg_configure.subr b/subr/pkg_configure.subr index 23ef26d..e94810d 100644 --- a/subr/pkg_configure.subr +++ b/subr/pkg_configure.subr @@ -13,6 +13,9 @@ pkg_configure() { if [ -n "${PKG_PKG_CONFIG_LIB_PATH}" ]; then export PKG_CONFIG_LIBPATH="${PKG_PKG_CONFIG_LIBPATH}"; fi; + if [ -n "${PKG_PYTHON}" ]; then + export PYTHON="${PKG_PYTHON}"; + fi; AR="${PKG_AR}" \ CC="${PKG_CC}" \ RANLIB="${PKG_RANLIB}" \ @@ -22,7 +25,7 @@ pkg_configure() { LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \ ${PKG_CONFIGURE} \ ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG}; - unset PKGCONFIG PKG_CONFIG PKG_CONFIG_LIBPATH; + unset PKGCONFIG PKG_CONFIG PKG_CONFIG_LIBPATH PYTHON; fi; }; diff --git a/vars/build.vars b/vars/build.vars index 0ffcbfc..436b34f 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -271,7 +271,7 @@ HOST_PACKAGES_DEPS_LDFLAGS_CONFIGURE=""; HOST_PACKAGES_DEPS_MAKEFLAGS_INSTALL="PREFIX= prefix="; HOST_PACKAGES_DEPS_PACKAGES=" cmake_host llvm_host clang_host file_host libffi_host glib_host -infounzip_host infozip_host intltool_host ruby_host"; +infounzip_host infozip_host intltool_host python3_host ruby_host"; HOST_PACKAGES_DEPS_PREFIX="${PREFIX}"; : ${PKG_CMAKE_HOST_SHA256SUM:=7d73ee4fae572eb2d7cd3feb48971aea903bb30a20ea5ae8b4da826d8ccad5fe}; : ${PKG_CMAKE_HOST_VERSION:=3.6.3}; @@ -304,6 +304,11 @@ HOST_PACKAGES_DEPS_PREFIX="${PREFIX}"; : ${PKG_INTLTOOL_HOST_SHA256SUM:=67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd}; : ${PKG_INTLTOOL_HOST_VERSION:=0.51.0}; : ${PKG_INTLTOOL_HOST_URL:=https://launchpad.net/intltool/trunk/${PKG_INTLTOOL_HOST_VERSION}/+download/intltool-${PKG_INTLTOOL_HOST_VERSION}.tar.gz}; +: ${PKG_PYTHON3_HOST_SHA256SUM:=687e067d9f391da645423c7eda8205bae9d35edc0c76ef5218dcbe4cc770d0d7}; +: ${PKG_PYTHON3_HOST_VERSION:=3.5.1}; +: ${PKG_PYTHON3_HOST_URL:=https://www.python.org/ftp/python/${PKG_PYTHON3_HOST_VERSION}/Python-${PKG_PYTHON3_HOST_VERSION}.tgz}; +: ${PKG_PYTHON3_HOST_CONFIGURE_ARGS_EXTRA:="--enable-ipv6 --enable-shared --without-ensurepip"}; +: ${PKG_PYTHON3_HOST_SUBDIR:=Python-${PKG_PYTHON3_HOST_VERSION}}; : ${PKG_RUBY_HOST_SHA256SUM:=ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507}; : ${PKG_RUBY_HOST_VERSION:=2.3.0}; : ${PKG_RUBY_HOST_URL:=https://cache.ruby-lang.org/pub/ruby/${PKG_RUBY_HOST_VERSION%.*}/ruby-${PKG_RUBY_HOST_VERSION}.tar.gz}; @@ -325,6 +330,7 @@ libpipeline libressl libevent libfetch libgpg_error libassuan libfirm libgcrypt libksba libudns lua ncurses ncursestw ncursesw npth popt shared_mime_info sqlite3 w32api w32lib xz cmake"; NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; +NATIVE_PACKAGES_DEPS_PYTHON="${PREFIX}/bin/python"; : ${PKG_EXPAT_SHA256SUM:=d9e50ff2d19b3538bd2127902a89987474e1a4db8e43a66a4d1a712ab9a504ff}; : ${PKG_EXPAT_VERSION:=2.2.0}; : ${PKG_EXPAT_URL:=http://pkgs.fedoraproject.org/repo/pkgs/expat/expat-${PKG_EXPAT_VERSION}.tar.bz2/2f47841c829facb346eb6e3fab5212e2/expat-${PKG_EXPAT_VERSION}.tar.bz2}; @@ -506,6 +512,7 @@ xextproto xtrans libX11 libXext freetype fontconfig renderproto Xrender libXft libXfixes libXi libICE libSM libXt libXmu libXpm libXaw libxkbfile pixman cairo dbus pango atk gdk gtk2 imlib2 libcaca"; NATIVE_PACKAGES_DEPS_X11_PREFIX="${PREFIX_NATIVE}"; +NATIVE_PACKAGES_DEPS_X11_PYTHON="${PREFIX}/bin/python"; : ${PKG_INPUTPROTO_SHA256SUM:=893a6af55733262058a27b38eeb1edc733669f01d404e8581b167f03c03ef31d}; : ${PKG_INPUTPROTO_VERSION:=2.3.2}; : ${PKG_INPUTPROTO_URL:=https://www.x.org/releases/individual/proto/inputproto-${PKG_INPUTPROTO_VERSION}.tar.bz2}; @@ -635,6 +642,7 @@ DEV_PACKAGES_PACKAGES=" ncurses ncursesw coreutils bash libz git make sed grep findutils m4 flex bison diffutils patch patchutils gzip tar dos2unix nano vim"; DEV_PACKAGES_PREFIX="${NATIVE_PACKAGES_DEPS_PREFIX}"; +DEV_PACKAGES_PYTHON="${PREFIX}/bin/python"; # # Packages list native_packages_cmdline @@ -793,6 +801,7 @@ bdwgc bison chicken cparser diffutils flex lunix m4 make man_db patch patchutils : ${PKG_PYTHON3_URL:=https://www.python.org/ftp/python/${PKG_PYTHON3_VERSION}/Python-${PKG_PYTHON3_VERSION}.tgz}; : ${PKG_PYTHON3_CONFIGURE_ARGS:="--build=x86_64 -C --enable-ipv6 --enable-shared --host=${DEFAULT_TARGET} --prefix=${PREFIX_NATIVE} --without-ensurepip"}; : ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${DEFAULT_TARGET}-gcc -shared -mout-dsolib --sysroot=${PREFIX_NATIVE}:CC=${DEFAULT_TARGET}-gcc:CFLAGS=--sysroot=${PREFIX_NATIVE}:CPPFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=-L${PREFIX_NATIVE}/lib"}: +: ${PKG_PYTHON3_INSTALL_FILES:="@python3=bin/python"}; : ${PKG_PYTHON3_SUBDIR:=Python-${PKG_PYTHON3_VERSION}}; : ${PKG_RUBY_SHA256SUM:=ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507}; : ${PKG_RUBY_VERSION:=2.3.0}; @@ -1022,6 +1031,7 @@ ${NATIVE_PACKAGES_ETC_PACKAGES} ${NATIVE_PACKAGES_INET_PACKAGES}"; NATIVE_PACKAGES_PARALLELISE=1; NATIVE_PACKAGES_PREFIX="${PREFIX_NATIVE}"; +NATIVE_PACKAGES_PYTHON="${PREFIX}/bin/python"; # # Build target dist_minipix diff --git a/vars/env.vars b/vars/env.vars index 4cc41c9..265931c 100644 --- a/vars/env.vars +++ b/vars/env.vars @@ -14,7 +14,7 @@ DEFAULT_BUILD_VARS=" INSTALL_TARGET_EXTRA IN_TREE LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE \ LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBTOOL MAKE MAKE_INSTALL_VNAME \ MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA \ - NO_CLEAN_BASE_DIR NO_LOG_VARS PARALLELISE PATCHES_EXTRA PKG_CONFIG \ + NO_CLEAN_BASE_DIR NO_LOG_VARS PYTHON PARALLELISE PATCHES_EXTRA PKG_CONFIG \ PKG_CONFIG_LIBDIR PKGCONFIG PREFIX RANLIB SHA256SUM SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"; DEFAULT_LOG_MSG_FAIL_COLOUR=91; diff --git a/vars/python3_host.vars b/vars/python3_host.vars new file mode 100644 index 0000000..682c0d2 --- /dev/null +++ b/vars/python3_host.vars @@ -0,0 +1,17 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_python3_host_install_make_post() { + if ex_rtl_fileop test "${PKG_DESTDIR}/bin/python"; then + ex_rtl_fileop rm "${PKG_DESTDIR}/bin/python"; + fi; + cat > "${PKG_DESTDIR}/bin/python" <