GNUStep Base PR - property list format configurable

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: another_commander, winston, Getafix

Post Reply
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 712
Joined: Sun Jun 20, 2010 6:00 pm

GNUStep Base PR - property list format configurable

Post by mcarans »

I asked the GNUStep devs if the property list format could be made configurable. This would remove the need to patch GNUStep Base.

They asked for a PR so I made one: https://github.com/gnustep/libs-base/pull/556. Took me a while since Objective-C syntax is new to me.

With that change, in Oolite we can override the format with a category like this:

Code: Select all

// GSPersistentDomain+Override.h
#import <GNUstepBase/GSPersistentDomain.h>

@interface GSPersistentDomain (Override)

- (NSPropertyListFormat)propertyListFormat;
@end


// GSPersistentDomain+Override.m
#import "GSPersistentDomain+Override.h"
#import <Foundation/NSPropertyList.h>

@implementation GSPersistentDomain (Override)

- (NSPropertyListFormat)propertyListFormat {
    return NSPropertyListOpenStepFormat;
}
@end
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 794
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: GNUStep Base PR - property list format configurable

Post by Lone_Wolf »

Is that the change in gnustep-base you mentioned in viewtopic.php?p=302973#p302973 ?

You might want to add some notes to the PR explaining why this change is needed and what issues it solves.


How will this affect oolite ?

for example : Will there be a hard dependency of oolite on a version of gnustep-base with that change ?
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 712
Joined: Sun Jun 20, 2010 6:00 pm

Re: GNUStep Base PR - property list format configurable

Post by mcarans »

Lone_Wolf wrote: Wed Nov 05, 2025 11:39 am
Is that the change in gnustep-base you mentioned in viewtopic.php?p=302973#p302973 ?

You might want to add some notes to the PR explaining why this change is needed and what issues it solves.


How will this affect oolite ?

for example : Will there be a hard dependency of oolite on a version of gnustep-base with that change ?
Oolite currently relies on a patched version of GNUStep Base and hence is tied to whatever version that patch works against (unless you can live with XML plist format). What the PR will change is that GNUStep Base won't need to be patched in future. Oolite will no longer be tied to a patched version, but the minimum version it will compile against will be the version where the PR is merged although the changes in Oolite could be switched on and off with an #ifdef if needed.

I had to make a new PR based on specific requirements from the GNUStep dev: https://github.com/gnustep/libs-base/pull/560
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 794
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: GNUStep Base PR - property list format configurable

Post by Lone_Wolf »

Since the change is about writing, this is probably related to the savefile being written in xml format ?

Personally I like xml as it has a clear structure that's very powerful.
Switching the savefile to openstep would be consistent with the format used in the plist files in resources/config and such.

One question :
xml is supported on many platforms, while openstep seems to be limited to platforms supported by Apple and/or Gnustep .

Is increasing the ties between oolite and GNUstep a good idea ?
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 7178
Joined: Wed Feb 28, 2007 7:54 am

Re: GNUStep Base PR - property list format configurable

Post by another_commander »

Save files should remain XML for compatibility and transferability between game versions.

This is more about the Defaults file format. Oolite historically had it set to OpenStep, but somewhere along the way the gnustep guys decided to switch default user defaults file format to XML. The Windows port stayed on OpenStep for defaults, since we were using a specifically-for-us gnustep-base compiled version anyway, while the Linux port got unintentionally switched to XML since that's what the default setting in the distros' gnustep-base versions now was.

OpenStep is generally preferred for Oolite because it's more user friendly. Except for save files, for the earlier mentioned reason.
User avatar
mcarans
---- E L I T E ----
---- E L I T E ----
Posts: 712
Joined: Sun Jun 20, 2010 6:00 pm

Re: GNUStep Base PR - property list format configurable

Post by mcarans »

another_commander wrote: Thu Nov 06, 2025 9:59 am
Save files should remain XML for compatibility and transferability between game versions.

This is more about the Defaults file format. Oolite historically had it set to OpenStep, but somewhere along the way the gnustep guys decided to switch default user defaults file format to XML. The Windows port stayed on OpenStep for defaults, since we were using a specifically-for-us gnustep-base compiled version anyway, while the Linux port got unintentionally switched to XML since that's what the default setting in the distros' gnustep-base versions now was.

OpenStep is generally preferred for Oolite because it's more user friendly. Except for save files, for the earlier mentioned reason.
The PR has been merged so we can make the format consistent between Windows and Linux (but not OSX if we get it working on there in future unless we implement the OpenStep format):
"I'll merge this as is, and then I hope you don't mind but I'm going to reduce the exposed information and wrap it with macros to show that it's not available on OSX."

BTW there is also a GNUStep format NSPropertyListGNUstepFormat which is an augmented OpenStep format that supports more types.
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 794
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: GNUStep Base PR - property list format configurable

Post by Lone_Wolf »

another_commander wrote: Thu Nov 06, 2025 9:59 am
OpenStep is generally preferred for Oolite because it's more user friendly.
One thing I'm missing for OpenStep is a viewer/editor. Do you know of one ?
OS : Arch Linux 64-bit - rolling release

From: The Netherlands, Europe

OXPs : My user page (needs updating)

Retired, occasionally active
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 7178
Joined: Wed Feb 28, 2007 7:54 am

Re: GNUStep Base PR - property list format configurable

Post by another_commander »

Lone_Wolf wrote: Tue Nov 11, 2025 9:19 pm
One thing I'm missing for OpenStep is a viewer/editor. Do you know of one ?
No, afraid not. But the format is so simple that I never considered using anything more complicated than Notepad++ to view the files.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2437
Joined: Mon May 31, 2010 11:11 pm

Re: GNUStep Base PR - property list format configurable

Post by Switeck »

another_commander wrote: Wed Nov 12, 2025 5:29 am
Lone_Wolf wrote: Tue Nov 11, 2025 9:19 pm
One thing I'm missing for OpenStep is a viewer/editor. Do you know of one ?
No, afraid not. But the format is so simple that I never considered using anything more complicated than Notepad++ to view the files.
And Notepad++ can help spot 'left open' brackets inside nested brackets.
(where the code may have 5 { but only 4 } ...)
Post Reply