Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Perhaps add code to allow override by an environment variable?
Well dang. Ok, sometimes I miss the nose right there on my face! There, indeed, is already code that does exactly that in src/video/x11/SDL_x11opengl.c, it checks an env var called "SDL_OPENGL_LIBRARY".

Doing something like this works just fine:
export SDL_OPENGL_LIBRARY=/opt/X11/lib/libGL.dylib
(or wherever your X11 happens to be).

This will override whatever it was set when SDL2 was built.
 
Well dang. Ok, sometimes I miss the nose right there on my face! There, indeed, is already code that does exactly that in src/video/x11/SDL_x11opengl.c, it checks an env var called "SDL_OPENGL_LIBRARY".

Doing something like this works just fine:
export SDL_OPENGL_LIBRARY=/opt/X11/lib/libGL.dylib
(or wherever your X11 happens to be).

This will override whatever it was set when SDL2 was built.

LOL, no one noticed. (That’s a common issue with env variables, it is often nowhere obvious. There is, for example, a bug in gtk4, which requires GSK_RENDERER=cairo in env. Sure enough, I had to search for this solution; somehow users are assumed to guess that.)
 
  • Like
Reactions: ADunsmuir
@lauland Oddly, I am trying now with MPV, and 2.32.4 with GL works (no extra patches), while 2.32.6 does not. However there was nothing in the update from my side: https://github.com/macos-powerpc/powerpc-ports/commit/594507a7ca2255a97600ad8d13a6b369ae87c92f
I did switch to gcc-4.2 with revbump, but both versions (i.e. of 2.32.6) have wrong colors and no OpenGL recognized.

Upd2. Nah, something went off on my side, though still not clear what exactly. I was able to build 2.32.6 now with the correct outcome, so it is fixable at least.

Upd3. Oh Lawd, it was a silly typo in the portfile 🤦‍♂️

Ignore this, there is no issue with either SDL or my toolchain. I should just read arguments passed to configure before debugging further.
 
Last edited:
Happens to the best of us! Can't count how many times things unexpected break in bizarre ways, and it was only my own human confusion.

I've been thinking about the whole "gcc-4.2" thing:
It is very good that SDL2 builds with it, but only in that it decreases the dependencies when doing a build without MacPorts, and determining the actual minimal requirements. In that, you don't need a newer compiler, so if you don't have one, you're fine.

But, I think, if you have one handy, which you definitely do if you have MacPorts, you should use it, probably! The last thing I'd want is to hear you ran into some issue down the road because you removed the old compiler from the blacklist.

It's amazing modern SDL2 builds with such an old compiler, but it very old, and if you have anything newer you should use it...being able to build may go away at some point, unexpectedly, anyway.

Even for MacOS 7/8/9 I am using GCC 9! (Still old, but yards new). The hoops I had to jump through to get SDL2 to build with CodeWarrior were quite painful, and I'm strongly considering dropping support. Dealing with compiler foibles is just not worth the time it takes.

Which is to say, using 4.2 makes sense for me in my context, but maybe not in the context of MacPorts. My two cents: Maybe add it back to the blacklist?
 
Happens to the best of us! Can't count how many times things unexpected break in bizarre ways, and it was only my own human confusion.

I've been thinking about the whole "gcc-4.2" thing:
It is very good that SDL2 builds with it, but only in that it decreases the dependencies when doing a build without MacPorts, and determining the actual minimal requirements. In that, you don't need a newer compiler, so if you don't have one, you're fine.

But, I think, if you have one handy, which you definitely do if you have MacPorts, you should use it, probably! The last thing I'd want is to hear you ran into some issue down the road because you removed the old compiler from the blacklist.

It's amazing modern SDL2 builds with such an old compiler, but it very old, and if you have anything newer you should use it...being able to build may go away at some point, unexpectedly, anyway.

Even for MacOS 7/8/9 I am using GCC 9! (Still old, but yards new). The hoops I had to jump through to get SDL2 to build with CodeWarrior were quite painful, and I'm strongly considering dropping support. Dealing with compiler foibles is just not worth the time it takes.

Which is to say, using 4.2 makes sense for me in my context, but maybe not in the context of MacPorts. My two cents: Maybe add it back to the blacklist?

Well, we could, of course, but if there is no difference in outcome, maybe no point to hurry with reverting that. (It’s also easy to build with a desired compiler manually, passing configure.compiler= on command line.)
FWIW, xorg-server-legacy still uses gcc-4.2 (and does not build with modern gcc, though I didn’t bother fixing that). But mesa needs a modern compiler.

P. S. I was considering to drop Xcode gcc completely and use it only to bootstrap, and then we do not need to use old C++ ABI. But that will radically deviate from MacPorts, we gonna be on our own.
Also, have you seen that I have builds against libc++ on PowerPC? It is working fine, from what I can tell, though not many ports are tested on it.
 
Well, we could, of course, but if there is no difference in outcome, maybe no point to hurry with reverting that. (It’s also easy to build with a desired compiler manually, passing configure.compiler= on command line.)
FWIW, xorg-server-legacy still uses gcc-4.2 (and does not build with modern gcc, though I didn’t bother fixing that). But mesa needs a modern compiler.

P. S. I was considering to drop Xcode gcc completely and use it only to bootstrap, and then we do not need to use old C++ ABI. But that will radically deviate from MacPorts, we gonna be on our own.
Also, have you seen that I have builds against libc++ on PowerPC? It is working fine, from what I can tell, though not many ports are test
 
Shame about xorg-server-legacy, but, hey, at least it builds with something. Mesa is messy, I need to look into it, but requiring me to deal with python just to build the thing is just irritating. I have a truly ancient version that builds with CodeWarrior pro 1 that I've looked into for SDL 1.2 and SDL2 for m68k, very limited features, but hey, any OpenGL on an m68k is a minor miracle! (And...very...slow..with...no...gpu....)

Dropping XCode gcc may seem radical, but isn't a bad idea, necessarily. If you've got newer compilers right there, it's an extra step, but not a bad one, and anyone using MacPorts will probably want them anyway. Deviating from the main MacPorts radically may happen anyway in the future.

Like I said, I only used it because I wanted to have minimal dependencies. I'm building SDL2_mixer, SDL2_image, SDL2_ttf, straight from their githubs right now. Mixer and image are fine with a few things disabled, but...guess what...ttf requires a newer compiler! (All three build for MacOS 7/8/9 with features turned WAY down).

Not doing too much C++ at the moment, but sure I will at some point and libc++ will be welcome.
 
  • Like
Reactions: repairedCheese
I think my fixes for building with gcc for some of those SDL2 dependents were merged to upstreams, so they should build now.

Re xorg-server: it may be possible (and maybe even not too hard – not Qt-level of hard at least) to have a much newer version working. Some Cocoa code needs to be fixed, but there is not much of it. Otherwise I had the latest xorg-sever building (sure enough, it does not yet work, since Cocoa hacks were quick and dirty).
If there will be interest in that, I will share the tree and perhaps review patches.

In a grand scheme of things, I think we just need three things fixed to make life with PowerPC a piece of cake:
1. Robust X11 with proper OpenGL. This is basically X server and SDL, since GTK is working fine already.
2. Qt5+. This is a pain to deal with…
3. Palemoon. Also a pain. Less to fix, but hard to debug.

Optionally V8, though I am not sure if it make the way to get Chromium or not. V8 on its own is fixable, but codebase is a nightmare to read.
Also optionally X11 for Java, but aside of “proving that we can” I don’t see a huge utility in that, tbh.
 
@lauland Could you try this?

I have fixed building of the latest `mpv` (with SDL2+X11), and provisionally fixed colors with X11 backend without GL.
 
@lauland Could you try this?

I have fixed building of the latest `mpv` (with SDL2+X11), and provisionally fixed colors with X11 backend without GL.
There's so many dependencies on both it'd be quite crazy of me to try without having MacPorts to pull them all in. I'm crazy, but not quite that crazy. With that said, I'm very curious to take a look...

I attempted to use PowerPC Ports, but, of course, the installer doesn't work on 10.4. Should I use the legacy 10a190 version, or is that even worth it?

I've installed the official MacPorts for Tiger and am pulling in some basic stuff like curl, git, and all their dependencies, etc. It (of course) wants to build SO MUCH from scratch (gcc, etc), but I might as well, so I have it all handy for the "future". I might be able to use that, pull the dependencies for mpv, and then apply patches from your PowerPC Ports (by hand), or force your portfile(s). (Or something equally insane).

But I think you get my point. My PowerPC machine is Tiger, because I need Classic for my MacOS 9 stuff, which is my primary focus.
 
There's so many dependencies on both it'd be quite crazy of me to try without having MacPorts to pull them all in. I'm crazy, but not quite that crazy. With that said, I'm very curious to take a look...

I attempted to use PowerPC Ports, but, of course, the installer doesn't work on 10.4. Should I use the legacy 10a190 version, or is that even worth it?

I've installed the official MacPorts for Tiger and am pulling in some basic stuff like curl, git, and all their dependencies, etc. It (of course) wants to build SO MUCH from scratch (gcc, etc), but I might as well, so I have it all handy for the "future". I might be able to use that, pull the dependencies for mpv, and then apply patches from your PowerPC Ports (by hand), or force your portfile(s). (Or something equally insane).

But I think you get my point. My PowerPC machine is Tiger, because I need Classic for my MacOS 9 stuff, which is my primary focus.

You should get in touch with @cellularmitosis and @glebm – they probably have a lot of stuff built for Tiger, including gcc.

Disabling extra variants will reduce dependencies, but still, quite a bit of stuff is needed, yeah.

As for PPCPorts installer, I can make it for Tiger. We were discussing with @cellularmitosis that. If building from GitHub, you need to revert upstream commit removing 10.4 support or build 2.10.5 (no big deal here, it will work). For example, pick my sysutils/MacPorts port at 2.10.5, run `port pkg MacPorts`, and hopefully it produces the working installer.
 
"If you built it they will come." - Field of Dreams

I can probably help you more if you get PPCPorts for Tiger easily installable. Though I understand that might be a pain. Either way, if other people are interested in such a beast, add my vote.
 
Last edited:
I can probably help you more if you get PPCPorts for Tiger. Though I understand that might be a pain. Either way, if other people are interested in such a beast, add my vote.

Restoring 10.4 support into the base is easy, I will do that. I can also rewrite logic in toolchain components, so that on Tiger they use whatever MacPorts had at the moment of @glebm PR merge (since that was actually tested and confirmed to work).
Someone has to do the builds then, and either fix what is found to be broken or at least inform us. An easy way to handle some problematic ports will be just pegging to w/e version works (good thing, we don’t need to beg someone’s permission anymore to fix something LOL).
 
Restoring 10.4 support into the base is easy, I will do that. I can also rewrite logic in toolchain components, so that on Tiger they use whatever MacPorts had at the moment of @glebm PR merge (since that was actually tested and confirmed to work).
Someone has to do the builds then, and either fix what is found to be broken or at least inform us. An easy way to handle some problematic ports will be just pegging to w/e version works (good thing, we don’t need to beg someone’s permission anymore to fix something LOL).
If you do that I can absolutely let you know what is broken! (Hopefully not "lots"). May or may not be able to help with fixes, but if you want bug reports from me, you'll get 'em.
 
(Hopefully not "lots").

Well… It is quite common that every next update breaks a port, because nothing is tested with gcc, not on a single system. And then CI only run for three latest systems, so no SDK issues are ever detected, unless someone complains on Trac. (You would think that port health will be checked from buildbots at least post factum, but no, usually no one cares.)
Besides daily broken builds, there are incompatibility breakages: something gets updated without verifying that dependents can still build with it and work or subport is removed while it has dependents. I think, recently was a third time when I fixed Deluge, broken by someone updating dependencies without maintaining coherency (and that included sorting out the mess with 5–10 dependencies).
As a bonus, often a port is broken by something completely silly: a patch is not rebased or not needed, and fails to apply, or someone fixes an issue for clang, breaking the build with gcc at the same time, etc.
Honestly, it is as bad as it can get. My rough estimate is if nothing is done for a week, something won’t work anymore, and within a month the whole set-up is largely unusable.
It will be yet worse for Tiger, for obvious reasons. Though getting gcc14 should have substantially improved the situation – my experience with 10.4 is pre-gcc14, so may be biased towards the worse.

I think, a reasonable – and feasible to follow through – approach for Tiger is to choose a few apps which you and other real-world users actually use, and update whatever in their dependency tree, once MacPorts updates that. Ideally also verify that apps still work and not just build (this is perhaps relevant for Python stuff more than anything else).
And of course, fundamental toolchain and build tools must be kept working – plus things like curl, openssh and git.
This must be perfectly doable with reasonable effort (maybe even little effort).

It may also be worth considering adopting a system of stable releases for Tiger, without requiring users to go through daily/weekly updates – with associated breakages. Like OpenBSD and NetBSD do, for example.
What I currently have with PPCPorts is a “developer snapshot”, so at any given moment something is broken until I fix it LOL.
Then sources.conf can be adjusted for Tiger, so that a single tarball of the MacPorts ports with our fixes on top is used instead of separate sources. Update that once in a quarter or smth like that, and then users won’t have bleeding-edge versions, but will have a reliably working set-up.
 
No, dang, as someone who has attempted to use MacPorts on poorly supported (really unsupported) systems (not just Tiger), I can only imagine your pain.

Probably few have any idea of the amount of work it takes just to keep things from spontaneously falling apart. So many are happy to use things, without knowing how the sausage was made (so to speak).

Well, consider me a possible guinea pig. Obviously a goal, in order to help you, would be getting mpv and its dependencies. Of course that's easy to SAY, that's probably over a hundred cascading packages! Starting smaller might be a good idea, don't you think?

gcc won't be an issue, because you have a newer one avail for Tiger. (And even if you didn't, I already do via TigerBrew). I want to stress, I was only using gcc 4 for SDL2 because I was building without any MacPorts and just wanted to see if it worked. I don't really care one way or the other about gcc version.

Anyway, let me know if you want me to test anything. If there's a way to Frankenstein something together from what already exists without any new work on your part, let me know. It isn't clear to anyone not familiar with the guts of MacPorts (ie me) how to install it from source, otherwise take parts and put them together, etc. (Or if it's even worth trying, as the result may build, but then either not quite work, be pointed at the wrong place, or fundamental ports broken, etc).
 
Obviously a goal, in order to help you, would be getting mpv and its dependencies. Of course that's easy to SAY, that's probably over a hundred cascading packages! Starting smaller might be a good idea, don't you think?

Anyway, let me know if you want me to test anything. If there's a way to Frankenstein something together from what already exists without any new work on your part, let me know. It isn't clear to anyone not familiar with the guts of MacPorts (ie me) how to install it from source, otherwise take parts and put them together, etc. (Or if it's even worth trying, as the result may build, but then either not quite work, be pointed at the wrong place, or fundamental ports broken, etc).

I just mentioned mpv, because it uses SDL. There is nothing particular to do about it at the moment – looks like I have fixed both libplacebo (which prevented updating beyond `mpv-legacy`) and color on BE with X11.

It would really helpful if you try restoring Cocoa support into modern SDL2 and SDL3. Besides that, well, whatever you yourself have interest in – otherwise it won’t work :)

If you are good with Cocoa and have an idea how X server works (I don’t), then taking a look at possibility of fixing the modern XQuartz for PowerPC may be worth.
 
I'm not good with Cocoa, but do know a lot about X11...but am pragmatic, and Apple's X11 is fine for what I need at the moment, so probably won't look at XQuartz, unless there's something specific. (But that might be dealing with Cocoa code, not SDL2 in ANY way, of course, but just Cocoa in general, which I am not good at).

Getting the working Cocoa driver from SDL 2.0.3 to build for SDL 2.31 (or any recent version) is not trivial, nor would trying something REALLY crazy like hacking on the current driver to get it to work (somehow...with 5 million patches?!?) on older MacOS X (especially on something as ancient as Tiger). Both would be quite a bit of truly nasty work in the SDL2 driver plumbing.

With that said, I've been doing a LOT of SDL2 driver plumbing recently, obviously. The 2.0.3 driver looks promising, and I will probably work on it at some point, just to have any Cocoa at all for SDL2 Tiger. I, of course, naively just put it in the tree to see what happens, and to say it "doesn't build" is an understatement. I do not know a lot of Cocoa, so think working on it is just at the edge of my skills, but would be a good way to learn more, which I've been meaning to.

I'll post any progress here.

----

It's neither here nor there, but just because I knew I could, and nobody else seems to have tried, I started sketching out 68k AmigaOS 3 support in my MacOS 7/8/9 SDL2 tree. ("Hm...what happens if I change m68k-apple-macos-gcc to m68k-amigaos-gcc in the Makefile?"). I actually have it building but not displaying anything. My Amiga skills are so rusty there's more rust than skills, so probably won't get far. But, yes, been doing lots of SDL2 driver plumbing.

FYI there's an EXACT analogy to the Cocoa driver issue, in that there is a working AmigaOS 4 SDL2, but its drivers use APIs and whatnot that are "too new" for AmigaOS 3.
 
Last edited:
  • Like
Reactions: barracuda156
It's neither here nor there, but just because I knew I could, and nobody else seems to have tried, I started sketching out 68k AmigaOS 3 support in my MacOS 7/8/9 SDL2 tree. ("Hm...what happens if I change m68k-apple-macos-gcc to m68k-amigaos-gcc in the Makefile?"). I actually have it building but not displaying anything.

That is what I have with XQuartz 2.8.5 on powerpc now LOL
It even does not segfault, but does not do anything useful either.

Not really sure whether reverting breakages or trying to actually rewrite new code is a better approach. (Better in a sense of getting somewhat better outcome than we have now with reasonable efforts.)
 
That is what I have with XQuartz 2.8.5 on powerpc now LOL
It even does not segfault, but does not do anything useful either.

Not really sure whether reverting breakages or trying to actually rewrite new code is a better approach. (Better in a sense of getting somewhat better outcome than we have now with reasonable efforts.)
Well, once we get I can get PowerPC Ports on my tiger I can take a look.
 
Take your time, but let me know what to do to build it, esp what problems I might expect to run into. Obviously I don't mind building things.
 
Take your time, but let me know what to do to build it, esp what problems I might expect to run into. Obviously I don't mind building things.

It was always literally `./configure && make && sudo make install` with only Xcode as a dependency (okay, on 10a190 there was a 1-line patch).
(Also, if the base ever becomes too problematic to maintain for 10.4, it is easy to peg it to some recent version and backport our powerpc-specific patches.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.