diff --git a/overlay/ports/portmidi/ios-support.patch b/overlay/ports/portmidi/ios-support.patch new file mode 100644 index 00000000000000..22debe6d3c5ffd --- /dev/null +++ b/overlay/ports/portmidi/ios-support.patch @@ -0,0 +1,385 @@ +diff --git a/pm_mac/pmmacosxcm.c b/pm_mac/pmmacosxcm.c +index 39285ed..6d2980a 100755 +--- a/pm_mac/pmmacosxcm.c ++++ b/pm_mac/pmmacosxcm.c +@@ -75,14 +75,15 @@ + #include "pmutil.h" + #include "pminternal.h" + #include "porttime.h" ++#include "ptmacosx.h" + #include "pmmacosxcm.h" + ++#include + #include + #include + + #include + #include +-#include + #include + #include + +@@ -199,7 +200,7 @@ extern pm_fns_node pm_macosx_out_dictionary; + + typedef struct coremidi_info_struct { + int is_virtual; /* virtual device (TRUE) or actual device (FALSE)? */ +- UInt64 delta; /* difference between stream time and real time in ns */ ++ uint64_t delta; /* difference between stream time and real time in ns */ + int sysex_mode; /* middle of sending sysex */ + uint32_t sysex_word; /* accumulate data when receiving sysex */ + uint32_t sysex_byte_count; /* count how many received */ +@@ -213,10 +214,10 @@ typedef struct coremidi_info_struct { + /* allow for running status (is running status possible here? -rbd): -cpr */ + unsigned char last_command; + int32_t last_msg_length; +- UInt64 min_next_time; /* when can the next send take place? (host time) */ ++ uint64_t min_next_time; /* when can the next send take place? (host time) */ + int isIACdevice; + Float64 us_per_host_tick; /* host clock frequency, units of min_next_time */ +- UInt64 host_ticks_per_byte; /* host clock units per byte at maximum rate */ ++ uint64_t host_ticks_per_byte; /* host clock units per byte at maximum rate */ + } coremidi_info_node, *coremidi_info_type; + + /* private function declarations */ +@@ -258,10 +259,10 @@ static int midi_length(int32_t msg) + static PmTimestamp midi_synchronize(PmInternal *midi) + { + coremidi_info_type info = (coremidi_info_type) midi->api_info; +- UInt64 pm_stream_time_2 = // current time in ns +- AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()); ++ uint64_t pm_stream_time_2 = // current time in ns ++ Pt_HostTimeToNanos(Pt_CurrentHostTime()); + PmTimestamp real_time; // in ms +- UInt64 pm_stream_time; // in ns ++ uint64_t pm_stream_time; // in ns + /* if latency is zero and this is an output, there is no + time reference and midi_synchronize should never be called */ + assert(midi->time_proc); +@@ -270,11 +271,10 @@ static PmTimestamp midi_synchronize(PmInternal *midi) + /* read real_time between two reads of stream time */ + pm_stream_time = pm_stream_time_2; + real_time = (*midi->time_proc)(midi->time_info); +- pm_stream_time_2 = AudioConvertHostTimeToNanos( +- AudioGetCurrentHostTime()); ++ pm_stream_time_2 = Pt_HostTimeToNanos(Pt_CurrentHostTime()); + /* repeat if more than 0.5 ms has elapsed */ + } while (pm_stream_time_2 > pm_stream_time + 500000); +- info->delta = pm_stream_time - ((UInt64) real_time * (UInt64) 1000000); ++ info->delta = pm_stream_time - ((uint64_t) real_time * (uint64_t) 1000000); + midi->sync_time = real_time; + return real_time; + } +@@ -415,20 +415,20 @@ static void read_callback(const MIDIPacketList *newPackets, PmInternal *midi) + */ + CM_DEBUG printf("read_callback packet @ %lld ns (host %lld) " + "status %x length %d\n", +- AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()), +- AudioGetCurrentHostTime(), ++ Pt_HostTimeToNanos(Pt_CurrentHostTime()), ++ Pt_CurrentHostTime(), + packet->data[0], packet->length); + for (packetIndex = 0; packetIndex < newPackets->numPackets; packetIndex++) { + /* Set the timestamp and dispatch this message */ + CM_DEBUG printf(" packet->timeStamp %lld ns %lld host\n", + packet->timeStamp, +- AudioConvertHostTimeToNanos(packet->timeStamp)); ++ Pt_HostTimeToNanos(packet->timeStamp)); + if (packet->timeStamp == 0) { + event.timestamp = now; + } else { + event.timestamp = (PmTimestamp) /* explicit conversion */ ( +- (AudioConvertHostTimeToNanos(packet->timeStamp) - info->delta) / +- (UInt64) 1000000); ++ (Pt_HostTimeToNanos(packet->timeStamp) - info->delta) / ++ (uint64_t) 1000000); + } + status = packet->data[0]; + /* process packet as sysex data if it begins with MIDI_SYSEX, or +@@ -474,8 +474,8 @@ static void virtual_read_callback(const MIDIPacketList *newPackets, + newPackets->packet[0].length == 8 && + /* CoreMIDI declares packets with 4-byte alignment, so we + * should be safe to test for 8 0xFF's as 2 32-bit values: */ +- *(SInt32 *) &newPackets->packet[0].data[0] == -1 && +- *(SInt32 *) &newPackets->packet[0].data[4] == -1) { ++ *(int32_t *) &newPackets->packet[0].data[0] == -1 && ++ *(int32_t *) &newPackets->packet[0].data[4] == -1) { + CM_DEBUG printf("got close request packet\n"); + pm_descriptors[id].pub.opened = FALSE; + return; +@@ -505,9 +505,9 @@ static coremidi_info_type create_macosxcm_info(int is_virtual, int is_input) + info->last_msg_length = 0; + info->min_next_time = 0; + info->isIACdevice = FALSE; +- info->us_per_host_tick = 1000000.0 / AudioGetHostClockFrequency(); ++ info->us_per_host_tick = Pt_MicrosPerHostTick(); + info->host_ticks_per_byte = +- (UInt64) (1000000.0 / (info->us_per_host_tick * MAX_BYTES_PER_S)); ++ (uint64_t) (1000000.0 / (info->us_per_host_tick * MAX_BYTES_PER_S)); + info->packetList = (is_input ? NULL : + (MIDIPacketList *) info->packetBuffer); + return info; +@@ -581,7 +581,7 @@ static PmError midi_in_close(PmInternal *midi) + } + } else { + /* make "close virtual port" message */ +- SInt64 close_port_bytes = 0xFFFFFFFFFFFFFFFF; ++ int64_t close_port_bytes = 0xFFFFFFFFFFFFFFFF; + /* memory requirements: packet count (4), timestamp (8), length (2), + * data (8). Total: 22, but we allocate plenty more: + */ +@@ -754,7 +754,7 @@ static PmError midi_write_flush(PmInternal *midi, PmTimestamp timestamp) + if (info->packet != NULL) { + /* out of space, send the buffer and start refilling it */ + /* update min_next_time each flush to support rate limit */ +- UInt64 host_now = AudioGetCurrentHostTime(); ++ uint64_t host_now = Pt_CurrentHostTime(); + if (host_now > info->min_next_time) + info->min_next_time = host_now; + if (info->is_virtual) { +@@ -780,8 +780,8 @@ static PmError send_packet(PmInternal *midi, Byte *message, + CM_DEBUG printf("add %d to packet %p len %d timestamp %lld @ %lld ns " + "(host %lld)\n", + message[0], info->packet, messageLength, timestamp, +- AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()), +- AudioGetCurrentHostTime()); ++ Pt_HostTimeToNanos(Pt_CurrentHostTime()), ++ Pt_CurrentHostTime()); + info->packet = MIDIPacketListAdd(info->packetList, + sizeof(info->packetBuffer), info->packet, + timestamp, messageLength, message); +@@ -842,11 +842,11 @@ static PmError midi_write_short(PmInternal *midi, PmEvent *event) + * latency is zero. Both mean no timing and send immediately. + */ + if (when == 0 || midi->latency == 0) { +- timestamp = AudioGetCurrentHostTime(); ++ timestamp = Pt_CurrentHostTime(); + } else { /* translate PortMidi time + latency to CoreMIDI time */ +- timestamp = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + ++ timestamp = ((uint64_t) (when + midi->latency) * (uint64_t) 1000000) + + info->delta; +- timestamp = AudioConvertNanosToHostTime(timestamp); ++ timestamp = Pt_NanosToHostTime(timestamp); + } + + message[0] = Pm_MessageStatus(what); +@@ -876,7 +876,7 @@ static PmError midi_write_short(PmInternal *midi, PmEvent *event) + + static PmError midi_begin_sysex(PmInternal *midi, PmTimestamp when) + { +- UInt64 when_ns; ++ uint64_t when_ns; + coremidi_info_type info = (coremidi_info_type) midi->api_info; + assert(info); + info->sysex_byte_count = 0; +@@ -885,13 +885,13 @@ static PmError midi_begin_sysex(PmInternal *midi, PmTimestamp when) + if (when == 0) when = midi->now; + /* if latency == 0, midi->now is not valid. We will just set it to zero */ + if (midi->latency == 0) when = 0; +- when_ns = ((UInt64) (when + midi->latency) * (UInt64) 1000000) + ++ when_ns = ((uint64_t) (when + midi->latency) * (uint64_t) 1000000) + + info->delta; + info->sysex_timestamp = +- (MIDITimeStamp) AudioConvertNanosToHostTime(when_ns); +- UInt64 now; /* only make system time call when writing a virtual port */ ++ (MIDITimeStamp) Pt_NanosToHostTime(when_ns); ++ uint64_t now; /* only make system time call when writing a virtual port */ + if (info->is_virtual && info->sysex_timestamp < +- (now = AudioGetCurrentHostTime())) { ++ (now = Pt_CurrentHostTime())) { + info->sysex_timestamp = now; + } + +@@ -963,24 +963,23 @@ static unsigned int midi_check_host_error(PmInternal *midi) + return FALSE; + } + +- + MIDITimeStamp timestamp_pm_to_cm(PmTimestamp timestamp) + { +- UInt64 nanos; ++ uint64_t nanos; + if (timestamp <= 0) { + return (MIDITimeStamp)0; + } else { +- nanos = (UInt64)timestamp * (UInt64)1000000; +- return (MIDITimeStamp)AudioConvertNanosToHostTime(nanos); ++ nanos = (uint64_t)timestamp * (uint64_t)1000000; ++ return (MIDITimeStamp)Pt_NanosToHostTime(nanos); + } + } + + + PmTimestamp timestamp_cm_to_pm(MIDITimeStamp timestamp) + { +- UInt64 nanos; +- nanos = AudioConvertHostTimeToNanos(timestamp); +- return (PmTimestamp)(nanos / (UInt64)1000000); ++ uint64_t nanos; ++ nanos = Pt_HostTimeToNanos(timestamp); ++ return (PmTimestamp)(nanos / (uint64_t)1000000); + } + + +@@ -1094,9 +1093,9 @@ static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint, + nConnected = CFDataGetLength(connections) / + (int32_t) sizeof(MIDIUniqueID); + if (nConnected) { +- const SInt32 *pid = (const SInt32 *)(CFDataGetBytePtr(connections)); ++ const int32_t *pid = (const int32_t *)(CFDataGetBytePtr(connections)); + for (i = 0; i < nConnected; ++i, ++pid) { +- MIDIUniqueID id = EndianS32_BtoN(*pid); ++ MIDIUniqueID id = CFSwapInt32BigToHost(*pid); + MIDIObjectRef connObject; + MIDIObjectType connObjectType; + err = MIDIObjectFindByUniqueID(id, &connObject, +diff --git a/porttime/ptmacosx.h b/porttime/ptmacosx.h +new file mode 100755 +index 0000000..4795f62 +--- /dev/null ++++ b/porttime/ptmacosx.h +@@ -0,0 +1,21 @@ ++/** @file ptmacosx.h portable timer implementation for mac os x. */ ++ ++#include // needed for uint64_t ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++uint64_t Pt_CurrentHostTime(void); ++ ++uint64_t Pt_NanosToHostTime(uint64_t nanos); ++ ++uint64_t Pt_HostTimeToNanos(uint64_t host_time); ++ ++uint64_t Pt_MicrosPerHostTick(void); ++ ++/** @} */ ++ ++#ifdef __cplusplus ++} ++#endif +diff --git a/porttime/ptmacosx_mach.c b/porttime/ptmacosx_mach.c +index 1390af8..8d74b56 100755 +--- a/porttime/ptmacosx_mach.c ++++ b/porttime/ptmacosx_mach.c +@@ -1,8 +1,8 @@ + /* ptmacosx.c -- portable timer implementation for mac os x */ + + #include ++#include + #include +-#include + + #import + #import +@@ -10,8 +10,16 @@ + #import + #include + #include ++#include ++ ++#if TARGET_OS_OSX ++#include ++#else ++#include ++#endif + + #include "porttime.h" ++#include "ptmacosx.h" + #include "sys/time.h" + #include "pthread.h" + +@@ -29,7 +37,7 @@ + #endif + + static int time_started_flag = FALSE; +-static UInt64 start_time; ++static uint64_t start_time; + static pthread_t pt_thread_pid; + + /* note that this is static data -- we only need one copy */ +@@ -115,12 +123,12 @@ static void *Pt_CallbackProc(void *p) + parameters->id); */ + while (pt_callback_proc_id == parameters->id) { + /* wait for a multiple of resolution ms */ +- UInt64 wait_time; ++ uint64_t wait_time; + int delay = mytime++ * parameters->resolution - Pt_Time(); + PtTimestamp timestamp; + if (delay < 0) delay = 0; +- wait_time = AudioConvertNanosToHostTime((UInt64)delay * NSEC_PER_MSEC); +- wait_time += AudioGetCurrentHostTime(); ++ wait_time = Pt_NanosToHostTime((uint64_t)delay * NSEC_PER_MSEC); ++ wait_time += Pt_CurrentHostTime(); + mach_wait_until(wait_time); + timestamp = Pt_Time(); + (*(parameters->callback))(timestamp, parameters->userData); +@@ -133,7 +141,7 @@ static void *Pt_CallbackProc(void *p) + PtError Pt_Start(int resolution, PtCallback *callback, void *userData) + { + if (time_started_flag) return ptAlreadyStarted; +- start_time = AudioGetCurrentHostTime(); ++ start_time = Pt_CurrentHostTime(); + + if (callback) { + int res; +@@ -191,9 +199,9 @@ int Pt_Started(void) + + PtTimestamp Pt_Time(void) + { +- UInt64 clock_time, nsec_time; +- clock_time = AudioGetCurrentHostTime() - start_time; +- nsec_time = AudioConvertHostTimeToNanos(clock_time); ++ uint64_t clock_time, nsec_time; ++ clock_time = Pt_CurrentHostTime() - start_time; ++ nsec_time = Pt_HostTimeToNanos(clock_time); + return (PtTimestamp)(nsec_time / NSEC_PER_MSEC); + } + +@@ -202,3 +210,45 @@ void Pt_Sleep(int32_t duration) + { + usleep(duration * 1000); + } ++ ++uint64_t Pt_CurrentHostTime(void) ++{ ++#if TARGET_OS_OSX ++ return AudioGetCurrentHostTime(); ++#else ++ return mach_absolute_time(); ++#endif ++} ++ ++uint64_t Pt_NanosToHostTime(uint64_t nanos) ++{ ++#if TARGET_OS_OSX ++ return AudioConvertNanosToHostTime(nanos); ++#else ++ mach_timebase_info_data_t clock_timebase; ++ mach_timebase_info(&clock_timebase); ++ return (nanos * clock_timebase.denom) / clock_timebase.numer; ++#endif ++} ++ ++uint64_t Pt_HostTimeToNanos(uint64_t host_time) ++{ ++#if TARGET_OS_OSX ++ return AudioConvertHostTimeToNanos(host_time); ++#else ++ mach_timebase_info_data_t clock_timebase; ++ mach_timebase_info(&clock_timebase); ++ return (host_time * clock_timebase.numer) / clock_timebase.denom; ++#endif ++} ++ ++uint64_t Pt_MicrosPerHostTick(void) ++{ ++#if TARGET_OS_OSX ++ return 1000000.0 / AudioGetHostClockFrequency(); ++#else ++ mach_timebase_info_data_t clock_timebase; ++ mach_timebase_info(&clock_timebase); ++ return clock_timebase.numer / (clock_timebase.denom * 1000.0); ++#endif ++} diff --git a/overlay/ports/portmidi/portfile.cmake b/overlay/ports/portmidi/portfile.cmake new file mode 100644 index 00000000000000..d6d98a28c5704d --- /dev/null +++ b/overlay/ports/portmidi/portfile.cmake @@ -0,0 +1,31 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO PortMidi/portmidi + REF "928520f7b79f371854387cb480b4e3b5bf5dac95" + SHA512 e5ba3f794d8c9b86099d7ec23eb662202a2c8a405e01e06b6dca6eda9d10c04d5ad94b6998b0ece428ed34837b72695d459dfb0a9d81ce178422398f38860933 + HEAD_REF master + PATCHES + "ios-support.patch" # Upstream PR: https://github.com/PortMidi/portmidi/pull/65 +) + +if(VCPKG_CRT_LINKAGE STREQUAL static) + set(PM_USE_STATIC_RUNTIME ON) +else() + set(PM_USE_STATIC_RUNTIME OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DPM_USE_STATIC_RUNTIME="${PM_USE_STATIC_RUNTIME}" +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/PortMidi) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.txt") diff --git a/overlay/ports/portmidi/usage b/overlay/ports/portmidi/usage new file mode 100644 index 00000000000000..9851cb79f02a52 --- /dev/null +++ b/overlay/ports/portmidi/usage @@ -0,0 +1,4 @@ +portmidi provides CMake targets: + + find_package(PortMidi CONFIG REQUIRED) + target_link_libraries(main PRIVATE PortMidi::portmidi) diff --git a/overlay/ports/portmidi/vcpkg.json b/overlay/ports/portmidi/vcpkg.json new file mode 100644 index 00000000000000..4b57bec5173ec4 --- /dev/null +++ b/overlay/ports/portmidi/vcpkg.json @@ -0,0 +1,23 @@ +{ + "name": "portmidi", + "version": "2.0.4", + "port-version": 4, + "description": "PortMidi is a cross platform (Windows, macOS, Linux, and BSDs which support alsalib) library for interfacing with operating systems' MIDI I/O APIs.", + "homepage": "https://github.com/PortMidi/portmidi", + "license": "MIT", + "supports": "!uwp", + "dependencies": [ + { + "name": "alsa", + "platform": "linux | android | freebsd | openbsd" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/ports/icu/portfile.cmake b/ports/icu/portfile.cmake index c622dfd708d266..36cddcc09ec5dd 100644 --- a/ports/icu/portfile.cmake +++ b/ports/icu/portfile.cmake @@ -19,11 +19,22 @@ vcpkg_extract_source_archive(SOURCE_PATH mingw-dll-install.patch disable-static-prefix.patch # https://gitlab.kitware.com/cmake/cmake/-/issues/16617; also mingw. fix-win-build.patch + vcpkg-cross-data.patch ) vcpkg_find_acquire_program(PYTHON3) set(ENV{PYTHON} "${PYTHON3}") +vcpkg_list(SET CONFIGURE_OPTIONS) +vcpkg_list(SET CONFIGURE_OPTIONS_RELEASE) +vcpkg_list(SET CONFIGURE_OPTIONS_DEBUG) +vcpkg_list(SET BUILD_OPTIONS) + +if(VCPKG_TARGET_IS_EMSCRIPTEN) + vcpkg_list(APPEND CONFIGURE_OPTIONS --disable-extras) + vcpkg_list(APPEND BUILD_OPTIONS "PKGDATA_OPTS=--without-assembly -O ../data/icupkg.inc") +endif() + if(VCPKG_TARGET_IS_WINDOWS) list(APPEND CONFIGURE_OPTIONS --enable-icu-build-win) endif() @@ -33,8 +44,11 @@ list(APPEND CONFIGURE_OPTIONS --disable-samples --disable-tests --disable-layout list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release) list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release) -set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel) -set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) +set(CONFIG_TRIPLETS) +list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-rel) +if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + list(APPEND CONFIG_TRIPLETS ${TARGET_TRIPLET}-dbg) +endif() if("tools" IN_LIST FEATURES) list(APPEND CONFIGURE_OPTIONS --enable-tools) @@ -89,7 +103,7 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() #31680: Fix @rpath in both debug and release build - foreach(CONFIG_TRIPLE IN ITEMS ${DEBUG_TRIPLET} ${RELEASE_TRIPLET}) + foreach(CONFIG_TRIPLE IN LISTS CONFIG_TRIPLETS) # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio ${LIBICUTU_RPATH} libicuuc) vcpkg_execute_build_process( @@ -141,7 +155,7 @@ if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() -vcpkg_install_make() +vcpkg_install_make(OPTIONS ${BUILD_OPTIONS}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share" @@ -178,7 +192,7 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/icu/debug") # To cross compile, we need some files at specific positions. So lets copy them -file(GLOB CROSS_COMPILE_DEFS "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/config/icucross.*") +file(GLOB CROSS_COMPILE_DEFS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/config/icucross.*") file(INSTALL ${CROSS_COMPILE_DEFS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/config") file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*icu*${ICU_VERSION_MAJOR}.dll") diff --git a/ports/icu/vcpkg-cross-data.patch b/ports/icu/vcpkg-cross-data.patch new file mode 100644 index 00000000000000..7ca87fb93b2e6d --- /dev/null +++ b/ports/icu/vcpkg-cross-data.patch @@ -0,0 +1,13 @@ +diff --git a/source/configure.ac b/source/configure.ac +index 1bd5871..c508f48 100644 +--- a/source/configure.ac ++++ b/source/configure.ac +@@ -1151,7 +1151,7 @@ AC_ARG_ENABLE(fuzzer, + fuzzer=false) + ICU_CONDITIONAL(FUZZER, test "$fuzzer" = true) + +-ICU_CONDITIONAL(DATA, test "$tools" = true || test "$cross_compiling" = "yes") ++ICU_CONDITIONAL(DATA, test "$tools" = true || test "$cross_compiling" = "yes" || test -n "$cross_buildroot") + + AC_ARG_WITH(data-packaging, + [ --with-data-packaging specify how to package ICU data. Possible values: diff --git a/ports/icu/vcpkg.json b/ports/icu/vcpkg.json index 88a574b25a5f92..d80834ecb61e81 100644 --- a/ports/icu/vcpkg.json +++ b/ports/icu/vcpkg.json @@ -1,6 +1,7 @@ { "name": "icu", "version": "73.1", + "port-version": 2, "description": "Mature and widely used Unicode and localization library.", "homepage": "https://icu.unicode.org/home", "license": "ICU", diff --git a/ports/libflac/portfile.cmake b/ports/libflac/portfile.cmake index c8c788c4020dd5..70f0e4fbcffae1 100644 --- a/ports/libflac/portfile.cmake +++ b/ports/libflac/portfile.cmake @@ -17,6 +17,7 @@ endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES asm WITH_ASM + stack-protector WITH_STACK_PROTECTOR ) vcpkg_cmake_configure( diff --git a/ports/libflac/vcpkg.json b/ports/libflac/vcpkg.json index 31c3d8301ae1ea..1d049c4eee2454 100644 --- a/ports/libflac/vcpkg.json +++ b/ports/libflac/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libflac", "version": "1.4.3", + "port-version": 2, "description": "Library for manipulating FLAC files", "homepage": "https://xiph.org/flac/", "license": "BSD-3-Clause", @@ -15,10 +16,20 @@ "host": true } ], + "default-features": [ + { + "name": "stack-protector", + "platform": "!emscripten" + } + ], "features": { "asm": { "description": "Use any assembly optimization routines", "supports": "x86" + }, + "stack-protector": { + "description": "Build with stack smashing protection", + "supports": "!emscripten" } } } diff --git a/ports/libmad/portfile.cmake b/ports/libmad/portfile.cmake index 9bdade74b91afb..7dcb435e23cefd 100644 --- a/ports/libmad/portfile.cmake +++ b/ports/libmad/portfile.cmake @@ -11,9 +11,26 @@ vcpkg_download_distfile( vcpkg_extract_source_archive(SOURCE_PATH ARCHIVE "${ARCHIVE}") +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + aso ASO +) + +set(EXTRA_OPTIONS) + +# Avoid architecture-specific assembly when targeting WASM. The upstream +# CMakeLists incorrectly recognizes the CPU as an Intel/64-bit CPU, therefore +# we have to override these flags: +# https://codeberg.org/tenacityteam/libmad/src/commit/84ba587793d61caadf6d1f6c0d94c3e165874a50/CMakeLists.txt +if(VCPKG_TARGET_IS_EMSCRIPTEN) + list(APPEND EXTRA_OPTIONS "-DFPM_64BIT=OFF -DFPM_INTEL=OFF -DFPM_DEFAULT=ON") +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + ${FEATURE_OPTIONS} + ${EXTRA_OPTIONS} -DEXAMPLE=OFF ) diff --git a/ports/libmad/vcpkg.json b/ports/libmad/vcpkg.json index 405735f86b84e4..050425a1315336 100644 --- a/ports/libmad/vcpkg.json +++ b/ports/libmad/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libmad", "version": "0.16.4", - "port-version": 1, + "port-version": 3, "description": "high-quality MPEG audio decoder", "homepage": "http://codeberg.org/tenacityteam/libmad", "dependencies": [ @@ -13,5 +13,17 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "default-features": [ + { + "name": "aso", + "platform": "x86 | x64 | arm" + } + ], + "features": { + "aso": { + "description": "Enable CPU architecture-specific optimizations (x86, ARM and MIPS only)", + "supports": "x86 | x64 | arm" + } + } } diff --git a/ports/libmodplug/portfile.cmake b/ports/libmodplug/portfile.cmake index cbc4e440737a30..f7c08c5302ed67 100644 --- a/ports/libmodplug/portfile.cmake +++ b/ports/libmodplug/portfile.cmake @@ -17,7 +17,16 @@ vcpkg_from_github( 005-fix-install-paths.patch # https://github.com/Konstanty/libmodplug/pull/61 ) -vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") +set(EXTRA_OPTIONS) + +if(VCPKG_TARGET_IS_EMSCRIPTEN) + list(APPEND EXTRA_OPTIONS "-DCMAKE_CXX_STANDARD=11") +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS ${EXTRA_OPTIONS} +) vcpkg_cmake_install() diff --git a/ports/libmodplug/vcpkg.json b/ports/libmodplug/vcpkg.json index d9a4feaa5c623f..fbb20260551897 100644 --- a/ports/libmodplug/vcpkg.json +++ b/ports/libmodplug/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libmodplug", "version": "0.8.9.0", - "port-version": 10, + "port-version": 11, "description": "The ModPlug mod file playing library.", "homepage": "https://github.com/Konstanty/libmodplug", "license": null, diff --git a/ports/pcre2/vcpkg.json b/ports/pcre2/vcpkg.json index 3dd6b9455d55b8..8585f46c8902e8 100644 --- a/ports/pcre2/vcpkg.json +++ b/ports/pcre2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "pcre2", "version": "10.42", - "port-version": 1, + "port-version": 2, "description": "Regular Expression pattern matching using the same syntax and semantics as Perl 5.", "homepage": "https://github.com/PCRE2Project/pcre2", "license": "BSD-3-Clause", @@ -21,7 +21,7 @@ "features": { "jit": { "description": "Enable support for Just-In-Time compiling regex matchers", - "supports": "!emscripten" + "supports": "!emscripten & !ios" }, "platform-default-features": { "description": "Enable default features", @@ -31,7 +31,7 @@ "features": [ "jit" ], - "platform": "!emscripten" + "platform": "!emscripten & !ios" } ] } diff --git a/ports/qtbase/portfile.cmake b/ports/qtbase/portfile.cmake index 9a96976ce01f88..8b9e3b0d3a0f94 100644 --- a/ports/qtbase/portfile.cmake +++ b/ports/qtbase/portfile.cmake @@ -157,6 +157,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_GUI_OPTIONS "xrender" FEATURE_xrender # requires FEATURE_xcb_native_painting; otherwise disabled. "xrender" FEATURE_xcb_native_painting # experimental "gles2" FEATURE_opengles2 + "gles3" FEATURE_opengles3 #"vulkan" CMAKE_REQUIRE_FIND_PACKAGE_Vulkan "egl" FEATURE_egl #"fontconfig" CMAKE_REQUIRE_FIND_PACKAGE_Fontconfig @@ -174,6 +175,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_GUI_OPTIONS "opengl" CMAKE_DISABLE_FIND_PACKAGE_WrapOpenGL "egl" CMAKE_DISABLE_FIND_PACKAGE_EGL "gles2" CMAKE_DISABLE_FIND_PACKAGE_GLESv2 + "gles3" CMAKE_DISABLE_FIND_PACKAGE_GLESv3 "fontconfig" CMAKE_DISABLE_FIND_PACKAGE_Fontconfig #"freetype" CMAKE_DISABLE_FIND_PACKAGE_WrapSystemFreetype # Bug in qt cannot be deactivated "harfbuzz" CMAKE_DISABLE_FIND_PACKAGE_WrapSystemHarfbuzz @@ -188,7 +190,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_GUI_OPTIONS # There are more X features but I am unsure how to safely disable them! Most of them seem to be found automaticall with find_package(X11) ) -if( "gles2" IN_LIST FEATURES) +if("gles2" IN_LIST FEATURES) list(APPEND FEATURE_GUI_OPTIONS -DINPUT_opengl='es2') list(APPEND FEATURE_GUI_OPTIONS -DFEATURE_opengl_desktop=OFF) endif() @@ -210,8 +212,7 @@ else() list(APPEND FEATURE_GUI_OPTIONS -DINPUT_xkbcommon=no) endif() -# Disable GLES3 -list(APPEND FEATURE_GUI_OPTIONS -DFEATURE_opengles3:BOOL=OFF) +# Disable OpenGL ES 3.1 and 3.2 list(APPEND FEATURE_GUI_OPTIONS -DFEATURE_opengles31:BOOL=OFF) list(APPEND FEATURE_GUI_OPTIONS -DFEATURE_opengles32:BOOL=OFF) diff --git a/ports/qtbase/vcpkg.json b/ports/qtbase/vcpkg.json index 64ec5f1d892011..bfeafa98fd127a 100644 --- a/ports/qtbase/vcpkg.json +++ b/ports/qtbase/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qtbase", "version": "6.5.3", - "port-version": 1, + "port-version": 2, "description": "Qt Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "license": null, @@ -192,6 +192,19 @@ } ] }, + "gles3": { + "description": "OpenGL ES 3.0", + "supports": "!windows & !osx", + "dependencies": [ + { + "name": "qtbase", + "default-features": false, + "features": [ + "gles2" + ] + } + ] + }, "glib": { "description": "GLib", "dependencies": [ diff --git a/ports/qtkeychain-qt6/vcpkg.json b/ports/qtkeychain-qt6/vcpkg.json index f5d43a44dff5ea..18351698bc8bda 100644 --- a/ports/qtkeychain-qt6/vcpkg.json +++ b/ports/qtkeychain-qt6/vcpkg.json @@ -1,16 +1,22 @@ { "name": "qtkeychain-qt6", "version": "0.14.1", + "port-version": 1, "description": "(Unaffiliated with Qt) Platform-independent Qt6 API for storing passwords securely", "homepage": "https://github.com/frankosterfeld/qtkeychain", "license": "BSD-3-Clause", "dependencies": [ { "name": "libsecret", - "platform": "!(windows | uwp | osx)" + "platform": "linux" + }, + { + "name": "qtbase", + "default-features": false }, { "name": "qttools", + "host": true, "features": [ "linguist" ] diff --git a/ports/rubberband/portfile.cmake b/ports/rubberband/portfile.cmake index f798852e9e7fe2..8f2ece76d6a23a 100644 --- a/ports/rubberband/portfile.cmake +++ b/ports/rubberband/portfile.cmake @@ -14,9 +14,12 @@ else() endif() # Select fastest available FFT library according https://github.com/breakfastquay/rubberband/blob/default/COMPILING.md#fft-libraries-supported -if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")) - set(FFT_LIB "fftw") -elseif(VCPKG_TARGET_IS_OSX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") +if( + (VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")) + OR (VCPKG_TARGET_IS_OSX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + OR VCPKG_TARGET_IS_IOS + OR VCPKG_TARGET_IS_EMSCRIPTEN +) set(FFT_LIB "fftw") else() set(FFT_LIB "sleef") diff --git a/ports/rubberband/vcpkg.json b/ports/rubberband/vcpkg.json index 39322b15f5b6c4..c307026e5b2529 100644 --- a/ports/rubberband/vcpkg.json +++ b/ports/rubberband/vcpkg.json @@ -1,6 +1,7 @@ { "name": "rubberband", "version": "3.3.0", + "port-version": 1, "description": "A high quality software library for audio time-stretching and pitch-shifting.", "homepage": "https://www.breakfastquay.com/rubberband/", "license": "GPL-2.0-or-later", @@ -8,12 +9,12 @@ "dependencies": [ { "name": "fftw3", - "platform": "(arm & windows) | (x86 & windows) | (arm64 & osx)" + "platform": "(arm & windows) | (x86 & windows) | (arm64 & osx) | ios | emscripten" }, "libsamplerate", { "name": "sleef", - "platform": "!(arm & windows) & !(x86 & windows) & !(arm64 & osx)" + "platform": "!(arm & windows) & !(x86 & windows) & !(arm64 & osx) & !ios & !emscripten" }, { "name": "vcpkg-tool-meson", diff --git a/ports/soundtouch/portfile.cmake b/ports/soundtouch/portfile.cmake index 501094ddd2f3b9..2ce7274acc7dbe 100644 --- a/ports/soundtouch/portfile.cmake +++ b/ports/soundtouch/portfile.cmake @@ -5,6 +5,8 @@ vcpkg_from_github( REF ${VERSION} SHA512 93f757b2c1abe16be589e0d191e6c0416c5980843bd416cd5cb820b65a705d98081c0fc7ca0d9880af54b5343318262c77ba39a096bb240ceec084e93ceef964 HEAD_REF master + PATCHES + use-o3-emscripten.patch # Upstream PR: https://codeberg.org/soundtouch/soundtouch/pulls/29 ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/soundtouch/use-o3-emscripten.patch b/ports/soundtouch/use-o3-emscripten.patch new file mode 100644 index 00000000000000..eaaa9fe912e744 --- /dev/null +++ b/ports/soundtouch/use-o3-emscripten.patch @@ -0,0 +1,34 @@ +From 405c4586d4556982fd5bbddf1c70bc4815465c51 Mon Sep 17 00:00:00 2001 +Date: Sat, 2 Mar 2024 23:02:06 +0100 +Subject: [PATCH] Use -O3 instead of -Ofast when targeting Emscripten (WASM) + +--- + CMakeLists.txt | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 14f23e8..dabcb9c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3,11 +3,16 @@ project(SoundTouch VERSION 2.3.2 LANGUAGES CXX) + + include(GNUInstallDirs) + ++set(COMPILE_OPTIONS) ++ + if(MSVC) + set(COMPILE_DEFINITIONS /O2 /fp:fast) +- set(COMPILE_OPTIONS ) + else() +- set(COMPILE_OPTIONS -Ofast) ++ if(EMSCRIPTEN) ++ list(APPEND COMPILE_OPTIONS -O3) ++ else() ++ list(APPEND COMPILE_OPTIONS -Ofast) ++ endif() + endif() + + ##################### +-- +2.43.0 + diff --git a/ports/soundtouch/vcpkg.json b/ports/soundtouch/vcpkg.json index db166e6369bf3f..d0ee6f74837ffe 100644 --- a/ports/soundtouch/vcpkg.json +++ b/ports/soundtouch/vcpkg.json @@ -1,7 +1,7 @@ { "name": "soundtouch", "version": "2.3.2", - "port-version": 2, + "port-version": 3, "description": "SoundTouch is an open-source audio processing library for changing the Tempo, Pitch and Playback Rates of audio streams or audio files.", "homepage": "https://www.surina.net/soundtouch", "supports": "!uwp", diff --git a/vcpkg.json b/vcpkg.json index d0a16f13a2f058..4f0b52a2e575c1 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -49,20 +49,17 @@ "libflac", { "name": "libid3tag", - "platform": "windows" + "platform": "!osx & !ios" }, "libkeyfinder", { "name": "libmad", - "platform": "!osx" + "platform": "!osx & !ios" }, "libmodplug", "libogg", "libopusenc", - { - "name": "libsndfile", - "default-features": false - }, + "libsndfile", "libusb", "libvorbis", "lilv", diff --git a/versions/baseline.json b/versions/baseline.json index 9033954af44373..e07a94cead1e55 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3322,7 +3322,7 @@ }, "icu": { "baseline": "73.1", - "port-version": 0 + "port-version": 2 }, "ideviceinstaller": { "baseline": "2023-07-21", @@ -4186,7 +4186,7 @@ }, "libflac": { "baseline": "1.4.3", - "port-version": 0 + "port-version": 2 }, "libfontenc": { "baseline": "1.1.4", @@ -4406,7 +4406,7 @@ }, "libmad": { "baseline": "0.16.4", - "port-version": 1 + "port-version": 3 }, "libmagic": { "baseline": "5.40", @@ -4450,7 +4450,7 @@ }, "libmodplug": { "baseline": "0.8.9.0", - "port-version": 10 + "port-version": 11 }, "libmorton": { "baseline": "0.2.12", @@ -6418,7 +6418,7 @@ }, "pcre2": { "baseline": "10.42", - "port-version": 1 + "port-version": 2 }, "pdal": { "baseline": "2.5.3", @@ -7046,7 +7046,7 @@ }, "qtkeychain-qt6": { "baseline": "0.14.1", - "port-version": 0 + "port-version": 1 }, "qtlanguageserver": { "baseline": "6.5.3", @@ -7474,7 +7474,7 @@ }, "rubberband": { "baseline": "3.3.0", - "port-version": 0 + "port-version": 1 }, "rxcpp": { "baseline": "4.1.1", @@ -7914,7 +7914,7 @@ }, "soundtouch": { "baseline": "2.3.2", - "port-version": 1 + "port-version": 3 }, "soxr": { "baseline": "0.1.3", diff --git a/versions/i-/icu.json b/versions/i-/icu.json index 7cd3b924823572..d76f3d6c058d36 100644 --- a/versions/i-/icu.json +++ b/versions/i-/icu.json @@ -1,5 +1,15 @@ { "versions": [ + { + "git-tree": "b6ac20c2420a4f7118d5db326c8c599e50b2c5a4", + "version": "73.1", + "port-version": 2 + }, + { + "git-tree": "deb5694d7965a264d6eb579df49aff4fe6362c24", + "version": "73.1", + "port-version": 1 + }, { "git-tree": "acc3cf9137af5fc8fdd3e8607377026cf88f144d", "version": "73.1", diff --git a/versions/l-/libflac.json b/versions/l-/libflac.json index 4881803176cae8..0a6a5e812834a6 100644 --- a/versions/l-/libflac.json +++ b/versions/l-/libflac.json @@ -1,5 +1,15 @@ { "versions": [ + { + "git-tree": "a92a3397dfb70e6eec94fab7b3665a1288d9f7bd", + "version": "1.4.3", + "port-version": 2 + }, + { + "git-tree": "8a05fdac2efaa1a739e13289a2bec7d6d32e84a3", + "version": "1.4.3", + "port-version": 1 + }, { "git-tree": "b03480bcc5f27cdc9a5f51fef012f880f1b0bf8d", "version": "1.4.3", diff --git a/versions/l-/libmad.json b/versions/l-/libmad.json index 2529730c15cde9..f604378424dbb3 100644 --- a/versions/l-/libmad.json +++ b/versions/l-/libmad.json @@ -1,5 +1,15 @@ { "versions": [ + { + "git-tree": "69c818a7eba6f5da1e09077064ee37a12887ecf0", + "version": "0.16.4", + "port-version": 3 + }, + { + "git-tree": "204aa1729bb363c40a79cbcdb3beab84fa4bd03e", + "version": "0.16.4", + "port-version": 2 + }, { "git-tree": "7016c2c6c5e65a6420a176aa97696897bb134c40", "version": "0.16.4", diff --git a/versions/l-/libmodplug.json b/versions/l-/libmodplug.json index 0cc70772131d42..d05d041b32c530 100644 --- a/versions/l-/libmodplug.json +++ b/versions/l-/libmodplug.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d9af89d39aa5f14bf7314ebc51bc74df26ff2a3b", + "version": "0.8.9.0", + "port-version": 11 + }, { "git-tree": "605d260810f9d1a489af7fb484d509581b39763d", "version": "0.8.9.0", diff --git a/versions/p-/pcre2.json b/versions/p-/pcre2.json index f615a1d26a1a72..7510f429c455fd 100644 --- a/versions/p-/pcre2.json +++ b/versions/p-/pcre2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "20b801575053f62e43a5ab22a8812e3f01302e88", + "version": "10.42", + "port-version": 2 + }, { "git-tree": "678c2336c4102c5a8868570c60140fdc2a8d1dcf", "version": "10.42", diff --git a/versions/q-/qtkeychain-qt6.json b/versions/q-/qtkeychain-qt6.json index d004ef1bde4ee5..17c1540656db07 100644 --- a/versions/q-/qtkeychain-qt6.json +++ b/versions/q-/qtkeychain-qt6.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "43422edc152951a565a24a097c3c52a1b1ac1e4f", + "version": "0.14.1", + "port-version": 1 + }, { "git-tree": "dcb9fb0fa722410c03a4d6fbfdb3608af68de9d5", "version": "0.14.1", diff --git a/versions/r-/rubberband.json b/versions/r-/rubberband.json index 05335a9964f19e..1202e7e70b6292 100644 --- a/versions/r-/rubberband.json +++ b/versions/r-/rubberband.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "478bcca88451fbdd2fa88816f21449c1b8675e9d", + "version": "3.3.0", + "port-version": 1 + }, { "git-tree": "f3a5ed426944950b92d114499028a3c4c5ed3219", "version": "3.3.0", diff --git a/versions/s-/soundtouch.json b/versions/s-/soundtouch.json index 428a6f97649332..d21a542a53fff7 100644 --- a/versions/s-/soundtouch.json +++ b/versions/s-/soundtouch.json @@ -1,5 +1,15 @@ { "versions": [ + { + "git-tree": "a30af1c2b397ee59f6c0048c5453ebbdf4626415", + "version": "2.3.2", + "port-version": 3 + }, + { + "git-tree": "ac2649a7dd79e3a99721c357c744f81b94643a3c", + "version": "2.3.2", + "port-version": 2 + }, { "git-tree": "a2f43b08cb75d26f5756e611a64f5708dcbfb0a1", "version": "2.3.2",