fltk: fix on darwin

Compiling Fl_cocoa.mm...
Fl_cocoa.mm:4079:30: error: use of undeclared identifier 'version'; did
you mean 'Fl::version'?
NSOperatingSystemVersion version = [[NSProcessInfo processInfo]
operatingSystemVersion];
^~~~~~~
Fl::version
../FL/Fl.H:262:17: note: 'Fl::version' declared here
static double version();
^
Fl_cocoa.mm:4079:5: error: use of undeclared identifier
'NSOperatingSystemVersion'
NSOperatingSystemVersion version = [[NSProcessInfo processInfo]
operatingSystemVersion];
^
Fl_cocoa.mm:4080:9: error: use of undeclared identifier 'version'
M = version.majorVersion;
^
Fl_cocoa.mm:4081:9: error: use of undeclared identifier 'version'
m = version.minorVersion;
^
Fl_cocoa.mm:4082:9: error: use of undeclared identifier 'version'
b = version.patchVersion;
^
5 errors generated.

+22
+2
pkgs/development/libraries/fltk/default.nix
··· 21 21 --replace 'class Fl_XFont_On_Demand' 'class FL_EXPORT Fl_XFont_On_Demand' 22 22 ''; 23 23 24 + patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ]; 25 + 24 26 nativeBuildInputs = [ pkgconfig ]; 25 27 propagatedBuildInputs = [ inputproto ] 26 28 ++ (if stdenv.isDarwin
+20
pkgs/development/libraries/fltk/nsosv.patch
··· 1 + diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm 2 + index 6f5b8b1..2c7763d 100644 3 + --- a/src/Fl_cocoa.mm 4 + +++ b/src/Fl_cocoa.mm 5 + @@ -4074,15 +4074,6 @@ Window fl_xid(const Fl_Window* w) 6 + static int calc_mac_os_version() { 7 + int M, m, b = 0; 8 + NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; 9 + -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 10 + - if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) { 11 + - NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; 12 + - M = version.majorVersion; 13 + - m = version.minorVersion; 14 + - b = version.patchVersion; 15 + - } 16 + - else 17 + -#endif 18 + { 19 + NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; 20 + const char *s = [[sv objectForKey:@"ProductVersion"] UTF8String];