diff --git a/ports/libopenmpt/CMakeLists.txt b/ports/libopenmpt/CMakeLists.txt index e1aa118e4f..6f4ad1b576 100644 --- a/ports/libopenmpt/CMakeLists.txt +++ b/ports/libopenmpt/CMakeLists.txt @@ -11,21 +11,11 @@ endif() find_package(ZLIB REQUIRED) -find_path(MPG123_INCLUDE_DIR NAMES mpg123.h) -find_library(MPG123_LIBRARY NAMES mpg123 libmpg123) +find_package(MPG123 REQUIRED) +find_package(Vorbis REQUIRED) +find_package(FLAC REQUIRED) -find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) -find_path(OGG_INCLUDE_DIR ogg/ogg.h) - -find_library(OGG_LIBRARY NAMES ogg) -find_library(VORBIS_LIBRARY NAMES vorbis) -find_library(VORBISFILE_LIBRARY NAMES vorbisfile) - -find_path(FLAC_INCLUDE_DIR FLAC/all.h) -find_library(FLAC_LIBRARY NAMES FLAC flac) - -find_path(PORTAUDIO_INCLUDE_DIR NAMES portaudio.h) -find_library(PORTAUDIO_LIBRARY NAMES portaudio) +find_package(portaudio REQUIRED) set( lib_headers @@ -52,11 +42,6 @@ include_directories( sounddsp soundlib openmpt123 - ${MPG123_INCLUDE_DIR} - ${VORBIS_INCLUDE_DIR} - ${OGG_INCLUDE_DIR} - ${FLAC_INCLUDE_DIR} - ${PORTAUDIO_INCLUDE_DIR} ) set( @@ -242,28 +227,27 @@ endif() target_link_libraries( libopenmpt PRIVATE - ${OGG_LIBRARY} - ${MPG123_LIBRARY} - ${VORBISFILE_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} + MPG123::libmpg123 + Vorbis::vorbisfile + FLAC::FLAC ZLIB::ZLIB ) +if(BUILD_SHARED_LIBS) + set(PORTAUDIO_TARGET portaudio) +else() + set(PORTAUDIO_TARGET portaudio_static) +endif() + target_link_libraries( openmpt123 PRIVATE libopenmpt - ${OGG_LIBRARY} - ${MPG123_LIBRARY} - ${VORBISFILE_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} - ${FLAC_LIBRARY} - ${PORTAUDIO_LIBRARY} Winmm ZLIB::ZLIB + ${PORTAUDIO_TARGET} ) + install( TARGETS libopenmpt RUNTIME DESTINATION bin diff --git a/ports/libopenmpt/vcpkg.json b/ports/libopenmpt/vcpkg.json index 18c3bf100a..3668ed848b 100644 --- a/ports/libopenmpt/vcpkg.json +++ b/ports/libopenmpt/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libopenmpt", "version-string": "2017-01-28-cf2390140", - "port-version": 1, + "port-version": 2, "description": "a library to render tracker music", "homepage": "https://github.com/OpenMPT/openmpt", "supports": "!uwp", diff --git a/ports/mpg123/0001-fix-checkcpuarch-path.patch b/ports/mpg123/0001-fix-checkcpuarch-path.patch new file mode 100644 index 0000000000..d6d3bc4771 --- /dev/null +++ b/ports/mpg123/0001-fix-checkcpuarch-path.patch @@ -0,0 +1,13 @@ +diff --git a/ports/cmake/cmake/CheckCPUArch.cmake b/ports/cmake/cmake/CheckCPUArch.cmake +index 84dab8a..925aa09 100644 +--- a/ports/cmake/cmake/CheckCPUArch.cmake ++++ b/ports/cmake/cmake/CheckCPUArch.cmake +@@ -2,7 +2,7 @@ macro(_CHECK_CPU_ARCH ARCH ARCH_DEFINES VARIABLE) + if(NOT DEFINED HAVE_${VARIABLE}) + message(STATUS "Check CPU architecture is ${ARCH}") + set(CHECK_CPU_ARCH_DEFINES ${ARCH_DEFINES}) +- configure_file(${PROJECT_SOURCE_DIR}/CheckCPUArch.c.in ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckCPUArch.c @ONLY) ++ configure_file(${PROJECT_SOURCE_DIR}/cmake/CheckCPUArch.c.in ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckCPUArch.c @ONLY) + try_compile(HAVE_${VARIABLE} "${PROJECT_BINARY_DIR}" + "${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckCPUArch.c") + if(HAVE_${VARIABLE}) diff --git a/ports/mpg123/0001-fix-x86-build.patch b/ports/mpg123/0001-fix-x86-build.patch deleted file mode 100644 index 9c098c6792..0000000000 --- a/ports/mpg123/0001-fix-x86-build.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/src/libmpg123/mangle.h b/src/libmpg123/mangle.h -index e37386a..b474e7f 100644 ---- a/src/libmpg123/mangle.h -+++ b/src/libmpg123/mangle.h -@@ -85,6 +85,10 @@ - #define ASM_VALUE(a) MANGLE_MACROCAT($,a) - #endif - -+#if defined(_WIN32) && !defined(_WIN64) -+#define OPT_X86 -+#endif -+ - /* Enable position-independent code for certain platforms. */ - - #if defined(OPT_X86) -@@ -130,7 +134,7 @@ Lpic_base: \ - /* Dummies for everyone else. */ - #define LOCAL_VAR(a) a - #define GLOBAL_VAR ASM_NAME --#define GLOBAL_VAR_PTR(a) .err Cannot use indirect addressing in non-PIC object. -+#define GLOBAL_VAR_PTR(a) // #error Cannot use indirect addressing in non-PIC object. - #define FUNC ASM_NAME - #define EXTERNAL_FUNC ASM_NAME - #define GET_GOT -diff --git a/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj -index f2bc362..07e81cd 100644 ---- a/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj -+++ b/ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj -@@ -1194,7 +1194,7 @@ yasm -a x86 -p gas -r raw -f win32 -g null -m x86 -o "$(IntDir)synth_stereo_sse_ - - - -- Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) -+ Shlwapi.lib;dct36_3dnow.o;dct36_3dnowext.o;dct36_sse.o;dct64_3dnow.o;dct64_3dnowext.o;dct64_mmx.o;dct64_sse.o;dct64_sse_float.o;equalizer_3dnow.o;getcpuflags.o;synth_3dnow.o;synth_3dnowext.o;synth_i586.o;synth_mmx.o;synth_sse.o;synth_sse_float.o;synth_stereo_sse_float.o;tabinit_mmx.o;synth_sse_accurate.o;synth_sse_s32.o;synth_stereo_sse_accurate.o;synth_stereo_sse_s32.o;%(AdditionalDependencies) - $(IntDir);%(AdditionalLibraryDirectories) - true - diff --git a/ports/mpg123/0002-fix-libmpg123-uwp-build.patch b/ports/mpg123/0002-fix-libmpg123-uwp-build.patch new file mode 100644 index 0000000000..ab37d02386 --- /dev/null +++ b/ports/mpg123/0002-fix-libmpg123-uwp-build.patch @@ -0,0 +1,21 @@ +diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt +index b843152..b8ff89b 100644 +--- a/ports/cmake/src/CMakeLists.txt ++++ b/ports/cmake/src/CMakeLists.txt +@@ -39,8 +39,6 @@ check_include_file("termios.h" HAVE_TERMIOS) + check_include_file("unistd.h" HAVE_UNISTD_H) + check_include_file("windows.h" HAVE_WINDOWS_H) + +-check_symbol_exists(strerror "string.h" HAVE_STRERROR) +- + function(check_m) + set(CMAKE_REQUIRED_LIBRARIES m) + check_function_exists(sin HAVE_M) +@@ -59,6 +57,7 @@ check_function_exists(shmget HAVE_SHMGET) + check_function_exists(shmat HAVE_SHMAT) + check_function_exists(shmdt HAVE_SHMDT) + check_function_exists(shmctl HAVE_SHMCTL) ++check_function_exists(strerror HAVE_STRERROR) + + search_libs(gethostbyname GETHOSTBYNAME_LIB nsl socket network) + search_libs(socket SOCKET_LIB socket) diff --git a/ports/mpg123/0003-fix-libout123-uwp-build.patch b/ports/mpg123/0003-fix-libout123-uwp-build.patch new file mode 100644 index 0000000000..2302c4283d --- /dev/null +++ b/ports/mpg123/0003-fix-libout123-uwp-build.patch @@ -0,0 +1,266 @@ +diff --git a/ports/cmake/CMakeLists.txt b/ports/cmake/CMakeLists.txt +index b5008da..8e6309a 100644 +--- a/ports/cmake/CMakeLists.txt ++++ b/ports/cmake/CMakeLists.txt +@@ -5,6 +5,13 @@ read_api_version(MPG123_VERSION API_VERSION OUTAPI_VERSION SYNAPI_VERSION) + + project(mpg123 VERSION ${MPG123_VERSION} LANGUAGES C ASM) + ++option(BUILD_LIBOUT123 "build libout123" ON) ++if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ message(WARNING "Output module is not implemented for '${CMAKE_SYSTEM_NAME}' platform.") ++ message(WARNING "To prevent build errors 'BUILD_LIBOUT123' option is set to OFF.") ++ set(BUILD_LIBOUT123 OFF) ++endif() ++ + include(cmake/search_libs.cmake) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) +@@ -34,17 +41,28 @@ set(exec_prefix "${CMAKE_INSTALL_PREFIX}") + set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}") + set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../libmpg123.pc.in" libmpg123.pc @ONLY) +-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../libout123.pc.in" libout123.pc @ONLY) ++if(BUILD_LIBOUT123) ++ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../libout123.pc.in" libout123.pc @ONLY) ++endif() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/../../libsyn123.pc.in" libsyn123.pc @ONLY) + + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/libmpg123.pc" +- "${CMAKE_CURRENT_BINARY_DIR}/libout123.pc" + "${CMAKE_CURRENT_BINARY_DIR}/libsyn123.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + install( + FILES + "${CMAKE_CURRENT_SOURCE_DIR}/../../man1/mpg123.1" +- "${CMAKE_CURRENT_SOURCE_DIR}/../../man1/out123.1" + DESTINATION "${CMAKE_INSTALL_MANDIR}") ++ ++if(BUILD_LIBOUT123) ++ install( ++ FILES ++ "${CMAKE_CURRENT_BINARY_DIR}/libout123.pc" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") ++ install( ++ FILES ++ "${CMAKE_CURRENT_SOURCE_DIR}/../../man1/out123.1" ++ DESTINATION "${CMAKE_INSTALL_MANDIR}") ++endif() +diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt +index b843152..3945c7e 100644 +--- a/ports/cmake/src/CMakeLists.txt ++++ b/ports/cmake/src/CMakeLists.txt +@@ -194,112 +194,114 @@ endif() + + # Modules + +-if(CHECK_MODULES) +- list(FIND CHECK_MODULES alsa ALSA_REQUIRED) +- list(FIND CHECK_MODULES coreaudio COREAUDIO_REQUIRED) +- list(FIND CHECK_MODULES pulse PULSE_REQUIRED) +- list(FIND CHECK_MODULES jack JACK_REQUIRED) +- list(FIND CHECK_MODULES tinyalsa TINYALSA_REQUIRED) +- list(FIND CHECK_MODULES win32 WIN32_REQUIRED) +- list(FIND CHECK_MODULES win32_wasapi WIN32_WASAPI_REQUIRED) +- set(MODULE_NOT_FOUND_MESSAGE "module required but couldn't be found") +-endif() +- +-if(NOT CHECK_MODULES OR NOT ALSA_REQUIRED EQUAL -1) +- find_package(ALSA) +- if(TARGET ALSA::ALSA) +- list(APPEND OUTPUT_MODULES alsa) +- elseif(CHECK_MODULES AND NOT ALSA_REQUIRED EQUAL -1) +- message(FATAL_ERROR "alsa ${MODULE_NOT_FOUND_MESSAGE}") ++if(BUILD_LIBOUT123) ++ if(CHECK_MODULES) ++ list(FIND CHECK_MODULES alsa ALSA_REQUIRED) ++ list(FIND CHECK_MODULES coreaudio COREAUDIO_REQUIRED) ++ list(FIND CHECK_MODULES pulse PULSE_REQUIRED) ++ list(FIND CHECK_MODULES jack JACK_REQUIRED) ++ list(FIND CHECK_MODULES tinyalsa TINYALSA_REQUIRED) ++ list(FIND CHECK_MODULES win32 WIN32_REQUIRED) ++ list(FIND CHECK_MODULES win32_wasapi WIN32_WASAPI_REQUIRED) ++ set(MODULE_NOT_FOUND_MESSAGE "module required but couldn't be found") + endif() +-endif() + +-if(NOT CHECK_MODULES OR NOT COREAUDIO_REQUIRED EQUAL -1) +- if(APPLE) +- find_library(AUDIO_TOOLBOX AudioToolbox) +- list(APPEND OUTPUT_MODULES coreaudio) +- elseif(CHECK_MODULES AND NOT COREAUDIO_REQUIRED EQUAL -1) +- message(FATAL_ERROR "coreaudio ${MODULE_NOT_FOUND_MESSAGE}") ++ if(NOT CHECK_MODULES OR NOT ALSA_REQUIRED EQUAL -1) ++ find_package(ALSA) ++ if(TARGET ALSA::ALSA) ++ list(APPEND OUTPUT_MODULES alsa) ++ elseif(CHECK_MODULES AND NOT ALSA_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "alsa ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() + endif() +-endif() + +-find_package(PkgConfig) +-if(PKG_CONFIG_FOUND) +- if(NOT CHECK_MODULES OR NOT PULSE_REQUIRED EQUAL -1) +- pkg_search_module(PULSE libpulse-simple) +- if(PULSE_FOUND) +- list(APPEND OUTPUT_MODULES pulse) +- elseif(CHECK_MODULES AND NOT PULSE_REQUIRED EQUAL -1) +- message(FATAL_ERROR "pulse ${MODULE_NOT_FOUND_MESSAGE}") ++ if(NOT CHECK_MODULES OR NOT COREAUDIO_REQUIRED EQUAL -1) ++ if(APPLE) ++ find_library(AUDIO_TOOLBOX AudioToolbox) ++ list(APPEND OUTPUT_MODULES coreaudio) ++ elseif(CHECK_MODULES AND NOT COREAUDIO_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "coreaudio ${MODULE_NOT_FOUND_MESSAGE}") + endif() + endif() + +- if(NOT CHECK_MODULES OR NOT JACK_REQUIRED EQUAL -1) +- pkg_search_module(JACK jack) +- if(JACK_FOUND) +- list(APPEND OUTPUT_MODULES jack) +- elseif(CHECK_MODULES AND NOT JACK_REQUIRED EQUAL -1) +- message(FATAL_ERROR "jack ${MODULE_NOT_FOUND_MESSAGE}") ++ find_package(PkgConfig) ++ if(PKG_CONFIG_FOUND) ++ if(NOT CHECK_MODULES OR NOT PULSE_REQUIRED EQUAL -1) ++ pkg_search_module(PULSE libpulse-simple) ++ if(PULSE_FOUND) ++ list(APPEND OUTPUT_MODULES pulse) ++ elseif(CHECK_MODULES AND NOT PULSE_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "pulse ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() ++ endif() ++ ++ if(NOT CHECK_MODULES OR NOT JACK_REQUIRED EQUAL -1) ++ pkg_search_module(JACK jack) ++ if(JACK_FOUND) ++ list(APPEND OUTPUT_MODULES jack) ++ elseif(CHECK_MODULES AND NOT JACK_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "jack ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() + endif() +- endif() + +- if(NOT CHECK_MODULES OR NOT TINYALSA_REQUIRED EQUAL -1) +- pkg_search_module(TINYALSA tinyalsa) +- if(TINYALSA_FOUND) +- list(APPEND OUTPUT_MODULES tinyalsa) +- elseif(CHECK_MODULES AND NOT TINYALSA_REQUIRED EQUAL -1) +- message(FATAL_ERROR "tinyalsa ${MODULE_NOT_FOUND_MESSAGE}") ++ if(NOT CHECK_MODULES OR NOT TINYALSA_REQUIRED EQUAL -1) ++ pkg_search_module(TINYALSA tinyalsa) ++ if(TINYALSA_FOUND) ++ list(APPEND OUTPUT_MODULES tinyalsa) ++ elseif(CHECK_MODULES AND NOT TINYALSA_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "tinyalsa ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() + endif() + endif() +-endif() + +-if(NOT CHECK_MODULES OR NOT WIN32_REQUIRED EQUAL -1) +- if(HAVE_WINDOWS_H) +- set(WIN32_LIBRARIES winmm) +- list(APPEND OUTPUT_MODULES win32) +- elseif(CHECK_MODULES AND NOT WIN32_REQUIRED EQUAL -1) +- message(FATAL_ERROR "win32 ${MODULE_NOT_FOUND_MESSAGE}") ++ if(NOT CHECK_MODULES OR NOT WIN32_REQUIRED EQUAL -1) ++ if(HAVE_WINDOWS_H) ++ set(WIN32_LIBRARIES winmm) ++ list(APPEND OUTPUT_MODULES win32) ++ elseif(CHECK_MODULES AND NOT WIN32_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "win32 ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() + endif() +-endif() + +-if(NOT CHECK_MODULES OR NOT WIN32_WASAPI_REQUIRED EQUAL -1) +- set(WASAPI_INCLUDES "initguid.h" "audioclient.h" "mmdeviceapi.h" "avrt.h") +- check_include_files("${WASAPI_INCLUDES}" HAVE_WASAPI) +- if(HAVE_WASAPI) +- set(WIN32_WASAPI_LIBRARIES ole32 avrt) +- list(APPEND OUTPUT_MODULES win32_wasapi) +- elseif(CHECK_MODULES AND NOT WIN32_WASAPI_REQUIRED EQUAL -1) +- message(FATAL_ERROR "win32_wasapi ${MODULE_NOT_FOUND_MESSAGE}") ++ if(NOT CHECK_MODULES OR NOT WIN32_WASAPI_REQUIRED EQUAL -1) ++ set(WASAPI_INCLUDES "initguid.h" "audioclient.h" "mmdeviceapi.h" "avrt.h") ++ check_include_files("${WASAPI_INCLUDES}" HAVE_WASAPI) ++ if(HAVE_WASAPI) ++ set(WIN32_WASAPI_LIBRARIES ole32 avrt) ++ list(APPEND OUTPUT_MODULES win32_wasapi) ++ elseif(CHECK_MODULES AND NOT WIN32_WASAPI_REQUIRED EQUAL -1) ++ message(FATAL_ERROR "win32_wasapi ${MODULE_NOT_FOUND_MESSAGE}") ++ endif() + endif() +-endif() + +-if(CHECK_MODULES) +- list(REMOVE_AT CHECK_MODULES +- ${ALSA_REQUIRED} +- ${COREAUDIO_REQUIRED} +- ${PULSE_REQUIRED} +- ${JACK_REQUIRED} +- ${TINYALSA_REQUIRED} +- ${WIN32_REQUIRED} +- ${WIN32_WASAPI_REQUIRED}) +- list(LENGTH CHECK_MODULES CHECK_MODULES_LENGTH) +- if(NOT CHECK_MODULES_LENGTH EQUAL 0) +- message(FATAL_ERROR "Dunno how to find modules: ${CHECK_MODULES}") ++ if(CHECK_MODULES) ++ list(REMOVE_AT CHECK_MODULES ++ ${ALSA_REQUIRED} ++ ${COREAUDIO_REQUIRED} ++ ${PULSE_REQUIRED} ++ ${JACK_REQUIRED} ++ ${TINYALSA_REQUIRED} ++ ${WIN32_REQUIRED} ++ ${WIN32_WASAPI_REQUIRED}) ++ list(LENGTH CHECK_MODULES CHECK_MODULES_LENGTH) ++ if(NOT CHECK_MODULES_LENGTH EQUAL 0) ++ message(FATAL_ERROR "Dunno how to find modules: ${CHECK_MODULES}") ++ endif() + endif() +-endif() + +-if(NOT OUTPUT_MODULES) +- set(DEFAULT_OUTPUT_MODULE dummy) +- set(DEFAULT_OUTPUT_MODULES ${DEFAULT_OUTPUT_MODULE}) +-else() +- list(GET OUTPUT_MODULES 0 _DEFAULT_OUTPUT_MODULE) +- set(DEFAULT_OUTPUT_MODULE ${_DEFAULT_OUTPUT_MODULE} CACHE STRING "Default output module") +- if(BUILD_SHARED_LIBS) +- string(REPLACE ";" "," DEFAULT_OUTPUT_MODULES "${OUTPUT_MODULES}") +- else() ++ if(NOT OUTPUT_MODULES) ++ set(DEFAULT_OUTPUT_MODULE dummy) + set(DEFAULT_OUTPUT_MODULES ${DEFAULT_OUTPUT_MODULE}) ++ else() ++ list(GET OUTPUT_MODULES 0 _DEFAULT_OUTPUT_MODULE) ++ set(DEFAULT_OUTPUT_MODULE ${_DEFAULT_OUTPUT_MODULE} CACHE STRING "Default output module") ++ if(BUILD_SHARED_LIBS) ++ string(REPLACE ";" "," DEFAULT_OUTPUT_MODULES "${OUTPUT_MODULES}") ++ else() ++ set(DEFAULT_OUTPUT_MODULES ${DEFAULT_OUTPUT_MODULE}) ++ endif() ++ set_property(CACHE DEFAULT_OUTPUT_MODULE PROPERTY STRINGS ${OUTPUT_MODULES}) + endif() +- set_property(CACHE DEFAULT_OUTPUT_MODULE PROPERTY STRINGS ${OUTPUT_MODULES}) + endif() + + option(ACCURATE_ROUNDING "use rounding instead of fast truncation for integer output, where possible" ON) +@@ -362,7 +364,9 @@ add_compile_options( + + add_subdirectory("compat") + add_subdirectory("libmpg123") +-add_subdirectory("libout123") ++if(BUILD_LIBOUT123) ++ add_subdirectory("libout123") ++endif() + add_subdirectory("libsyn123") + + if(UNIX) diff --git a/ports/mpg123/0004-fix-libsyn123-uwp-build.patch b/ports/mpg123/0004-fix-libsyn123-uwp-build.patch new file mode 100644 index 0000000000..803296dede --- /dev/null +++ b/ports/mpg123/0004-fix-libsyn123-uwp-build.patch @@ -0,0 +1,52 @@ +diff --git a/src/libmpg123/sample.h b/src/libmpg123/sample.h +index 4d244fe..ed3ef86 100644 +--- a/src/libmpg123/sample.h ++++ b/src/libmpg123/sample.h +@@ -171,7 +171,7 @@ static inline int16_t ftoi16(float x) + ( (u >= 2147483648UL) \ + ? (int32_t)((uint32_t)u - (uint32_t)2147483648UL) \ + : ((u == 0) \ +- ? (int32_t)-2147483648UL \ ++ ? -(int32_t)2147483648UL \ + : -(int32_t)((uint32_t)2147483648UL - u) ) \ + ) + +diff --git a/src/libsyn123/resample.c b/src/libsyn123/resample.c +index b92f7f2..3552ffa 100644 +--- a/src/libsyn123/resample.c ++++ b/src/libsyn123/resample.c +@@ -2005,7 +2005,7 @@ syn123_resample_intotal_64(long inrate, long outrate, int64_t outs) + // First offset is -inrate. + // You may want to work it out for yourself. Or trust me;-) + int err; +- uint64_t vtot = muloffdiv64(outs, vinrate, -vinrate, voutrate, &err, NULL); ++ uint64_t vtot = muloffdiv64(outs, vinrate, -(int64_t)vinrate, voutrate, &err, NULL); + if(err) + return SYN123_OVERFLOW; + if(vtot == UINT64_MAX) +diff --git a/src/libsyn123/sampleconv.c b/src/libsyn123/sampleconv.c +index 6e8fb3f..7179957 100644 +--- a/src/libsyn123/sampleconv.c ++++ b/src/libsyn123/sampleconv.c +@@ -21,6 +21,8 @@ + #include "syn123_int.h" + #include "sample.h" + #include "debug.h" ++// Avoid conflict with pragmas in isnan() and friends. ++#undef warning + + /* Conversions between native byte order encodings. */ + +diff --git a/src/libsyn123/volume.c b/src/libsyn123/volume.c +index de018a2..a80851d 100644 +--- a/src/libsyn123/volume.c ++++ b/src/libsyn123/volume.c +@@ -12,6 +12,8 @@ + #define NO_SMAX + #include "syn123_int.h" + #include "debug.h" ++// Avoid conflict with pragmas in isnan() and friends. ++#undef warning + + static const double db_min = -SYN123_DB_LIMIT; + static const double db_max = SYN123_DB_LIMIT; diff --git a/ports/mpg123/portfile.cmake b/ports/mpg123/portfile.cmake index eea5769e15..dd12ddc0d5 100644 --- a/ports/mpg123/portfile.cmake +++ b/ports/mpg123/portfile.cmake @@ -1,26 +1,13 @@ -set(MPG123_VERSION 1.26.5) -set(MPG123_HASH 0c2b3174c834e4bd459a3324b825d9bf9341a3486c0af815773b00cb007578cb718522ac4e983c7ad7e3bb5df9fdd342a03cb51345c41f68971145196ac04b7a) +set(MPG123_VERSION 1.28.0) +set(MPG123_HASH 4e333ee4f3bbebcfff280cf286265e969a8da93b9043d03c0189e22cd40918b07bf12181bd06141d4479c78bc0d0ed472e0d3bb61b2fdb96fe9f7cd48f9a6b77) -#architecture detection -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") - set(MPG123_ARCH Win32) - set(MPG123_CONFIGURATION _x86) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") - set(MPG123_ARCH x64) - set(MPG123_CONFIGURATION _x86) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") - set(MPG123_ARCH ARM) - set(MPG123_CONFIGURATION _Generic) -elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - set(MPG123_ARCH ARM64) - set(MPG123_CONFIGURATION _Generic) -else() - message(FATAL_ERROR "unsupported architecture") -endif() - -#linking -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(MPG123_CONFIGURATION_SUFFIX _Dll) +set(PATCHES "") +if(VCPKG_TARGET_IS_UWP) + set(PATCHES + 0002-fix-libmpg123-uwp-build.patch + 0003-fix-libout123-uwp-build.patch + 0004-fix-libsyn123-uwp-build.patch + ) endif() vcpkg_from_sourceforge( @@ -30,60 +17,25 @@ vcpkg_from_sourceforge( FILENAME "mpg123-${MPG123_VERSION}.tar.bz2" SHA512 ${MPG123_HASH} PATCHES - 0001-fix-x86-build.patch + 0001-fix-checkcpuarch-path.patch + ${PATCHES} ) include(${CURRENT_INSTALLED_DIR}/share/yasm-tool-helper/yasm-tool-helper.cmake) yasm_tool_helper(APPEND_TO_PATH) -macro(read_api_version) - file(READ "${SOURCE_PATH}/configure.ac" configure_ac) - string(REGEX MATCH "API_VERSION=([0-9]+)" result ${configure_ac}) - set(API_VERSION ${CMAKE_MATCH_1}) -endmacro() +if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) -if(VCPKG_TARGET_IS_UWP) - vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH ports/MSVC++/2015/uwp/libmpg123/libmpg123.vcxproj - OPTIONS /p:UseEnv=True - PLATFORM ${MPG123_ARCH} - RELEASE_CONFIGURATION Release_uwp - DEBUG_CONFIGURATION Debug_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() - file(INSTALL - ${SOURCE_PATH}/ports/MSVC++/mpg123.h - ${SOURCE_PATH}/src/libmpg123/fmt123.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include - ) - - read_api_version() - configure_file( - ${SOURCE_PATH}/src/libmpg123/mpg123.h.in - ${CURRENT_PACKAGES_DIR}/include/mpg123.h.in @ONLY - ) - -elseif(VCPKG_TARGET_IS_WINDOWS) - vcpkg_install_msbuild( - SOURCE_PATH ${SOURCE_PATH} - PROJECT_SUBPATH ports/MSVC++/2015/win32/libmpg123/libmpg123.vcxproj - OPTIONS /p:UseEnv=True - RELEASE_CONFIGURATION Release${MPG123_CONFIGURATION}${MPG123_CONFIGURATION_SUFFIX} - DEBUG_CONFIGURATION Debug${MPG123_CONFIGURATION}${MPG123_CONFIGURATION_SUFFIX} - ) - - file(INSTALL - ${SOURCE_PATH}/ports/MSVC++/mpg123.h - ${SOURCE_PATH}/src/libmpg123/fmt123.h - DESTINATION ${CURRENT_PACKAGES_DIR}/include - ) - - read_api_version() - configure_file( - ${SOURCE_PATH}/src/libmpg123/mpg123.h.in - ${CURRENT_PACKAGES_DIR}/include/mpg123.h.in @ONLY - ) + 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 diff --git a/ports/mpg123/vcpkg.json b/ports/mpg123/vcpkg.json index 1661997476..e699f89155 100644 --- a/ports/mpg123/vcpkg.json +++ b/ports/mpg123/vcpkg.json @@ -1,6 +1,6 @@ { "name": "mpg123", - "version": "1.26.5", + "version": "1.28.0", "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 b505800252..801041acdb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3406,7 +3406,7 @@ }, "libopenmpt": { "baseline": "2017-01-28-cf2390140", - "port-version": 1 + "port-version": 2 }, "libopusenc": { "baseline": "0.2.1", @@ -4137,7 +4137,7 @@ "port-version": 0 }, "mpg123": { - "baseline": "1.26.5", + "baseline": "1.28.0", "port-version": 0 }, "mpi": { diff --git a/versions/l-/libopenmpt.json b/versions/l-/libopenmpt.json index d97f501817..30e4512e13 100644 --- a/versions/l-/libopenmpt.json +++ b/versions/l-/libopenmpt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "465b2d6e597952e0ef962af05dce08769dba11e7", + "version-string": "2017-01-28-cf2390140", + "port-version": 2 + }, { "git-tree": "a6579258d2dab9e661a439e241ff20f2427b918e", "version-string": "2017-01-28-cf2390140", diff --git a/versions/m-/mpg123.json b/versions/m-/mpg123.json index 60740511be..098759f80d 100644 --- a/versions/m-/mpg123.json +++ b/versions/m-/mpg123.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b34c661c7e28355ade113c330d1c3b93a77a4e13", + "version": "1.28.0", + "port-version": 0 + }, { "git-tree": "6e185d93bd44a85eda8d650c24df2f96da710d56", "version": "1.26.5",