cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
887 stars 114 forks source link

Unable to build on Linux due to cmake errors #683

Closed crabctrl closed 3 years ago

crabctrl commented 3 years ago

When building on Gentoo x86_64 I get the following error:

CMake Error at proto/CMakeLists.txt:5 (nanopb_generate_cpp):
  Unknown CMake command "nanopb_generate_cpp".

Is there a dependency on nanopb or something that isn't mentioned in the build instructions?

cxong commented 3 years ago

This function is defined in https://github.com/cxong/cdogs-sdl/blob/master/src/proto/nanopb/extra/FindNanopb.cmake

crabctrl commented 3 years ago

That still doesn't explain why the build is failing, unfortunately..

cxong commented 3 years ago

I'm not sure what's different about gentoo; I tried with a fresh ubuntu on WSL and these are the commands I used to get the build working:

sudo apt-get update
sudo apt install cmake libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libgtk-3-dev build-essential ninja-build
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
unzip protoc-3.12.3-linux-x86_64.zip
sudo mv bin/protoc /usr/bin
sudo mv include/* /usr/local/include
sudo apt install python2 python-is-python2
curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
sudo python2 get-pip.py
pip install protobuf
./make.sh

You can also reference the travis build script here: https://github.com/cxong/cdogs-sdl/blob/master/.travis.yml HTH

crabctrl commented 3 years ago

...is Python 2 required to build the project? i.e. does it not work with Python 3?

cxong commented 3 years ago

I think so; I tried with python3 earlier and it didn't work but I think nanopb could work with python3. Haven't looked into it that much

crabctrl commented 3 years ago

In that case, it would probably be a good idea to consider upgrading to Python 3, or at the very least mention in the README that it is incompatible with Python 2. Given that Python 2 has been deprecated, most users are going to assume that Python 3 is the only required interpreter, and already some distros are removing Python 2 entirely...

cxong commented 3 years ago

Please try again with python3

crabctrl commented 3 years ago

I've tried compiling the latest commit with Python 3, and unfortunately I am still getting the exact same error.

vilhelmgray commented 3 years ago

FYI @katp32, I'm working on a Gentoo ebuild for cdogs-sdl, so please keep an eye on this PR: https://github.com/gentoo/gentoo/pull/16539

vilhelmgray commented 3 years ago

@katp32 Now that the ebuild has been merged into the Gentoo repo, try emerging it and see if your CMake issue is still present: emerge games-arcade/cdogs-sdl

crabctrl commented 3 years ago

Indeed, it seems to work now. Not sure what the original issue was; thanks!