mirror of
https://github.com/novatiq/packages.git
synced 2026-04-27 22:34:41 +01:00
python packages: move all things python under lang/python
I admit this may be be a bit aggressive, but the lang folder is getting cluttered/filled up with Python, PHP, Perl, Ruby, etc. packages. Makes sense to try to group them into per-lang folders. I took the Pythons. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
This commit is contained in:
25
lang/python/python/patches/001-enable-zlib.patch
Normal file
25
lang/python/python/patches/001-enable-zlib.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
From 6eeab87bc852481e599325549c854b701bf2e39f Mon Sep 17 00:00:00 2001
|
||||
From: Alexandru Ardelean <aa@ocedo.com>
|
||||
Date: Thu, 25 Sep 2014 18:18:29 +0300
|
||||
Subject: [PATCH] enable zlib
|
||||
|
||||
---
|
||||
Modules/Setup.dist | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
|
||||
index 01fb85f..01ac492 100644
|
||||
--- a/Modules/Setup.dist
|
||||
+++ b/Modules/Setup.dist
|
||||
@@ -358,7 +358,7 @@ _symtable symtablemodule.c
|
||||
# Andrew Kuchling's zlib module.
|
||||
# This require zlib 1.1.3 (or later).
|
||||
# See http://www.gzip.org/zlib/
|
||||
-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
|
||||
+zlib zlibmodule.c -lz
|
||||
|
||||
# Interface to the Expat XML parser
|
||||
#
|
||||
--
|
||||
1.8.4.5
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index cbdeaf3..5154412 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -480,7 +480,8 @@ class PyBuildExt(build_ext):
|
||||
add_dir_to_list(dir_list, directory)
|
||||
|
||||
if os.path.normpath(sys.prefix) != '/usr' \
|
||||
- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
|
||||
+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
|
||||
+ and not cross_compiling:
|
||||
# OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
|
||||
# (PYTHONFRAMEWORK is set) to avoid # linking problems when
|
||||
# building a framework with different architectures than
|
||||
@@ -0,0 +1,20 @@
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index 7f4ec2f..e270bf2 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -1038,6 +1038,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
||||
done; \
|
||||
done
|
||||
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
|
||||
+ifeq (@COMPILE_ALL_TESTS@,yes)
|
||||
if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
|
||||
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
|
||||
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
|
||||
@@ -1064,6 +1065,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
||||
$(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
|
||||
|
||||
# Create the PLATDIR source directory, if one wasn't distributed..
|
||||
$(srcdir)/Lib/$(PLATDIR):
|
||||
@@ -0,0 +1,22 @@
|
||||
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
|
||||
index 748a63b..cb6e291 100644
|
||||
--- a/Python/pythonrun.c
|
||||
+++ b/Python/pythonrun.c
|
||||
@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
|
||||
int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
|
||||
int Py_NoSiteFlag; /* Suppress 'import site' */
|
||||
int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
|
||||
-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
|
||||
+int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
|
||||
int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
|
||||
int Py_FrozenFlag; /* Needed by getpath.c */
|
||||
int Py_UnicodeFlag = 0; /* Needed by compile.c */
|
||||
@@ -174,7 +174,7 @@ Py_InitializeEx(int install_sigs)
|
||||
if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
|
||||
Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
|
||||
if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
|
||||
- Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
|
||||
+ Py_DontWriteBytecodeFlag = atoi(p);
|
||||
/* The variable is only tested for existence here; _PyRandom_Init will
|
||||
check its value further. */
|
||||
if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 1d1ae72..511aed5 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
|
||||
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
|
||||
if cross_compiling:
|
||||
self.add_gcc_paths()
|
||||
- self.add_multiarch_paths()
|
||||
+ else:
|
||||
+ self.add_multiarch_paths()
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/Lib/distutils/command/build_scripts.py
|
||||
+++ b/Lib/distutils/command/build_scripts.py
|
||||
@@ -89,6 +89,7 @@ class build_scripts (Command):
|
||||
adjust = 1
|
||||
post_interp = match.group(1) or ''
|
||||
|
||||
+ adjust = 0
|
||||
if adjust:
|
||||
log.info("copying and adjusting %s -> %s", script,
|
||||
self.build_dir)
|
||||
@@ -0,0 +1,54 @@
|
||||
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.
|
||||
|
||||
The _python_sysroot variable is also used to prefix the LIBDIR value
|
||||
taken from the sysconfigdata module.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/Lib/distutils/sysconfig.py
|
||||
===================================================================
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -19,8 +19,13 @@
|
||||
from distutils.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)
|
||||
+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'))
|
||||
+else:
|
||||
+ PREFIX = os.path.normpath(sys.prefix)
|
||||
+ EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
|
||||
|
||||
# Path to the base directory of the project. On Windows the binary may
|
||||
# live in project/PCBuild9. If we're dealing with an x64 Windows build,
|
||||
Index: b/Lib/distutils/command/build_ext.py
|
||||
===================================================================
|
||||
--- a/Lib/distutils/command/build_ext.py
|
||||
+++ b/Lib/distutils/command/build_ext.py
|
||||
@@ -237,7 +237,10 @@
|
||||
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('.')
|
||||
@@ -0,0 +1,34 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 7868b7b..10ec68f 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -1067,6 +1067,7 @@ class PyBuildExt(build_ext):
|
||||
if db_setup_debug: print "db lib: ", dblib, "not found"
|
||||
|
||||
except db_found:
|
||||
+ rt_dblib_dir = None if cross_compiling else dblib_dir
|
||||
if db_setup_debug:
|
||||
print "bsddb using BerkeleyDB lib:", db_ver, dblib
|
||||
print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
|
||||
@@ -1081,7 +1082,7 @@ class PyBuildExt(build_ext):
|
||||
exts.append(Extension('_bsddb', ['_bsddb.c'],
|
||||
depends = ['bsddb.h'],
|
||||
library_dirs=dblib_dir,
|
||||
- runtime_library_dirs=dblib_dir,
|
||||
+ runtime_library_dirs=rt_dblib_dir,
|
||||
include_dirs=db_incs,
|
||||
libraries=dblibs))
|
||||
else:
|
||||
@@ -1292,10 +1293,11 @@ class PyBuildExt(build_ext):
|
||||
break
|
||||
elif cand == "bdb":
|
||||
if db_incs is not None:
|
||||
+ rt_dblib_dir = None if cross_compiling else dblib_dir
|
||||
print "building dbm using bdb"
|
||||
dbmext = Extension('dbm', ['dbmmodule.c'],
|
||||
library_dirs=dblib_dir,
|
||||
- runtime_library_dirs=dblib_dir,
|
||||
+ runtime_library_dirs=rt_dblib_dir,
|
||||
include_dirs=db_incs,
|
||||
define_macros=[
|
||||
('HAVE_BERKDB_H', None),
|
||||
@@ -0,0 +1,15 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 7868b7b..544fa7e 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -452,8 +452,9 @@ class PyBuildExt(build_ext):
|
||||
# directly since an inconsistently reproducible issue comes up where
|
||||
# the environment variable is not set even though the value were passed
|
||||
# into configure and stored in the Makefile (issue found on OS X 10.3).
|
||||
+ rt_lib_dirs = [] if cross_compiling else self.compiler.runtime_library_dirs
|
||||
for env_var, arg_name, dir_list in (
|
||||
- ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
|
||||
+ ('LDFLAGS', '-R', rt_lib_dirs),
|
||||
('LDFLAGS', '-L', self.compiler.library_dirs),
|
||||
('CPPFLAGS', '-I', self.compiler.include_dirs)):
|
||||
env_val = sysconfig.get_config_var(env_var)
|
||||
@@ -0,0 +1,12 @@
|
||||
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
|
||||
index e478a57..eb297b4 100644
|
||||
--- a/Modules/_cursesmodule.c
|
||||
+++ b/Modules/_cursesmodule.c
|
||||
@@ -117,7 +117,6 @@ char *PyCursesVersion = "2.2";
|
||||
#defines many common symbols (such as "lines") which breaks the
|
||||
curses module in other ways. So the code will just specify
|
||||
explicit prototypes here. */
|
||||
-extern int setupterm(char *,int,int *);
|
||||
#ifdef __sgi
|
||||
#include <term.h>
|
||||
#endif
|
||||
Reference in New Issue
Block a user