Ronald Oussoren avatar Ronald Oussoren committed 83b7a85

Make sure GNUstep works again (mostly)

Comments (0)

Files changed (8)

 
 .. _`Coding style`: coding-style.txt
 
+Add templates for various file types
+....................................
+
+Add Xcode/PB file templates for various types of files, at least for an
+empty python file.
+
 Add templates for various project-types
 .......................................
 
 should simular templates for other usefull projects and most importantly a 
 document-based application. 
 
+
 Other possibilies include:
 
 * Standalone Service

pyobjc/Doc/gnustep.txt

 make the GNUstep port as stable as the MacOS X "port".
 
 The GNUstep port was primarily developed on Linux i86 (specifically 
-the Debian testing distribution), using python 2.3.2,  gcc 3.3.2 and 
-gnustep-base 1.7.3-1. The code in setup.py works for this configuration,
+the Debian testing distribution), using python 2.3.3,  gcc 3.3.2 and 
+gnustep-base1 1.9.0-1. The code in setup.py works for this configuration,
 but probably not for other configurations.
 
+GNUstep support is *very* fragile, in some versions of the the selectors for
+new classes should be strings, in others they should be SEL objects (as you
+would expect). We also use undocumented private functions to initialize new
+classes.
+
 TODO
 ----
 
+* Fix the odd bug...
+
+  I currently get the following text when importing objc::
+
+  	Unable to retrieve information about SIGPIPE
+
+  This text is not printed by PyObjC and I haven't been able to find who
+  does print that text...
+
 * Fix bugs found using the unittests
 
+  runPyObjCTests finds some problems that disapear when those tests are run
+  seperately...
+
 * Port the AppKit wrappers
 
 * Extract more CFLAGS and LDFLAGS information from the GNUstep build system,

pyobjc/Lib/objc/_convenience.py

     ('__xor__', __xor__CFNumber),
     ('__nonzero__', __nonzero__CFNumber),
 )
+CONVENIENCE_METHODS['decimalNumberByAdding:'] = CONVENIENCE_METHODS['_cfNumberType']
 
 #CONVENIENCE_METHODS['boolValue'] = (
 #    ('__nonzero__', lambda (self): self.boolValue() != 0),

pyobjc/Modules/objc/objc-runtime-gnu.h

 static inline void 
 PyObjCRT_InitMethod(Method_t m, SEL name, const char* types, IMP imp)
 {
-	/* class_add_method_list on GNUstep assumes the method_name is
-	 * a string, not a SEL.
+	/* XXX: With some versions of the GNU runtime, the runtime assumes
+	 * that method_name is initialy a string instead of a selector, other
+	 * versions do not. The version on my development box currently 
+	 * doesn't.
+	 *
+	 * m->method_name = (SEL)PyObjCRT_SELName(name);
 	 */
-	m->method_name = (SEL)PyObjCRT_SELName(name);
+	m->method_name = name;
 	m->method_types = types;
 	m->method_imp = imp;
 }

pyobjc/Scripts/CodeGenerators/strconst_generator.py

 
     in_class = 0
     struct_level = 0
+    maybe_struct_level = 0
 
     for ln in fp.xreadlines():
+        if maybe_struct_level:
+            if ln.strip().startswith('{'):
+                struct_level += 1
+                continue
+        maybe_struct_level = 0
 
         # Skip declarations in objective-C class definitions
         if not in_class:
 
         if ln.strip().startswith('struct ') and ln.strip().endswith('{'):
             struct_level += 1
+        elif ln.strip().startswith('struct '):
+            maybe_struct_level = 1
 
         if struct_level:
             continue

pyobjc/Scripts/make_distrib.py

     print "Setting up Xcode templates"
     makeDir(basedir, 
             'Library', 'Application Support', 'Apple', 
-            'Developer Tools', 'Project Templates')
+            'Developer Tools', 'Project Templates', 'Application')
     templateDestination = os.path.join(basedir, 
             'Library', 'Application Support', 'Apple', 
-            'Developer Tools', 'Project Templates')
+            'Developer Tools', 'Project Templates', 'Application')
     templateDir = os.path.join('Xcode', 'Project Templates')
     for dname in os.listdir(templateDir):
         if dname == 'CVS': continue

pyobjc/Scripts/runalltests

         	print "-- Running '%s'"%path
         	fd = os.popen("'%s' '%s' 2>&1"%(sys.executable, path), 'r')
                 ln = ''
-                for ln in fd.xreadlines():
-                    sys.stdout.write(ln)
+                for _ln in fd.xreadlines():
+                    sys.stdout.write(_ln)
+
+                    # Odd GNUstep bug...
+                    if _ln.startswith('Unable to retrieve information about SIGPIPE'): continue
+
+                    ln = _ln
 
                 xit = fd.close()
                 if ln.startswith('OK'):
 
         	print "-- Done"
 
+#os.path.walk('Lib/objc', perform_some_tests, None)
+#os.path.walk('Lib/Foundation', perform_some_tests, None)
 os.path.walk('Lib', perform_some_tests, None)
 
 keys = tests.keys()
             fd = open('build/codegen/_%s_Classes.inc'%(fw,), 'w')
             fd.write('static const char* gClassNames[] = {\n')
             fd.write('\tNULL\n')
-            fd.write('};')
+            fd.write('};\n')
             fd.close()
 
     def create_cached_class_list(self):
                 if not isinstance(o, objc.objc_class): continue
                 fd.write('\t"%s",\n'%(o.__name__))
             fd.write('\tNULL\n')
-            fd.write('};')
+            fd.write('};\n')
             fd.close()
 
             d1 = open('build/codegen/_%s_Classes.inc~'%(pfx,), 'r').read()
             # Note: dependencies don't work here, we depend on a file that
             # probably didn't exist when the glob was done...
             print "** Created a fresh class-cache, rebuilding the extensions"
-            shutil.rmtree(
-                    os.path.join(self.build_temp, 'Modules', 'AppKit'))
-            os.mkdir(
-                    os.path.join(self.build_temp, 'Modules', 'AppKit'))
-            shutil.rmtree(
-                    os.path.join(self.build_temp, 'Modules', 'Foundation'))
-            os.mkdir(
-                    os.path.join(self.build_temp, 'Modules', 'Foundation'))
+            if os.path.exists(
+                        os.path.join(self.build_temp, 'Modules', 'AppKit')):
+                shutil.rmtree(
+                        os.path.join(self.build_temp, 'Modules', 'AppKit'))
+                os.mkdir(
+                        os.path.join(self.build_temp, 'Modules', 'AppKit'))
+
+            if os.path.exists(
+                        os.path.join(self.build_temp, 'Modules', 'Foundation')):
+                shutil.rmtree(
+                        os.path.join(self.build_temp, 'Modules', 'Foundation'))
+                os.mkdir(
+                        os.path.join(self.build_temp, 'Modules', 'Foundation'))
 
             try:
                 os.unlink(os.path.join(self.build_lib, '_AppKit.so'))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.