Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SnakeCoils

macrumors regular
Oct 17, 2018
133
60
Italy
An updated SDL2 library for PPC would be a godsend, many open source project now relies on 2.0.5+ versions (like the FS-UAE and MAME emulators for example) so a more recent release would be a nice boost for new PowerMac portings :)
 
  • Like
Reactions: eastone

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
An updated SDL2 library for PPC would be a godsend, many open source project now relies on 2.0.5+ versions (like the FS-UAE and MAME emulators for example) so a more recent release would be a nice boost for new PowerMac portings :)

Given that 2.0.22 builds for 10.6.8 x86, chances are high I can fix it for 10.6 PPC. Tricky part is that MacPorts uses 10.7 SDK to build it on 10.6.8.

I am not sure though that all functionality can be supported (both due to SDK and due to ICE with GCC).
It is more likely X11 backend gonna work better than Cocoa (if the latter can work at all).

Do you know which configure options are needed for software you are interested in?
 

doctor_dog

macrumors member
Dec 19, 2022
94
103
An updated SDL2 library for PPC would be a godsend, many open source project now relies on 2.0.5+ versions (like the FS-UAE and MAME emulators for example) so a more recent release would be a nice boost for new PowerMac portings :)
You mentioned 2.0.5+, so I thought it worth repeating for anyone who stumbles across this: I haven't tried the 2.0.8 patch Barracuda suggested yet, but 2.0.6 builds via Macports if you just need something higher than .5.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
You mentioned 2.0.5+, so I thought it worth repeating for anyone who stumbles across this: I haven't tried the 2.0.8 patch Barracuda suggested yet, but 2.0.6 builds via Macports if you just need something higher than .5.

Hmm, I thought it does not have 2.0.6 at all, and Ken’s patches for it were never merged.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
Ok, I have built 2.0.22 (disabling for now some optional stuff, will try enabling back). It was not difficult at all, just very annoying to port the patch which essentially fixes countless instances of the same wrong code.

UPD. Okay, enabling cocoa video is not particularly trivial. Another module under question is joystick.
Everything else at least builds. For hidapi I found a fix – basically, reverting a commit which triggers ICE.
 
Last edited:
  • Like
Reactions: doctor_dog

doctor_dog

macrumors member
Dec 19, 2022
94
103
Hmm, I thought it does not have 2.0.6 at all, and Ken’s patches for it were never merged.
Doh! I was afraid you might say something like this, as I couldn't remember if I had to do Portfile "surgery" to get this to work or not. Sounds like the answer was "yes". I did just confirm I have 2.0.6 installed on my machine via Macports, though, happy to share the Portfile if that is helpful.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
Doh! I was afraid you might say something like this, as I couldn't remember if I had to do Portfile "surgery" to get this to work or not. Sounds like the answer was "yes". I did just confirm I have 2.0.6 installed on my machine via Macports, though, happy to share the Portfile if that is helpful.

I had a portfile for 2.0.9, perhaps even shared on Trac in a thread, but skip that anyway, I will probably make a PR for 2.0.22 in a day or two.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
A quick update. Upon some thought and discussion in macports-devel list, my current idea is the following:

1. Drop an idea to fix Cocoa on anything beyond 2.0.8 or perhaps 2.0.6. While it is likely possible to build, it is unlikely to work correctly and also such Frankenstein patches will be hard to sell to Macports (and fairly so, in this case). Specifically, SDL_cocoamodes.m is the breaker. Its code will not compile with reasonable patches, and at best we will need to fall back to a much earlier version.

2. Instead, find out which is the latest version to build with X11 backend and minimal patches, enable it in Macports for PPC (X11 is already used for non-Darwin OSs).

3. Optionally, make a -legacy port with Cocoa backend specifically for ppc with whatever version confirmed to build and work.

By the way, anyone here got real-life test cases for SDL2? I am specifically interested whether X11 backend solves your needs. If yes, that makes life much easier, and perhaps we can have a more recent version than 2.0.22, if not the current one.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
Okay, here we go: https://github.com/macports/macports-ports/pull/19531

SDL 2.28.1 for PowerPC

Disclaimer: 1. Cocoa video and joystick are disabled (the first being broken by upstream beyond repair, the second due to unfixed GCC bug, causing ICE). 2. I have only tested the build so far, on 10.6 ppc. Presumably it should work, however, provided X11 code is sane – since no patches for it were applied.
 
  • Like
Reactions: doctor_dog

doctor_dog

macrumors member
Dec 19, 2022
94
103
Okay, here we go: https://github.com/macports/macports-ports/pull/19531

SDL 2.28.1 for PowerPC

Disclaimer: 1. Cocoa video and joystick are disabled (the first being broken by upstream beyond repair, the second due to unfixed GCC bug, causing ICE). 2. I have only tested the build so far, on 10.6 ppc. Presumably it should work, however, provided X11 code is sane – since no patches for it were applied.
You are awesome, thank you! I don't have a project off-hand to test with (I've been eyeing VCMI but I think it requires QT5 and I don't know if it supports X or not). I'll take a look.

Random follow-up: Since you got this to build, would it make sense to go back to packages like gegl/babl and revert backn to using SDL2 instead of SDL1? Or do you think the disabled Cocoa would cause problems?
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
You are awesome, thank you! I don't have a project off-hand to test with (I've been eyeing VCMI but I think it requires QT5 and I don't know if it supports X or not). I'll take a look.

Random follow-up: Since you got this to build, would it make sense to go back to packages like gegl/babl and revert backn to using SDL2 instead of SDL1? Or do you think the disabled Cocoa would cause problems?

I guess someone who actively uses a given software can determine relative benefits. In any case, in order to have it merged to Macports, we need to determine whether it is practically useful, i.e. gives some advantage over what we have with SDL1. Then we can think of whether to change some existing defaults (which is not necessary, perhaps, as long as a variant is available).
GCC should also be unbanned for SDL2_* ports. They all build fine now.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
As a quick update: apparently many games and emulators require joystick module to be enabled, so we got an issue here. I will see what can be done.

As is, SDL2 may still be useful for software which does not require joystick.
 
  • Like
Reactions: eastone

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
UPD2. Do not build from that PR yet, turned out upstream hardcoded wrong paths to libGL, which leads to a defunct binary (paths are not checked, not set by config and lead to nowhere; well, what can I say…).

I will rebase it soon to make it usable. Provisionally I have fixed the problem now.
 

SnakeCoils

macrumors regular
Oct 17, 2018
133
60
Italy
Awesome! :) I checked the needed versions for FS-UAE and SDLmame, they must be at least 2.22 for the Amiga emulator and 2.0.6 for the arcade emulator (intel version, 2.0.14 for Arm) but for MAME compile the OSX 10.14 seems to be mandatory (official mamedev documentation). The big issue with SDLmame are the backends but most of the emulated hardware related sources compiles just fine on PPC. FS-UAE on the other side was tolerant enough to allow a compile (with some little patches here and there) on OSX 10.5.8 with SDL 2.0.5 until version 3.0.5 but the main hurdle was the SDL2 library. The FS-UAE developer is a nice guy very friendly to PPC OSX users, if an updated SDL2 library (with cocoa and joystick support) will be released maybe the PowerMac support could be resumed, at least for the Amiga emulator: the SDLmame guys instead decided some time ago to drop an active support for the MacOS PPC architecture, the most recent version able to run on our beloved machines is the 0.168 from 2015 :-(
 
  • Like
Reactions: eastone

barracuda156

macrumors 68000
Sep 3, 2021
1,752
1,282
Hi all,

Does anyone own this sacred graal?
My current dream would be to run Mednafen on Mac Os X 10.5 but I cannot find any compiled version for it :(

Seems like the biggest show stopper is having SDL 2.0.5+.

Thanks :)

I have added to Macports SDL2 2.30.1 for PowerPC.


Few notes:
– Joystick support disabled at the moment, which in turn means that most games won’t run with it yet. However, it appears otherwise functional (as usual, no guarantees, LOL).
– Tiger is expectedly worse, but builds from https://github.com/macports/macports-ports/pull/23134
 

doctor_dog

macrumors member
Dec 19, 2022
94
103
Last year I shelved a pet project to get VCMI to build on PowerPC and play some epic Heroes of Might and Magic 3. It needed a more modern SDL2 IIRC however; I don't have a lot of free time at the moment, but very interested to try this with building VCMI. You the man, thanks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.