tags 581934 + patch
thanks

On Mon, Aug 09, 2010 at 08:38:05AM +0200, Federico Giménez Nieto wrote:
> Yes, when all the required packages will be ready i'll try, probably
> with a little help from your side :), to fix any remaining issues.

I'm always glad to help (if I can), but keep in mind that this package
is the most mysterious one, to me at least.

> Then, should we suggest upstream to introduce the distro-specific
> soname or should we try to modify it by ourselves?

I'm afraid I don't understand the question.  If upstream bumps the
SONAME, it isn't distro-specific in anyway, right?  AFAICT, (in Debian
at least; I'm not aware of other practices) a distro-specific SONAME
for a library is introduced when

    1) An ABI breaking Debian-specific patch has been added; which
       - might be rejected by upstream (for whatever reason);
       - might be a bugfix already present upstream, but
         ABI-incompatible with the version in Debian (as is the case).
    2) A new upstream release is ABI incompatible, but upstream forgot
       to indicate that with the proper mechanism (this happens quite
       often for ObjC libraries, unfortunately).
    3) Upstream is providing a library, but it doesn't have any
       interface versioning mechanism (as some of the Mozilla
       libraries).
    4) Something else I surely forget.

In all cases, a decent distro should attempt to track incompatible
library changes and act accordingly.  This is both for the overall
distro health (dependent packages using the library must not fail
miserably at runtime) and for user/developer friendliness (some people
use Debian as a development platform, so any programs using the
a library the distro provides should continue to run flawlessly, or
otherwise be forced to be rebuilt/relinked against the new version --
this is actually the use case of gnustep-dl2).

So, you should make sure that upstream bumps the SONAME for next
release (0.13?), because there are ABI breaks all over the place
(affecting all public libraries).  For the current transition, the
attached minimized patch seems to work for me, but don't forget to:

  - Perform extensive runtime tests; most changes are not trivial.
  - Rename the runtime library to libgnustep-dl-0d (debian/control);
    and update dependencies (this implies passing through NEW).
  - Amend debian/rules to cater for the package rename.
  - Rename debian/libgnustep-dl-0.install as
    debian/libgnustep-dl-0d.install and adjust the EOControl entry for
    soname change.

In theory, it _might_ be possible to rework Richard's approach,
avoiding the ABI break.  If I only understood 10% of gnustep-dl2's
code...
2010-08-11  Yavor Doganov  <ya...@gnu.org>

	* EOControl/GNUmakefile (EOControl_INTERFACE_VERSION): Define
          as Debian-specific due to the ABI break.

2010-04-09  Fred Kiefer  <fredkie...@gmx.de>

        * EOInterface/EOPopUpAssociation.m:
	* DBModeler/ModelerEntityEditor.m:
	* DBModeler/ModelerTableEmbedibleEditor.m: Add missing includes.

2010-04-07  David Ayers  <ay...@fsfe.org>

        * EOInterface/EOPopUpAssociation.m: Add missing include.
        Reported by: German Arias.

2010-03-15  Richard Frith-Macdonald  <r...@gnu.org>

	* EOControl/EONSAddOns.h:
	* EOControl/EONSAddOns.m:
	* EOControl/EOKeyValueCoding.m:
	* EOControl/EOClassDescription.m:
	Rewrite mechanism to try to ensure that our implementations are used
	for KVC.  New version should work with the objc runtime API.

--- gnustep-dl2-0.12.0.orig/EOControl/EOClassDescription.m
+++ gnustep-dl2-0.12.0/EOControl/EOClassDescription.m
@@ -739,17 +739,13 @@
 
 @end
 
-
-...@implementation NSObject (EOClassDescriptionPrimitives)
-
-- (void)GDL2CDNSObjectICategoryID
-{
-}
+...@interface GDL2CDNSObject : NSObject
+...@end
+...@implementation GDL2CDNSObject
 
 + (void)load
 {
-  GDL2_ActivateCategory("NSObject",
-                        @selector(GDL2CDNSObjectICategoryID), YES);
+  GDL2_Activate([self class], YES);
 }
 
 // when you enable the NSDebugMLLogs here you will have a loop. dave
--- gnustep-dl2-0.12.0.orig/EOControl/EOKeyValueCoding.m
+++ gnustep-dl2-0.12.0/EOControl/EOKeyValueCoding.m
@@ -92,16 +92,13 @@
 #define INITIALIZE if (!initialized) initialize();
 
 
-...@implementation NSObject (_EOKeyValueCodingCompatibility)
-
-- (void)GDL2KVCNSObjectICategoryID
-{
-}
+...@interface	GDL2KVCNSObject : NSObject
+...@end
+...@implementation GDL2KVCNSObject
 
 + (void)load
 {
-  GDL2_ActivateCategory("NSObject",
-			@selector(GDL2KVCNSObjectICategoryID), YES);
+  GDL2_Activate([self class], YES);
 }
 
 
@@ -235,16 +232,13 @@
 @end
 
 
-...@implementation NSArray (EOKeyValueCoding)
-
-- (void)GDL2KVCNSArrayICategoryID
-{
-}
+...@interface	GDL2KVCNSArray : NSArray
+...@end
+...@implementation	GDL2KVCNSArray
 
 + (void)load
 {
-  GDL2_ActivateCategory("NSArray",
-			@selector(GDL2KVCNSArrayICategoryID), YES);
+  GDL2_Activate([self class], YES);
 }
 
 /**
@@ -543,16 +537,14 @@
 @end
 
 
-...@implementation NSDictionary (EOKeyValueCoding)
+...@interface	GDL2KVCNSDictionary : NSDictionary
+...@end
+...@implementation	GDL2KVCNSDictionary
 
-- (void)GDL2KVCNSDictionaryICategoryID
-{
-}
 
 + (void)load
 {
-  GDL2_ActivateCategory("NSDictionary",
-			@selector(GDL2KVCNSDictionaryICategoryID), YES);
+  GDL2_Activate([self class], YES);
 }
 
 /**
@@ -851,16 +843,13 @@
           isSmart: (BOOL)smartFlag;
 @end
 
-...@implementation NSMutableDictionary (EOKVCGNUstepExtensions)
-
-- (void)GDL2KVCNSMutableDictionaryICategoryID
-{
-}
+...@interface	GDL2KVCNSMutableDictionary : NSMutableDictionary
+...@end
+...@implementation GDL2KVCNSMutableDictionary
 
 + (void)load
 {
-  GDL2_ActivateCategory("NSMutableDictionary",
-			@selector(GDL2KVCNSMutableDictionaryICategoryID), YES);
+  GDL2_Activate([self class], YES);
 }
 
 /**
--- gnustep-dl2-0.12.0.orig/EOControl/EONSAddOns.h
+++ gnustep-dl2-0.12.0/EOControl/EONSAddOns.h
@@ -51,7 +51,7 @@
 GSUseStrictWO451Compatibility(NSString *key);
 
 GDL2CONTROL_EXPORT void
-GDL2_ActivateCategory(const char *className, SEL sel, BOOL isInstance);
+GDL2_Activate(Class cls, BOOL isInstance);
 
 GDL2CONTROL_EXPORT void
 GDL2_ActivateAllGDL2Categories(void);
--- gnustep-dl2-0.12.0.orig/EOControl/EONSAddOns.m
+++ gnustep-dl2-0.12.0/EOControl/EONSAddOns.m
@@ -64,6 +64,11 @@
 
 #include "EOPrivate.h"
 
+...@class GDL2KVCNSObject;
+...@class GDL2KVCNSArray;
+...@class GDL2KVCNSDictionary;
+...@class GDL2KVCNSMutableDictionary;
+...@class GDL2CDNSObject;
 
 static NSRecursiveLock *local_lock = nil;
 static BOOL GSStrictWO451Flag = NO;
@@ -98,6 +103,7 @@
 void
 GDL2_DumpMethodList(Class cls, SEL sel, BOOL isInstance)
 {
+/*
   void *iterator = 0;
   GSMethodList mList;
   
@@ -113,39 +119,30 @@
 	      mList, meth, imp);
     }
   fprintf(stderr,"List finished\n"); fflush(stderr);
+*/
 }
 
 void
-GDL2_ActivateCategory(const char *className, SEL sel, BOOL isInstance)
+GDL2_Activate(Class cls, BOOL isInstance)
 {
-  Class cls;
-  GSMethodList mList;
-
-  cls = GSClassFromName(className);
-  mList = GSMethodListForSelector(cls, sel, 0, isInstance);
-
-  GSRemoveMethodList(cls, mList, isInstance);
-  GSAddMethodList(cls, mList, isInstance);
-
-  GSFlushMethodCacheForClass(cls);
+  if (NO == isInstance)
+    {
+      cls = object_getClass(cls);
+    }
+  GSObjCAddClassOverride([cls superclass], cls);
 }
 
 void
 GDL2_ActivateAllGDL2Categories(void)
 {
   /* EOKeyValueCoding */
-  GDL2_ActivateCategory("NSObject",
-                        @selector(GDL2KVCNSObjectICategoryID), YES);
-  GDL2_ActivateCategory("NSArray",
-			@selector(GDL2KVCNSArrayICategoryID), YES);
-  GDL2_ActivateCategory("NSDictionary",
-                        @selector(GDL2KVCNSDictionaryICategoryID), YES);
-  GDL2_ActivateCategory("NSMutableDictionary",
-                        @selector(GDL2KVCNSMutableDictionaryICategoryID), YES);
+  GDL2_Activate([GDL2KVCNSObject class], YES);
+  GDL2_Activate([GDL2KVCNSArray class], YES);
+  GDL2_Activate([GDL2KVCNSDictionary class], YES);
+  GDL2_Activate([GDL2KVCNSMutableDictionary class], YES);
 
   /* EOClassDescription */
-  GDL2_ActivateCategory("NSObject",
-                        @selector(GDL2CDNSObjectICategoryID), YES);
+  GDL2_Activate([GDL2CDNSObject class], YES);
 
 }
 
--- gnustep-dl2-0.12.0.orig/EOControl/GNUmakefile
+++ gnustep-dl2-0.12.0/EOControl/GNUmakefile
@@ -29,6 +29,7 @@
 
 # The library to be compiled
 NATIVE_LIBRARY_NAME=EOControl
+EOControl_INTERFACE_VERSION=0d
 
 EOControl_NEEDS_GUI = no
 
--- gnustep-dl2-0.12.0.orig/EOInterface/EOPopUpAssociation.m
+++ gnustep-dl2-0.12.0/EOInterface/EOPopUpAssociation.m
@@ -24,8 +24,10 @@
 */
 
 #ifdef GNUSTEP
-#include <Foundation/NSString.h>
 #include <Foundation/NSArray.h>
+#include <Foundation/NSString.h>
+#include <Foundation/NSException.h>
+#include <Foundation/NSValue.h>
 
 #include <AppKit/NSPopUpButton.h>
 #else
--- gnustep-dl2-0.12.0.orig/DBModeler/ModelerEntityEditor.m
+++ gnustep-dl2-0.12.0/DBModeler/ModelerEntityEditor.m
@@ -40,6 +40,7 @@
 #ifdef NeXT_GUI_LIBRARY
 #include <AppKit/AppKit.h>
 #else
+#include <Foundation/NSRunLoop.h>
 #include <AppKit/NSImage.h>
 #include <AppKit/NSSplitView.h>
 #include <AppKit/NSScrollView.h>
--- gnustep-dl2-0.12.0.orig/DBModeler/ModelerTableEmbedibleEditor.m
+++ gnustep-dl2-0.12.0/DBModeler/ModelerTableEmbedibleEditor.m
@@ -29,6 +29,8 @@
 #ifdef NeXT_GUI_LIBRARY
 #include <AppKit/AppKit.h>
 #else
+#include <Foundation/NSNotification.h>                                        
+#include <Foundation/NSUserDefaults.h>
 #include <AppKit/NSMenuItem.h>
 #include <AppKit/NSPopUpButton.h>
 #include <AppKit/NSTableColumn.h>

Reply via email to