NSBundle and Frameworks

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NSBundle and Frameworks

David Wetzel
Hi!

I don't know if I shot my GNUstep installation by updating some FreeBSD ports, but I had to add this to make GSWeb find MIME.plist

My frameworks are in

/usr/local/GNUstep/Local/Library/Frameworks/

The lib in

/usr/local/lib/libWebObjects.so.1

This was just a fast hack. I feel like we should have a nicer refactored version of

+ _addFrameworkFromClass:

Is anybody seeing this too?

Cheers,

David


*** /home/dave/libs-base/Source/NSBundle.m Sat Dec  2 23:34:52 2017
--- NSBundle.m Sat Dec  2 23:39:46 2017
***************
*** 28,34 ****
 
 
     <title>NSBundle class reference</title>
!    $Date$ $Revision$
  */
 
  #define EXPOSE_NSBundle_IVARS 1
--- 28,34 ----
 
 
     <title>NSBundle class reference</title>
!    $Date: 2016-06-27 20:06:12 +0100 (Mon, 27 Jun 2016) $ $Revision: 39933 $
  */
 
  #define EXPOSE_NSBundle_IVARS 1
***************
*** 804,809 ****
--- 804,818 ----
   bundlePath = [bundlePath stringByDeletingLastPathComponent];
 
   pathComponent = [bundlePath lastPathComponent];
+  if ([pathComponent isEqual: @"Library"])
+           {
+             bundlePath = [bundlePath stringByAppendingPathComponent: @"Frameworks"];
+             bundlePath = [bundlePath stringByAppendingPathComponent:
+                 [NSString stringWithFormat: @"%@%@", name, @".framework"]];
+           /* Try creating the bundle.  */
+                   if (bundlePath)
+                     bundle = [[self alloc] initWithPath: bundlePath];
+    }
            if ([pathComponent isEqual: @"Versions"])
     {
       bundlePath = [bundlePath stringByDeletingLastPathComponent];


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: NSBundle and Frameworks

Ivan Vučica-2
It feels wrong that you would need this. In which bundle is GSMime.plist located? Is it in the WebObjects.framework?

What's the value of bundlePath on line 804?

Your change, if it's doing the right thing, seems to be in a totally wrong place. That chunk of code deals with Versions, according to the comment on lines 801-803; so with your change, that comment would be quite misleading.

I think I might finally get around to play with GNUstep tomorrow a bit on Debian. Can you provide closer repro steps? Is it enough to build gsweb's 'hello' example to reproduce this?


I'd also suggest pulling the latest code from Git... you seem to have an expanded $Date$ and $Revision$ macro, which I don't think Git cares about or would expand.

On Sun, Dec 3, 2017 at 4:47 AM David Wetzel <[hidden email]> wrote:
Hi!

I don't know if I shot my GNUstep installation by updating some FreeBSD ports, but I had to add this to make GSWeb find MIME.plist

My frameworks are in

/usr/local/GNUstep/Local/Library/Frameworks/

The lib in

/usr/local/lib/libWebObjects.so.1

This was just a fast hack. I feel like we should have a nicer refactored version of

+ _addFrameworkFromClass:

Is anybody seeing this too?

Cheers,

David


*** /home/dave/libs-base/Source/NSBundle.m      Sat Dec  2 23:34:52 2017
--- NSBundle.m  Sat Dec  2 23:39:46 2017
***************
*** 28,34 ****


     <title>NSBundle class reference</title>
!    $Date$ $Revision$
  */

  #define       EXPOSE_NSBundle_IVARS   1
--- 28,34 ----


     <title>NSBundle class reference</title>
!    $Date: 2016-06-27 20:06:12 +0100 (Mon, 27 Jun 2016) $ $Revision: 39933 $
  */

  #define       EXPOSE_NSBundle_IVARS   1
***************
*** 804,809 ****
--- 804,818 ----
          bundlePath = [bundlePath stringByDeletingLastPathComponent];

          pathComponent = [bundlePath lastPathComponent];
+         if ([pathComponent isEqual: @"Library"])
+           {
+             bundlePath = [bundlePath stringByAppendingPathComponent: @"Frameworks"];
+             bundlePath = [bundlePath stringByAppendingPathComponent:
+                 [NSString stringWithFormat: @"%@%@", name, @".framework"]];
+           /* Try creating the bundle.  */
+                   if (bundlePath)
+                     bundle = [[self alloc] initWithPath: bundlePath];
+    }
            if ([pathComponent isEqual: @"Versions"])
            {
              bundlePath = [bundlePath stringByDeletingLastPathComponent];


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev
Reply | Threaded
Open this post in threaded view
|

Re: NSBundle and Frameworks

David Wetzel
Hi!

> Am 04.12.2017 um 18:05 schrieb Ivan Vučica <[hidden email]>:
>
> It feels wrong that you would need this. In which bundle is GSMime.plist located? Is it in the WebObjects.framework?

Yes.


> What's the value of bundlePath on line 804?


The framework is in /usr/local/GNUstep/Local/Library/Frameworks/WebObjects.framework

> Your change, if it's doing the right thing, seems to be in a totally wrong place. That chunk of code deals with Versions, according to the comment on lines 801-803; so with your change, that comment would be quite misleading.

I think that whole code needs some love. There are many different platforms and possible locations of frameworks.

> I think I might finally get around to play with GNUstep tomorrow a bit on Debian. Can you provide closer repro steps? Is it enough to build gsweb's 'hello' example to reproduce this?

It is loaded in GSWResourceManager so that should be enough.

> I'd also suggest pulling the latest code from Git... you seem to have an expanded $Date$ and $Revision$ macro, which I don't think Git cares about or would expand.

I used the -base from FreeBSD ports since that installs all the dependencies. I bet that is what most people do.
I did not spot any bundle related changes since the release that FreeBSD uses and the git version.
I used GSWeb from gib (obviously)

This bundle thing came up since I upgraded my ports.


David


_______________________________________________
Gnustep-dev mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/gnustep-dev