supertux.mk 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ################################################################################
  2. #
  3. # supertux
  4. #
  5. ################################################################################
  6. SUPERTUX_VERSION = 0.6.0
  7. SUPERTUX_SITE = https://github.com/SuperTux/supertux/releases/download/v$(SUPERTUX_VERSION)
  8. SUPERTUX_SOURCE = SuperTux-v$(SUPERTUX_VERSION)-Source.tar.gz
  9. # Supertux itself is GPL-3.0+, but it bundles a few libraries with different
  10. # licenses (sexp-cpp, squirrel, tinygettext) which are linked statically.
  11. SUPERTUX_LICENSE = GPL-3.0+ (code), CC-BY-SA-2.0, CC-BY-SA-3.0, GPL-2.0+ (images music sounds)
  12. SUPERTUX_LICENSE_FILES = LICENSE.txt data/AUTHORS
  13. # Use bundled squirrel, tinygettext sexp-cpp packages which are hardcoded in
  14. # the CMake build system.
  15. SUPERTUX_DEPENDENCIES = host-pkgconf boost freetype libcurl libgl libglew \
  16. libogg libpng libvorbis openal physfs sdl2 sdl2_image
  17. # CMAKE_BUILD_TYPE=Release: disable profiling code (-pg)
  18. # ENABLE_BOOST_STATIC_LIBS=OFF: use boost shared libraries since supertux
  19. # depends on !BR2_STATIC_LIBS and boost provide only shared libraries with
  20. # BR2_SHARED_LIBS.
  21. # ENABLE_OPENGL=ON: Can be disabled but will make SuperTux unplayable slow.
  22. # GLBINDING_ENABLED=OFF: use GLEW (default) instead of glbinding.
  23. # Install the game directly in /usr/bin and game data in /usr/share/supertux2.
  24. # Force using physfs.so from staging since the check on PHYSFS_getPrefDir symbol
  25. # in physfs.h (CHECK_SYMBOL_EXISTS) doesn't work.
  26. # ENABLE_OPENGLES2=OFF: Disable opengles2 for now.
  27. SUPERTUX_CONF_OPTS += \
  28. -DCMAKE_BUILD_TYPE=Release \
  29. -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -DGLEW_NO_GLU" \
  30. -DENABLE_BOOST_STATIC_LIBS=OFF \
  31. -DBUILD_DOCUMENTATION=OFF \
  32. -DENABLE_OPENGL=ON \
  33. -DGLBINDING_ENABLED=OFF \
  34. -DINSTALL_SUBDIR_BIN="bin" \
  35. -DINSTALL_SUBDIR_SHARE="share/supertux2" \
  36. -DUSE_SYSTEM_PHYSFS=ON \
  37. -DENABLE_OPENGLES2=OFF
  38. # Avoid incompatible posix_memalign declaration on x86 and x86_64 with
  39. # musl.
  40. # https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01425.html
  41. ifeq ($(BR2_TOOLCHAIN_USES_MUSL):$(BR2_i386)$(BR2_x86_64),y:y)
  42. define SUPERTUX_REMOVE_PEDANTIC
  43. $(SED) 's% -pedantic%%' $(@D)/CMakeLists.txt
  44. $(SED) 's%CHECK_CXX_FLAG(pedantic)%%' $(@D)/external/tinygettext/CMakeLists.txt
  45. endef
  46. SUPERTUX_POST_PATCH_HOOKS += SUPERTUX_REMOVE_PEDANTIC
  47. endif
  48. # From https://bugs.debian.org/cgi-bin/bugreport.cgi/?bug=770670
  49. # "The problem lies within SDL_cpuinfo.h. It includes altivec.h, which by
  50. # definition provides an unconditional vector, pixel and bool define in
  51. # standard-c++ mode. In GNU-c++ mode this names are only defined
  52. # context-sensitive by cpp. SDL_cpuinfo.h is included by SDL.h.
  53. # Including altivec.h makes arbitrary code break."
  54. #
  55. # Acording to a bug report in GCC [1]:
  56. # "You need to use -std=g++11 or undefine bool after the include of altivec.h
  57. # as context sensitive keywords is not part of the C++11 standard".
  58. # So use gnu++11 instead of c++11 only for altivec system.
  59. # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58241#c3
  60. ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),y)
  61. define SUPERTUX_FIX_ALTIVEC_ISSUE
  62. $(SED) 's%std=c++0x%std=gnu++0x%' $(@D)/external/tinygettext/CMakeLists.txt
  63. endef
  64. SUPERTUX_POST_PATCH_HOOKS += SUPERTUX_FIX_ALTIVEC_ISSUE
  65. endif
  66. $(eval $(cmake-package))