Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
mingw::python: fully support subprocess through PC/_subprocess module.
Browse files Browse the repository at this point in the history
  • Loading branch information
janneke committed Jul 18, 2010
1 parent 333b64f commit e3d4668
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions gub/specs/python-2-6.py
Expand Up @@ -42,6 +42,8 @@ class Python_2_6__mingw (python.Python__mingw):
'python-2.4.2-winsock2.patch',
'python-2.4.2-setup.py-selectmodule.patch',
'python-2.4.5-disable-pwd-mingw.patch',
'python-2.4.5-mingw-site.patch',
'python-2.4.5-mingw-socketmodule.patch',
]
dependencies = [
'db-devel',
Expand Down
13 changes: 10 additions & 3 deletions gub/specs/python.py
Expand Up @@ -125,11 +125,18 @@ def __init__ (self, settings, source):
# 2.4.2 and combined in one patch; move to cross-Python?
def patch (self):
Python.patch (self)
## to make subprocess.py work.
self.file_sub ([
("import fcntl", ""),
('(== "win32")', r'in ("win32", "mingw32")'),
], "%(srcdir)s/Lib/subprocess.py",
must_succeed=True)
must_succeed=True)
def configure (self):
Python.configure (self)
self.dump ('''
_subprocess ../PC/_subprocess.c
msvcrt ../PC/msvcrtmodule.c
''',
'%(builddir)s/Modules/Setup',
mode='a')
def compile (self):
self.system ('''
cd %(builddir)s && rm -f python.exe
Expand Down
3 changes: 2 additions & 1 deletion patches/python-2.4.5-1.patch
Expand Up @@ -496,12 +496,13 @@
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
--- python-2.4.5/Modules/posixmodule.c.orig 2008-11-08 16:59:06.000000000 +0100
+++ python-2.4.5/Modules/posixmodule.c 2008-11-08 16:59:59.000000000 +0100
@@ -118,6 +118,10 @@ corresponding Unix manual entries for mo
@@ -118,6 +118,11 @@ corresponding Unix manual entries for mo
#define HAVE_FSYNC 1
#define fsync _commit
#else
+#ifdef __MINGW32__ /* MINGW32 (cross-)compiler*/
+#define HAVE_FSYNC 1
+#define HAVE_PIPE 1
+#define fsync _commit
+#else
#if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)
Expand Down
3 changes: 2 additions & 1 deletion patches/python-2.6.4.patch
Expand Up @@ -496,12 +496,13 @@
(sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
--- python-2.4.5/Modules/posixmodule.c.orig 2008-11-08 16:59:06.000000000 +0100
+++ python-2.4.5/Modules/posixmodule.c 2008-11-08 16:59:59.000000000 +0100
@@ -118,6 +118,10 @@ corresponding Unix manual entries for mo
@@ -118,6 +118,11 @@ corresponding Unix manual entries for mo
#define HAVE_FSYNC 1
#define fsync _commit
#else
+#ifdef __MINGW32__ /* MINGW32 (cross-)compiler*/
+#define HAVE_FSYNC 1
+#define HAVE_PIPE 1
+#define fsync _commit
+#else
#if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS)
Expand Down

0 comments on commit e3d4668

Please sign in to comment.