From 102ae03b2b41c15bf49afc297fd95b0e78b9af0d Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Fri, 25 Oct 2019 22:11:49 +1300 Subject: [PATCH 1/8] Basic build and package support --- switch/libprojectM/.gitignore | 2 + switch/libprojectM/PKGBUILD | 50 +++++ ...a4516-disable_navtive_preset_factory.patch | 37 ++++ ...jectM-4befa4516-platform_definitions.patch | 171 ++++++++++++++++++ 4 files changed, 260 insertions(+) create mode 100644 switch/libprojectM/.gitignore create mode 100644 switch/libprojectM/PKGBUILD create mode 100644 switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch create mode 100644 switch/libprojectM/projectM-4befa4516-platform_definitions.patch diff --git a/switch/libprojectM/.gitignore b/switch/libprojectM/.gitignore new file mode 100644 index 00000000..7ffa7ad2 --- /dev/null +++ b/switch/libprojectM/.gitignore @@ -0,0 +1,2 @@ +*.tgz +switch-libprojectm \ No newline at end of file diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD new file mode 100644 index 00000000..fdb7bd93 --- /dev/null +++ b/switch/libprojectM/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Rhys Koedijk + +pkgname=switch-libprojectm +pkgver=r1866.4befa4516 +pkgrel=1 +pkgdesc='Cross-platform music visualization. Open-source and Milkdrop-compatible' +arch=('any') +url='https://github.com/projectM-visualizer/projectm' +license=('(L)GPL') +options=(!strip libtool staticlibs) +source=(${pkgname}::"git+https://github.com/projectM-visualizer/projectm.git#commit=4befa4516fedf1c591fbd4e39476ca67f89af6b2") +sha256sums=('SKIP') +makedepends=('git' 'switch-pkg-config' 'devkitpro-pkgbuild-helpers') +groups=('switch-portlibs') + +pkgver() { + cd "$srcdir/${pkgname}" + printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd ${pkgname} + patch -Np1 -i "$srcdir/../projectM-4befa4516-disable_navtive_preset_factory.patch" + patch -Np1 -i "$srcdir/../projectM-4befa4516-platform_definitions.patch" +} + +build() { + cd ${pkgname} + + source /opt/devkitpro/switchvars.sh + + libtoolize + aclocal + autoheader + automake --add-missing + autoconf + + ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ + --disable-shared --enable-static --disable-threading --disable-sdl + + make +} + +package() { + cd ${pkgname} + + make DESTDIR="$pkgdir" install + + install -Dm644 LICENSE.txt "$pkgdir"/opt/devkitpro/portlibs/switch/licenses/$pkgname/LICENSE +} diff --git a/switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch b/switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch new file mode 100644 index 00000000..3921e9de --- /dev/null +++ b/switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch @@ -0,0 +1,37 @@ +diff --git a/configure.ac b/configure.ac +index 79a42bd7..581596fa 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -65,7 +65,6 @@ AC_CONFIG_FILES([ + src/Makefile + src/libprojectM/Makefile + src/libprojectM/Renderer/Makefile +- src/libprojectM/NativePresetFactory/Makefile + src/libprojectM/MilkdropPresetFactory/Makefile + src/libprojectM/libprojectM.pc + src/NativePresets/Makefile +diff --git a/src/libprojectM/Makefile.am b/src/libprojectM/Makefile.am +index a7799c8f..4887383c 100644 +--- a/src/libprojectM/Makefile.am ++++ b/src/libprojectM/Makefile.am +@@ -1,7 +1,7 @@ + EXTRA_DIST= + CLEANFILES= + +-SUBDIRS=Renderer NativePresetFactory MilkdropPresetFactory ++SUBDIRS=Renderer MilkdropPresetFactory + + AM_CPPFLAGS = \ + ${my_CFLAGS} \ +@@ -16,10 +16,9 @@ lib_LTLIBRARIES = libprojectM.la # public, possibly-shared library + # link flags + libprojectM_la_LDFLAGS = $(CG_LDFLAGS) -no-undefined -version-info 4:1:1 + +-# link libRenderer, MilkdropPresetFactory, NativePresetFactory, and libprojectM sources ++# link libRenderer, MilkdropPresetFactory, and libprojectM sources + libprojectM_la_LIBADD = \ + ../libprojectM/MilkdropPresetFactory/libMilkdropPresetFactory.la \ +-../libprojectM/NativePresetFactory/libNativePresetFactory.la \ + ../libprojectM/Renderer/libRenderer.la + libprojectM_la_SOURCES = ConfigFile.cpp Preset.cpp PresetLoader.cpp timer.cpp \ + KeyHandler.cpp PresetChooser.cpp TimeKeeper.cpp PCM.cpp PresetFactory.cpp \ \ No newline at end of file diff --git a/switch/libprojectM/projectM-4befa4516-platform_definitions.patch b/switch/libprojectM/projectM-4befa4516-platform_definitions.patch new file mode 100644 index 00000000..77a2ccdd --- /dev/null +++ b/switch/libprojectM/projectM-4befa4516-platform_definitions.patch @@ -0,0 +1,171 @@ +diff --git a/src/libprojectM/Common.hpp b/src/libprojectM/Common.hpp +index 45e248a1..b8841dee 100755 +--- a/src/libprojectM/Common.hpp ++++ b/src/libprojectM/Common.hpp +@@ -61,6 +61,10 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); + #define STRING_BUFFER_SIZE 1024*150 + #define STRING_LINE_SIZE 1024 + ++#ifdef __SWITCH__ ++#include ++#define projectM_isnan std::isnan ++#endif + + #ifdef __unix__ + #include +@@ -80,6 +84,10 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); + #define projectM_isnan(x) ((x) != (x)) + #endif + ++#ifdef __SWITCH__ ++#define projectM_fmax fmax ++#endif ++ + #ifdef __unix__ + #define projectM_fmax fmax + #endif +@@ -92,6 +100,10 @@ extern FILE *fmemopen(void *buf, size_t len, const char *pMode); + #define projectM_fmax(x,y) ((x) >= (y) ? (x): (y)) + #endif + ++#ifdef __SWITCH__ ++#define projectM_fmin fmin ++#endif ++ + #ifdef __unix__ + #define projectM_fmin fmin + #endif +diff --git a/src/libprojectM/PresetLoader.cpp b/src/libprojectM/PresetLoader.cpp +index a685d22c..15b5b694 100644 +--- a/src/libprojectM/PresetLoader.cpp ++++ b/src/libprojectM/PresetLoader.cpp +@@ -16,6 +16,13 @@ + #include + #include + ++#ifdef __SWITCH__ ++extern "C" ++{ ++#include ++} ++#endif ++ + #ifdef __unix__ + extern "C" + { +diff --git a/src/libprojectM/PresetLoader.hpp b/src/libprojectM/PresetLoader.hpp +index b6ca2782..2eca5346 100644 +--- a/src/libprojectM/PresetLoader.hpp ++++ b/src/libprojectM/PresetLoader.hpp +@@ -9,6 +9,10 @@ + #include "dirent.h" + #endif + ++#ifdef __SWITCH__ ++#include ++#endif ++ + #ifdef __unix__ + #include + #endif +diff --git a/src/libprojectM/Renderer/TextureManager.cpp b/src/libprojectM/Renderer/TextureManager.cpp +index 9f4ab41f..4fde0e8e 100644 +--- a/src/libprojectM/Renderer/TextureManager.cpp ++++ b/src/libprojectM/Renderer/TextureManager.cpp +@@ -10,6 +10,10 @@ + #include "dirent.h" + #endif + ++#ifdef __SWITCH__ ++#include ++#endif ++ + #ifdef __unix__ + #include + #endif + diff --git a/src/libprojectM/Renderer/hlslparser/src/Engine.cpp b/src/libprojectM/Renderer/hlslparser/src/Engine.cpp +index a7e4f0ed..efe730ed 100755 +--- a/src/libprojectM/Renderer/hlslparser/src/Engine.cpp ++++ b/src/libprojectM/Renderer/hlslparser/src/Engine.cpp +@@ -5,6 +5,27 @@ + #include // strcmp, strcasecmp + #include // strtod, strtol + ++#ifdef __SWITCH__ ++#include // strcasecmp ++#include ++ ++char *strdup(const char *src) ++{ ++ char *str; ++ char *p; ++ int len = 0; ++ ++ while (src[len]) ++ len++; ++ str = (char *)malloc(len + 1); ++ p = str; ++ while (*src) ++ *p++ = *src++; ++ *p = '\0'; ++ return str; ++} ++ ++#endif + + namespace M4 { + +diff --git a/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp b/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp +index 99bcb313..caf63851 100755 +--- a/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp ++++ b/src/libprojectM/Renderer/hlslparser/src/HLSLParser.cpp +@@ -24,6 +24,9 @@ + #include + #endif /** WIN32 */ + ++#ifdef __SWITCH__ ++#include ++#endif + + namespace M4 + { +diff --git a/src/libprojectM/projectM.cpp b/src/libprojectM/projectM.cpp +index fcda10c7..0768035f 100755 +--- a/src/libprojectM/projectM.cpp ++++ b/src/libprojectM/projectM.cpp +@@ -30,6 +30,10 @@ + + #include "timer.h" + #include ++#ifdef __SWITCH__ ++#include "time.h" ++#endif ++ + #ifdef __unix__ + #include "time.h" + #endif +@@ -179,6 +183,10 @@ void projectM::readConfig (const std::string & configFile ) + ( "Smooth Preset Duration", config.read("Smooth Transition Duration", 10)); + _settings.presetDuration = config.read ( "Preset Duration", 15 ); + ++#ifdef __SWITCH__ ++ _settings.presetURL = config.read ( "Preset Path", "/projectM/presets" ); ++#endif ++ + #ifdef __unix__ + _settings.presetURL = config.read ( "Preset Path", "/usr/local/share/projectM/presets" ); + #endif +@@ -199,6 +207,13 @@ void projectM::readConfig (const std::string & configFile ) + ( "Menu Font", "../Resources/fonts/VeraMono.ttf"); + #endif + ++#ifdef __SWITCH__ ++ _settings.titleFontURL = config.read ++ ( "Title Font", "/projectM/fonts/Vera.tff" ); ++ _settings.menuFontURL = config.read ++ ( "Menu Font", "/projectM/fonts/VeraMono.tff" ); ++#endif ++ + #ifdef __unix__ + _settings.titleFontURL = config.read + ( "Title Font", "/usr/local/share/projectM/fonts/Vera.tff" ); From 2b775d8e8a070e037295c18337f099db0815dffa Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Sat, 26 Oct 2019 22:41:00 +1300 Subject: [PATCH 2/8] Added ftgl font renderer support --- switch/libprojectM/PKGBUILD | 14 +++++--- ...4516-disable_navtive_preset_factory.patch} | 0 ...-4befa4516-disable_render_draw_stats.patch | 21 +++++++++++ ...m-4befa4516-enable_ftgl_font_support.patch | 36 +++++++++++++++++++ ...ectm-4befa4516-platform_definitions.patch} | 0 5 files changed, 66 insertions(+), 5 deletions(-) rename switch/libprojectM/{projectM-4befa4516-disable_navtive_preset_factory.patch => libprojectm-4befa4516-disable_navtive_preset_factory.patch} (100%) create mode 100644 switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch create mode 100644 switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch rename switch/libprojectM/{projectM-4befa4516-platform_definitions.patch => libprojectm-4befa4516-platform_definitions.patch} (100%) diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD index fdb7bd93..634c109e 100644 --- a/switch/libprojectM/PKGBUILD +++ b/switch/libprojectM/PKGBUILD @@ -1,6 +1,7 @@ # Maintainer: Rhys Koedijk -pkgname=switch-libprojectm +pkgbasename=libprojectm +pkgname=switch-$pkgbasename pkgver=r1866.4befa4516 pkgrel=1 pkgdesc='Cross-platform music visualization. Open-source and Milkdrop-compatible' @@ -8,8 +9,9 @@ arch=('any') url='https://github.com/projectM-visualizer/projectm' license=('(L)GPL') options=(!strip libtool staticlibs) -source=(${pkgname}::"git+https://github.com/projectM-visualizer/projectm.git#commit=4befa4516fedf1c591fbd4e39476ca67f89af6b2") +source=(${pkgname}::"git+${url}.git#commit=4befa4516fedf1c591fbd4e39476ca67f89af6b2") sha256sums=('SKIP') +depends=('switch-ftgl' 'switch-glfw') makedepends=('git' 'switch-pkg-config' 'devkitpro-pkgbuild-helpers') groups=('switch-portlibs') @@ -20,8 +22,10 @@ pkgver() { prepare() { cd ${pkgname} - patch -Np1 -i "$srcdir/../projectM-4befa4516-disable_navtive_preset_factory.patch" - patch -Np1 -i "$srcdir/../projectM-4befa4516-platform_definitions.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-enable_ftgl_font_support.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-platform_definitions.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_render_draw_stats.patch" } build() { @@ -36,7 +40,7 @@ build() { autoconf ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ - --disable-shared --enable-static --disable-threading --disable-sdl + --disable-shared --enable-static --disable-threading --disable-sdl --enable-ftgl make } diff --git a/switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch b/switch/libprojectM/libprojectm-4befa4516-disable_navtive_preset_factory.patch similarity index 100% rename from switch/libprojectM/projectM-4befa4516-disable_navtive_preset_factory.patch rename to switch/libprojectM/libprojectm-4befa4516-disable_navtive_preset_factory.patch diff --git a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch new file mode 100644 index 00000000..e10aaecb --- /dev/null +++ b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch @@ -0,0 +1,21 @@ +diff --git a/src/libprojectM/Renderer/Renderer.cpp b/src/libprojectM/Renderer/Renderer.cpp +index 7b46f79..1c558cb 100644 +--- a/src/libprojectM/Renderer/Renderer.cpp ++++ b/src/libprojectM/Renderer/Renderer.cpp +@@ -700,6 +700,7 @@ void Renderer::draw_stats() + { + + #ifdef USE_FTGL ++/* + char buffer[128]; + float offset = (this->showfps % 2 ? -0.05 : 0.0); + // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); +@@ -748,7 +749,7 @@ void Renderer::draw_stats() + glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + +- ++*/ + #endif /** USE_FTGL */ + } + void Renderer::draw_fps() \ No newline at end of file diff --git a/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch b/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch new file mode 100644 index 00000000..2592dce0 --- /dev/null +++ b/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch @@ -0,0 +1,36 @@ +diff --git a/configure.ac b/configure.ac +index 581596f..3f24065 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -77,6 +77,15 @@ AC_CONFIG_FILES([ + ]) + + ++# FTGL ++AC_ARG_ENABLE([ftgl], AS_HELP_STRING([--enable-ftgl], [font support]), [], [enable_ftgl=check]) ++AS_IF([test "$enable_ftgl" != "no"], [ ++ AC_DEFINE([USE_FTGL], [1], [Define USE_FTGL]) ++ CFLAGS="$CFLAGS `freetype-config --cflags`" ++ CXXFLAGS="$CXXFLAGS `freetype-config --cflags`" ++]) ++ ++ + # SDL + AC_ARG_ENABLE([sdl], AS_HELP_STRING([--enable-sdl], [Build SDL2 application]), [], [enable_sdl=check]) + AS_IF([test "$enable_sdl" != "no"], [ +@@ -221,6 +228,7 @@ AS_IF([test "$enable_jack" != "no"], + [enable_jack=no])])]) + + ++AM_CONDITIONAL([ENABLE_FTGL], [test "x$enable_ftgl" = "xyes"]) + AM_CONDITIONAL([ENABLE_SDL], [test "x$enable_sdl" = "xyes"]) + AM_CONDITIONAL([ENABLE_QT], [test "x$enable_qt" = "xyes"]) + AM_CONDITIONAL([ENABLE_JACK], [test "x$enable_jack" = "xyes"]) +@@ -261,6 +269,7 @@ Applications: + + libprojectM: yes + Threading: ${enable_threading} ++Fonts: ${enable_ftgl} + SDL: ${enable_sdl} + Qt: ${enable_qt} + Pulseaudio: ${enable_pulseaudio} \ No newline at end of file diff --git a/switch/libprojectM/projectM-4befa4516-platform_definitions.patch b/switch/libprojectM/libprojectm-4befa4516-platform_definitions.patch similarity index 100% rename from switch/libprojectM/projectM-4befa4516-platform_definitions.patch rename to switch/libprojectM/libprojectm-4befa4516-platform_definitions.patch From 3d422caca47b1912d5e1d3bdc1fea99c34a89949 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Sun, 27 Oct 2019 23:28:49 +1300 Subject: [PATCH 3/8] Build improvements --- switch/libprojectM/PKGBUILD | 10 +++--- ...46a1fb7-configure-ac-enable-ftgl-arg.patch | 33 +++++++++++++++++ ...m-4befa4516-enable_ftgl_font_support.patch | 36 ------------------- 3 files changed, 38 insertions(+), 41 deletions(-) create mode 100644 switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch delete mode 100644 switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD index 634c109e..c6989412 100644 --- a/switch/libprojectM/PKGBUILD +++ b/switch/libprojectM/PKGBUILD @@ -2,16 +2,16 @@ pkgbasename=libprojectm pkgname=switch-$pkgbasename -pkgver=r1866.4befa4516 +pkgver=r1871.0e46a1fb7 pkgrel=1 pkgdesc='Cross-platform music visualization. Open-source and Milkdrop-compatible' arch=('any') url='https://github.com/projectM-visualizer/projectm' license=('(L)GPL') options=(!strip libtool staticlibs) -source=(${pkgname}::"git+${url}.git#commit=4befa4516fedf1c591fbd4e39476ca67f89af6b2") +source=(${pkgname}::"git+${url}.git#commit=0e46a1fb785851870f030cec8368faba13882f13") sha256sums=('SKIP') -depends=('switch-ftgl' 'switch-glfw') +depends=('switch-ftgl' 'switch-mesa') makedepends=('git' 'switch-pkg-config' 'devkitpro-pkgbuild-helpers') groups=('switch-portlibs') @@ -22,10 +22,10 @@ pkgver() { prepare() { cd ${pkgname} - patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" - patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-enable_ftgl_font_support.patch" patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-platform_definitions.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_render_draw_stats.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-0e46a1fb7-configure-ac-enable-ftgl-arg.patch" } build() { diff --git a/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch b/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch new file mode 100644 index 00000000..a6bed613 --- /dev/null +++ b/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch @@ -0,0 +1,33 @@ +diff --git a/configure.ac b/configure.ac +index 79a42bd..1c6c967 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -123,6 +123,20 @@ AS_IF([test "x$enable_threading" = "xyes" && ! test "$EMSCRIPTEN"], [ + ]) + ]) + ++# FTGL ++AC_ARG_ENABLE([ftgl], ++ AS_HELP_STRING([--enable-ftgl], [FTGL support to display text such as preset title, stats, fps, ...]), ++ [], [enable_ftgl=check]) ++AS_IF([test "$enable_ftgl" != "no"], [ ++ PKG_CHECK_MODULES([FTGL], [ftgl], [ ++ AC_DEFINE([USE_FTGL], [1], [Define USE_FTGL]) ++ ], ++ [ ++ AS_IF([test "$enable_ftgl" = "yes"], AC_MSG_ERROR([*** libftgl not found!])) ++ enable_ftgl=no ++ ]) ++]) ++ + AC_ARG_ENABLE([gles], + AS_HELP_STRING([--enable-gles], [OpenGL ES support]), + [], [enable_gles=no]) +@@ -266,6 +280,7 @@ SDL: ${enable_sdl} + Qt: ${enable_qt} + Pulseaudio: ${enable_pulseaudio} + Jack: ${enable_jack} ++FTGL: ${enable_ftgl} + OpenGLES: ${enable_gles} + Emscripten: ${enable_emscripten} + llvm: ${enable_llvm} \ No newline at end of file diff --git a/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch b/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch deleted file mode 100644 index 2592dce0..00000000 --- a/switch/libprojectM/libprojectm-4befa4516-enable_ftgl_font_support.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 581596f..3f24065 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -77,6 +77,15 @@ AC_CONFIG_FILES([ - ]) - - -+# FTGL -+AC_ARG_ENABLE([ftgl], AS_HELP_STRING([--enable-ftgl], [font support]), [], [enable_ftgl=check]) -+AS_IF([test "$enable_ftgl" != "no"], [ -+ AC_DEFINE([USE_FTGL], [1], [Define USE_FTGL]) -+ CFLAGS="$CFLAGS `freetype-config --cflags`" -+ CXXFLAGS="$CXXFLAGS `freetype-config --cflags`" -+]) -+ -+ - # SDL - AC_ARG_ENABLE([sdl], AS_HELP_STRING([--enable-sdl], [Build SDL2 application]), [], [enable_sdl=check]) - AS_IF([test "$enable_sdl" != "no"], [ -@@ -221,6 +228,7 @@ AS_IF([test "$enable_jack" != "no"], - [enable_jack=no])])]) - - -+AM_CONDITIONAL([ENABLE_FTGL], [test "x$enable_ftgl" = "xyes"]) - AM_CONDITIONAL([ENABLE_SDL], [test "x$enable_sdl" = "xyes"]) - AM_CONDITIONAL([ENABLE_QT], [test "x$enable_qt" = "xyes"]) - AM_CONDITIONAL([ENABLE_JACK], [test "x$enable_jack" = "xyes"]) -@@ -261,6 +269,7 @@ Applications: - - libprojectM: yes - Threading: ${enable_threading} -+Fonts: ${enable_ftgl} - SDL: ${enable_sdl} - Qt: ${enable_qt} - Pulseaudio: ${enable_pulseaudio} \ No newline at end of file From e8764df9ebcbe330018b8c93bfcc4fb2cd35603a Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 28 Oct 2019 00:05:44 +1300 Subject: [PATCH 4/8] Build improvements --- ...projectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch b/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch index a6bed613..048badf4 100644 --- a/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch +++ b/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch @@ -1,8 +1,8 @@ diff --git a/configure.ac b/configure.ac -index 79a42bd..1c6c967 100644 +index 581596f..44c5167 100644 --- a/configure.ac +++ b/configure.ac -@@ -123,6 +123,20 @@ AS_IF([test "x$enable_threading" = "xyes" && ! test "$EMSCRIPTEN"], [ +@@ -122,6 +122,23 @@ AS_IF([test "x$enable_threading" = "xyes" && ! test "$EMSCRIPTEN"], [ ]) ]) @@ -13,6 +13,9 @@ index 79a42bd..1c6c967 100644 +AS_IF([test "$enable_ftgl" != "no"], [ + PKG_CHECK_MODULES([FTGL], [ftgl], [ + AC_DEFINE([USE_FTGL], [1], [Define USE_FTGL]) ++ CFLAGS="$CFLAGS ${FTGL_CFLAGS}" ++ CXXFLAGS="$CXXFLAGS ${FTGL_CFLAGS}" ++ LIBS="$LIBS ${FTGL_LIBS}" + ], + [ + AS_IF([test "$enable_ftgl" = "yes"], AC_MSG_ERROR([*** libftgl not found!])) @@ -23,7 +26,7 @@ index 79a42bd..1c6c967 100644 AC_ARG_ENABLE([gles], AS_HELP_STRING([--enable-gles], [OpenGL ES support]), [], [enable_gles=no]) -@@ -266,6 +280,7 @@ SDL: ${enable_sdl} +@@ -265,6 +282,7 @@ SDL: ${enable_sdl} Qt: ${enable_qt} Pulseaudio: ${enable_pulseaudio} Jack: ${enable_jack} From 607cdd5a4df7f958f08f190e081ab0556b9f7d38 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 28 Oct 2019 01:24:52 +1300 Subject: [PATCH 5/8] Better build support for ftgl --- switch/libprojectM/PKGBUILD | 3 +-- ...6a1fb7-configure_ac_enable_ftgl_arg.patch} | 0 ...-4befa4516-disable_render_draw_stats.patch | 21 ------------------- 3 files changed, 1 insertion(+), 23 deletions(-) rename switch/libprojectM/{libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch => libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch} (100%) delete mode 100644 switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD index c6989412..22499595 100644 --- a/switch/libprojectM/PKGBUILD +++ b/switch/libprojectM/PKGBUILD @@ -24,8 +24,7 @@ prepare() { cd ${pkgname} patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-platform_definitions.patch" patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" - patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_render_draw_stats.patch" - patch -Np1 -i "${startdir}/${pkgbasename}-0e46a1fb7-configure-ac-enable-ftgl-arg.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-0e46a1fb7-configure_ac_enable_ftgl_arg.patch" } build() { diff --git a/switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch b/switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch similarity index 100% rename from switch/libprojectM/libprojectm-0e46a1fb7-configure-ac-enable-ftgl-arg.patch rename to switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch diff --git a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch deleted file mode 100644 index e10aaecb..00000000 --- a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/libprojectM/Renderer/Renderer.cpp b/src/libprojectM/Renderer/Renderer.cpp -index 7b46f79..1c558cb 100644 ---- a/src/libprojectM/Renderer/Renderer.cpp -+++ b/src/libprojectM/Renderer/Renderer.cpp -@@ -700,6 +700,7 @@ void Renderer::draw_stats() - { - - #ifdef USE_FTGL -+/* - char buffer[128]; - float offset = (this->showfps % 2 ? -0.05 : 0.0); - // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); -@@ -748,7 +749,7 @@ void Renderer::draw_stats() - glPopMatrix(); - // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - -- -+*/ - #endif /** USE_FTGL */ - } - void Renderer::draw_fps() \ No newline at end of file From 093d22c78e5e2481ce40b3f962658e954f0e8585 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 28 Oct 2019 01:40:30 +1300 Subject: [PATCH 6/8] disable ftgl support for now, causes undefined references when linking --- switch/libprojectM/PKGBUILD | 3 ++- ...-4befa4516-disable_render_draw_stats.patch | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD index 22499595..34d54a6c 100644 --- a/switch/libprojectM/PKGBUILD +++ b/switch/libprojectM/PKGBUILD @@ -24,6 +24,7 @@ prepare() { cd ${pkgname} patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-platform_definitions.patch" patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" + patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_render_draw_stats.patch" patch -Np1 -i "${startdir}/${pkgbasename}-0e46a1fb7-configure_ac_enable_ftgl_arg.patch" } @@ -39,7 +40,7 @@ build() { autoconf ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ - --disable-shared --enable-static --disable-threading --disable-sdl --enable-ftgl + --disable-shared --enable-static --disable-threading --disable-sdl --disable-ftgl make } diff --git a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch new file mode 100644 index 00000000..e10aaecb --- /dev/null +++ b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch @@ -0,0 +1,21 @@ +diff --git a/src/libprojectM/Renderer/Renderer.cpp b/src/libprojectM/Renderer/Renderer.cpp +index 7b46f79..1c558cb 100644 +--- a/src/libprojectM/Renderer/Renderer.cpp ++++ b/src/libprojectM/Renderer/Renderer.cpp +@@ -700,6 +700,7 @@ void Renderer::draw_stats() + { + + #ifdef USE_FTGL ++/* + char buffer[128]; + float offset = (this->showfps % 2 ? -0.05 : 0.0); + // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); +@@ -748,7 +749,7 @@ void Renderer::draw_stats() + glPopMatrix(); + // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + +- ++*/ + #endif /** USE_FTGL */ + } + void Renderer::draw_fps() \ No newline at end of file From 84a8fa10e9d1835049a86d21ccf1319458171802 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 4 Nov 2019 14:27:44 +1300 Subject: [PATCH 7/8] Removed .gitignore --- switch/libprojectM/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 switch/libprojectM/.gitignore diff --git a/switch/libprojectM/.gitignore b/switch/libprojectM/.gitignore deleted file mode 100644 index 7ffa7ad2..00000000 --- a/switch/libprojectM/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.tgz -switch-libprojectm \ No newline at end of file From 8a28b6a1cb6112c906ce1b3329ef15a4f5c0dc55 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Mon, 4 Nov 2019 14:29:41 +1300 Subject: [PATCH 8/8] Disable FTGL support entirely (https://github.com/projectM-visualizer/projectm/issues/261) --- switch/libprojectM/PKGBUILD | 4 +-- ...46a1fb7-configure_ac_enable_ftgl_arg.patch | 36 ------------------- ...-4befa4516-disable_render_draw_stats.patch | 21 ----------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch delete mode 100644 switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch diff --git a/switch/libprojectM/PKGBUILD b/switch/libprojectM/PKGBUILD index 34d54a6c..d8c20809 100644 --- a/switch/libprojectM/PKGBUILD +++ b/switch/libprojectM/PKGBUILD @@ -24,8 +24,6 @@ prepare() { cd ${pkgname} patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-platform_definitions.patch" patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_navtive_preset_factory.patch" - patch -Np1 -i "${startdir}/${pkgbasename}-4befa4516-disable_render_draw_stats.patch" - patch -Np1 -i "${startdir}/${pkgbasename}-0e46a1fb7-configure_ac_enable_ftgl_arg.patch" } build() { @@ -40,7 +38,7 @@ build() { autoconf ./configure --prefix="${PORTLIBS_PREFIX}" --host=aarch64-none-elf \ - --disable-shared --enable-static --disable-threading --disable-sdl --disable-ftgl + --disable-shared --enable-static --disable-threading --disable-sdl make } diff --git a/switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch b/switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch deleted file mode 100644 index 048badf4..00000000 --- a/switch/libprojectM/libprojectm-0e46a1fb7-configure_ac_enable_ftgl_arg.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 581596f..44c5167 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -122,6 +122,23 @@ AS_IF([test "x$enable_threading" = "xyes" && ! test "$EMSCRIPTEN"], [ - ]) - ]) - -+# FTGL -+AC_ARG_ENABLE([ftgl], -+ AS_HELP_STRING([--enable-ftgl], [FTGL support to display text such as preset title, stats, fps, ...]), -+ [], [enable_ftgl=check]) -+AS_IF([test "$enable_ftgl" != "no"], [ -+ PKG_CHECK_MODULES([FTGL], [ftgl], [ -+ AC_DEFINE([USE_FTGL], [1], [Define USE_FTGL]) -+ CFLAGS="$CFLAGS ${FTGL_CFLAGS}" -+ CXXFLAGS="$CXXFLAGS ${FTGL_CFLAGS}" -+ LIBS="$LIBS ${FTGL_LIBS}" -+ ], -+ [ -+ AS_IF([test "$enable_ftgl" = "yes"], AC_MSG_ERROR([*** libftgl not found!])) -+ enable_ftgl=no -+ ]) -+]) -+ - AC_ARG_ENABLE([gles], - AS_HELP_STRING([--enable-gles], [OpenGL ES support]), - [], [enable_gles=no]) -@@ -265,6 +282,7 @@ SDL: ${enable_sdl} - Qt: ${enable_qt} - Pulseaudio: ${enable_pulseaudio} - Jack: ${enable_jack} -+FTGL: ${enable_ftgl} - OpenGLES: ${enable_gles} - Emscripten: ${enable_emscripten} - llvm: ${enable_llvm} \ No newline at end of file diff --git a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch b/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch deleted file mode 100644 index e10aaecb..00000000 --- a/switch/libprojectM/libprojectm-4befa4516-disable_render_draw_stats.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/libprojectM/Renderer/Renderer.cpp b/src/libprojectM/Renderer/Renderer.cpp -index 7b46f79..1c558cb 100644 ---- a/src/libprojectM/Renderer/Renderer.cpp -+++ b/src/libprojectM/Renderer/Renderer.cpp -@@ -700,6 +700,7 @@ void Renderer::draw_stats() - { - - #ifdef USE_FTGL -+/* - char buffer[128]; - float offset = (this->showfps % 2 ? -0.05 : 0.0); - // glBlendFunc(GL_ONE_MINUS_DST_COLOR,GL_ZERO); -@@ -748,7 +749,7 @@ void Renderer::draw_stats() - glPopMatrix(); - // glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - -- -+*/ - #endif /** USE_FTGL */ - } - void Renderer::draw_fps() \ No newline at end of file