From 8698d986db21d6399fb57f1af1e38d6223bf9b92 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 24 May 2019 20:50:31 -0400 Subject: gnu: supertux: Update to 0.6.0. * gnu/packages/games.scm (supertux): Update to 0.6.0. [source]: Add patches. [arguments]: Add -DUSE_SYSTEM_PHYSFS=ON. Add 'patch-squirrel-path' phase. [inputs]: Add freetype and squirrel. * gnu/packages/patches/supertux-fix-build-with-gcc5.patch, gnu/packages/patches/supertux-unbundle-squirrel.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. --- .../patches/supertux-fix-build-with-gcc5.patch | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 gnu/packages/patches/supertux-fix-build-with-gcc5.patch (limited to 'gnu/packages/patches/supertux-fix-build-with-gcc5.patch') diff --git a/gnu/packages/patches/supertux-fix-build-with-gcc5.patch b/gnu/packages/patches/supertux-fix-build-with-gcc5.patch new file mode 100644 index 0000000000..6393215ca1 --- /dev/null +++ b/gnu/packages/patches/supertux-fix-build-with-gcc5.patch @@ -0,0 +1,75 @@ +Taken from https://github.com/SuperTux/supertux/commit/a75317ef0a94847d9b6a7833b9c6652ef29edde3. +This patch fixes building with gcc versions earlier than 6. + +From a75317ef0a94847d9b6a7833b9c6652ef29edde3 Mon Sep 17 00:00:00 2001 +From: Ingo Ruhnke +Date: Fri, 28 Dec 2018 22:45:35 +0100 +Subject: [PATCH] Add workaround for backwards compatibilty with gcc5 + +Fixes #1014 +--- + src/video/gl/gl_painter.cpp | 11 ++++++----- + src/video/ttf_surface.cpp | 16 +++++++++------- + 2 files changed, 15 insertions(+), 12 deletions(-) + +diff --git a/src/video/gl/gl_painter.cpp b/src/video/gl/gl_painter.cpp +index 5e0d1e7b1e..32fb7a09b6 100644 +--- a/src/video/gl/gl_painter.cpp ++++ b/src/video/gl/gl_painter.cpp +@@ -37,12 +37,13 @@ namespace { + + inline std::tuple blend_factor(Blend blend) + { ++ using B = std::tuple; + switch(blend) { +- case Blend::NONE: return {GL_ONE, GL_ZERO}; +- case Blend::BLEND: return {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; +- case Blend::ADD: return {GL_SRC_ALPHA, GL_ONE}; +- case Blend::MOD: return {GL_DST_COLOR, GL_ZERO}; +- default: return {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}; ++ case Blend::NONE: return B(GL_ONE, GL_ZERO); ++ case Blend::BLEND: return B(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ++ case Blend::ADD: return B(GL_SRC_ALPHA, GL_ONE); ++ case Blend::MOD: return B(GL_DST_COLOR, GL_ZERO); ++ default: return B(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + } + +diff --git a/src/video/ttf_surface.cpp b/src/video/ttf_surface.cpp +index 7c9505004f..b41d67b2c8 100644 +--- a/src/video/ttf_surface.cpp ++++ b/src/video/ttf_surface.cpp +@@ -55,12 +55,13 @@ TTFSurface::create(const TTFFont& font, const std::string& text) + SDL_SetSurfaceColorMod(text_surface.get(), 0, 0, 0); + SDL_SetSurfaceBlendMode(text_surface.get(), SDL_BLENDMODE_BLEND); + ++ using P = std::tuple; + const std::initializer_list > positions[] = { + {}, +- {{0, 0}}, +- {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, +- {{-2, 0}, {2, 0}, {0, -2}, {0, 2}, +- {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} ++ {P{0, 0}}, ++ {P{-1, 0}, P{1, 0}, P{0, -1}, P{0, 1}}, ++ {P{-2, 0}, P{2, 0}, P{0, -2}, P{0, 2}, ++ P{-1, -1}, P{1, -1}, P{-1, 1}, P{1, 1}} + }; + + int shadow_size = std::min(2, font.get_shadow_size()); +@@ -77,11 +78,12 @@ TTFSurface::create(const TTFFont& font, const std::string& text) + SDL_SetSurfaceColorMod(text_surface.get(), 0, 0, 0); + SDL_SetSurfaceBlendMode(text_surface.get(), SDL_BLENDMODE_BLEND); + ++ using P = std::tuple; + const std::initializer_list > positions[] = { + {}, +- {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, +- {{-2, 0}, {2, 0}, {0, -2}, {0, 2}, +- {-1, -1}, {1, -1}, {-1, 1}, {1, 1}} ++ {P{-1, 0}, P{1, 0}, P{0, -1}, P{0, 1}}, ++ {P{-2, 0}, P{2, 0}, P{0, -2}, P{0, 2}, ++ P{-1, -1}, P{1, -1}, P{-1, 1}, P{1, 1}} + }; + + int border = std::min(2, font.get_border()); -- cgit v1.2.3