Opened 6 years ago

Closed 6 years ago

#57540 closed defect (fixed)

libsdl2 @2.0.9: error: property 'CGColor' not found on object of type 'NSColor *'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: lion Cc: iEFdev, kencu (Ken), Schamschula (Marius Schamschula), rmottola (Riccardo), l2dy (Zero King)
Port: libsdl2

Description

libsdl2 used to build fine on 10.7, and on 10.6 when using the 10.7 sdk, but now it fails:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.9/src/video/cocoa/SDL_cocoawindow.m:1178:53: error: property 'CGColor' not found on object of type 'NSColor *'
    self.layer.backgroundColor = NSColor.blackColor.CGColor;
                                                    ^

Attachments (3)

patch-src-video-cocoa-SDL_cocoawindow-allow-10.7-SDK.diff (957 bytes) - added by kencu (Ken) 6 years ago.
patch-ltmain-compat-version.diff (892 bytes) - added by kencu (Ken) 6 years ago.
libsdl2-blackcolor.diff (695 bytes) - added by rmottola (Riccardo) 6 years ago.
allocate Black constant CGColor directly

Download all attachments as: .zip

Change History (30)

comment:1 Changed 6 years ago by iEFdev

Cc: iEFdev added

comment:2 Changed 6 years ago by kencu (Ken)

I sent this one on to Josh a while back.

Changed 6 years ago by kencu (Ken)

comment:3 Changed 6 years ago by kencu (Ken)

the new libsdl2 has a wonky compatibility version that causes every port I built against libsdl2 to fail to link. Here's a patch that fixes that for me.

comment:4 Changed 6 years ago by jmroot (Joshua Root)

Are there upstream bugs for these?

comment:5 Changed 6 years ago by kencu (Ken)

not yet. What do you think of them (especially the compatibility fix)?

comment:6 Changed 6 years ago by jmroot (Joshua Root)

Cc: kencu added

The 10.7 fix looks fine. I can't reproduce any link failure. We need to point out to upstream that compatibility_version is only supposed to go up and figure out how they want to handle the versioning going forward.

comment:8 Changed 6 years ago by Schamschula (Marius Schamschula)

Cc: Schamschula added

comment:9 Changed 6 years ago by Schamschula (Marius Schamschula)

I also ran into the library compatibility issue. I reactivated @2.0.8 until this is fixed.

comment:10 Changed 6 years ago by jmroot (Joshua Root)

Can you give specific examples of ports that have a problem with the compatibility version? I tried a couple and they worked OK.

comment:11 Changed 6 years ago by kencu (Ken)

there were half a dozen or so.

  • libsdl-net
  • widelands
  • hatari I think
  • another libsdl one , maybe image

and a couple more.. More than I wanted to just rebuild, although rebuilding them all would have fixed it I guess.

Last edited 6 years ago by kencu (Ken) (previous) (diff)

comment:12 Changed 6 years ago by Schamschula (Marius Schamschula)

In my case:

  • ffmpeg
  • libsdl2_image
  • logstalgia

comment:13 Changed 6 years ago by jmroot (Joshua Root)

And you're getting an error when you run an executable? Or from rev-upgrade?

comment:14 Changed 6 years ago by Schamschula (Marius Schamschula)

I get an error from the link check at the end of port upgrade outdated causing me to have to run rev-upgrade.

On my work machine I also got the error from qt5-qtgamepad.

comment:15 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: rmottola added

Has duplicate #57548.

comment:16 Changed 6 years ago by l2dy (Zero King)

Cc: l2dy added

Changed 6 years ago by rmottola (Riccardo)

Attachment: libsdl2-blackcolor.diff added

allocate Black constant CGColor directly

comment:17 Changed 6 years ago by rmottola (Riccardo)

Sorry for not finding this duplicate ticket earlier, I mistyped the search. I have a quite simple patch which solves CGColor property availabel only in 10.8. Allocating a Black color has a direct function!

comment:18 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

If you think that's a better fix than the one Ken attached above which Josh passed on to the developers, you should notify the developers.

comment:19 Changed 6 years ago by kencu (Ken)

Hey, if Riccardo's patch works, I like that better, for sure.

comment:20 Changed 6 years ago by rmottola (Riccardo)

Update: with just my "single" one line patch, the port appears to compile and install, I would prefer that to Kencu's.

My only test is running Gimp... and also there could be the other linker errors which I do not address.

I reported upstream on Joshua's patch.

comment:21 in reply to:  10 ; Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to jmroot:

Can you give specific examples of ports that have a problem with the compatibility version? I tried a couple and they worked OK.

All ports that link with libsdl2 should be affected. Selected rev-upgrade output from my system:

Incompatible library version: /opt/local/bin/melt requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/lib/mlt/libmltsdl2.dylib requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/lib/libSDL2_image-2.0.0.dylib requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/bin/plaympeg-smpeg2 requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/lib/libsmpeg2-2.0.0.dylib requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/lib/libSDL2_mixer-2.0.0.dylib requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/bin/gdash requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/bin/ffmpeg requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/bin/ffplay requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/bin/ffprobe requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0
Incompatible library version: /opt/local/lib/libavdevice.58.3.100.dylib requires version 9.0.0 or later, but /opt/local/lib/libSDL2-2.0.0.dylib provides version 1.0.0

comment:22 Changed 6 years ago by kencu (Ken)

how about we push riccardo's fix and set the compatibility version to 9.0.0? We can come back to it later someday after upstream sorts it out again.

I'll put together a PR. I hate to see so many ports needlessly revbumped.

comment:23 in reply to:  21 ; Changed 6 years ago by jmroot (Joshua Root)

Replying to ryandesign:

All ports that link with libsdl2 should be affected. Selected rev-upgrade output from my system:

Rev-upgrade detects this, yes. But do you have problems actually running anything? I don't, which is odd. It suggests that rev-upgrade's check may not match what is actually done by dyld, on Mojave at least.

comment:24 in reply to:  22 Changed 6 years ago by jmroot (Joshua Root)

Replying to kencu:

how about we push riccardo's fix and set the compatibility version to 9.0.0? We can come back to it later someday after upstream sorts it out again.

I'll put together a PR. I hate to see so many ports needlessly revbumped.

The problem is, if upstream declines to use the higher version number, I'm not going to fight that forever and the rev bumps won't have been needless.

comment:25 in reply to:  23 Changed 6 years ago by l2dy (Zero King)

Replying to jmroot:

Replying to ryandesign:

All ports that link with libsdl2 should be affected. Selected rev-upgrade output from my system:

Rev-upgrade detects this, yes. But do you have problems actually running anything? I don't, which is odd. It suggests that rev-upgrade's check may not match what is actually done by dyld, on Mojave at least.

I'm on High Sierra and ffmpeg @4.1_0+gpl2 did crash.

dyld: Library not loaded: /opt/local/lib/libSDL2-2.0.0.dylib
  Referenced from: /opt/local/bin/ffmpeg
  Reason: Incompatible library version: ffmpeg requires version 9.0.0 or later, but libSDL2-2.0.0.dylib provides version 1.0.0
Abort trap: 6

comment:26 Changed 6 years ago by jmroot (Joshua Root)

The upstream maintainers will be discussing what they want to do with the compatibility version tomorrow.

comment:27 Changed 6 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: assignedclosed

In 47b164c2bea775b75b40bb2470e492906fd8f315/macports-ports (master):

libsdl2: fix library version, build fix for 10.7

Fixes: #57540

Note: See TracTickets for help on using tickets.