diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/fluidsynth | |
Diffstat (limited to 'vcpkg/ports/fluidsynth')
| -rw-r--r-- | vcpkg/ports/fluidsynth/cmake-config-glib.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/fluidsynth/portfile.cmake | 92 | ||||
| -rw-r--r-- | vcpkg/ports/fluidsynth/usage | 10 | ||||
| -rw-r--r-- | vcpkg/ports/fluidsynth/vcpkg.json | 48 |
4 files changed, 163 insertions, 0 deletions
diff --git a/vcpkg/ports/fluidsynth/cmake-config-glib.diff b/vcpkg/ports/fluidsynth/cmake-config-glib.diff new file mode 100644 index 0000000..77e1f6a --- /dev/null +++ b/vcpkg/ports/fluidsynth/cmake-config-glib.diff @@ -0,0 +1,13 @@ +diff --git a/FluidSynthConfig.cmake.in b/FluidSynthConfig.cmake.in +index e6e9840..5831f9a 100644 +--- a/FluidSynthConfig.cmake.in ++++ b/FluidSynthConfig.cmake.in +@@ -74,7 +74,7 @@ if(NOT FLUIDSYNTH_IS_SHARED) + find_dependency(Threads) + endif() + +- if(FLUIDSYNTH_SUPPORT_GLIB AND NOT TARGET GLib2::glib-2 OR NOT TARGET GLib2::gthread-2) ++ if(FLUIDSYNTH_SUPPORT_GLIB AND (NOT TARGET GLib2::glib-2 OR NOT TARGET GLib2::gthread-2)) + find_dependency(GLib2 @GLIB2_MINUMUM_VERSION@) + endif() + diff --git a/vcpkg/ports/fluidsynth/portfile.cmake b/vcpkg/ports/fluidsynth/portfile.cmake new file mode 100644 index 0000000..80620f8 --- /dev/null +++ b/vcpkg/ports/fluidsynth/portfile.cmake @@ -0,0 +1,92 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO FluidSynth/fluidsynth + REF "v${VERSION}" + SHA512 8f326db4049b3241c7a0472aa5db8c715dcfc0a1ce9c5fda492bf84e6c17e27a2298131a58a51e275797259a434e59bfe3f53d85358f903652dca8de753a3376 + HEAD_REF master + PATCHES + cmake-config-glib.diff +) +# Do not use or install FindSndFileLegacy.cmake and its deps +file(REMOVE + "${SOURCE_PATH}/cmake_admin/FindFLAC.cmake" + "${SOURCE_PATH}/cmake_admin/Findmp3lame.cmake" + "${SOURCE_PATH}/cmake_admin/Findmpg123.cmake" + "${SOURCE_PATH}/cmake_admin/FindOgg.cmake" + "${SOURCE_PATH}/cmake_admin/FindOpus.cmake" + "${SOURCE_PATH}/cmake_admin/FindSndFileLegacy.cmake" + "${SOURCE_PATH}/cmake_admin/FindVorbis.cmake" +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + libinstpatch enable-libinstpatch + sndfile enable-libsndfile + pulseaudio enable-pulseaudio +) + +# enable platform-specific features, force the build to fail if the required libraries are not found, +# and disable all other features to avoid system libraries to be picked up +set(WINDOWS_OPTIONS enable-dsound enable-wasapi enable-waveout enable-winmidi HAVE_MMSYSTEM_H HAVE_DSOUND_H HAVE_OBJBASE_H) +set(MACOS_OPTIONS enable-coreaudio enable-coremidi COREAUDIO_FOUND COREMIDI_FOUND) +set(LINUX_OPTIONS enable-alsa ALSA_FOUND) +set(ANDROID_OPTIONS enable-opensles OpenSLES_FOUND) +set(IGNORED_OPTIONS enable-coverage enable-dbus enable-floats enable-fpe-check enable-framework enable-jack + enable-libinstpatch enable-midishare enable-oboe enable-openmp enable-oss enable-pipewire enable-portaudio + enable-profiling enable-readline enable-sdl3 enable-systemd enable-trap-on-fpe enable-ubsan) + +if(VCPKG_TARGET_IS_WINDOWS) + set(OPTIONS_TO_ENABLE ${WINDOWS_OPTIONS}) + set(OPTIONS_TO_DISABLE ${MACOS_OPTIONS} ${LINUX_OPTIONS} ${ANDROID_OPTIONS}) +elseif(VCPKG_TARGET_IS_OSX) + set(OPTIONS_TO_ENABLE ${MACOS_OPTIONS}) + set(OPTIONS_TO_DISABLE ${WINDOWS_OPTIONS} ${LINUX_OPTIONS} ${ANDROID_OPTIONS}) +elseif(VCPKG_TARGET_IS_LINUX) + set(OPTIONS_TO_ENABLE ${LINUX_OPTIONS}) + set(OPTIONS_TO_DISABLE ${WINDOWS_OPTIONS} ${MACOS_OPTIONS} ${ANDROID_OPTIONS}) +elseif(VCPKG_TARGET_IS_ANDROID) + set(OPTIONS_TO_ENABLE ${ANDROID_OPTIONS}) + set(OPTIONS_TO_DISABLE ${WINDOWS_OPTIONS} ${MACOS_OPTIONS} ${LINUX_OPTIONS}) +endif() + +foreach(_option IN LISTS OPTIONS_TO_ENABLE) + list(APPEND ENABLED_OPTIONS "-D${_option}:BOOL=ON") +endforeach() + +foreach(_option IN LISTS OPTIONS_TO_DISABLE IGNORED_OPTIONS) + list(APPEND DISABLED_OPTIONS "-D${_option}:BOOL=OFF") +endforeach() + +vcpkg_find_acquire_program(PKGCONFIG) +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + ${ENABLED_OPTIONS} + ${DISABLED_OPTIONS} + "-Dosal=cpp11" + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" + MAYBE_UNUSED_VARIABLES + ${OPTIONS_TO_DISABLE} + enable-coverage + enable-framework + enable-ubsan +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/fluidsynth) +vcpkg_fixup_pkgconfig() + +vcpkg_copy_tools(TOOL_NAMES fluidsynth AUTO_CLEAN) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/man") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + diff --git a/vcpkg/ports/fluidsynth/usage b/vcpkg/ports/fluidsynth/usage new file mode 100644 index 0000000..ea5f1ea --- /dev/null +++ b/vcpkg/ports/fluidsynth/usage @@ -0,0 +1,10 @@ +fluidsynth provides CMake targets: + + find_package(FluidSynth CONFIG REQUIRED) + target_link_libraries(main PRIVATE FluidSynth::libfluidsynth) + add_custom_command(OUTPUT result COMMAND FluidSynth::q ARGS ...) + +fluidsynth provides pkg-config modules: + + # Software SoundFont synth + fluidsynth diff --git a/vcpkg/ports/fluidsynth/vcpkg.json b/vcpkg/ports/fluidsynth/vcpkg.json new file mode 100644 index 0000000..802efec --- /dev/null +++ b/vcpkg/ports/fluidsynth/vcpkg.json @@ -0,0 +1,48 @@ +{ + "name": "fluidsynth", + "version": "2.5.0", + "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", + "license": "LGPL-2.1-or-later", + "supports": "!(uwp | xbox)", + "dependencies": [ + { + "name": "alsa", + "platform": "linux" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "libinstpatch": { + "description": "Use libinstpatch for DLS support. Required if C++17 is not available", + "dependencies": [ + "glib" + ] + }, + "pulseaudio": { + "description": "Build with PulseAudio support", + "dependencies": [ + "pulseaudio" + ] + }, + "sndfile": { + "description": "Enable rendering to file and SF3 support", + "dependencies": [ + { + "name": "libsndfile", + "default-features": false, + "features": [ + "external-libs" + ] + } + ] + } + } +} |