Opened 12 years ago

Closed 7 years ago

#37562 closed defect (fixed)

libsdl: Cocoa backend is using deprecated APIs

Reported by: alex@… Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: jeremyhu (Jeremy Huddleston Sequoia), doh123@…, mamoll (Mark Moll), dpreid@…, cooljeanius (Eric Gallager)
Port: libsdl

Description

I updated to libsdl 1.2.15_2 and found that my application that uses SDL no longer runs, SDL fails to initialize saying there is no video device available. I've just looked at the changelog for libsdl and found that it was changed to "disable deprecated cocoa video". I installed XQuartz and with that get an SDL error saying that the X11 driver was not configured with OpenGL (my application is using OpenGL with SDL). I can't find anything saying that the Cocoa backend is deprecated upstream, so what is the reason for it being considered deprecated in MacPorts? I don't want to have to use X11, the Cocoa backend was working fine before.

Change History (26)

comment:1 Changed 12 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to jmr@…

In the future, please Cc the port maintainer(s).

comment:2 Changed 12 years ago by larryv (Lawrence Velázquez)

Cc: jeremyhu@… added

Also CC jeremyhu, who removed the Cocoa support in r100912.

comment:3 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: invalid
Status: newclosed

It's using APIs that were deprecated in Lion. If you want that support, I suggest you work with upstream to find a solution for Mountain Lion which doesn't use those APIs.

Closing for upstream to fix.

comment:4 Changed 12 years ago by alex@…

Even so, it was working without any issues (as far as I could see) on Mountain Lion prior to the update, so why did you need to remove support for it?

Also, any suggestions to fix the lack of OpenGL support in the X11 backend?

comment:5 Changed 12 years ago by jmroot (Joshua Root)

Resolution: invalid
Status: closedreopened
Summary: Why has the Cocoa backend been removed from libsdl?libsdl: Cocoa backend is not enabled on platforms where it works

If it doesn't work on newer systems that's one thing, but I don't see why we can't enable it on OS versions where it works.

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

I don't see any deprecation warnings compiling on Lion (except for XKeycodeToKeysym). Which APIs are the problem? Do you know if there's an upstream bug report for this?

comment:7 Changed 12 years ago by cdeil (Christoph Deil)

I wanted to use gource via Macports on my Macbook Pro Retina with Mountain Lion 10.8.2 with XQuartz 2.7.4 (xorg-server 1.13.0), but get the error mentioned above:

$ port installed libsdl gource
The following ports are currently installed:
  gource @0.38_4 (active)
  libsdl @1.2.15_2+x11 (active)

$ gource
gource: SDL initialization failed - X11 driver not configured with OpenGL
Try 'gource --help' for more information.

Is there a way to make gource work on this machine?

comment:8 Changed 12 years ago by doh123@…

Cc: doh123@… added

I need this fixed as well... Gource used to work on 10.8, and now with this change it no longer does. Deprecated or not, I don't see why functionality is removed... there is a reason things become deprecated and stick around instead of just removing it all.

Last edited 12 years ago by doh123@… (previous) (diff)

comment:9 Changed 12 years ago by doh123@…

Temporary work around... use the old version.

sudo port install subversion

(if you don't have it already).

then...

svn co -r 89205 http://svn.macports.org/repository/macports/trunk/dports/devel/libsdl
cd libsdl
sudo port install

then you should have the old version back that works. I did the above to get Gource working for now.

Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:10 Changed 12 years ago by mamoll (Mark Moll)

Cc: mmoll@… added

Cc Me!

comment:11 Changed 12 years ago by ddennedy (Dan Dennedy)

libsdl has been working fine on Mountain Lion for me - that is until this recent update. Please don't hold users as virtual hostages to coerce upstream to deal with deprecated APIs. I am speaking both as a port maintainer (mlt, frei0r, kdenlive) and upstream developer.

comment:12 Changed 12 years ago by igeek1@…

The temporary workaround works perfectly for me, but it gets blown away every time I run a routine MacPorts update check. My solution:

function fixgource
{
    local dir=`pwd`
    cd
    svn co -r 89205 http://svn.macports.org/repository/macports/trunk/dports/devel/libsdl
    cd libsdl
    sudo port install
    cd ..
    rm -rf libsdl
    cd $dir
}

comment:13 in reply to:  12 Changed 12 years ago by neverpanic (Clemens Lang)

Replying to igeek1@…:

The temporary workaround works perfectly for me, but it gets blown away every time I run a routine MacPorts update check.

That's expected behavior. Use a local repository as described in https://guide.macports.org/#development.local-repositories to prevent this.

comment:14 in reply to:  description Changed 12 years ago by dpreid@…

This changeset (that from revision 0 to revision 1) also affects me - one of my games will not load at all now (displays SDL error saying that the X11 driver was not configured with OpenGL) and another game now exhibits a transparency problem, where the alpha colour displays instead of being transparent.

I would like to see this issue resolved. Depreciation does not meen broken - this changeset was unnecessary, and should not be implemented UNTIL there is an upstream replacement.

comment:15 Changed 12 years ago by dpreid@…

Cc: dpreid@… added

Cc Me!

comment:16 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed
Summary: libsdl: Cocoa backend is not enabled on platforms where it workslibsdl: Cocoa backend is disabled on 10.8, but it works

I'd like to get answers to the questions I asked in comment:6, so I can investigate the possibility of a better fix. But, since that information has not been forthcoming, the change for 10.8 is reverted in r102413.

comment:17 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

Reopening ... I haven't had time to point you in the right direction, but now this is broken again, so reopening...

comment:18 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from jmr@… to jeremyhu@…
Status: reopenednew

comment:19 Changed 12 years ago by alex@…

I've built it today, saw no deprecation warnings when compiling the Cocoa video backend (there were warnings from the X11 backend and some other code, but not the Cocoa backend). It works fine.

comment:20 Changed 12 years ago by jmroot (Joshua Root)

Cc: jmr@… added; jeremyhu@… removed

comment:21 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Summary: libsdl: Cocoa backend is disabled on 10.8, but it workslibsdl: Cocoa backend is using deprecated APIs

But now it's building fine. I must've had something messed up with my SDK earlier, sorry...

In any event, we should probably transition away from the deprecated OS X APIs:

~/src/macports/dports/devel/libsdl $ grep deprec /opt/local/var/macports/logs/_Volumes_Home_jeremy_src_macports_trunk_dports_devel_libsdl/libsdl/main.log 
:info:build ./src/video/x11/SDL_x11events.c:1124:9: warning: 'XKeycodeToKeysym' is deprecated [-Wdeprecated-declarations]
:info:build ./src/video/x11/SDL_x11events.c:1216:16: warning: 'XKeycodeToKeysym' is deprecated [-Wdeprecated-declarations]
:info:build ./src/audio/macosx/SDL_coreaudio.c:196:14: warning: 'CloseComponent' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/audio/macosx/SDL_coreaudio.c:244:12: warning: 'FindNextComponent' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/audio/macosx/SDL_coreaudio.c:251:14: warning: 'OpenAComponent' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:317:35: warning: 'NewPtrClear' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:325:35: warning: 'NewPtrClear' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:336:32: warning: 'NewPtrClear' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:491:37: warning: 'NewPtrClear' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:508:5: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:515:4: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:531:3: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:558:3: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/joystick/darwin/SDL_sysjoystick.c:658:4: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:76:14: warning: 'GetComponentInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:157:13: warning: 'FSCloseFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:248:14: warning: 'FSGetDataForkName' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:251:14: warning: 'FSOpenFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:255:14: warning: 'FSReadFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:275:18: warning: 'FSReadFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:287:14: warning: 'FSReadFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFilePlayer.c:292:14: warning: 'FSSetForkPosition' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFileReaderThread.c:420:12: warning: 'FSReadFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/AudioFileReaderThread.c:606:5: warning: 'FSGetForkPosition' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:105:18: warning: 'FSGetVolumeInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:149:14: warning: 'FSGetVolumeInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:164:14: warning: 'PBMakeFSRefUnicodeSync' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:172:14: warning: 'FSGetDataForkName' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:178:14: warning: 'FSOpenFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:184:14: warning: 'FSGetForkSize' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:191:16: warning: 'NewPtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:197:14: warning: 'FSReadFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:316:9: warning: 'DisposePtr' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:318:5: warning: 'FSCloseFork' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:332:14: warning: 'FSGetVolumeInfo' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:345:14: warning: 'FSOpenIterator' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:349:22: warning: 'FSGetCatalogInfoBulk' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:386:9: warning: 'FSCloseIterator' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:568:26: warning: 'FindNextComponent' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/CDPlayer.c:574:18: warning: 'OpenAComponent' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]
:info:build ./src/cdrom/macosx/SDL_syscdrom.c:487:8: warning: 'FSEjectVolumeSync' is deprecated: first deprecated in OS X 10.8 [-Wdeprecated-declarations]

comment:22 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Cc: jeremyhu@… added; jmr@… removed
Owner: changed from jeremyhu@… to jmr@…

comment:23 Changed 12 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:24 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Last edited 12 years ago by jeremyhu (Jeremy Huddleston Sequoia) (previous) (diff)

comment:25 Changed 12 years ago by ddennedy (Dan Dennedy)

I can confirm that an upgrade to libsdl with +no_x11 is working for me again with ffplay and melt. I am not sure what the status of the ticket is intended to be, but thank you for your attention to the matter.

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

Resolution: fixed
Status: newclosed

The long-term fix here is to move to libsdl2.

Note: See TracTickets for help on using tickets.