How to compile SDL 1.2 for OSX High Sierra

I’m working on a project which requires SDL 1.2 and I was wondering if 1.2.15 can still run in OSX High Sierra.

I downloaded the sources and configured SDL with --without-x but when I make, I get:

In file included from ./src/video/quartz/SDL_QuartzEvents.m:24:
./src/video/quartz/SDL_QuartzVideo.h:94:5: error: unknown type name 
'CGDirectPaletteRef'CGDirectPaletteRef palette;            /* palette of an 8-bit display */

plus several warnings on enums which have been renamed, i.e.:

./src/video/quartz/SDL_QuartzEvents.m:407:23: warning: 'NSAlphaShiftKeyMask' is deprecated: first
deprecated in macOS 10.12 [-Wdeprecated-declarations]
for (i = 0, bit = NSAlphaShiftKeyMask; bit <= NSCommandKeyMask; bit <<= 1, ++i) {

So I’m not sure if the 1.2 source can actually build.

Also, I tried writing a simple SDL app to test keyboard input, linking against the 1.2 runtime and while I can create a window, I don’t get any keypress events. In contrast, if I (minimally) modify my test code to use SDL2 (which unfortunately I can’t use for this project), I do get keyboard events.

Any thoughts?

Homebrew has sdl1 that builds

is that the 1.2.15 source or the tip of the 1.2 branch? I did compile tip on High Sierra successfully

Cool thanks for tip. I was hoping to build myself from source too thought.

(Sorry, messed up the last reply).

I tried with 1.2.15 sources as downloaded from the SDL website. Where could I get this 1.2 branch you mention? Somewhere on github?

Grab the Mercurial from libsdl’s own mercurial/hg repository and switch to the SDL-1.2 branch.