diff --git a/pkgs/development/libraries/fltk/default.nix b/pkgs/development/libraries/fltk/default.nix index 99cb8aae3236..6f906d52502e 100644 --- a/pkgs/development/libraries/fltk/default.nix +++ b/pkgs/development/libraries/fltk/default.nix @@ -21,6 +21,8 @@ composableDerivation.composableDerivation {} { --replace 'class Fl_XFont_On_Demand' 'class FL_EXPORT Fl_XFont_On_Demand' ''; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = [ inputproto ] ++ (if stdenv.isDarwin diff --git a/pkgs/development/libraries/fltk/nsosv.patch b/pkgs/development/libraries/fltk/nsosv.patch new file mode 100644 index 000000000000..9e55b011b571 --- /dev/null +++ b/pkgs/development/libraries/fltk/nsosv.patch @@ -0,0 +1,20 @@ +diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm +index 6f5b8b1..2c7763d 100644 +--- a/src/Fl_cocoa.mm ++++ b/src/Fl_cocoa.mm +@@ -4074,15 +4074,6 @@ Window fl_xid(const Fl_Window* w) + static int calc_mac_os_version() { + int M, m, b = 0; + NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; +-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 +- if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) { +- NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; +- M = version.majorVersion; +- m = version.minorVersion; +- b = version.patchVersion; +- } +- else +-#endif + { + NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; + const char *s = [[sv objectForKey:@"ProductVersion"] UTF8String];