mywave82 / opencubicplayer

Open Cubic Player (unix fork). Music visualizer for various tracked music formats (amiga modules, S3M, IT), chiptunes and other formats related to demoscene
https://stian.cubic.org/project-ocp.php
GNU General Public License v2.0
283 stars 19 forks source link

ocp 0.2.90: build failure on macOS 10.14 (Mojave) with SDL2 #33

Closed nandahkrishna closed 3 years ago

nandahkrishna commented 3 years ago

Hello, Homebrew maintainer here. I'm trying to get 0.2.90 to work with sdl2, to fix problems where audio wasn't playing (PR: https://github.com/Homebrew/homebrew-core/pull/77633). I can confirm that I am able to play audio on newer versions of macOS.

However, the build fails on macOS 10.14:

clang -g -O2 -fno-common -fPIC -Wall -I.././ -dynamiclib -flat_namespace -undefined suppress -o devpsdl2.dylib devpsdl2.o -L/usr/local/lib -lSDL2
ld: file not found: /System/Library/Frameworks/CoreHaptics.framework/Versions/A/CoreHaptics for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [devpsdl2.dylib] Error 1
make: *** [dirs] Error 2

The Core Haptics framework is present only in macOS 10.15 and above, but I wonder if it's necessary for ocp. The full logs are available here: https://github.com/Homebrew/homebrew-core/pull/77633/checks?check_run_id=2625181675.

Is there anything else we should be doing/changing to get this to work? Thanks!

mywave82 commented 3 years ago

Please mind: I do not have a Mac myself

Might it be that CoreHaptics is pulled in from SDL2 If so: SDL2 should probably be fixed there.

Possible work-around, use SDL instead of SDL2 on MacOS 10.14 and older?

And a wish, any developer available that can fix the built-in CoreAudio driver in OCP. The code used to work MANY years ago when I had access to an ancient system, and since then it has gone through some bit-rot. Suspect that it is missing something minor like correct library, an initalization call or something similiar.

alexmyczko commented 3 years ago

did you not fix it on my mba m1? i need to check if it is coreaudio or sdl2 audio

nandahkrishna commented 3 years ago

Might it be that CoreHaptics is pulled in from SDL2 If so: SDL2 should probably be fixed there.

I think this is the case, for joystick support with SDL2. We may not be able to remove it, I think.

Possible work-around, use SDL instead of SDL2 on MacOS 10.14 and older?

This seems to have worked 🎉, building ocp succeeded on our CI once I did this. I don't have a 10.14 device or VM to test this out, but it should work as intended.

Thank you, @mywave82! I'll be closing this issue as it's resolved.