aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/juce
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/juce')
-rw-r--r--vcpkg/ports/juce/0001-build-allow-setting-JUCE_PLUGINHOST_LADSPA.patch15
-rw-r--r--vcpkg/ports/juce/0004-install-paths.patch23
-rw-r--r--vcpkg/ports/juce/avoid-macos-15-deprecations.patch20
-rw-r--r--vcpkg/ports/juce/devendor-oboe.diff17
-rw-r--r--vcpkg/ports/juce/gcc-has-builtin.diff12
-rw-r--r--vcpkg/ports/juce/install-extras.diff19
-rw-r--r--vcpkg/ports/juce/juceaide.diff92
-rw-r--r--vcpkg/ports/juce/portfile.cmake174
-rw-r--r--vcpkg/ports/juce/prefer-cmake.diff45
-rw-r--r--vcpkg/ports/juce/usage30
-rw-r--r--vcpkg/ports/juce/vcpkg-compile-definitions.diff27
-rw-r--r--vcpkg/ports/juce/vcpkg.json179
12 files changed, 653 insertions, 0 deletions
diff --git a/vcpkg/ports/juce/0001-build-allow-setting-JUCE_PLUGINHOST_LADSPA.patch b/vcpkg/ports/juce/0001-build-allow-setting-JUCE_PLUGINHOST_LADSPA.patch
new file mode 100644
index 0000000..3c714e6
--- /dev/null
+++ b/vcpkg/ports/juce/0001-build-allow-setting-JUCE_PLUGINHOST_LADSPA.patch
@@ -0,0 +1,15 @@
+diff --git a/extras/AudioPluginHost/CMakeLists.txt b/extras/AudioPluginHost/CMakeLists.txt
+index 852796383..37a5306c9 100644
+--- a/extras/AudioPluginHost/CMakeLists.txt
++++ b/extras/AudioPluginHost/CMakeLists.txt
+@@ -51,7 +51,7 @@ target_compile_definitions(AudioPluginHost PRIVATE
+ JUCE_CONTENT_SHARING=1
+ JUCE_DIRECTSOUND=1
+ JUCE_DISABLE_CAUTIOUS_PARAMETER_ID_CHECKING=1
+- JUCE_PLUGINHOST_LADSPA=1
++ JUCE_PLUGINHOST_LADSPA=${JUCE_PLUGINHOST_LADSPA}
+ JUCE_PLUGINHOST_LV2=1
+ JUCE_PLUGINHOST_VST3=1
+ JUCE_PLUGINHOST_VST=0
+--
+2.34.1
diff --git a/vcpkg/ports/juce/0004-install-paths.patch b/vcpkg/ports/juce/0004-install-paths.patch
new file mode 100644
index 0000000..c665118
--- /dev/null
+++ b/vcpkg/ports/juce/0004-install-paths.patch
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4262a9852..a46b51f1a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -167,14 +167,14 @@ if(("${CMAKE_SOURCE_DIR}" STREQUAL "${JUCE_SOURCE_DIR}") AND (NOT JUCE_BUILD_HEL
+ _juce_add_lv2_manifest_helper_target()
+
+ if(TARGET juce_lv2_helper)
+- install(TARGETS juce_lv2_helper EXPORT LV2_HELPER DESTINATION "bin/JUCE-${JUCE_VERSION}")
++ install(TARGETS juce_lv2_helper EXPORT LV2_HELPER DESTINATION "${JUCE_TOOL_INSTALL_DIR}")
+ install(EXPORT LV2_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
+ endif()
+
+ _juce_add_vst3_manifest_helper_target()
+
+ if(TARGET juce_vst3_helper)
+- install(TARGETS juce_vst3_helper EXPORT VST3_HELPER DESTINATION "bin/JUCE-${JUCE_VERSION}")
++ install(TARGETS juce_vst3_helper EXPORT VST3_HELPER DESTINATION "${JUCE_TOOL_INSTALL_DIR}")
+ install(EXPORT VST3_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
+ endif()
+ endif()
+--
+2.34.1
diff --git a/vcpkg/ports/juce/avoid-macos-15-deprecations.patch b/vcpkg/ports/juce/avoid-macos-15-deprecations.patch
new file mode 100644
index 0000000..30cf3b9
--- /dev/null
+++ b/vcpkg/ports/juce/avoid-macos-15-deprecations.patch
@@ -0,0 +1,20 @@
+diff --git a/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h b/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h
+index 4562abf..8b1883b 100644
+--- a/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h
++++ b/modules/juce_gui_basics/native/juce_PerScreenDisplayLinks_mac.h
+@@ -23,6 +23,9 @@
+ ==============================================================================
+ */
+
++#pragma clang diagnostic push
++#pragma clang diagnostic ignored "-Wdeprecated-declarations"
++
+ namespace juce
+ {
+
+@@ -302,3 +305,5 @@ private:
+ };
+
+ } // namespace juce
++
++#pragma clang diagnostic pop
diff --git a/vcpkg/ports/juce/devendor-oboe.diff b/vcpkg/ports/juce/devendor-oboe.diff
new file mode 100644
index 0000000..c45949a
--- /dev/null
+++ b/vcpkg/ports/juce/devendor-oboe.diff
@@ -0,0 +1,17 @@
+diff --git a/extras/Build/CMake/JUCEModuleSupport.cmake b/extras/Build/CMake/JUCEModuleSupport.cmake
+index afefe2d..2dd2ecf 100644
+--- a/extras/Build/CMake/JUCEModuleSupport.cmake
++++ b/extras/Build/CMake/JUCEModuleSupport.cmake
+@@ -603,8 +603,10 @@ function(juce_add_module module_path)
+ endif()
+
+ if((${module_name} STREQUAL "juce_audio_devices") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))
+- add_subdirectory("${module_path}/native/oboe")
+- target_link_libraries(${module_name} INTERFACE oboe)
++ find_path(JUCE_OBOE_INCLUDE_DIR NAMES oboe/Oboe.h REQUIRED)
++ target_include_directories(${module_name} INTERFACE "${JUCE_OBOE_INCLUDE_DIR}")
++ find_library(JUCE_OBOE_LIBRARY NAMES oboe REQUIRED)
++ target_link_libraries(${module_name} INTERFACE "${JUCE_OBOE_LIBRARY}" log OpenSLES)
+ endif()
+
+ if((${module_name} STREQUAL "juce_opengl") AND (CMAKE_SYSTEM_NAME STREQUAL "Android"))
diff --git a/vcpkg/ports/juce/gcc-has-builtin.diff b/vcpkg/ports/juce/gcc-has-builtin.diff
new file mode 100644
index 0000000..b403964
--- /dev/null
+++ b/vcpkg/ports/juce/gcc-has-builtin.diff
@@ -0,0 +1,12 @@
+diff --git a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
+index a491af9..44e934a 100644
+--- a/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
++++ b/modules/juce_graphics/juce_graphics_Harfbuzz.cpp
+@@ -84,7 +84,6 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations",
+ // -Wexpansion-to-defined on gcc 7. There's no way to turn that warning off
+ // locally, so we sidestep it.
+ #if ! defined(__has_builtin) && defined(__GNUC__) && __GNUC__ >= 5
+- #define __has_builtin(x) 1
+ #endif
+
+ #include <utility>
diff --git a/vcpkg/ports/juce/install-extras.diff b/vcpkg/ports/juce/install-extras.diff
new file mode 100644
index 0000000..ae80aef
--- /dev/null
+++ b/vcpkg/ports/juce/install-extras.diff
@@ -0,0 +1,19 @@
+diff --git a/extras/CMakeLists.txt b/extras/CMakeLists.txt
+index 7f5555e..539f1cb 100644
+--- a/extras/CMakeLists.txt
++++ b/extras/CMakeLists.txt
+@@ -35,5 +35,14 @@ add_subdirectory(AudioPerformanceTest)
+ add_subdirectory(AudioPluginHost)
+ add_subdirectory(BinaryBuilder)
+ add_subdirectory(NetworkGraphicsDemo)
++if(NOT ANDROID AND NOT IOS)
+ add_subdirectory(Projucer)
++endif()
+ add_subdirectory(UnitTestRunner)
++
++file(GLOB tools RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
++foreach(tool IN LISTS tools)
++ if(TARGET "${tool}")
++ install(TARGETS "${tool}" DESTINATION "${JUCE_TOOL_INSTALL_DIR}")
++ endif()
++endforeach()
diff --git a/vcpkg/ports/juce/juceaide.diff b/vcpkg/ports/juce/juceaide.diff
new file mode 100644
index 0000000..d868abf
--- /dev/null
+++ b/vcpkg/ports/juce/juceaide.diff
@@ -0,0 +1,92 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 49d85c6..76209f5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,3 +1,5 @@
++# Save cmake input for nested juceaide build
++get_cmake_property(vcpkg_input_vars CACHE_VARIABLES)
+ # ==============================================================================
+ #
+ # This file is part of the JUCE framework.
+@@ -142,7 +144,10 @@ set(JUCE_INSTALL_DESTINATION "lib/cmake/JUCE-${JUCE_VERSION}" CACHE STRING
+
+ set(JUCE_MODULE_PATH "include/JUCE-${JUCE_VERSION}/modules")
+ set(UTILS_INSTALL_DIR "${JUCE_INSTALL_DESTINATION}")
+-set(JUCEAIDE_PATH "${JUCE_TOOL_INSTALL_DIR}/${JUCE_JUCEAIDE_NAME}")
++set(JUCEAIDE_PATH "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/juce/${JUCE_JUCEAIDE_NAME}")
++if(WITH_JUCEAIDE)
++ set(JUCEAIDE_PATH "${WITH_JUCEAIDE}")
++endif()
+ configure_package_config_file("${JUCE_CMAKE_UTILS_DIR}/JUCEConfig.cmake.in"
+ "${JUCE_BINARY_DIR}/JUCEConfig.cmake"
+ PATH_VARS UTILS_INSTALL_DIR JUCEAIDE_PATH JUCE_MODULE_PATH
+diff --git a/extras/Build/juceaide/CMakeLists.txt b/extras/Build/juceaide/CMakeLists.txt
+index 17e5520974..b8cab564ec 100644
+--- a/extras/Build/juceaide/CMakeLists.txt
++++ b/extras/Build/juceaide/CMakeLists.txt
+@@ -60,6 +60,11 @@ if(JUCE_BUILD_HELPER_TOOLS)
+ export(TARGETS juceaide
+ NAMESPACE juce_tools::
+ FILE "${JUCE_BINARY_DIR}/JUCEToolsExport.cmake")
++
++elseif(WITH_JUCEAIDE)
++ add_executable(juceaide IMPORTED GLOBAL)
++ set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${WITH_JUCEAIDE}")
++ add_executable(juce::juceaide ALIAS juceaide)
+ else()
+ message(STATUS "Configuring juceaide")
+
+@@ -124,14 +129,25 @@ else()
+ list(APPEND PASSTHROUGH_ARGS "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
+ endif()
+
++ list(REMOVE_ITEM vcpkg_input_vars "JUCE_BUILD_EXTRAS")
++ foreach(var IN LISTS vcpkg_input_vars)
++ list(APPEND PASSTHROUGH_ARGS "-D${var}=$CACHE{${var}}")
++ endforeach()
++
++ if (NOT DEFINED CMAKE_BUILD_TYPE)
++ set(JUCE_JUCEAIDE_BUILD_TYPE "Release")
++ else()
++ set(JUCE_JUCEAIDE_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
++ endif()
++
+ # Looks like we're bootstrapping, reinvoke CMake
+ execute_process(COMMAND "${CMAKE_COMMAND}"
+ "."
+ "-B${JUCE_BINARY_DIR}/tools"
+ "-G${CMAKE_GENERATOR}"
+ "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}"
+- "-DCMAKE_CONFIGURATION_TYPES=Custom"
+- "-DCMAKE_BUILD_TYPE=Custom"
++ "-DCMAKE_CONFIGURATION_TYPES=${JUCE_JUCEAIDE_BUILD_TYPE}"
++ "-DCMAKE_BUILD_TYPE=${JUCE_JUCEAIDE_BUILD_TYPE}"
+ "-DJUCE_BUILD_HELPER_TOOLS=ON"
+ "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}"
+ ${PASSTHROUGH_ARGS}
+@@ -148,7 +164,8 @@ else()
+
+ execute_process(COMMAND "${CMAKE_COMMAND}"
+ --build "${JUCE_BINARY_DIR}/tools"
+- --config Custom
++ --config ${JUCE_JUCEAIDE_BUILD_TYPE}
++ --target juceaide
+ OUTPUT_VARIABLE command_output
+ ERROR_VARIABLE command_output
+ RESULT_VARIABLE result_variable)
+@@ -163,7 +180,14 @@ else()
+ include("${JUCE_BINARY_DIR}/tools/JUCEToolsExport.cmake")
+
+ add_executable(juceaide IMPORTED GLOBAL)
+- get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_CUSTOM)
++
++ string(TOUPPER ${JUCE_JUCEAIDE_BUILD_TYPE} JUCE_JUCEAIDE_BUILD_TYPE_UPPER)
++
++ get_target_property(imported_location juce_tools::juceaide IMPORTED_LOCATION_${JUCE_JUCEAIDE_BUILD_TYPE_UPPER})
++ if(NOT imported_location)
++ message(FATAL_ERROR "Failed to find imported location for juceaide")
++ endif()
++
+ set_target_properties(juceaide PROPERTIES IMPORTED_LOCATION "${imported_location}")
+
+ add_executable(juce::juceaide ALIAS juceaide)
diff --git a/vcpkg/ports/juce/portfile.cmake b/vcpkg/ports/juce/portfile.cmake
new file mode 100644
index 0000000..315ce76
--- /dev/null
+++ b/vcpkg/ports/juce/portfile.cmake
@@ -0,0 +1,174 @@
+set(VCPKG_BUILD_TYPE release) # no libraries
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO juce-framework/JUCE
+ REF "${VERSION}"
+ SHA512 ca404d94f8f79d9644f391342807dde279d1d313ef597a5d7fa88760e0459f2639cb98b6523c3ae71b2641357df63353c1f32e9b33dd9f050f5651fba470ec33
+ HEAD_REF master
+ PATCHES
+ 0001-build-allow-setting-JUCE_PLUGINHOST_LADSPA.patch
+ 0004-install-paths.patch
+ gcc-has-builtin.diff
+ devendor-oboe.diff
+ install-extras.diff
+ juceaide.diff
+ prefer-cmake.diff
+ vcpkg-compile-definitions.diff
+ avoid-macos-15-deprecations.patch
+)
+file(REMOVE_RECURSE "${SOURCE_PATH}/modules/juce_audio_devices/native/oboe")
+
+set(feature_compile_definitions
+ "curl" JUCE_USE_CURL
+ "fontconfig" JUCE_USE_FONTCONFIG
+ "freetype" JUCE_USE_FREETYPE
+ "jack" JUCE_JACK
+ "ladspa" JUCE_PLUGINHOST_LADSPA
+ "web-browser" JUCE_WEB_BROWSER
+ "xcursor" JUCE_USE_XCURSOR
+ "xinerama" JUCE_USE_XINERAMA
+ "xrandr" JUCE_USE_XRANDR
+ "xrender" JUCE_USE_XRENDER
+)
+set(enforced_definitions "")
+while(feature_compile_definitions)
+ list(POP_FRONT feature_compile_definitions feature compile_definition)
+ if(NOT feature IN_LIST FEATURES)
+ # Enforce controlled absence of dependency
+ list(APPEND enforced_definitions "${compile_definition}=0")
+ endif()
+endwhile()
+list(JOIN enforced_definitions "\n " enforced_definitions)
+file(WRITE "${SOURCE_PATH}/extras/Build/CMake/vcpkg-compile-definitions.cmake" "
+function(vcpkg_juce_add_compile_definitions target)
+ target_compile_definitions(\${target} INTERFACE
+ ${enforced_definitions}
+ )
+endfunction()
+")
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+FEATURES
+ "extras" JUCE_BUILD_EXTRAS
+ "ladspa" JUCE_PLUGINHOST_LADSPA
+)
+# Based on https://github.com/juce-framework/JUCE/blob/master/docs/Linux%20Dependencies.md
+if(VCPKG_TARGET_IS_LINUX)
+ message("juce currently requires the following programs from the system package manager:
+ libx11-dev libxcomposite-dev libxext-dev
+On Ubuntu derivatives:
+ sudo apt install libx11-dev libxcomposite-dev libxext-dev
+")
+ if(JUCE_OPENGL)
+ message("juce with opengl feature requires the following packages via the system package manager:
+ libglu1-mesa-dev mesa-common-dev
+On Ubuntu derivatives:
+ sudo apt install libglu1-mesa-dev mesa-common-dev
+")
+ endif()
+
+ if(${JUCE_PLUGINHOST_LADSPA})
+ message("juce with ladspa feature requires the following packages via the system package manager:
+ ladspa-sdk
+On Ubuntu derivatives:
+ sudo apt install ladspa-sdk
+")
+ endif()
+
+ if(JUCE_USE_XCURSOR)
+ message("juce with xcursor feature requires the following packages via the system package manager:
+ libxcursor-dev
+On Ubuntu derivatives:
+ sudo apt install libxcursor-dev
+")
+ endif()
+
+ if(JUCE_USE_XINERAMA)
+ message("juce with xinerama feature requires the following packages via the system package manager:
+ libxinerama-dev
+On Ubuntu derivatives:
+ sudo apt install libxinerama-dev
+")
+ endif()
+
+ if(JUCE_USE_XRANDR)
+ message("juce with xrandr feature requires the following packages via the system package manager:
+ libxrandr-dev
+On Ubuntu derivatives:
+ sudo apt install libxrandr-dev
+")
+ endif()
+
+ if(JUCE_USE_XRENDER)
+ message("juce with xrender feature requires the following packages via the system package manager:
+ libxrender-dev
+On Ubuntu derivatives:
+ sudo apt install libxrender-dev
+")
+ endif()
+
+ if(JUCE_WEB_BROWSER)
+ message("juce with web-browser feature requires the following packages via the system package manager:
+ libwebkit2gtk-4.0-dev
+On Ubuntu derivatives:
+ sudo apt install libwebkit2gtk-4.0-dev
+")
+ endif()
+endif()
+
+if(VCPKG_CROSSCOMPILING)
+ # Constructed with CURRENT_INSTALLED_DIR, for vcpkg_cmake_config_fixup.
+ list(APPEND FEATURE_OPTIONS "-DWITH_JUCEAIDE=${CURRENT_INSTALLED_DIR}/../${HOST_TRIPLET}/tools/${PORT}/juceaide${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+endif()
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DJUCE_ENABLE_MODULE_SOURCE_GROUPS=ON
+ -DJUCE_INSTALL_DESTINATION=share/juce
+ -DJUCE_TOOL_INSTALL_DIR=bin
+ ${FEATURE_OPTIONS}
+ MAYBE_UNUSED_VARIABLES
+ JUCE_TOOL_INSTALL_DIR
+ JUCE_PLUGINHOST_LADSPA
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(GLOB icons "${CURRENT_PACKAGES_DIR}/bin/*.ico")
+if(icons)
+ file(REMOVE_RECURSE ${icons})
+endif()
+
+set(tool_names "")
+file(GLOB tools "${CURRENT_PACKAGES_DIR}/bin/*")
+set(name_component NAME_WE)
+if(VCPKG_TARGET_EXECUTABLE_SUFFIX STREQUAL "")
+ set(name_component NAME)
+endif()
+foreach(tool IN LISTS tools)
+ get_filename_component(name "${tool}" ${name_component})
+ list(APPEND tool_names "${name}")
+endforeach()
+if(tool_names)
+ vcpkg_copy_tools(TOOL_NAMES ${tool_names} AUTO_CLEAN)
+endif()
+
+# Files not generated for Android or iOS
+file(TOUCH "${CURRENT_PACKAGES_DIR}/share/juce/LV2_HELPER.cmake")
+file(TOUCH "${CURRENT_PACKAGES_DIR}/share/juce/VST3_HELPER.cmake")
+
+# Catch libs which must be de-vendored, e.g. oboe.
+# This is to avoid ownership conflicts.
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib" "${CURRENT_PACKAGES_DIR}/include/oboe")
+if(EXISTS "${CURRENT_PACKAGES_DIR}/lib")
+ message(${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL} "juce must not install files to ${CURRENT_PACKAGES_DIR}/lib.")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
+endif()
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
diff --git a/vcpkg/ports/juce/prefer-cmake.diff b/vcpkg/ports/juce/prefer-cmake.diff
new file mode 100644
index 0000000..4395748
--- /dev/null
+++ b/vcpkg/ports/juce/prefer-cmake.diff
@@ -0,0 +1,45 @@
+diff --git a/extras/Build/CMake/JUCEModuleSupport.cmake b/extras/Build/CMake/JUCEModuleSupport.cmake
+index e89cc5d..afefe2d 100644
+--- a/extras/Build/CMake/JUCEModuleSupport.cmake
++++ b/extras/Build/CMake/JUCEModuleSupport.cmake
+@@ -390,10 +390,40 @@ function(_juce_create_pkgconfig_target name)
+ return()
+ endif()
+
++ # Prefer CMake over pkg-config
++ set(link_libs "")
++ if("alsa" IN_LIST JUCE_ARG_UNPARSED_ARGUMENTS)
++ list(REMOVE_ITEM JUCE_ARG_UNPARSED_ARGUMENTS "alsa")
++ find_package(ALSA REQUIRED)
++ list(APPEND link_libs ALSA::ALSA)
++ endif()
++ if("fontconfig" IN_LIST JUCE_ARG_UNPARSED_ARGUMENTS)
++ list(REMOVE_ITEM JUCE_ARG_UNPARSED_ARGUMENTS "fontconfig")
++ find_package(Fontconfig REQUIRED)
++ list(APPEND link_libs Fontconfig::Fontconfig)
++ endif()
++ if("freetype2" IN_LIST JUCE_ARG_UNPARSED_ARGUMENTS)
++ list(REMOVE_ITEM JUCE_ARG_UNPARSED_ARGUMENTS "freetype2")
++ find_package(Freetype REQUIRED)
++ list(APPEND link_libs Freetype::Freetype)
++ endif()
++ if("gl" IN_LIST JUCE_ARG_UNPARSED_ARGUMENTS)
++ list(REMOVE_ITEM JUCE_ARG_UNPARSED_ARGUMENTS "gl")
++ find_package(OpenGL REQUIRED)
++ list(APPEND link_libs OpenGL::GL)
++ endif()
++ if("libcurl" IN_LIST JUCE_ARG_UNPARSED_ARGUMENTS)
++ list(REMOVE_ITEM JUCE_ARG_UNPARSED_ARGUMENTS "libcurl")
++ find_package(CURL REQUIRED)
++ list(APPEND link_libs CURL::libcurl)
++ endif()
++ if(JUCE_ARG_UNPARSED_ARGUMENTS)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(${name} ${JUCE_ARG_UNPARSED_ARGUMENTS})
++ endif()
+
+ add_library(pkgconfig_${name} INTERFACE)
++ set_target_properties(pkgconfig_${name} PROPERTIES INTERFACE_LINK_LIBRARIES "${link_libs}")
+ add_library(juce::pkgconfig_${name} ALIAS pkgconfig_${name})
+ install(TARGETS pkgconfig_${name} EXPORT JUCE)
+
diff --git a/vcpkg/ports/juce/usage b/vcpkg/ports/juce/usage
new file mode 100644
index 0000000..a956743
--- /dev/null
+++ b/vcpkg/ports/juce/usage
@@ -0,0 +1,30 @@
+juce provides the following common CMake targets:
+
+ find_package(JUCE CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE
+ juce::juce_core
+ juce::juce_audio_basics
+ juce::juce_events
+ juce::juce_audio_devices
+ juce::juce_recommended_config_flags
+ juce::juce_recommended_lto_flags
+ juce::juce_recommended_warning_flags)
+
+See the Juce CMake API documentation and the License for details on how to create targets. Here are other available targets:
+
+ juce::juce_graphics
+ juce::juce_gui_basics
+ juce::juce_gui_extra
+ juce::juce_opengl
+ juce::juce_analytics
+ juce::juce_audio_formats
+ juce::juce_audio_plugin_client
+ juce::juce_audio_processors
+ juce::juce_audio_utils
+ juce::juce_box2d
+ juce::juce_cryptography
+ juce::juce_data_structures
+ juce::juce_dsp
+ juce::juce_osc
+ juce::juce_product_unlocking
+ juce::juce_video
diff --git a/vcpkg/ports/juce/vcpkg-compile-definitions.diff b/vcpkg/ports/juce/vcpkg-compile-definitions.diff
new file mode 100644
index 0000000..6ba0278
--- /dev/null
+++ b/vcpkg/ports/juce/vcpkg-compile-definitions.diff
@@ -0,0 +1,27 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 76209f5..69dc639 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -167,6 +167,7 @@ install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
+ "${JUCE_CMAKE_UTILS_DIR}/JUCECheckAtomic.cmake"
+ "${JUCE_CMAKE_UTILS_DIR}/JUCEHelperTargets.cmake"
+ "${JUCE_CMAKE_UTILS_DIR}/JUCEModuleSupport.cmake"
++ "${JUCE_CMAKE_UTILS_DIR}/vcpkg-compile-definitions.cmake"
+ "${JUCE_CMAKE_UTILS_DIR}/JUCEUtils.cmake"
+ "${JUCE_CMAKE_UTILS_DIR}/JuceLV2Defines.h.in"
+ "${JUCE_CMAKE_UTILS_DIR}/LaunchScreen.storyboard"
+diff --git a/extras/Build/CMake/JUCEModuleSupport.cmake b/extras/Build/CMake/JUCEModuleSupport.cmake
+index 2dd2ecf..635c50e 100644
+--- a/extras/Build/CMake/JUCEModuleSupport.cmake
++++ b/extras/Build/CMake/JUCEModuleSupport.cmake
+@@ -96,8 +96,10 @@ endif()
+
+ # ==================================================================================================
+
++include("${CMAKE_CURRENT_LIST_DIR}/vcpkg-compile-definitions.cmake")
+ function(_juce_add_interface_library target)
+ add_library(${target} INTERFACE)
++ vcpkg_juce_add_compile_definitions(${target})
+ target_sources(${target} INTERFACE ${ARGN})
+ endfunction()
+
diff --git a/vcpkg/ports/juce/vcpkg.json b/vcpkg/ports/juce/vcpkg.json
new file mode 100644
index 0000000..ae5f8ab
--- /dev/null
+++ b/vcpkg/ports/juce/vcpkg.json
@@ -0,0 +1,179 @@
+{
+ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
+ "name": "juce",
+ "version": "8.0.7",
+ "description": "Open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, AAX and LV2 audio plug-ins and plug-in hosts",
+ "homepage": "https://juce.com",
+ "license": null,
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "juce",
+ "host": true,
+ "default-features": false,
+ "features": [
+ "juceaide"
+ ]
+ },
+ {
+ "name": "oboe",
+ "platform": "android"
+ },
+ "opengl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "default-features": [
+ {
+ "name": "alsa",
+ "platform": "linux"
+ },
+ {
+ "name": "curl",
+ "platform": "freebsd | linux | openbsd"
+ },
+ {
+ "name": "fontconfig",
+ "platform": "freebsd | linux | openbsd"
+ },
+ {
+ "name": "xcursor",
+ "platform": "linux"
+ },
+ {
+ "name": "xinerama",
+ "platform": "linux"
+ },
+ {
+ "name": "xrandr",
+ "platform": "linux"
+ },
+ {
+ "name": "xrender",
+ "platform": "linux"
+ }
+ ],
+ "features": {
+ "alsa": {
+ "description": "Enable ALSA support",
+ "dependencies": [
+ "alsa"
+ ]
+ },
+ "curl": {
+ "description": "Use CURL for network support",
+ "supports": "freebsd | linux | openbsd",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false
+ }
+ ]
+ },
+ "extras": {
+ "description": "Enable JUCE extras such as Projucer, AudioPluginHost, BinaryBuilder.",
+ "dependencies": [
+ {
+ "name": "juce",
+ "default-features": false,
+ "features": [
+ "freetype"
+ ]
+ },
+ {
+ "name": "juce",
+ "default-features": false,
+ "features": [
+ "alsa"
+ ],
+ "platform": "linux"
+ },
+ {
+ "name": "juce",
+ "default-features": false,
+ "features": [
+ "curl"
+ ],
+ "platform": "freebsd | linux | openbsd"
+ }
+ ]
+ },
+ "fontconfig": {
+ "description": "Enable Fontconfig support",
+ "dependencies": [
+ "fontconfig",
+ {
+ "name": "juce",
+ "default-features": false,
+ "features": [
+ "freetype"
+ ]
+ }
+ ]
+ },
+ "freetype": {
+ "description": "Enable FreeType support",
+ "dependencies": [
+ "freetype"
+ ]
+ },
+ "jack": {
+ "description": "Enable JACK audio support",
+ "dependencies": [
+ "jack2"
+ ]
+ },
+ "juceaide": {
+ "description": "Build the juceaide tool",
+ "supports": "native",
+ "dependencies": [
+ {
+ "name": "juce",
+ "default-features": false,
+ "features": [
+ "freetype"
+ ]
+ }
+ ]
+ },
+ "ladspa": {
+ "description": "Enable LADSPA plugin host support."
+ },
+ "web-browser": {
+ "description": "Enable WebBrowser support",
+ "dependencies": [
+ {
+ "name": "webview2",
+ "platform": "windows"
+ }
+ ]
+ },
+ "xcursor": {
+ "description": "Enable XCursor support"
+ },
+ "xinerama": {
+ "description": "Enable Xinerama support",
+ "dependencies": [
+ "libxinerama"
+ ]
+ },
+ "xrandr": {
+ "description": "Enable XRandR support",
+ "dependencies": [
+ "libxrandr"
+ ]
+ },
+ "xrender": {
+ "description": "Enable XRender support",
+ "dependencies": [
+ "libxrender"
+ ]
+ }
+ }
+}