I managed to get the pyinstaller 1.5 release to work under solaris/x86 with just a few changes.

Mostly these changes are changing places in the code that say "if linux" to "if linux or solaris".

I also had to add a minimal implementation of mkdtemp() which was missing on solaris.

I'm not too sure about the tk detection in Configure.py (I'm not using it - it was just to set an undefined variable).

I attach the patch here. Is there any chance of someone familiar with the code merging these changes in? I know that the codebase has changed somewhat since the 1.5 release.

Hywel.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyinstaller?hl=en.

diff -ruN orig_pyinstaller-1.5/bindepend.py pyinstaller-1.5/bindepend.py
--- orig_pyinstaller-1.5/bindepend.py	2011-06-06 15:52:04.000000000 +0100
+++ pyinstaller-1.5/bindepend.py	2011-09-09 17:26:38.000000000 +0100
@@ -731,7 +731,7 @@
 
     `name`must include the prefix, e.g. ``libpython2.4.so``
     """
-    assert sys.platform == 'linux2', "Current implementation for Linux only"
+    assert sys.platform == 'linux2' or sys.platform.startswith('sunos'), "Current implementation for Linux (or sunos) only"
 
     lib = None
 
diff -ruN orig_pyinstaller-1.5/Build.py pyinstaller-1.5/Build.py
--- orig_pyinstaller-1.5/Build.py	2011-06-06 15:39:46.000000000 +0100
+++ pyinstaller-1.5/Build.py	2011-09-09 17:26:38.000000000 +0100
@@ -508,7 +508,8 @@
         it in its output.
         """
 
-        if target_platform.startswith("linux"):
+        if target_platform.startswith("linux") or \
+           target_platform.startswith("sun"):
             name = 'libpython%d.%d.so' % sys.version_info[:2]
         elif target_platform.startswith("darwin"):
             name = 'Python'
@@ -520,7 +521,8 @@
                 # lib found
                 return
 
-        if target_platform.startswith("linux"):
+        if target_platform.startswith("linux") or \
+           target_platform.startswith("sun"):
             lib = bindepend.findLibrary(name)
             if lib is None:
                 raise IOError("Python library not found!")
diff -ruN orig_pyinstaller-1.5/Configure.py pyinstaller-1.5/Configure.py
--- orig_pyinstaller-1.5/Configure.py	2011-06-06 15:39:46.000000000 +0100
+++ pyinstaller-1.5/Configure.py	2011-09-09 17:26:38.000000000 +0100
@@ -94,6 +94,8 @@
         pattern = r'libtcl(\d\.\d)?\.so'
     elif target_platform.startswith("darwin"):
         pattern = r'_tkinter'
+    elif target_platform.startswith("sun"):
+        pattern = r'libtcl(\d\.\d)?\.so'
 
     a = mf.ImportTracker()
     a.analyze_r('Tkinter')
diff -ruN orig_pyinstaller-1.5/source/common/launch.c pyinstaller-1.5/source/common/launch.c
--- orig_pyinstaller-1.5/source/common/launch.c	2011-06-06 15:39:48.000000000 +0100
+++ pyinstaller-1.5/source/common/launch.c	2011-09-09 17:26:38.000000000 +0100
@@ -42,6 +42,9 @@
 #include <sys/stat.h>
 #include "launch.h"
 #include "zlib.h"
+#ifdef SUNOS
+#include "mkdtemp.h"
+#endif
 
 /*
  * Python Entry point declarations (see macros in launch.h).
diff -ruN orig_pyinstaller-1.5/source/common/mkdtemp.h pyinstaller-1.5/source/common/mkdtemp.h
--- orig_pyinstaller-1.5/source/common/mkdtemp.h	1970-01-01 01:00:00.000000000 +0100
+++ pyinstaller-1.5/source/common/mkdtemp.h	2011-09-08 17:20:17.000000000 +0100
@@ -0,0 +1,15 @@
+
+#ifndef __MKDTEMP__
+#define __MKDTEMP__
+
+static char* mkdtemp(char *template)
+{
+   if( ! mktemp(template) )
+       return NULL;
+   if( mkdir(template, 0700) )
+       return NULL;
+   return template;
+}
+
+#endif
+
diff -ruN orig_pyinstaller-1.5/source/wscript pyinstaller-1.5/source/wscript
--- orig_pyinstaller-1.5/source/wscript	2011-06-06 15:39:48.000000000 +0100
+++ pyinstaller-1.5/source/wscript	2011-09-09 17:26:38.000000000 +0100
@@ -148,6 +148,9 @@
         conf.env.append_value('CCDEFINES', 'WIN32')
         conf.env.append_value('CPPPATH', '../zlib')
 
+    if myplatform.startswith('sun'):
+        conf.env.append_value('CCDEFINES', 'SUNOS')
+
     conf.env.append_value('CPPPATH', '../common')
 
 
@@ -190,7 +193,8 @@
     # XXX: -Wl,--as-needed detected during configure but fails during mac build
     if conf.check_cc(ccflags='-Wl,--as-needed',
             msg='Checking for flags -Wl,--as-needed') \
-            and not myplatform.startswith('darwin'):
+            and not myplatform.startswith('darwin') \
+            and not myplatform.startswith('sun'):
         conf.env.append_value('LINKFLAGS', '-Wl,--as-needed')
 
 

Reply via email to