Comments (19)
Hmm, does homebrew say anything when installing SDL2?
For openal-soft, it says this, for example, at least on the Catalina VMs of the GitHub Actions runners: https://github.com/xoreos/xoreos/runs/5177204214?check_suite_focus=true#step:3:64
from xoreos.
No, SDL2 is fine for anything else that is using it, and there is no notification from homebrew when installing.
I did try using brew doctor
and also reinstalled it as well, but it still didn't work.
If anyone else had an M1 (and uses homebrew), maybe they can test.
If it's an issue with my install, that's fine. If not, well the fix is recorded here.
from xoreos.
By the way, the GitHub actions are x86 though, am I right?
I believe that homebrew has moved things around so x86 and arm stuff can co-exist...
from xoreos.
Yeah, it looks to me like homebrow changed something. The GitHub runners should be x86, yeah. As were the Travis CI macOS VMs, IRC, back when Travis CI was still alive.
I basically just moved over the information in the Travis CI config into GitHub Actions workflow. I don't really know a lot about the Apple ecosystem, so I'm mostly just guessing and messing with things until they work :). I personally don't have a Mac at the moment, even, unfortunately, nevermind an M1 one, so I can't really check.
Can you modify our cmake/FindSDL2.cmake
file? In the find_path
in the else-branch on line 32, can you add /opt/homebrew/include/SDL2
to the HINTS paths?
I.e., replace that line with
find_path(SDL2_INCLUDE_DIR SDL.h HINTS /usr/include/SDL2 /usr/local/include/SDL2 /opt/local/include/SDL2 /opt/homebrew/include/SDL2 DOC "The directory where SDL.h resides")
Also, apart from this, can you also check using the autotools build system instead of cmake? Have a look at https://github.com/xoreos/xoreos/blob/master/.github/workflows/macos_autoconf_clang.yml#L24 to see how that is used. If that is broken on your system as well, this would also need to be fixed, I guess. We're using the sdl2-config script that SDL2 distributes there. If the configure script fails, please check where homebrew puts it
from xoreos.
Firstly, yes, replacing the line allows cmake to locate the includes correctly.
Secondly, I haven't tried using the auto tools before so I'll just have a poke around and report back later.
from xoreos.
Yes, it looks like the configure script needs to be altered...
The autogen.sh ran fine.
The configure script couldn't locate sdl2-config
checking for sdl2-config... sdl2-config configure: error: SDL2 (>= 2.0.0) is required and could not be found!
running which sdl2-config
in terminal gives me: /opt/homebrew/bin/sdl2-config
from xoreos.
Wait, if which
can find it, it's in the PATH, so the configure script should also find it?
What does sdl2-config --cflags --libs
output? And can you attach, upload or gist your config.log file?
from xoreos.
-I/opt/homebrew/include/SDL2 -D_THREAD_SAFE
-L/opt/homebrew/lib -lSDL2
from xoreos.
Oh. That looks rather like a bug in our ax_check_sdl2.m4
script.
Can you edit the file m4/ax_check_sdl2.m4
, and change the line that says
#include <SDL2/SDL.h>
to
#include <SDL.h>
?
You need to rerun autogen.sh, and then the configure script. And then make, if configure runs through without error.
from xoreos.
We're getting close!
No error from SDL2, but now I have one for Boost.
checking for Boost headers version >= 1.53.0... no
configure: error: cannot find Boost headers version >= 1.53.0
from xoreos.
Can you attach the config.log again? Thanks
And where does homebrew put the boost headers (and libraries)?
from xoreos.
Headers are in opt/homebrew/include/boost
Libraries are......I guess opt/homebrew/lib...? Check the screenshot here and see if these are the libraries you mean:
from xoreos.
Yep, those are the libraries
Okay, so does homebrew not install anything into /usr/local/ anymore now?
from xoreos.
Don't quote me on this, but I think that's where homebrew puts x86 stuff.
It's still a transition period, and it's common enough for people with M1s to still have to compile x86 versions of software and run through Rosetta.
from xoreos.
Ah, okay, that makes sense. It's a bit annoying, though :P
Can you apply this patch and retry (starting with autogen.sh)? homebrew_boost_m4.patch.txt
You'll apply those with patch -p1 < homebrew_boost_m4.patch.txt
, in case you're not familiar with them.
EDIT: This is assuming you're in the project's root directory. The -p flag specificies how many directories to strip off the path that's in the patch file. If you're inside the m4 directory, you need to pass -p2
from xoreos.
The scripts ran fine, and I was able to compile successfully.
Thanks :)
from xoreos.
Nice :)
So in summary, what's needed is the following:
- Add /opt/homebrew to cmake/FindSDL2.cmake
- Add /opt/homebrew to m4/boost.m4
- Remove the extra SDL2 directory in the include directory in m4/ax_check_sdl2.m4
DId I miss anything?
The first two points are due to changes in homebrew for M1 Macs. While the latter one is actually a bug in our configure script that only didn't show any consequences before now.
(Or technically, it might a fault of SDL2, that their sdl2-config script shouldn't add the SDL2 directory to their include directive, but that's something they do on all platforms.)
And the first one makes our CMake build system work on M1 Macs, while the latter two make our autotools build systems works on M1 Macs.
I'll need to check that none of the changes break anything on my local cross-compilers, so a public fix in the repo might take a while. Just as a heads up. But in either case, thanks for finding those issues :)
from xoreos.
Yes, I think thatβs it.
ππΌ
from xoreos.
Okay, fixed in fa430d3...87d09c6
from xoreos.
Related Issues (20)
- Star Wars: The Old Republic MMORPG HOT 3
- BUILD: Can't find SDL.h in VS2017 HOT 7
- Not enabling XML causes errors in xml.cpp HOT 4
- BUILD: Automake Travis does not fail if unit tests fail HOT 2
- Boost link error, undefined icu reference HOT 6
- KOTOR: Target indicator is too high
- NWN: Error starting the engine when using the Steam version HOT 4
- BUILD: OpenGL not found on FreeBSD HOT 5
- Feature: update GFF fields for DA2 HOT 1
- KOTOR: Crash on New Game, hiding HUD parts HOT 12
- SONIC: Probe finds NDS file, but game instance fails indexing it HOT 2
- AURORA: Dragon Age II PS3 mesh format
- Request: List of required files for each supported game HOT 2
- KOTOR: macOS: Mac App Store version of KotoR HOT 4
- KOTOR2: macOS: Mac App Store version of KotoR2 HOT 8
- GRAPHICS: RenderQueue compareDepth invalid comparison
- GRAPHICS: glm::mat4() does not produce identity matrix
- KOTOR: Error: unable to detect the game in Haiku_Os
- Does the Xoreos team still have twMax?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xoreos.