aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/portmidi
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/portmidi')
-rw-r--r--vcpkg/ports/portmidi/android-support.patch13
-rw-r--r--vcpkg/ports/portmidi/portfile.cmake31
-rw-r--r--vcpkg/ports/portmidi/usage4
-rw-r--r--vcpkg/ports/portmidi/vcpkg.json23
4 files changed, 71 insertions, 0 deletions
diff --git a/vcpkg/ports/portmidi/android-support.patch b/vcpkg/ports/portmidi/android-support.patch
new file mode 100644
index 0000000..06bf421
--- /dev/null
+++ b/vcpkg/ports/portmidi/android-support.patch
@@ -0,0 +1,13 @@
+diff --git a/pm_common/pmutil.c b/pm_common/pmutil.c
+index b7047e9..8d8817d 100755
+--- a/pm_common/pmutil.c
++++ b/pm_common/pmutil.c
+@@ -8,7 +8,7 @@
+ #include "pmutil.h"
+ #include "pminternal.h"
+
+-#ifdef WIN32
++#if defined(WIN32) | defined(ANDROID)
+ #define bzero(addr, siz) memset(addr, 0, siz)
+ #endif
+
diff --git a/vcpkg/ports/portmidi/portfile.cmake b/vcpkg/ports/portmidi/portfile.cmake
new file mode 100644
index 0000000..5b455df
--- /dev/null
+++ b/vcpkg/ports/portmidi/portfile.cmake
@@ -0,0 +1,31 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO PortMidi/portmidi
+ REF "v${VERSION}"
+ SHA512 00d7cec97b58c074d484793b6097f4e60d061a9d680940bbcdb6670b287b78dbc099af378fb2e066c61f1c26e5060ded9c8f78c80fc03518b33e43f830e34a27
+ HEAD_REF master
+ PATCHES
+ "android-support.patch"
+)
+
+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/vcpkg/ports/portmidi/usage b/vcpkg/ports/portmidi/usage
new file mode 100644
index 0000000..9851cb7
--- /dev/null
+++ b/vcpkg/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/vcpkg/ports/portmidi/vcpkg.json b/vcpkg/ports/portmidi/vcpkg.json
new file mode 100644
index 0000000..e0d21bd
--- /dev/null
+++ b/vcpkg/ports/portmidi/vcpkg.json
@@ -0,0 +1,23 @@
+{
+ "name": "portmidi",
+ "version": "2.0.6",
+ "port-version": 1,
+ "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
+ }
+ ]
+}