diff --git a/ports/libopenmpt/CMakeLists.txt b/ports/libopenmpt/CMakeLists.txt index 6f4ad1b5762..35094e8f44a 100644 --- a/ports/libopenmpt/CMakeLists.txt +++ b/ports/libopenmpt/CMakeLists.txt @@ -10,28 +10,11 @@ if(MSVC) endif() find_package(ZLIB REQUIRED) - -find_package(MPG123 REQUIRED) +find_package(mpg123 CONFIG REQUIRED) find_package(Vorbis REQUIRED) -find_package(FLAC REQUIRED) -find_package(portaudio REQUIRED) - -set( - lib_headers - libopenmpt/libopenmpt.h - libopenmpt/libopenmpt.hpp - libopenmpt/libopenmpt_config.h - libopenmpt/libopenmpt_ext.h - libopenmpt/libopenmpt_ext.hpp - libopenmpt/libopenmpt_ext_impl.hpp - libopenmpt/libopenmpt_impl.hpp - libopenmpt/libopenmpt_internal.h - libopenmpt/libopenmpt_stream_callbacks_buffer.h - libopenmpt/libopenmpt_stream_callbacks_fd.h - libopenmpt/libopenmpt_stream_callbacks_file.h - libopenmpt/libopenmpt_version.h -) +file(GLOB HEADERS libopenmpt/*.h libopenmpt/*.hpp) +list(FILTER HEADERS EXCLUDE REGEX "_impl\\.hpp$|_internal\\.h$") include_directories( . @@ -44,141 +27,22 @@ include_directories( openmpt123 ) -set( - lib_sources - common/ComponentManager.cpp - common/FileReader.cpp - common/Logging.cpp - common/Profiler.cpp - common/misc_util.cpp - common/mptCPU.cpp - common/mptFileIO.cpp - common/mptIO.cpp - common/mptLibrary.cpp - common/mptOS.cpp - common/mptPathString.cpp - common/mptRandom.cpp - common/mptString.cpp - common/mptStringFormat.cpp - common/mptStringParse.cpp - common/mptTime.cpp - common/mptUUID.cpp - common/mptWine.cpp - common/serialization_utils.cpp - common/stdafx.cpp - common/typedefs.cpp - common/version.cpp +file(GLOB_RECURSE SOURCES + common/*.cpp + soundbase/*.cpp + sounddsp/*.cpp + # Because this is a GLOB_RECURSE, soundlib/plugins/*.cpp will be included + soundlib/*.cpp libopenmpt/libopenmpt_c.cpp libopenmpt/libopenmpt_cxx.cpp libopenmpt/libopenmpt_ext_impl.cpp libopenmpt/libopenmpt_impl.cpp - sounddsp/AGC.cpp - sounddsp/DSP.cpp - sounddsp/EQ.cpp - sounddsp/Reverb.cpp - soundlib/AudioCriticalSection.cpp - soundlib/ContainerMMCMP.cpp - soundlib/ContainerPP20.cpp - soundlib/ContainerUMX.cpp - soundlib/ContainerXPK.cpp - soundlib/Dither.cpp - soundlib/Dlsbank.cpp - soundlib/Fastmix.cpp - soundlib/ITCompression.cpp - soundlib/ITTools.cpp - soundlib/InstrumentExtensions.cpp - soundlib/Load_669.cpp - soundlib/Load_amf.cpp - soundlib/Load_ams.cpp - soundlib/Load_dbm.cpp - soundlib/Load_digi.cpp - soundlib/Load_dmf.cpp - soundlib/Load_dsm.cpp - soundlib/Load_dtm.cpp - soundlib/Load_far.cpp - soundlib/Load_gdm.cpp - soundlib/Load_imf.cpp - soundlib/Load_it.cpp - soundlib/Load_itp.cpp - soundlib/Load_mdl.cpp - soundlib/Load_med.cpp - soundlib/Load_mid.cpp - soundlib/Load_mo3.cpp - soundlib/Load_mod.cpp - soundlib/Load_mt2.cpp - soundlib/Load_mtm.cpp - soundlib/Load_okt.cpp - soundlib/Load_plm.cpp - soundlib/Load_psm.cpp - soundlib/Load_ptm.cpp - soundlib/Load_s3m.cpp - soundlib/Load_sfx.cpp - soundlib/Load_stm.cpp - soundlib/Load_stp.cpp - soundlib/Load_uax.cpp - soundlib/Load_ult.cpp - soundlib/Load_wav.cpp - soundlib/Load_xm.cpp - soundlib/MIDIEvents.cpp - soundlib/MIDIMacros.cpp - soundlib/MPEGFrame.cpp - soundlib/Message.cpp - soundlib/MixFuncTable.cpp - soundlib/MixerLoops.cpp - soundlib/MixerSettings.cpp - soundlib/ModChannel.cpp - soundlib/ModInstrument.cpp - soundlib/ModSample.cpp - soundlib/ModSequence.cpp - soundlib/OggStream.cpp - soundlib/Paula.cpp - soundlib/RowVisitor.cpp - soundlib/S3MTools.cpp - soundlib/SampleFormatFLAC.cpp - soundlib/SampleFormatMP3.cpp - soundlib/SampleFormatMediaFoundation.cpp - soundlib/SampleFormatOpus.cpp - soundlib/SampleFormatVorbis.cpp - soundlib/SampleFormats.cpp - soundlib/SampleIO.cpp - soundlib/Snd_flt.cpp - soundlib/Snd_fx.cpp - soundlib/Sndfile.cpp - soundlib/Sndmix.cpp - soundlib/SoundFilePlayConfig.cpp - soundlib/Tables.cpp - soundlib/Tagging.cpp - soundlib/UMXTools.cpp - soundlib/UpgradeModule.cpp - soundlib/WAVTools.cpp - soundlib/WindowedFIR.cpp - soundlib/XMTools.cpp - soundlib/load_j2b.cpp - soundlib/mod_specifications.cpp - soundlib/modcommand.cpp - soundlib/modsmp_ctrl.cpp - soundlib/pattern.cpp - soundlib/patternContainer.cpp - soundlib/plugins/DigiBoosterEcho.cpp - soundlib/plugins/LFOPlugin.cpp - soundlib/plugins/PlugInterface.cpp - soundlib/plugins/PluginManager.cpp - soundlib/plugins/dmo/Chorus.cpp - soundlib/plugins/dmo/Compressor.cpp - soundlib/plugins/dmo/DMOPlugin.cpp - soundlib/plugins/dmo/Distortion.cpp - soundlib/plugins/dmo/Echo.cpp - soundlib/plugins/dmo/Flanger.cpp - soundlib/plugins/dmo/Gargle.cpp - soundlib/plugins/dmo/I3DL2Reverb.cpp - soundlib/plugins/dmo/ParamEq.cpp - soundlib/plugins/dmo/WavesReverb.cpp - soundlib/tuning.cpp - soundlib/tuningCollection.cpp - soundlib/tuningbase.cpp ) -add_library(libopenmpt ${lib_sources}) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(libopenmpt ${SOURCES}) target_compile_definitions(libopenmpt PRIVATE -DMPT_WITH_MPG123 -DMPT_WITH_OGG @@ -187,81 +51,45 @@ target_compile_definitions(libopenmpt PRIVATE -DLIBOPENMPT_BUILD ) -set(cli_srcs openmpt123/openmpt123.cpp) - -add_executable(openmpt123 ${cli_srcs}) - -target_compile_definitions(openmpt123 PRIVATE - -DMPT_WITH_MPG123 -DMPT_WITH_OGG - -DMPT_WITH_VORBIS -DMPT_WITH_VORBISFILE - -DMPT_WITH_ZLIB -DMPT_BUILD_VCPKG - -DLIBOPENMPT_BUILD -) - - - if(BUILD_SHARED_LIBS) target_compile_definitions( libopenmpt - PRIVATE - -DMPT_BUILD_MSVC_SHARED -DLIBOPENMPT_BUILD_DLL - ) - target_compile_definitions( - openmpt123 - PRIVATE - -DMPT_BUILD_MSVC_SHARED -DLIBOPENMPT_BUILD_DLL - ) -else() - target_compile_definitions( - libopenmpt - PRIVATE - -DMPT_BUILD_MSVC_STATIC - ) - target_compile_definitions( - openmpt123 - PRIVATE - -DMPT_BUILD_MSVC_STATIC + PRIVATE -DLIBOPENMPT_BUILD_DLL ) endif() +target_include_directories( + libopenmpt + PUBLIC + $ +) + target_link_libraries( libopenmpt PRIVATE - MPG123::libmpg123 - Vorbis::vorbisfile - FLAC::FLAC - ZLIB::ZLIB + MPG123::libmpg123 + Vorbis::vorbisfile + Vorbis::vorbis + ZLIB::ZLIB ) -if(BUILD_SHARED_LIBS) - set(PORTAUDIO_TARGET portaudio) -else() - set(PORTAUDIO_TARGET portaudio_static) -endif() +set(LIBOPENMPT_REQUIRES_PRIVATE "zlib vorbis vorbisfile libmpg123") +set(LIBOPENMPT_LIBS_PRIVATE "") +set(prefix "${CMAKE_INSTALL_PREFIX}") +set(exec_prefix [[${prefix}]]) +set(includedir [[${prefix}/include]]) +set(libdir [[${prefix}/lib]]) +configure_file(libopenmpt/libopenmpt.pc.in libopenmpt.pc) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenmpt.pc DESTINATION lib/pkgconfig) -target_link_libraries( - openmpt123 - PRIVATE - libopenmpt - Winmm - ZLIB::ZLIB - ${PORTAUDIO_TARGET} -) - -install( - TARGETS libopenmpt - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib -) - -if(NOT DISABLE_INSTALL_HEADERS) - install(FILES ${lib_headers} DESTINATION include/libopenmpt) -endif() - -if(NOT DISABLE_INSTALL_TOOLS) - install ( - TARGETS openmpt123 - RUNTIME DESTINATION tools/libopenmpt - ) -endif() +install(TARGETS libopenmpt EXPORT libopenmpt-targets) +install(EXPORT libopenmpt-targets DESTINATION share/libopenmpt NAMESPACE libopenmpt::) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libopenmpt-config.cmake [[ +include(CMakeFindDependencyMacro) +find_dependency(ZLIB) +find_dependency(mpg123 CONFIG) +find_dependency(Vorbis) +include(${CMAKE_CURRENT_LIST_DIR}/libopenmpt-targets.cmake) +]]) +install(FILES ${HEADERS} DESTINATION include/libopenmpt) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenmpt-config.cmake DESTINATION share/libopenmpt) diff --git a/ports/libopenmpt/deaf2e3837fb08b1a53fd21bb53adbafe0a84e7d.patch b/ports/libopenmpt/deaf2e3837fb08b1a53fd21bb53adbafe0a84e7d.patch deleted file mode 100644 index cece6f83927..00000000000 --- a/ports/libopenmpt/deaf2e3837fb08b1a53fd21bb53adbafe0a84e7d.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/common/mptUUID.h b/common/mptUUID.h -index a683fdcab..be7d4cb61 100644 ---- a/common/mptUUID.h -+++ b/common/mptUUID.h -@@ -13,6 +13,8 @@ - - #include "Endianness.h" - -+#include -+ - #if MPT_OS_WINDOWS - #if defined(MODPLUG_TRACKER) || !defined(NO_DMO) - #include diff --git a/ports/libopenmpt/portfile.cmake b/ports/libopenmpt/portfile.cmake index 76cb968dc51..77e2a823ff6 100644 --- a/ports/libopenmpt/portfile.cmake +++ b/ports/libopenmpt/portfile.cmake @@ -1,27 +1,31 @@ -if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) - message(FATAL_ERROR "Windowstore not supported") -endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO OpenMPT/openmpt - REF cf2390140c37a53ecf7d5fe73412982d346efba4 - SHA512 6401bac7a899eaacebb601591f982fabde6351f1c0dc0c2d24f1f303b78592e7883a84463bdf3cf0fd029eb38d7b7085fdfadafea2931b307b43d0b601db863e + REF 7da598b28acdb8ee8ea0ed93bcb57d680424f5cc # libopenmpt-0.5.12 + SHA512 0f5441518dbbbbae194c724c47238a3cad876d8eb81e6a89fed3801724a6ae023d6d8806f792dc2f44082f3849cd4e1130081db3668f9974170171227f70e879 HEAD_REF master - PATCHES - deaf2e3837fb08b1a53fd21bb53adbafe0a84e7d.patch ) +file(READ ${CMAKE_CURRENT_LIST_DIR}/vcpkg.json vcpkg_json) +string(JSON version GET "${vcpkg_json}" "version") + file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA - OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DVERSION=${version} ) - -vcpkg_install_cmake() +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() +vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/libopenmpt) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libopenmpt RENAME copyright) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libopenmpt/libopenmpt_config.h "defined(LIBOPENMPT_USE_DLL)" "0") +else() + vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/libopenmpt/libopenmpt_config.h "defined(LIBOPENMPT_USE_DLL)" "1") +endif() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) diff --git a/ports/libopenmpt/vcpkg.json b/ports/libopenmpt/vcpkg.json index 3668ed848b6..d050598a1a3 100644 --- a/ports/libopenmpt/vcpkg.json +++ b/ports/libopenmpt/vcpkg.json @@ -1,16 +1,20 @@ { "name": "libopenmpt", - "version-string": "2017-01-28-cf2390140", - "port-version": 2, + "version": "0.5.12", "description": "a library to render tracker music", - "homepage": "https://github.com/OpenMPT/openmpt", - "supports": "!uwp", + "homepage": "https://openmpt.org/", "dependencies": [ - "libflac", "libogg", "libvorbis", "mpg123", - "portaudio", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ] } diff --git a/ports/mpg123/0003-fix-libout123-uwp-build.patch b/ports/mpg123/0003-fix-libout123-uwp-build.patch index 2302c4283d2..b1b37f5e5ea 100644 --- a/ports/mpg123/0003-fix-libout123-uwp-build.patch +++ b/ports/mpg123/0003-fix-libout123-uwp-build.patch @@ -263,4 +263,4 @@ index b843152..3945c7e 100644 +endif() add_subdirectory("libsyn123") - if(UNIX) + if(0) diff --git a/ports/mpg123/no-executables.patch b/ports/mpg123/no-executables.patch new file mode 100644 index 00000000000..7ceb8b9979c --- /dev/null +++ b/ports/mpg123/no-executables.patch @@ -0,0 +1,13 @@ +diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt +index b843152..00f8012 100644 +--- a/ports/cmake/src/CMakeLists.txt ++++ b/ports/cmake/src/CMakeLists.txt +@@ -365,7 +365,7 @@ add_subdirectory("libmpg123") + add_subdirectory("libout123") + add_subdirectory("libsyn123") + +-if(UNIX) ++if(0) + add_subdirectory("tests") + + add_executable(${PROJECT_NAME} diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index dd12ddc0d59..d89cda0de1c 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -18,60 +18,22 @@ vcpkg_from_sourceforge( SHA512 ${MPG123_HASH} PATCHES 0001-fix-checkcpuarch-path.patch + no-executables.patch ${PATCHES} ) include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake) yasm_tool_helper(APPEND_TO_PATH) -if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH}/ports/cmake + OPTIONS -DUSE_MODULES=OFF +) +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_fixup_pkgconfig() - vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH}/ports/cmake - OPTIONS -DUSE_MODULES=OFF - ) - vcpkg_install_cmake() - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) - vcpkg_fixup_pkgconfig() - - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -elseif(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_LINUX) - set(MPG123_OPTIONS - --disable-dependency-tracking - ) - - # Find cross-compiler prefix - if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - include("${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") - endif() - if(CMAKE_C_COMPILER) - vcpkg_execute_required_process( - COMMAND ${CMAKE_C_COMPILER} -dumpmachine - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} - LOGNAME dumpmachine-${TARGET_TRIPLET} - ) - file(READ ${CURRENT_BUILDTREES_DIR}/dumpmachine-${TARGET_TRIPLET}-out.log MPG123_HOST) - string(REPLACE "\n" "" MPG123_HOST "${MPG123_HOST}") - message(STATUS "Cross-compiling with ${CMAKE_C_COMPILER}") - message(STATUS "Detected autoconf triplet --host=${MPG123_HOST}") - set(MPG123_OPTIONS - --host=${MPG123_HOST} - ${MPG123_OPTIONS} - ) - endif() - - vcpkg_configure_make( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS ${MPG123_OPTIONS} - ) - vcpkg_install_make() - vcpkg_fixup_pkgconfig() - - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) - -message(STATUS "Installing done") diff --git a/ports/mpg123/vcpkg.json b/ports/mpg123/vcpkg.json index e699f891557..3d0246a8c1e 100644 --- a/ports/mpg123/vcpkg.json +++ b/ports/mpg123/vcpkg.json @@ -1,6 +1,7 @@ { "name": "mpg123", "version": "1.28.0", + "port-version": 1, "description": "mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers 1, 2 and 3 (MPEG 1.0 layer 3 also known as MP3).", "homepage": "https://sourceforge.net/projects/mpg123/", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 08c5a894b0c..bba77839b01 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3665,8 +3665,8 @@ "port-version": 0 }, "libopenmpt": { - "baseline": "2017-01-28-cf2390140", - "port-version": 2 + "baseline": "0.5.12", + "port-version": 0 }, "libopensp": { "baseline": "1.5.2", @@ -4430,7 +4430,7 @@ }, "mpg123": { "baseline": "1.28.0", - "port-version": 0 + "port-version": 1 }, "mpi": { "baseline": "1", diff --git a/versions/l-/libopenmpt.json b/versions/l-/libopenmpt.json index 30e4512e13e..73690c86465 100644 --- a/versions/l-/libopenmpt.json +++ b/versions/l-/libopenmpt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8cb8a2342ad5552d311c9f38d399b2ca55726f8a", + "version": "0.5.12", + "port-version": 0 + }, { "git-tree": "465b2d6e597952e0ef962af05dce08769dba11e7", "version-string": "2017-01-28-cf2390140", diff --git a/versions/m-/mpg123.json b/versions/m-/mpg123.json index 098759f80d3..bc7bc7d9df1 100644 --- a/versions/m-/mpg123.json +++ b/versions/m-/mpg123.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fe2d74c3ff7d3dc66eaaf61d64a950c566798dcd", + "version": "1.28.0", + "port-version": 1 + }, { "git-tree": "b34c661c7e28355ade113c330d1c3b93a77a4e13", "version": "1.28.0",