error compiling dev version on arch

9 replies [Last post]
jose1711
User offline. Last seen 3 years 28 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

hi, i am a maintainer of hedgewars-hg in aur. sadly looks like building is currently broken.

make
[  0%] Built target hedgewars-server
[  0%] Building C object misc/libphyslayer/CMakeFiles/physlayer.dir/physfsrwops.c.o
In file included from /home/jose/tarballs/aur4/hedgewars-hg/src/hedgewars-hg/misc/libphyslayer/physfsrwops.c:25:
/home/jose/tarballs/aur4/hedgewars-hg/src/hedgewars-hg/misc/libphyslayer/physfsrwops.h:28:10: fatal error: SDL.h: No such file or directory
   28 | #include "SDL.h"
      |          ^~~~~~~
compilation terminated.
make[2]: *** [misc/libphyslayer/CMakeFiles/physlayer.dir/build.make:95: misc/libphyslayer/CMakeFiles/physlayer.dir/physfsrwops.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3096: misc/libphyslayer/CMakeFiles/physlayer.dir/all] Error 2
make: *** [Makefile:182: all] Error 2

sdl2 is installed and header files are present so it looks like cmake is unable to detect them.

/usr/include/SDL2/SDL.h

can someone please take a look? i am ready to provide more logs if required. thanks, jose

nemo
nemo's picture
User offline. Last seen 7 hours 57 min ago. Offline
Joined: 2009-01-28
Posts: 1861

So, we merged a change to SDL cmake to a standard syntax at the request of the debian/ubuntu maintainer, Locutus. I've had issues myself with compiling since on older cmakes, requiring the following change...
-find_package(SDL2 REQUIRED CONFIG)
+find_package(SDL2 REQUIRED)

in
QTfrontend/CMakeLists.txt
misc/libphyslayer/CMakeLists.txt
project_files/hwc/CMakeLists.txt

I'm not sure if that's your issue or not.
https://hg.hedgewars.org/hedgewars/rev/15555

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

jose1711
User offline. Last seen 3 years 28 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

thank you nemo, that indeed helped. i don't know how to approach this now though. should i patch manually in prepare phase, wait until this commit is reverted or something else? cheers, jose

nemo
nemo's picture
User offline. Last seen 7 hours 57 min ago. Offline
Joined: 2009-01-28
Posts: 1861

Supposedly this change was requested by cmake folks, who claimed their upstream maintained SDL locating was much better than hedgewars homebrew that we've spent a decade tweaking due to distro oddities. Given both debian and arch seem to have issues with this, I'd advocate taking up with cmake folks if they are pushing to make their stuff standard. And yeah, patches appreciated. Would be good to get this resolved by next release.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

jose1711
User offline. Last seen 3 years 28 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

hmm.... looks like this commit https://hg.hedgewars.org/hedgewars/rev/027a56b3895e took care of it.

xiongmao
User offline. Last seen 3 years 18 weeks ago. Offline
Joined: 2018-11-03
Posts: 15

Unfortunately that's not very likely, this change is only for windows Sad Smiley

jose1711
User offline. Last seen 3 years 28 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

you are right.. still. i can now compile hw without issues (also the previous changesets). then it must be caused by a change in the system but with arch being rolling distro it's really hard to find out.

nemo
nemo's picture
User offline. Last seen 7 hours 57 min ago. Offline
Joined: 2009-01-28
Posts: 1861

Yeah, I'm going to bet on arch personally. You mind looking for recent changes to cmake?

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

jose1711
User offline. Last seen 3 years 28 weeks ago. Offline
Joined: 2008-06-20
Posts: 80

that was one of my first thoughts but cmake was updated in august:

[2020-08-22T10:42:57+0200] [ALPM] upgraded cmake (3.18.1-1 -> 3.18.2-1)

and sdl even earlier:
[2020-07-07T08:58:21+0200] [ALPM] upgraded sdl2 (2.0.12-1 -> 2.0.12-2)

nemo
nemo's picture
User offline. Last seen 7 hours 57 min ago. Offline
Joined: 2009-01-28
Posts: 1861

hm... that's still fairly recent for the cmake.
might be interesting to revert just to see what happens, but eh, no urgency. if it works, great.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]