microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.85k stars 6.3k forks source link

[libmodplug] Fails to compile on Debian 9, probably all Linux #3666

Closed AlexMax closed 5 years ago

AlexMax commented 6 years ago

Okay, so trying to compile libmodplug (a dependency of sdl2-mixer) appears to be failing on Linux:

The following packages will be built and installed:
    libmodplug[core]:x64-linux
Starting package 1/1: libmodplug:x64-linux
Building package libmodplug[core]:x64-linux...
-- CURRENT_INSTALLED_DIR=/home/alexmax/workspace/vcpkg/installed/x64-linux
-- DOWNLOADS=/home/alexmax/workspace/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=/home/alexmax/workspace/vcpkg/packages/libmodplug_x64-linux
-- CURRENT_BUILDTREES_DIR=/home/alexmax/workspace/vcpkg/buildtrees/libmodplug
-- CURRENT_PORT_DIR=/home/alexmax/workspace/vcpkg/ports/libmodplug
-- Using cached /home/alexmax/workspace/vcpkg/downloads/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d.zip
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Extracting done
-- Configuring x64-linux-dbg
-- Configuring x64-linux-dbg done
-- Configuring x64-linux-rel
-- Configuring x64-linux-rel done
-- Build x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_build_cmake.cmake:170 (message):
    Command failed: /home/alexmax/workspace/vcpkg/downloads/tools/cmake-3.10.2-linux/cmake-3.10.2-Linux-x86_64/bin/cmake;--build;.;--config;Debug;--target;install;--;-v;-j1
    Working Directory: /home/alexmax/workspace/vcpkg/buildtrees/libmodplug/x64-linux-dbg
    See logs for more information:
      /home/alexmax/workspace/vcpkg/buildtrees/libmodplug/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_cmake.cmake:24 (vcpkg_build_cmake)
  ports/libmodplug/portfile.cmake:12 (vcpkg_install_cmake)
  scripts/ports.cmake:72 (include)

Error: Building package libmodplug:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: libmodplug:x64-linux
  Vcpkg version: 0.0.113-unknownhash

Additionally, attach any relevant sections from the log files above.

Upon looking at the log file, it was endless swaths of errors like:

[1/36] /usr/bin/c++  -DHAVE_SETENV -DMODPLUG_BUILD -DMODPLUG_STATIC -I/home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src -I/home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/libmodplug -I.  -MD -MT CMakeFiles/modplug.dir/src/load_669.cpp.o -MF CMakeFiles/modplug.dir/src/load_669.cpp.o.d -o CMakeFiles/modplug.dir/src/load_669.cpp.o -c /home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/load_669.cpp
FAILED: CMakeFiles/modplug.dir/src/load_669.cpp.o
/usr/bin/c++  -DHAVE_SETENV -DMODPLUG_BUILD -DMODPLUG_STATIC -I/home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src -I/home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/libmodplug -I.  -MD -MT CMakeFiles/modplug.dir/src/load_669.cpp.o -MF CMakeFiles/modplug.dir/src/load_669.cpp.o.d -o CMakeFiles/modplug.dir/src/load_669.cpp.o -c /home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/load_669.cpp
In file included from /home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/load_669.cpp:12:0:
/home/alexmax/workspace/vcpkg/buildtrees/libmodplug/src/libmodplug-5a39f5913d07ba3e61d8d5afdba00b70165da81d/src/libmodplug/stdafx.h:70:9: error: ‘uint8_t’ does not name a type
 typedef uint8_t UCHAR;
         ^~~~~~~

I think I know what's going on here. The CMakeLists.txt included in libmodplug does not appear to be designed to work under *NIX, as I also could not get the program to compile myself using it - instead I encountered the exact same errors.

Instead, I had to resort to autotools. The bundled INSTALL file is incorrect, as there is no configure script included in the git repository. Instead, one must autoreconf it yourself. Thus:

$ autoreconf -vi
$ ./configure
$ make

However, I haven't the faintest clue how to properly integrate these build steps into vcpkg.

vicroms commented 5 years ago

@AlexMax

The port for libmodplug has been fixed and it now successfully builds on Linux, I have confirmed that as a result of this sdl2pp and sdl2-mixer now also build succesfully.

If you still experience issues with this libraries please file a new issue.