Thu Jul 17 15:26:49 2014 UTC ()
Fix SCO OpenServer 5.0.7/3.2 build.


(ryoon)
diff -r1.44 -r1.45 pkgsrc/lang/python27/Makefile
diff -r1.44 -r1.45 pkgsrc/lang/python27/distinfo
diff -r0 -r1.1 pkgsrc/lang/python27/patches/patch-Lib_multiprocessing_process.py
diff -r0 -r1.1 pkgsrc/lang/python27/patches/patch-Modules_getaddrinfo.c
diff -r0 -r1.1 pkgsrc/lang/python27/patches/patch-Modules_mmapmodule.c
diff -r0 -r1.1 pkgsrc/lang/python27/patches/patch-Modules_posixmodule.c
diff -r0 -r1.4 pkgsrc/lang/python27/patches/patch-Modules_socketmodule.c
diff -r1.13 -r1.14 pkgsrc/lang/python27/patches/patch-al

cvs diff -r1.44 -r1.45 pkgsrc/lang/python27/Makefile (expand / switch to context diff)
--- pkgsrc/lang/python27/Makefile 2014/07/02 09:53:16 1.44
+++ pkgsrc/lang/python27/Makefile 2014/07/17 15:26:49 1.45
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.44 2014/07/02 09:53:16 adam Exp $
+# $NetBSD: Makefile,v 1.45 2014/07/17 15:26:49 ryoon Exp $
 
 .include "dist.mk"
 
@@ -29,7 +29,8 @@
 
 USE_LANGUAGES=		c c++
 
-PTHREAD_OPTS+=	require
+PTHREAD_OPTS+=		require
+PTHREAD_AUTO_VARS=	yes
 .include "../../mk/pthread.buildlink3.mk"
 .if ${PTHREAD_TYPE} == "pth"
 CONFIGURE_ARGS+=	--with-pth
@@ -74,6 +75,8 @@
 PY_PLATNAME=	hp-ux11
 .elif ${OPSYS} == "Linux"
 PY_PLATNAME=	linux2
+.elif ${OS_VARIANT} == "SCOOSR5"
+PY_PLATNAME=	sco_sv3
 .else
 PY_PLATNAME=	${LOWER_OPSYS}${OS_VERSION:C/\..*//}
 .endif
@@ -176,6 +179,12 @@
 post-install:
 	${LN} -fs ${DESTDIR}${PREFIX}/lib/libpython2.7.sl \
 		${DESTDIR}${PREFIX}/lib/libpython2.7.sl.1.0
+.endif
+
+.if ${OS_VARIANT} == "SCOOSR5"
+# SCO OpenServer 5.0.7/3.2 has no socklen_t in system headers, but has in
+# GNU pth's header. It should be used in this case.
+CONFIGURE_ENV+=		ac_cv_type_socklen_t=yes
 .endif
 
 BUILDLINK_DEPMETHOD.readline=		build

cvs diff -r1.44 -r1.45 pkgsrc/lang/python27/distinfo (expand / switch to context diff)
--- pkgsrc/lang/python27/distinfo 2014/07/02 09:53:16 1.44
+++ pkgsrc/lang/python27/distinfo 2014/07/17 15:26:49 1.45
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.44 2014/07/02 09:53:16 adam Exp $
+$NetBSD: distinfo,v 1.45 2014/07/17 15:26:49 ryoon Exp $
 
 SHA1 (Python-2.7.8.tar.xz) = 9c6281eeace0c3646fa556c8087bb1b7e033c9c4
 RMD160 (Python-2.7.8.tar.xz) = 04d7d55ea65074a9b419e5d0920414e54691d907
@@ -7,19 +7,24 @@
 SHA1 (patch-Include_pyerrors.h) = 3eba043c83b1d1df4918524f7b53047a6ed372ae
 SHA1 (patch-Include_pyport.h) = 971c7c548b92595712d0d70a0917a0ccc83b6c7e
 SHA1 (patch-Lib_distutils_unixccompiler.py) = 39b967dc2ae648143d5841f22602a21063b4d5ea
+SHA1 (patch-Lib_multiprocessing_process.py) = b47ad4cbeddbcfb4342c08c84d0d515a793815d4
 SHA1 (patch-Lib_poplib.py) = 5d7f64b028abd2fd43651f27a7f2ce7efe5b0859
 SHA1 (patch-Lib_smtplib.py) = f1118bbc53b4e292eb9a28ef3ef10eb4aa553bc3
 SHA1 (patch-Lib_test_test__poplib.py) = 1bdef76b687d042272e35c08521d4244d2c7fbe1
 SHA1 (patch-Lib_test_test_smtplib.py) = 9e8a7f826c7d0f493746718b49fc27ac97c2cbb1
 SHA1 (patch-Misc_NEWS) = c9171e10227567750db8e11881aca305cd8c3a42
 SHA1 (patch-Modules___ssl.c) = aaddaea5bcd6c84d3d896c7c37f710933b8228bc
+SHA1 (patch-Modules_getaddrinfo.c) = 696c58c4c4bbb710fb1508d7d88864d0b08cfc79
 SHA1 (patch-Modules_getpath.c) = f68b38eb90f974b67ceab3922ce7f92eb77f25c3
+SHA1 (patch-Modules_mmapmodule.c) = 87ea76e6d8263045c1ca794ff5c75ed631a74b6d
+SHA1 (patch-Modules_posixmodule.c) = b8960592611499202bb5ff8521d619e0637177b6
+SHA1 (patch-Modules_socketmodule.c) = 960ce4af2a142c471c707de446f2d390044bbc13
 SHA1 (patch-aa) = 990e4025bb6a37715e1f5df1831499f0ab08acfa
 SHA1 (patch-ab) = 0d0ae9802dfe3b85659adb16793affd8c4ffce43
 SHA1 (patch-ad) = de730b9f5a5efb56afa8bed05824b5f6579242ec
 SHA1 (patch-ae) = ff6d8c6164fe3c6dc4fb33d88eb8a49d5c5442f6
 SHA1 (patch-ah) = ae3ce0656d890ca34292920bf0185f94ba847139
-SHA1 (patch-al) = d07699c6987da69fca911a15ab8011a82e43143d
+SHA1 (patch-al) = 43457e0749366e65bc139d0905ca95c6d6d79ecf
 SHA1 (patch-am) = 366ce0b130cc9b6d6c5354769da05bb4b5845e01
 SHA1 (patch-an) = 6098fbf0fc31422196cc40d3a227934523db11ca
 SHA1 (patch-ao) = 3a1cd2b255340fd23fc1fce8680e692581ffcec1

File Added: pkgsrc/lang/python27/patches/patch-Lib_multiprocessing_process.py
$NetBSD: patch-Lib_multiprocessing_process.py,v 1.1 2014/07/17 15:26:49 ryoon Exp $

--- Lib/multiprocessing/process.py.orig	2014-06-30 02:05:29.000000000 +0000
+++ Lib/multiprocessing/process.py
@@ -306,7 +306,15 @@ class _MainProcess(Process):
         self._popen = None
         self._counter = itertools.count(1)
         self._children = set()
-        self._authkey = AuthenticationString(os.urandom(32))
+        # Get randomness from urandom or the 'random' module.
+        # from http://bugs.python.org/issue6645
+        # for SCO OpenServer 5.0.7/3.2 and AIX
+        try:
+            self._authkey = AuthenticationString(os.urandom(32))
+        except:
+            import random
+            bytes = [chr(random.randrange(256)) for i in range(32)]
+            self._authkey = AuthenticationString(bytes)
         self._tempdir = None
 
 _current_process = _MainProcess()

File Added: pkgsrc/lang/python27/patches/patch-Modules_getaddrinfo.c
$NetBSD: patch-Modules_getaddrinfo.c,v 1.1 2014/07/17 15:26:49 ryoon Exp $

--- Modules/getaddrinfo.c.orig	2014-06-30 02:05:43.000000000 +0000
+++ Modules/getaddrinfo.c
@@ -66,6 +66,15 @@
 #define YES 1
 #define NO  0
 
+/* SCO OpenServer 5.0.7/3.2's sys/reg.h defines ERR. */
+#if defined(ERR)
+#undef ERR
+#endif
+
+# if defined(_SCO_DS)
+typedef int socklen_t;
+#endif
+
 #ifdef FAITH
 static int translate = NO;
 static struct in6_addr faith_prefix = IN6ADDR_GAI_ANY_INIT;

File Added: pkgsrc/lang/python27/patches/Attic/patch-Modules_mmapmodule.c
$NetBSD: patch-Modules_mmapmodule.c,v 1.1 2014/07/17 15:26:49 ryoon Exp $

--- Modules/mmapmodule.c.orig	2014-06-30 02:05:43.000000000 +0000
+++ Modules/mmapmodule.c
@@ -23,7 +23,7 @@
 
 #ifndef MS_WINDOWS
 #define UNIX
-# ifdef __APPLE__
+# if defined(__APPLE__) || defined(_SCO_DS)
 #  include <fcntl.h>
 # endif
 #endif

File Added: pkgsrc/lang/python27/patches/patch-Modules_posixmodule.c
$NetBSD: patch-Modules_posixmodule.c,v 1.1 2014/07/17 15:26:49 ryoon Exp $

--- Modules/posixmodule.c.orig	2014-06-30 02:05:43.000000000 +0000
+++ Modules/posixmodule.c
@@ -317,6 +317,10 @@ extern int lstat(const char *, struct st
 #define PARSE_PID "i"
 #define PyLong_FromPid PyInt_FromLong
 #define PyLong_AsPid PyInt_AsLong
+#elif SIZEOF_PID_T == SIZEOF_SHORT
+#define PARSE_PID "i"
+#define PyLong_FromPid PyInt_FromLong
+#define PyLong_AsPid PyInt_AsLong
 #elif SIZEOF_PID_T == SIZEOF_LONG
 #define PARSE_PID "l"
 #define PyLong_FromPid PyInt_FromLong

File Added: pkgsrc/lang/python27/patches/patch-Modules_socketmodule.c
$NetBSD: patch-Modules_socketmodule.c,v 1.4 2014/07/17 15:26:49 ryoon Exp $

--- Modules/socketmodule.c.orig	2014-06-30 02:05:43.000000000 +0000
+++ Modules/socketmodule.c
@@ -244,7 +244,7 @@ shutdown(how) -- shut down traffic in on
 /* Irix 6.5 fails to define this variable at all. This is needed
    for both GCC and SGI's compiler. I'd say that the SGI headers
    are just busted. Same thing for Solaris. */
-#if (defined(__sgi) || defined(sun)) && !defined(INET_ADDRSTRLEN)
+#if (defined(__sgi) || defined(sun) || defined(_SCO_DS)) && !defined(INET_ADDRSTRLEN)
 #define INET_ADDRSTRLEN 16
 #endif
 

cvs diff -r1.13 -r1.14 pkgsrc/lang/python27/patches/Attic/patch-al (expand / switch to context diff)
--- pkgsrc/lang/python27/patches/Attic/patch-al 2014/07/02 09:53:16 1.13
+++ pkgsrc/lang/python27/patches/Attic/patch-al 2014/07/17 15:26:49 1.14
@@ -1,4 +1,4 @@
-$NetBSD: patch-al,v 1.13 2014/07/02 09:53:16 adam Exp $
+$NetBSD: patch-al,v 1.14 2014/07/17 15:26:49 ryoon Exp $
 
 - recognize MirBSD, Interix
 - remove special-case library version hack for FreeBSD
@@ -34,17 +34,29 @@
  	  INSTSONAME="$LDLIBRARY".$SOVERSION
  	  ;;
      hp*|HP*)
-@@ -6050,8 +6045,7 @@ $as_echo "$CC" >&6; }
+@@ -5393,6 +5388,11 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+ 	LDLIBRARY='libpython$(VERSION).so'
+ 	RUNSHARED=LIBPATH=`pwd`${LIBPATH:+:${LIBPATH}}
+ 	;;
++    SCO_SV*)
++	LDLIBRARY='libpython$(VERSION).so'
++	RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
++	INSTSONAME="$LDLIBRARY".$SOVERSION
++	;;
+ 
+   esac
+ else # shared is disabled
+@@ -6050,8 +6050,7 @@ $as_echo "$CC" >&6; }
  		cur_target_minor=`sw_vers -productVersion | \
  				sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
  		cur_target="${cur_target_major}.${cur_target_minor}"
 -		if test ${cur_target_major} -eq 10 && \
 -		   test ${cur_target_minor} -ge 3
-+		if false
++		if test false
  		then
  		    cur_target=10.3
  		    if test ${enable_universalsdk}; then
-@@ -8209,9 +8203,9 @@ then
+@@ -8209,9 +8208,9 @@ then
  			LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
  		else
  			# No framework, use the Python app as bundle-loader
@@ -52,12 +64,12 @@
 -			LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 -			LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 +			BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)'
-+			LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
++			DSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
 +			LDCXXSHARED="$LDCXXSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
  		fi ;;
  	Darwin/*)
  		# Use -undefined dynamic_lookup whenever possible (10.3 and later).
-@@ -8234,9 +8228,9 @@ then
+@@ -8234,9 +8233,9 @@ then
  				LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
  			else
  				# No framework, use the Python app as bundle-loader
@@ -70,7 +82,7 @@
  			fi
  		else
  			# building for OS X 10.3 and later
-@@ -8250,7 +8244,7 @@ then
+@@ -8250,7 +8249,7 @@ then
  		;;
  	Linux*|GNU*|QNX*)
  		LDSHARED='$(CC) -shared'
@@ -79,7 +91,7 @@
  	BSD/OS*/4*)
  		LDSHARED="gcc -shared"
  		LDCXXSHARED="g++ -shared";;
-@@ -8278,9 +8272,15 @@ then
+@@ -8278,6 +8277,9 @@ then
  				   ;;
  				esac
  		fi;;
@@ -89,13 +101,7 @@
  	NetBSD*|DragonFly*)
  		LDSHARED='$(CC) -shared'
  		LDCXXSHARED='$(CXX) -shared';;
-+	Interix*)
-+		LDSHARED='$(CC) -shared'" ${LDFLAGS}"
-+		LDCXXSHARED='$(CXX) -shared'" ${LDFLAGS}";; # XXX tv needs image-base hack
- 	OpenUNIX*|UnixWare*)
- 		if test "$GCC" = "yes" ; then
- 			LDSHARED='$(CC) -shared'
-@@ -8324,7 +8324,8 @@ then
+@@ -8324,7 +8326,8 @@ then
  		 fi;;
  	Linux*|GNU*) CCSHARED="-fPIC";;
  	BSD/OS*/4*) CCSHARED="-fpic";;
@@ -105,7 +111,7 @@
  	OpenUNIX*|UnixWare*)
  		if test "$GCC" = "yes"
  		then CCSHARED="-fPIC"
-@@ -8376,11 +8377,12 @@ then
+@@ -8376,11 +8379,12 @@ then
  	OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
  	SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
  	ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
@@ -119,3 +125,14 @@
  	SunOS/5*) case $CC in
  		  *gcc*)
  		    if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null
+@@ -10370,6 +10374,10 @@ int
+ main ()
+ {
+ int x=kqueue()
++/* SCO OpenServer 5.0.7/3.2 has not kqueue, but detected as yes. */
++#if defined(_SCO_DS)
++#error no kqueue
++#endif
+   ;
+   return 0;
+ }