Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluidsynth] Update to 2.2.4 #20978

Merged
merged 21 commits into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions ports/fluidsynth/force-x86-gentables.patch
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 356bb73..b4c43d7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -410,14 +410,23 @@ set (GENTAB_BDIR ${CMAKE_CURRENT_BINARY_DIR}/gentables)
# To fix cross-compiling fluidsynth from Win32 to ARM (using vcpkg), we need to pass the current generator
# on to the external project, otherwise (for some unknown reason) the target compiler will be used rather
# than the host compiler.
-ExternalProject_Add(gentables
- DOWNLOAD_COMMAND ""
- SOURCE_DIR ${GENTAB_SDIR}
- BINARY_DIR ${GENTAB_BDIR}
- CONFIGURE_COMMAND
- "${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}"
- BUILD_COMMAND
- "${CMAKE_COMMAND}" --build "${GENTAB_BDIR}"
- INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${CMAKE_BINARY_DIR}/"
-)
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
+ ExternalProject_Add(gentables
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
+ CONFIGURE_COMMAND
+ "${CMAKE_COMMAND}" "${CMAKE_CURRENT_SOURCE_DIR}/gentables" -G "${CMAKE_GENERATOR}" -A Win32 -B "${CMAKE_CURRENT_BINARY_DIR}/gentables"
+ BUILD_COMMAND
+ "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/gentables"
+ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/"
+ )
+else()
+ ExternalProject_Add(gentables
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gentables
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gentables
+ INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gentables/make_tables.exe "${CMAKE_BINARY_DIR}/"
+ )
+endif()
add_dependencies(libfluidsynth-OBJ gentables)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
index e913cb2..107f777 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -424,14 +424,24 @@ set (GENTAB_BDIR ${CMAKE_CURRENT_BINARY_DIR}/gentables)
# To fix cross-compiling fluidsynth from Win32 to ARM (using vcpkg), we need to pass the current generator
# on to the external project, otherwise (for some unknown reason) the target compiler will be used rather
# than the host compiler.
-ExternalProject_Add(gentables
- DOWNLOAD_COMMAND ""
- SOURCE_DIR ${GENTAB_SDIR}
- BINARY_DIR ${GENTAB_BDIR}
- CONFIGURE_COMMAND
- "${CMAKE_COMMAND}" -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} -G "${CMAKE_GENERATOR}" -B "${GENTAB_BDIR}" "${GENTAB_SDIR}"
- BUILD_COMMAND
- "${CMAKE_COMMAND}" --build "${GENTAB_BDIR}"
- INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${CMAKE_BINARY_DIR}/"
-)
+set(CMAKE_DISABLE_SOURCE_CHANGES OFF)
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL arm OR VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
+ ExternalProject_Add(gentables
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ${GENTAB_SDIR}
+ BINARY_DIR ${GENTAB_BDIR}
+ CONFIGURE_COMMAND
+ "${CMAKE_COMMAND}" "${GENTAB_SDIR}" -A Win32 -B "${GENTAB_BDIR}"
+ BUILD_COMMAND
+ "${CMAKE_COMMAND}" --build "${GENTAB_BDIR}"
+ INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${CMAKE_BINARY_DIR}/"
+ )
+else()
+ ExternalProject_Add(gentables
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ${GENTAB_SDIR}
+ BINARY_DIR ${GENTAB_BDIR}
+ INSTALL_COMMAND ${GENTAB_BDIR}/make_tables.exe "${CMAKE_BINARY_DIR}/"
+ )
+endif()
add_dependencies(libfluidsynth-OBJ gentables)
24 changes: 14 additions & 10 deletions ports/fluidsynth/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO FluidSynth/fluidsynth
REF 90a6c52e1c347d1c4283b0de9f860ed2fbc413bc #v2.2.1
SHA512 311a078e95204baf9b348fb8c83370003982fad59553de945437fec7647c9237dd4382f9f8f70080ed472745c66fe528764cd898581d628ab4422427c3d58b3a
REF 926581851ed1a095ef5b8659f77b38272d57e624 #v2.2.3
SHA512 df30a3df20ba4c1c3f248e718c47856761004b5a63285e55e46bc1a3dd61b0b2d4b0b1139d0edf64135de68d6592f84bcf5308c76a9774415769b8d3aa682a7a
HEAD_REF master
PATCHES
force-x86-gentables.patch
force-x86-gentables.patch
)

set(feature_list dbus jack libinstpatch libsndfile midishare opensles oboe oss sdl2 pulseaudio readline lash alsa systemd coreaudio coremidi dart)
Expand All @@ -15,28 +15,32 @@ foreach(_feature IN LISTS feature_list)
endforeach()

vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}
-DLIB_INSTALL_DIR=lib
OPTIONS_DEBUG
-Denable-debug:BOOL=ON
MAYBE_UNUSED_VARIABLES
enable-coreaudio
enable-coremidi
enable-dart
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# Copy fluidsynth.exe to tools dir
vcpkg_copy_tools(TOOL_NAMES fluidsynth AUTO_CLEAN)

# Remove unnecessary files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 6 additions & 3 deletions ports/fluidsynth/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "fluidsynth",
"version": "2.2.1",
"port-version": 1,
"version": "2.2.3",
"description": "FluidSynth reads and handles MIDI events from the MIDI input device. It is the software analogue of a MIDI synthesizer. FluidSynth can also play midifiles using a Soundfont.",
"homepage": "https://github.com/FluidSynth/fluidsynth",
"dependencies": [
"glib"
"glib",
{
"name": "vcpkg-cmake",
"host": true
}
]
}