diff --git a/CMakeLists.txt b/CMakeLists.txt index 98ed936..cc24333 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,7 +361,27 @@ if (DEFINED ANDROID_NDK) add_subdirectory(subprojects/oboe) target_link_libraries(liblooper PUBLIC oboe) endif() -target_link_libraries(liblooper PUBLIC fmt::fmt) +pkg_check_modules(libxspf IMPORTED_TARGET libxspf) +if (NOT libxspf_FOUND) + include(ExternalProject) + set(XSPF ${CMAKE_BINARY_DIR}/libxspf-prefix/src/libxspf-build/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}xspf${CMAKE_STATIC_LIBRARY_SUFFIX}) + ExternalProject_Add(libxspf + URL https://ftp.osuosl.org/pub/xiph/releases/xspf/libxspf-1.2.0.tar.lzma + PATCH_COMMAND cd && patch -Np1 -i ${CMAKE_SOURCE_DIR}/xspf-no-examples.patch + CONFIGURE_COMMAND /configure --disable-test --enable-static --disable-shared + BUILD_COMMAND make + INSTALL_COMMAND make install DESTDIR= + TEST_COMMAND "" + BUILD_BYPRODUCTS ${XSPF}) + ExternalProject_Get_Property(libxspf install_dir) + include_directories(${install_dir}/include) + + add_dependencies(liblooper libxspf) +else() + set(XSPF PkgConfig::libxspf) +endif() + +target_link_libraries(liblooper PUBLIC fmt::fmt ${XSPF}) target_include_directories(liblooper PUBLIC ${LIBINTL_INCDIRS}) target_link_libraries(liblooper PUBLIC ${LIBINTL_LIBRARY}) if(DEFINED EMSCRIPTEN) @@ -540,7 +560,7 @@ if(DEFINED EMSCRIPTEN) copy_to_bindir(assets/ForkAwesome/css/fork-awesome.min.css fork-awesome.min.css) copy_to_bindir(assets/ForkAwesome/css/fork-awesome.min.css.map fork-awesome.min.css.map) endif() -target_link_libraries(${TARGET_NAME} PUBLIC liblooper ${UI_BACKENDS} ${PLAYBACK_BACKENDS} vorbis mpg123) +target_link_libraries(${TARGET_NAME} PUBLIC liblooper ${UI_BACKENDS} ${PLAYBACK_BACKENDS}) install(TARGETS ${TARGET_NAME} ${EXTRA_LIBS}) if (${BUILD_SDL2}) install(EXPORT SDL2-static SDL2main) diff --git a/xspf-no-examples.patch b/xspf-no-examples.patch new file mode 100644 index 0000000..fddb904 --- /dev/null +++ b/xspf-no-examples.patch @@ -0,0 +1,292 @@ +diff '--color=auto' -u -r a/Makefile.am b/Makefile.am +--- a/Makefile.am 2024-11-25 11:06:27.730127246 -0800 ++++ b/Makefile.am 2024-11-25 11:07:34.874500429 -0800 +@@ -12,14 +12,6 @@ + + lib_LTLIBRARIES = libxspf.la + +-bin_PROGRAMS = \ +- examples/check/xspf_check \ +- examples/strip/xspf_strip +- +-noinst_PROGRAMS = \ +- examples/read/example_read \ +- examples/write/example_write +- + if XSPF_TEST_ENABLED + check_PROGRAMS = test/xspf_test + endif +@@ -33,7 +25,6 @@ + + ## Libtool workaround for distcheck + clean-local: +- -rm -f examples/*/.libs/* + if XSPF_TEST_ENABLED + -rm -f test/.libs/* + endif +@@ -116,33 +107,6 @@ + + + +-examples_check_xspf_check_LDADD = libxspf.la +- +-examples_check_xspf_check_SOURCES = \ +- examples/check/check.cpp +- +- +- +-examples_read_example_read_LDADD = libxspf.la +- +-examples_read_example_read_SOURCES = \ +- examples/read/read.cpp +- +- +- +-examples_strip_xspf_strip_LDADD = libxspf.la +- +-examples_strip_xspf_strip_SOURCES = \ +- examples/strip/strip.cpp +- +- +- +-examples_write_example_write_LDADD = libxspf.la +- +-examples_write_example_write_SOURCES = \ +- examples/write/write.cpp +- +- + if XSPF_TEST_ENABLED + test_xspf_test_CFLAGS = @CPPTEST_CFLAGS@ + +@@ -199,8 +163,6 @@ + doc/Makefile.in \ + doc/release.sh.in \ + \ +- examples/read/playlist.xspf \ +- \ + m4/pkg.m4 \ + \ + test/for_version_0/fail/playlist-extension-forbidden.xspf \ +diff '--color=auto' -u -r a/Makefile.in b/Makefile.in +--- a/Makefile.in 2024-11-25 11:06:27.730127246 -0800 ++++ b/Makefile.in 2024-11-25 11:13:35.546912479 -0800 +@@ -35,10 +35,6 @@ + POST_UNINSTALL = : + build_triplet = @build@ + host_triplet = @host@ +-bin_PROGRAMS = examples/check/xspf_check$(EXEEXT) \ +- examples/strip/xspf_strip$(EXEEXT) +-noinst_PROGRAMS = examples/read/example_read$(EXEEXT) \ +- examples/write/example_write$(EXEEXT) + @XSPF_TEST_ENABLED_TRUE@check_PROGRAMS = test/xspf_test$(EXEEXT) + TESTS = test/xspf_test$(EXEEXT) + subdir = . +@@ -89,24 +85,6 @@ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libxspf_la_LDFLAGS) $(LDFLAGS) -o $@ + binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +-am_examples_check_xspf_check_OBJECTS = examples/check/check.$(OBJEXT) +-examples_check_xspf_check_OBJECTS = \ +- $(am_examples_check_xspf_check_OBJECTS) +-examples_check_xspf_check_DEPENDENCIES = libxspf.la +-am_examples_read_example_read_OBJECTS = examples/read/read.$(OBJEXT) +-examples_read_example_read_OBJECTS = \ +- $(am_examples_read_example_read_OBJECTS) +-examples_read_example_read_DEPENDENCIES = libxspf.la +-am_examples_strip_xspf_strip_OBJECTS = examples/strip/strip.$(OBJEXT) +-examples_strip_xspf_strip_OBJECTS = \ +- $(am_examples_strip_xspf_strip_OBJECTS) +-examples_strip_xspf_strip_DEPENDENCIES = libxspf.la +-am_examples_write_example_write_OBJECTS = \ +- examples/write/write.$(OBJEXT) +-examples_write_example_write_OBJECTS = \ +- $(am_examples_write_example_write_OBJECTS) +-examples_write_example_write_DEPENDENCIES = libxspf.la + am__test_xspf_test_SOURCES_DIST = \ + test/ProjectOpus/ProjectOpusSuite.cpp \ + test/ProjectOpus/ProjectOpusSuite.h \ +@@ -155,16 +133,9 @@ + LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +-SOURCES = $(libxspf_la_SOURCES) $(examples_check_xspf_check_SOURCES) \ +- $(examples_read_example_read_SOURCES) \ +- $(examples_strip_xspf_strip_SOURCES) \ +- $(examples_write_example_write_SOURCES) \ ++SOURCES = $(libxspf_la_SOURCES) \ + $(test_xspf_test_SOURCES) + DIST_SOURCES = $(libxspf_la_SOURCES) \ +- $(examples_check_xspf_check_SOURCES) \ +- $(examples_read_example_read_SOURCES) \ +- $(examples_strip_xspf_strip_SOURCES) \ +- $(examples_write_example_write_SOURCES) \ + $(am__test_xspf_test_SOURCES_DIST) + RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ +@@ -387,22 +358,6 @@ + include/xspf/ProjectOpus/ProjectOpusPlaylistExtensionReader.h \ + include/xspf/ProjectOpus/ProjectOpusPlaylistExtensionWriter.h + +-examples_check_xspf_check_LDADD = libxspf.la +-examples_check_xspf_check_SOURCES = \ +- examples/check/check.cpp +- +-examples_read_example_read_LDADD = libxspf.la +-examples_read_example_read_SOURCES = \ +- examples/read/read.cpp +- +-examples_strip_xspf_strip_LDADD = libxspf.la +-examples_strip_xspf_strip_SOURCES = \ +- examples/strip/strip.cpp +- +-examples_write_example_write_LDADD = libxspf.la +-examples_write_example_write_SOURCES = \ +- examples/write/write.cpp +- + @XSPF_TEST_ENABLED_TRUE@test_xspf_test_CFLAGS = @CPPTEST_CFLAGS@ + @XSPF_TEST_ENABLED_TRUE@test_xspf_test_LDFLAGS = @CPPTEST_LIBS@ + @XSPF_TEST_ENABLED_TRUE@test_xspf_test_LDADD = libxspf.la +@@ -452,8 +407,6 @@ + doc/Makefile.in \ + doc/release.sh.in \ + \ +- examples/read/playlist.xspf \ +- \ + m4/pkg.m4 \ + \ + test/for_version_0/fail/playlist-extension-forbidden.xspf \ +@@ -554,8 +507,6 @@ + test/for_version_1/pass/track-whitespace-anyURI.xspf \ + test/for_version_1/pass/track-whitespace-nonNegativeInteger.xspf \ + \ +- test/ProjectOpus/Example.xspf \ +- \ + win32/Code_Blocks/libxspf.cbp \ + win32/Code_Blocks/libxspf.workspace \ + \ +@@ -750,50 +701,6 @@ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +-examples/check/$(am__dirstamp): +- @$(MKDIR_P) examples/check +- @: > examples/check/$(am__dirstamp) +-examples/check/$(DEPDIR)/$(am__dirstamp): +- @$(MKDIR_P) examples/check/$(DEPDIR) +- @: > examples/check/$(DEPDIR)/$(am__dirstamp) +-examples/check/check.$(OBJEXT): examples/check/$(am__dirstamp) \ +- examples/check/$(DEPDIR)/$(am__dirstamp) +-examples/check/xspf_check$(EXEEXT): $(examples_check_xspf_check_OBJECTS) $(examples_check_xspf_check_DEPENDENCIES) examples/check/$(am__dirstamp) +- @rm -f examples/check/xspf_check$(EXEEXT) +- $(CXXLINK) $(examples_check_xspf_check_OBJECTS) $(examples_check_xspf_check_LDADD) $(LIBS) +-examples/read/$(am__dirstamp): +- @$(MKDIR_P) examples/read +- @: > examples/read/$(am__dirstamp) +-examples/read/$(DEPDIR)/$(am__dirstamp): +- @$(MKDIR_P) examples/read/$(DEPDIR) +- @: > examples/read/$(DEPDIR)/$(am__dirstamp) +-examples/read/read.$(OBJEXT): examples/read/$(am__dirstamp) \ +- examples/read/$(DEPDIR)/$(am__dirstamp) +-examples/read/example_read$(EXEEXT): $(examples_read_example_read_OBJECTS) $(examples_read_example_read_DEPENDENCIES) examples/read/$(am__dirstamp) +- @rm -f examples/read/example_read$(EXEEXT) +- $(CXXLINK) $(examples_read_example_read_OBJECTS) $(examples_read_example_read_LDADD) $(LIBS) +-examples/strip/$(am__dirstamp): +- @$(MKDIR_P) examples/strip +- @: > examples/strip/$(am__dirstamp) +-examples/strip/$(DEPDIR)/$(am__dirstamp): +- @$(MKDIR_P) examples/strip/$(DEPDIR) +- @: > examples/strip/$(DEPDIR)/$(am__dirstamp) +-examples/strip/strip.$(OBJEXT): examples/strip/$(am__dirstamp) \ +- examples/strip/$(DEPDIR)/$(am__dirstamp) +-examples/strip/xspf_strip$(EXEEXT): $(examples_strip_xspf_strip_OBJECTS) $(examples_strip_xspf_strip_DEPENDENCIES) examples/strip/$(am__dirstamp) +- @rm -f examples/strip/xspf_strip$(EXEEXT) +- $(CXXLINK) $(examples_strip_xspf_strip_OBJECTS) $(examples_strip_xspf_strip_LDADD) $(LIBS) +-examples/write/$(am__dirstamp): +- @$(MKDIR_P) examples/write +- @: > examples/write/$(am__dirstamp) +-examples/write/$(DEPDIR)/$(am__dirstamp): +- @$(MKDIR_P) examples/write/$(DEPDIR) +- @: > examples/write/$(DEPDIR)/$(am__dirstamp) +-examples/write/write.$(OBJEXT): examples/write/$(am__dirstamp) \ +- examples/write/$(DEPDIR)/$(am__dirstamp) +-examples/write/example_write$(EXEEXT): $(examples_write_example_write_OBJECTS) $(examples_write_example_write_DEPENDENCIES) examples/write/$(am__dirstamp) +- @rm -f examples/write/example_write$(EXEEXT) +- $(CXXLINK) $(examples_write_example_write_OBJECTS) $(examples_write_example_write_LDADD) $(LIBS) + test/ProjectOpus/$(am__dirstamp): + @$(MKDIR_P) test/ProjectOpus + @: > test/ProjectOpus/$(am__dirstamp) +@@ -835,10 +742,6 @@ + -rm -f *.$(OBJEXT) + -rm -f bindings/c/xspf_c.$(OBJEXT) + -rm -f bindings/c/xspf_c.lo +- -rm -f examples/check/check.$(OBJEXT) +- -rm -f examples/read/read.$(OBJEXT) +- -rm -f examples/strip/strip.$(OBJEXT) +- -rm -f examples/write/write.$(OBJEXT) + -rm -f src/ProjectOpus/ProjectOpusPlaylistExtension.$(OBJEXT) + -rm -f src/ProjectOpus/ProjectOpusPlaylistExtension.lo + -rm -f src/ProjectOpus/ProjectOpusPlaylistExtensionReader.$(OBJEXT) +@@ -902,10 +805,6 @@ + -rm -f *.tab.c + + @AMDEP_TRUE@@am__include@ @am__quote@bindings/c/$(DEPDIR)/xspf_c.Plo@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@examples/check/$(DEPDIR)/check.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@examples/read/$(DEPDIR)/read.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@examples/strip/$(DEPDIR)/strip.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@examples/write/$(DEPDIR)/write.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/XspfChunkCallback.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/XspfData.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/XspfDataWriter.Plo@am__quote@ +@@ -1111,10 +1010,6 @@ + clean-libtool: + -rm -rf .libs _libs + -rm -rf bindings/c/.libs bindings/c/_libs +- -rm -rf examples/check/.libs examples/check/_libs +- -rm -rf examples/read/.libs examples/read/_libs +- -rm -rf examples/strip/.libs examples/strip/_libs +- -rm -rf examples/write/.libs examples/write/_libs + -rm -rf src/.libs src/_libs + -rm -rf src/ProjectOpus/.libs src/ProjectOpus/_libs + -rm -rf test/.libs test/_libs +@@ -1572,14 +1467,6 @@ + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f bindings/c/$(DEPDIR)/$(am__dirstamp) + -rm -f bindings/c/$(am__dirstamp) +- -rm -f examples/check/$(DEPDIR)/$(am__dirstamp) +- -rm -f examples/check/$(am__dirstamp) +- -rm -f examples/read/$(DEPDIR)/$(am__dirstamp) +- -rm -f examples/read/$(am__dirstamp) +- -rm -f examples/strip/$(DEPDIR)/$(am__dirstamp) +- -rm -f examples/strip/$(am__dirstamp) +- -rm -f examples/write/$(DEPDIR)/$(am__dirstamp) +- -rm -f examples/write/$(am__dirstamp) + -rm -f src/$(DEPDIR)/$(am__dirstamp) + -rm -f src/$(am__dirstamp) + -rm -f src/ProjectOpus/$(DEPDIR)/$(am__dirstamp) +@@ -1600,7 +1487,7 @@ + + distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +- -rm -rf bindings/c/$(DEPDIR) examples/check/$(DEPDIR) examples/read/$(DEPDIR) examples/strip/$(DEPDIR) examples/write/$(DEPDIR) src/$(DEPDIR) src/ProjectOpus/$(DEPDIR) test/$(DEPDIR) test/ProjectOpus/$(DEPDIR) ++ -rm -rf bindings/c/$(DEPDIR) src/$(DEPDIR) src/ProjectOpus/$(DEPDIR) test/$(DEPDIR) test/ProjectOpus/$(DEPDIR) + -rm -f Makefile + distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags +@@ -1637,7 +1524,7 @@ + maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache +- -rm -rf bindings/c/$(DEPDIR) examples/check/$(DEPDIR) examples/read/$(DEPDIR) examples/strip/$(DEPDIR) examples/write/$(DEPDIR) src/$(DEPDIR) src/ProjectOpus/$(DEPDIR) test/$(DEPDIR) test/ProjectOpus/$(DEPDIR) ++ -rm -rf bindings/c/$(DEPDIR) src/$(DEPDIR) src/ProjectOpus/$(DEPDIR) test/$(DEPDIR) test/ProjectOpus/$(DEPDIR) + -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-generic + +@@ -1688,7 +1575,6 @@ + + + clean-local: +- -rm -f examples/*/.libs/* + @XSPF_TEST_ENABLED_TRUE@ -rm -f test/.libs/* + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded.