Skip to content

Commit bb5b47e

Browse files
author
pmp-p
committed
3.80b4+panda-master droid api19
1 parent bf764f9 commit bb5b47e

File tree

56 files changed

+1127
-1416
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1127
-1416
lines changed
2.53 MB
Binary file not shown.

sources.32/Python-3.8.0b4.build

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
#!/bin/bash
2+
3+
#GHZIP=https://github.com/python/cpython/archive/v3.7.1rc1.zip
4+
5+
export PYVER=3.8
6+
export SRC=Python-3.8.0b4
7+
export SRC_URL=https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tar.xz
8+
9+
export TARGET=Android
10+
11+
export OPT_COMMON="--with-computed-gotos --with-system-ffi --with-pydebug=no"
12+
13+
export OPT_HOST="--disable-shared"
14+
15+
export OPT_TARGET="--without-ensurepip --with-c-locale-coercion --disable-ipv6" # --enable-shared"
16+
17+
#pydebug build ?
18+
export DM=false
19+
20+
#==============================================================================
21+
#ROOT=$(dirname $(realpath "$0") )
22+
23+
. $SDK/build.functions
24+
. $SDK/build.${BITS}.functions
25+
26+
set_source_tree 4243
27+
28+
if echo $ANDROID_API|grep -q 19
29+
then
30+
echo -n "#FIXME API-19 : readline/sqlite won't fix : WITH_LIBRARIES==$WITH_LIBRARIES changed to "
31+
export WITH_LIBRARIES="libffi"
32+
echo "WITH_LIBRARIES=$WITH_LIBRARIES"
33+
fi
34+
35+
#export ORIGIN=$(pwd)
36+
37+
echo Will build $TARGET from $ORIGIN source tree
38+
39+
echo "<enter> to continue"
40+
read
41+
42+
export PYTHONDONTWRITEBYTECODE=1
43+
44+
export PDK_PYTHON=${ORIGIN}/Android/build/python-native/python
45+
46+
export PDK_APYTHON=${ORIGIN}/Android/build/python${PYVER}-android-${ANDROID_API}-${ANDROID_ARCH}/python
47+
48+
export LIB_PYTHON=${ROOT}/DEVICE/fs/usr/lib-$ANDROID_ARCH
49+
export BIN_PYTHON=${ROOT}/DEVICE/fs/usr/bin
50+
51+
if echo "$@"|grep -q rebuild
52+
then
53+
echo "CLEANING UP"
54+
rm -vf $PDK_APYTHON ${ORIGIN}/Android/build/python${PYVER}-android-${ANDROID_API}-${ANDROID_ARCH}/libpython3.*.so
55+
fi
56+
57+
if [ -f $PDK_APYTHON ]
58+
then
59+
echo "
60+
* found TARGET $PDK_APYTHON - skipping HOST + TARGET build
61+
"
62+
else
63+
if mkdir -p ${DEV_APPDIR}
64+
then
65+
echo Building HOST + TARGET cpython${PYVER}${PYMODE} from $ORIGIN/Android
66+
67+
patch_me
68+
pwd
69+
70+
cd $ORIGIN/Android
71+
72+
#for 3.8
73+
touch ../Modules/Setup.dist
74+
75+
cmd="./makesetup $DEV_PATHS $OPT_COMMON $OPT_TARGET"
76+
echo "----------------------------------------------------------------"
77+
echo $cmd
78+
echo "----------------------------------------------------------------"
79+
if $cmd
80+
then
81+
82+
#will fail on ncurses as first pass
83+
>$ORIGIN.log
84+
echo "to view log : tail -f $ORIGIN.log"
85+
make 2>> $ORIGIN.log | pv -w 60 -p -l -s 2640 >>$ORIGIN.log
86+
if [ -f $PDK_APYTHON ]
87+
then
88+
echo "
89+
90+
Great built on first pass - you lucky owner of the perfect build env, do not dare to update it !
91+
92+
"
93+
else
94+
echo "
95+
96+
Build failed, that was expected because i tell you so
97+
98+
Logfile is $ORIGIN.log
99+
100+
"
101+
# NEED NDK <16b only 15c still has sgtty.h
102+
cp -vf $ORIGIN.patchset/external/ncurses-6.0.mint.tar.gz ${ORIGIN}/Android/build/external-libraries/ncurses-6.0.tar.gz
103+
cp -vf $ORIGIN.patchset/external/readline-6.3.tar.gz ${ORIGIN}/Android/build/external-libraries/readline-6.3.tar.gz
104+
echo "Stuff fixed ... maybe, press <enter> to resume build"
105+
read
106+
echo "to view log : tail -f $ORIGIN.log"
107+
make 2>&1 | pv -w 60 -p -l -s 6300 >$ORIGIN.log
108+
fi
109+
#make install
110+
fi
111+
fi
112+
fi
113+
114+
115+
cd ${ROOT}
116+
117+
118+
if [ -f $PDK_APYTHON ]
119+
then
120+
echo "Installing to ${DEV_APPDIR}"
121+
echo
122+
mkdir -p $BIN_PYTHON $LIB_PYTHON/
123+
124+
build_dir=${ORIGIN}/Android/build/python${PYVER}-android-${ANDROID_API}-${ANDROID_ARCH}
125+
126+
127+
dyn_load=${ROOT}/DEVICE/fs/usr/lib/python${PYVER}/lib-dynload
128+
129+
mkdir -p "${dyn_load}"
130+
131+
cp -f ${build_dir}/build/lib.linux-arm-${PYVER}/*.so "${dyn_load}/"
132+
133+
if $DM
134+
then
135+
cp -f ${build_dir}/build/lib.linux-arm-${PYVER}/_sysconfigdata_dm_linux_.py "${dyn_load}/"
136+
else
137+
cp -f ${build_dir}/build/lib.linux-arm-${PYVER}/_sysconfigdata_m_linux_.py "${dyn_load}/"
138+
fi
139+
140+
#FIXME: 3.x -> 3.xdm link
141+
if $DM
142+
then
143+
cp -f ${build_dir}/python "${BIN_PYTHON}/python${PYVER}dm"
144+
else
145+
cp -f ${build_dir}/python "${BIN_PYTHON}/python${PYVER}m"
146+
fi
147+
cp -f ${build_dir}/libpython3.*.so "${LIB_PYTHON}/"
148+
149+
register_pdk PDK_PYTHON $PDK_PYTHON
150+
register_pdk PDK_APYTHON $PDK_APYTHON
151+
register_pdk PDK_LIB_PYTHON ${LIB_PYTHON}
152+
153+
else
154+
echo "I have failed to build $ORIGIN, <press enter to read $ORIGIN.log>"
155+
echo "================================================================="
156+
cat $ORIGIN.log | more
157+
echo "================================================================="
158+
159+
fi
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--- Python-3.8.0b4/Lib/ctypes/__init__.py 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Lib/ctypes/__init__.py 2019-08-31 12:37:41.115992690 +0200
3+
@@ -453,6 +453,9 @@
4+
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
5+
elif _sys.platform == "cygwin":
6+
pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
7+
+elif _sys.platform in ("android","bionic"):
8+
+ print('444:bionic',_sys.version_info,file=_sys.stderr)
9+
+ pythonapi = PyDLL("libpython%d.%d.so" % _sys.version_info[:2] )
10+
else:
11+
pythonapi = PyDLL(None)
12+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- Python-3.8.0b4/Lib/zipfile.py 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Lib/zipfile.py 2019-08-31 09:14:19.331179000 +0200
3+
@@ -1570,7 +1570,7 @@
4+
zinfo.compress_size = 0
5+
zinfo.CRC = 0
6+
7+
- zinfo.flag_bits = 0x00
8+
+ #zinfo.flag_bits = 0x00
9+
if zinfo.compress_type == ZIP_LZMA:
10+
# Compressed data includes an end-of-stream (EOS) marker
11+
zinfo.flag_bits |= 0x02

sources.32/cpython-master.patchset/Makefile.pre.in.diff renamed to sources.32/Python-3.8.0b4.patchset/Makefile.pre.in.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
--- cpython-master/Makefile.pre.in 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Makefile.pre.in 2018-01-23 23:55:20.000000000 +0100
3-
@@ -215,7 +215,7 @@
1+
--- Python-3.8.0b4/Makefile.pre.in 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Makefile.pre.in 2019-08-31 11:57:53.529672465 +0200
3+
@@ -225,7 +225,7 @@
44
PY3LIBRARY= @PY3LIBRARY@
55
DLLLIBRARY= @DLLLIBRARY@
66
LDLIBRARYDIR= @LDLIBRARYDIR@

sources.32/cpython-master.patchset/Modules__localemodule.c.diff renamed to sources.32/Python-3.8.0b4.patchset/Modules__localemodule.c.diff

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
--- cpython-master/Modules/_localemodule.c 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Modules/_localemodule.c 2018-01-24 16:32:07.000000000 +0100
3-
@@ -103,6 +103,10 @@
1+
--- Python-3.8.0b4/Modules/_localemodule.c 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Modules/_localemodule.c 2019-08-31 11:57:53.533672312 +0200
3+
@@ -97,6 +97,10 @@
44
PyErr_SetString(Error, "invalid locale category");
55
return NULL;
66
}
@@ -11,15 +11,18 @@
1111
#endif
1212

1313
if (locale) {
14-
@@ -144,7 +148,16 @@
14+
@@ -214,7 +218,19 @@
1515
}
1616

1717
/* if LC_NUMERIC is different in the C library, use saved value */
18-
- l = localeconv();
18+
- lc = localeconv();
19+
+
1920
+//PMPP API<21
20-
+#if __ANDROID_API__ < 21
2121
+ /* Don't even try on Android's broken locale.h. */
2222
+ /* maybe can use c++ stdlib to implement */
23+
+
24+
+#if __ANDROID_API__ < 21
25+
+
2326
+ goto failed;
2427
+#else
2528
+ /* if LC_NUMERIC is different in the C library, use saved value */

sources.32/cpython-master.patchset/Modules_mmapmodule.c.diff renamed to sources.32/Python-3.8.0b4.patchset/Modules_mmapmodule.c.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- cpython-master/Modules/mmapmodule.c 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Modules/mmapmodule.c 2018-01-23 23:55:20.000000000 +0100
1+
--- Python-3.8.0b4/Modules/mmapmodule.c 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Modules/mmapmodule.c 2019-08-31 11:57:53.541672005 +0200
33
@@ -79,6 +79,12 @@
44
# define MAP_ANONYMOUS MAP_ANON
55
#endif

sources.32/cpython-master.patchset/Modules_posixmodule.c.diff renamed to sources.32/Python-3.8.0b4.patchset/Modules_posixmodule.c.diff

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
1-
--- cpython-master/Modules/posixmodule.c 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Modules/posixmodule.c 2018-01-23 23:55:20.000000000 +0100
3-
@@ -394,6 +393,11 @@
4-
#define MODNAME "posix"
1+
--- Python-3.8.0b4/Modules/posixmodule.c 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Modules/posixmodule.c 2019-08-31 11:57:53.549671698 +0200
3+
@@ -63,7 +63,6 @@
4+
disguised Unix interface). Refer to the library manual and\n\
5+
corresponding Unix manual entries for more information on calls.");
6+
7+
-
8+
#ifdef HAVE_SYS_UIO_H
9+
#include <sys/uio.h>
10+
#endif
11+
@@ -497,6 +496,11 @@
512
#endif
6-
13+
}
14+
715
+//PMPP API<21
816
+#if __ANDROID_API__ < 21
917
+ extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
1018
+#endif
1119
+//PMPP API<21
12-
13-
#ifdef HAVE_FORK
14-
static void
15-
@@ -5885,6 +5889,51 @@
20+
21+
#ifdef MS_WINDOWS
22+
/* defined in fileutils.c */
23+
@@ -6560,6 +6564,51 @@
1624
for both the master and slave ends.
1725
[clinic start generated code]*/
18-
26+
1927
+#ifdef __ANDROID__
2028
+ static PyObject *
2129
+ os_openpty_impl(PyObject *module)
@@ -64,12 +72,24 @@
6472
static PyObject *
6573
os_openpty_impl(PyObject *module)
6674
/*[clinic end generated code: output=98841ce5ec9cef3c input=f3d99fd99e762907]*/
67-
@@ -5973,7 +6022,7 @@
75+
@@ -6648,7 +6697,7 @@
6876
return NULL;
6977
}
7078
#endif /* defined(HAVE_OPENPTY) || defined(HAVE__GETPTY) || defined(HAVE_DEV_PTMX) */
7179
-
7280
+#endif
73-
81+
7482
#ifdef HAVE_FORKPTY
7583
/*[clinic input]
84+
@@ -9799,7 +9848,11 @@
85+
errno = result;
86+
}
87+
#else
88+
+ #if __ANDROID_API__ < 21
89+
+ result = ftruncate(path->narrow, length);
90+
+ #else
91+
result = truncate(path->narrow, length);
92+
+ #endif
93+
#endif
94+
_Py_END_SUPPRESS_IPH
95+
Py_END_ALLOW_THREADS

sources.32/cpython-master.patchset/Modules_signalmodule.c.diff renamed to sources.32/Python-3.8.0b4.patchset/Modules_signalmodule.c.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
--- cpython-master/Modules/signalmodule.c 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Modules/signalmodule.c 2018-01-23 23:55:20.000000000 +0100
3-
@@ -40,6 +40,13 @@
1+
--- Python-3.8.0b4/Modules/signalmodule.c 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Modules/signalmodule.c 2019-08-31 11:57:53.553671545 +0200
3+
@@ -44,6 +44,13 @@
44
#define SIG_ERR ((PyOS_sighandler_t)(-1))
55
#endif
66

sources.32/cpython-master.patchset/Modules_timemodule.c.diff renamed to sources.32/Python-3.8.0b4.patchset/Modules_timemodule.c.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
--- cpython-master/Modules/timemodule.c 2018-01-23 22:26:07.000000000 +0100
2-
+++ cpython-master.api19/Modules/timemodule.c 2018-01-23 23:55:20.000000000 +0100
3-
@@ -477,6 +477,7 @@
1+
--- Python-3.8.0b4/Modules/timemodule.c 2019-08-29 23:59:20.000000000 +0200
2+
+++ Python-3.8.0b4.32/Modules/timemodule.c 2019-08-31 11:57:53.557671392 +0200
3+
@@ -461,6 +461,7 @@
44
}
55

66
#ifndef HAVE_TIMEGM
77
+#ifndef CRYSTAX
88
static time_t
99
timegm(struct tm *p)
1010
{
11-
@@ -488,6 +489,7 @@
11+
@@ -472,6 +473,7 @@
1212
((p->tm_year-1)/100)*86400 + ((p->tm_year+299)/400)*86400;
1313
}
1414
#endif

0 commit comments

Comments
 (0)