Browse Source

Fix python (and python2) syslog module

Since the syslog api is a wrapper around the native Android logging
system, we need to link the syslog module against liblog. Fixes #41.
android-5
Fredrik Fornwall 9 years ago
parent
commit
3152547b65
  1. 2
      packages/python/build.sh
  2. 20
      packages/python/setup.py.patch
  3. 2
      packages/python2/build.sh
  4. 12
      packages/python2/setup.py.patch

2
packages/python/build.sh

@ -7,7 +7,7 @@ TERMUX_PKG_HOSTBUILD=true
_MAJOR_VERSION=3.5 _MAJOR_VERSION=3.5
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0 TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0
TERMUX_PKG_BUILD_REVISION=2 TERMUX_PKG_BUILD_REVISION=3
TERMUX_PKG_SRCURL=http://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=http://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz
# The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python. # The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python.

20
packages/python/setup.py.patch

@ -1,7 +1,7 @@
diff -u -r ../Python-3.4.1/setup.py ./setup.py diff -u -r ../Python-3.5.0/setup.py ./setup.py
--- ../Python-3.4.1/setup.py 2014-05-19 07:19:40.000000000 +0200 --- ../Python-3.5.0/setup.py 2015-09-13 07:41:26.000000000 -0400
+++ ./setup.py 2014-06-04 11:12:26.776875501 +0200 +++ ./setup.py 2015-11-07 17:31:45.332321322 -0500
@@ -568,7 +568,8 @@ @@ -592,7 +592,8 @@
libraries=math_libs) ) libraries=math_libs) )
# time libraries: librt may be needed for clock_gettime() # time libraries: librt may be needed for clock_gettime()
@ -11,7 +11,7 @@ diff -u -r ../Python-3.4.1/setup.py ./setup.py
lib = sysconfig.get_config_var('TIMEMODULE_LIB') lib = sysconfig.get_config_var('TIMEMODULE_LIB')
if lib: if lib:
time_libs.append(lib) time_libs.append(lib)
@@ -625,7 +626,8 @@ @@ -651,7 +652,8 @@
missing.append('spwd') missing.append('spwd')
# select(2); not on ancient System V # select(2); not on ancient System V
@ -21,3 +21,13 @@ diff -u -r ../Python-3.4.1/setup.py ./setup.py
# Fred Drake's interface to the Python parser # Fred Drake's interface to the Python parser
exts.append( Extension('parser', ['parsermodule.c']) ) exts.append( Extension('parser', ['parsermodule.c']) )
@@ -661,7 +663,8 @@
# Lance Ellinghaus's syslog module
# syslog daemon interface
- exts.append( Extension('syslog', ['syslogmodule.c']) )
+ # Termux: Add 'log' android library since we use android logging:
+ exts.append( Extension('syslog', ['syslogmodule.c'], libraries=['log']) )
#
# Here ends the simple stuff. From here on, modules need certain

2
packages/python2/build.sh

@ -8,7 +8,7 @@ TERMUX_PKG_HOSTBUILD=true
_MAJOR_VERSION=2.7 _MAJOR_VERSION=2.7
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.10 TERMUX_PKG_VERSION=${_MAJOR_VERSION}.10
TERMUX_PKG_BUILD_REVISION=3 TERMUX_PKG_BUILD_REVISION=4
TERMUX_PKG_SRCURL=http://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SRCURL=http://www.python.org/ftp/python/${TERMUX_PKG_VERSION}/Python-${TERMUX_PKG_VERSION}.tar.xz
# The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python. # The flag --with(out)-pymalloc (disable/enable specialized mallocs) is enabled by default and causes m suffix versions of python.

12
packages/python2/setup.py.patch

@ -1,6 +1,6 @@
diff -u -r ../Python-2.7.10/setup.py ./setup.py diff -u -r ../Python-2.7.10/setup.py ./setup.py
--- ../Python-2.7.10/setup.py 2015-05-23 12:09:25.000000000 -0400 --- ../Python-2.7.10/setup.py 2015-05-23 12:09:25.000000000 -0400
+++ ./setup.py 2015-09-16 20:36:19.281639713 -0400 +++ ./setup.py 2015-11-07 17:34:53.020310751 -0500
@@ -294,6 +294,9 @@ @@ -294,6 +294,9 @@
(ext.name, sys.exc_info()[1])) (ext.name, sys.exc_info()[1]))
self.failed.append(ext.name) self.failed.append(ext.name)
@ -11,3 +11,13 @@ diff -u -r ../Python-2.7.10/setup.py ./setup.py
# Workaround for Mac OS X: The Carbon-based modules cannot be # Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python # reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args: if 'Carbon' in ext.extra_link_args:
@@ -674,7 +677,8 @@
# Lance Ellinghaus's syslog module
# syslog daemon interface
- exts.append( Extension('syslog', ['syslogmodule.c']) )
+ # Termux: Add 'log' android library since we use android logging:
+ exts.append( Extension('syslog', ['syslogmodule.c'], libraries=['log']) )
# George Neville-Neil's timing module:
# Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html

Loading…
Cancel
Save