From ffcc9c6a9dfeb481fb342accb71579ae5478ea74 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Apr 23 2016 16:14:40 +0000 Subject: Adds python v3.5.1 (via Redfoxmoon and Shiz.) --- diff --git a/370.python3.build b/370.python3.build new file mode 120000 index 0000000..52bb82e --- /dev/null +++ b/370.python3.build @@ -0,0 +1 @@ +pkg.build \ No newline at end of file diff --git a/370.python3.vars b/370.python3.vars new file mode 100644 index 0000000..0de381b --- /dev/null +++ b/370.python3.vars @@ -0,0 +1,21 @@ +# +# . ./build.vars and set -o errexit are assumed. +# + +pkg_python3_extract_post() { + cd ${PKG_SUBDIR}; + autoconf; + ./configure; + make _FIP=Programs/host_freeze_importlib Programs/host_freeze_importlib \ + BUILDPYTHON=hostpython hostpython \ + PGEN=Parser/hostpgen Parser/hostpgen; + make distclean; + cd ..; +}; + +pkg_python3_configure_pre() { + sed -i.orig '/^# autoconf/a\ +ac_cv_buggy_getaddrinfo=no' config.cache; +}; + +# vim:filetype=sh diff --git a/build.vars b/build.vars index e5deedd..1fe4cc2 100644 --- a/build.vars +++ b/build.vars @@ -42,7 +42,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${WGET_ARGS:="-N --no-check-certificate"}; : ${WORKDIR:=${PREFIX}/tmp}; -: ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils curl dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libarchive libelf libfetch libffi libnbcompat libressl libz make mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh pacman patch pemagine perl popt psxscl psxstub psxtypes rsync sed tar util_linux which xz zsh"}; +: ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils curl dalist dash diffutils findutils gawk git glib gmp grep gzip hexcurse irssi less libarchive libelf libfetch libffi libnbcompat libressl libz make mpc mpfr nano ncurses ncursestw ncursesw ntapi ntcon ntctty openssh pacman patch pemagine perl popt psxscl psxstub psxtypes python3 rsync sed tar util_linux which xz zsh"}; : ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE AUTOGEN BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBFILES_FIX LIBTOOL_MIDIPIX LIBTOOL_MIDIPIX_FIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SUBDIR URL URL_FNAME URL_TYPE VERSION"}; : ${PKG_LVL0_CFLAGS_CONFIGURE:=-O0}; : ${PKG_LVL0_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"}; @@ -276,6 +276,11 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; : ${PKG_PERL_URL:=http://www.cpan.org/src/5.0/perl-${PKG_PERL_VERSION}.tar.gz}; : ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_LVL3}/include --sysroot=${PREFIX_LVL3} --target=x86_64-nt64-midipix"}; : ${PKG_PERL_MAKEFLAGS_BUILD:=-j1}; +: ${PKG_PYTHON3_VERSION:=3.5.1}; +: ${PKG_PYTHON3_SHA256SUM:=687e067d9f391da645423c7eda8205bae9d35edc0c76ef5218dcbe4cc770d0d7}; +: ${PKG_PYTHON3_URL:=https://www.python.org/ftp/python/${PKG_PYTHON_VERSION}/Python-${PKG_PYTHON_VERSION}.tgz}; +: ${PKG_PYTHON3_CONFIGURE_ARGS:="--build=x86_64 -C --enable-ipv6 --enable-shared --host=${HOST_NATIVE} --prefix=/"}; +: ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${HOST_NATIVE}-gcc -shared -mout-implib --sysroot=${PREFIX_LVL3},CC=${HOST_NATIVE}-gcc,CFLAGS=--sysroot=${PREFIX_LVL3},CPPFLAGS=--sysroot=${PREFIX_LVL3},LDFLAGS=-L${PREFIX_LVL3}/lib"}: : ${PKG_RSYNC_VERSION:=3.1.2}; : ${PKG_RSYNC_SHA256SUM:=ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2}; : ${PKG_RSYNC_URL:=https://download.samba.org/pub/rsync/src/rsync-${PKG_RSYNC_VERSION}.tar.gz}; diff --git a/python3-3.5.1.local.patch b/python3-3.5.1.local.patch new file mode 100644 index 0000000..e6fbf05 --- /dev/null +++ b/python3-3.5.1.local.patch @@ -0,0 +1,194 @@ +--- Python-3.5.1/config.sub.orig 2015-12-07 01:39:11.000000000 +0000 ++++ Python-3.5.1/config.sub 2016-04-22 17:23:27.208488716 +0000 +@@ -795,6 +795,10 @@ + microblaze*) + basic_machine=microblaze-xilinx + ;; ++ midipix) ++ basic_machine=x86_64-pc ++ os=-midipix ++ ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 +@@ -1371,7 +1375,7 @@ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ ++ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ +--- Python-3.5.1/configure.ac.orig 2015-12-07 01:39:11.000000000 +0000 ++++ Python-3.5.1/configure.ac 2016-04-23 12:49:17.142936229 +0000 +@@ -58,6 +58,15 @@ + + if test "$cross_compiling" = yes; then + AC_MSG_CHECKING([for python interpreter for cross build]) ++ AC_MSG_CHECKING(python for build) ++ PYTHON_FOR_BUILD="${PYTHON_FOR_BUILD:-${PWD}/hostpython}" ++ AC_MSG_RESULT($PYTHON_FOR_BUILD) ++ AC_MSG_CHECKING(pgen for build) ++ PGEN_FOR_BUILD="${PGEN_FOR_BUILD:-Parser/hostpgen}" ++ AC_MSG_RESULT($PGEN_FOR_BUILD) ++ AC_MSG_CHECKING(_freeze_importlib for build) ++ _FIP_FOR_BUILD="${_FIP_FOR_BUILD:-Programs/host_freeze_importlib}" ++ AC_MSG_RESULT($_FIP_FOR_BUILD) + if test -z "$PYTHON_FOR_BUILD"; then + for interp in python$PACKAGE_VERSION python3 python; do + which $interp >/dev/null 2>&1 || continue +@@ -75,9 +84,16 @@ + elif test "$cross_compiling" = maybe; then + AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH]) + else +- PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E' ++ PYTHON_FOR_BUILD='$(BUILDPYTHON)' ++ PGEN_FOR_BUILD='$(PGEN)' ++ _FIP_FOR_BUILD='$(_FIP)' + fi + AC_SUBST(PYTHON_FOR_BUILD) ++AC_SUBST(PGEN_FOR_BUILD) ++AC_SUBST(_FIP_FOR_BUILD) ++AC_ARG_VAR(PYTHON_FOR_BUILD,[build system Python]) ++AC_ARG_VAR(PGEN_FOR_BUILD,[build system Python pgen]) ++AC_ARG_VAR(_FIP_FOR_BUILD,[build system Python _freeze_importlib]) + + 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 +@@ -373,6 +389,9 @@ + *-*-cygwin*) + ac_sys_system=Cygwin + ;; ++ *-*-midipix*) ++ ac_sys_system=Midipix ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +@@ -399,6 +418,7 @@ + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; + irix646) MACHDEP="irix6";; ++ midipix*) MACHDEP="midipix";; + '') MACHDEP="unknown";; + esac + fi +@@ -406,6 +426,9 @@ + AC_SUBST(_PYTHON_HOST_PLATFORM) + if test "$cross_compiling" = yes; then + case "$host" in ++ *-*-midipix*) ++ _host_cpu= ++ ;; + *-*-linux*) + case "$host_cpu" in + arm*) +--- Python-3.5.1/Makefile.pre.in.orig 2015-12-07 01:39:09.000000000 +0000 ++++ Python-3.5.1/Makefile.pre.in 2016-04-23 12:09:05.162989761 +0000 +@@ -276,6 +276,9 @@ + ########################################################################## + # Parser + PGEN= Parser/pgen$(EXE) ++PGEN_FOR_BUILD= @PGEN_FOR_BUILD@ ++_FIP= Programs/_freeze_importlib$(EXE) ++_FIP_FOR_BUILD= @_FIP_FOR_BUILD@ + + PSRCS= \ + Parser/acceler.c \ +@@ -597,6 +600,7 @@ + esac; \ + $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \ + _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \ ++ _PYTHON_HOST_PLATFORM='$(_PYTHON_HOST_PLATFORM)' \ + $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build + + # Build static library +@@ -708,15 +712,15 @@ + + Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile + +-Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) ++$(_FIP): Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) + $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + +-Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib +- ./Programs/_freeze_importlib \ ++Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py $(_FIP_FOR_BUILD) ++ ./$(_FIP_FOR_BUILD) \ + $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h + +-Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib +- ./Programs/_freeze_importlib \ ++Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py $(_FIP_FOR_BUILD) ++ ./$(_FIP_FOR_BUILD) \ + $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h + + +@@ -777,9 +781,9 @@ + + $(IO_OBJS): $(IO_H) + +-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN) ++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN_FOR_BUILD) + @$(MKDIR_P) Include +- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) ++ $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) + $(GRAMMAR_C): $(GRAMMAR_H) + touch $(GRAMMAR_C) + +--- Python-3.5.1/Modules/socketmodule.c.orig 2015-12-07 01:39:10.000000000 +0000 ++++ Python-3.5.1/Modules/socketmodule.c 2016-04-23 12:30:40.854961004 +0000 +@@ -1313,7 +1313,7 @@ + } + #endif + +-#ifdef AF_CAN ++#if defined(HAVE_LINUX_CAN_H) && defined(AF_CAN) + case AF_CAN: + { + struct sockaddr_can *a = (struct sockaddr_can *)addr; +@@ -1810,7 +1810,7 @@ + } + #endif + +-#if defined(AF_CAN) && defined(CAN_RAW) && defined(CAN_BCM) ++#if defined(HAVE_LINUX_CAN_H) && defined(AF_CAN) && defined(CAN_RAW) && defined(CAN_BCM) + case AF_CAN: + switch (s->sock_proto) { + case CAN_RAW: +@@ -2017,7 +2017,7 @@ + } + #endif + +-#ifdef AF_CAN ++#if defined(HAVE_LINUX_CAN_H) && defined(AF_CAN) + case AF_CAN: + { + *len_ret = sizeof (struct sockaddr_can); +@@ -6298,7 +6298,7 @@ + PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF"); + #endif + +-#ifdef AF_CAN ++#if defined(HAVE_LINUX_CAN_H) && defined(AF_CAN) + /* Controller Area Network */ + PyModule_AddIntMacro(m, AF_CAN); + #endif +--- Python-3.5.1/setup.py.orig 2015-12-07 01:39:11.000000000 +0000 ++++ Python-3.5.1/setup.py 2016-04-23 15:59:20.902683131 +0000 +@@ -1294,7 +1294,13 @@ + panel_library = 'panel' + if curses_library == 'ncursesw': + curses_defines.append(('HAVE_NCURSESW', '1')) +- curses_includes.append('/usr/include/ncursesw') ++ cflags = sysconfig.get_config_var('CFLAGS') ++ m = re.search(r'-isysroot\s+(\S+)', cflags) ++ if m is None: ++ sysroot = '/usr' ++ else: ++ sysroot = m.group(1) ++ curses_includes.append(sysroot + '/include/ncursesw') + # Bug 1464056: If _curses.so links with ncursesw, + # _curses_panel.so must link with panelw. + panel_library = 'panelw'