diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 993e7049..3a67131e 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -12,6 +12,16 @@ add_subdirectory(../.. libremidi-src) find_package(Python 3.8 COMPONENTS Interpreter Development.Module REQUIRED) +if(NOT readerwriterqueue_FOUND AND NOT TARGET readerwriterqueue) + FetchContent_Declare( + readerwriterqueue + GIT_REPOSITORY https://github.com/cameron314/readerwriterqueue + GIT_TAG master + ) + + FetchContent_MakeAvailable(readerwriterqueue) +endif() + FetchContent_Declare( nanobind GIT_REPOSITORY https://github.com/wjakob/nanobind @@ -20,4 +30,6 @@ FetchContent_Declare( FetchContent_MakeAvailable(nanobind) nanobind_add_module(pylibremidi pylibremidi.cpp) -target_link_libraries(pylibremidi PUBLIC libremidi readerwriterqueue) +target_link_libraries(pylibremidi PUBLIC libremidi readerwriterqueue Boost::headers) + +install(TARGETS pylibremidi LIBRARY DESTINATION .) \ No newline at end of file diff --git a/cmake/libremidi.deps.cmake b/cmake/libremidi.deps.cmake index c38bb14d..ba31880c 100644 --- a/cmake/libremidi.deps.cmake +++ b/cmake/libremidi.deps.cmake @@ -34,7 +34,25 @@ if(LIBREMIDI_NO_BOOST AND LIBREMIDI_FIND_BOOST) endif() if(LIBREMIDI_FIND_BOOST) - find_package(Boost REQUIRED OPTIONAL_COMPONENTS cobalt) + find_package(Boost OPTIONAL_COMPONENTS cobalt) + + if(NOT Boost_FOUND) + set(BOOST_ENABLE_CMAKE ON) + set(BOOST_INCLUDE_LIBRARIES container asio variant2 cobalt) + + FetchContent_Declare( + Boost + GIT_REPOSITORY https://github.com/boostorg/boost.git + GIT_TAG boost-1.89.0 + GIT_PROGRESS ON + GIT_SHALLOW TRUE + OVERRIDE_FIND_PACKAGE TRUE + ) + + FetchContent_MakeAvailable(Boost) + + find_package(Boost REQUIRED OPTIONAL_COMPONENTS cobalt) + endif() endif() # readerwriterqueue diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f896c46c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,117 @@ +[build-system] +requires = ["scikit-build-core >=0.4.3", "nanobind >=1.3.2"] +build-backend = "scikit_build_core.build" + +[project] +name = "pylibremidi" +version = "5.3.1" +description = "A modern C++ MIDI 1 / MIDI 2 real-time & file I/O library. Supports Windows, macOS, Linux and WebMIDI." +readme = "README.md" +requires-python = ">=3.8" +authors = [ + # Git history + { name = "Celerier Jean-Michaël", email = "jeanmichael.celerier@gmail.com" }, + { name = "Caleb Xu", email = "calebcenter@live.com" }, + { name = "Eric Conlon", email = "37287+ejconlon@users.noreply.github.com" }, + { name = "Alyssa Ross", email = "hi@alyssa.is" }, + { name = "Atsushi Eno", email = "atsushieno@gmail.com" }, + { name = "Gabe Gonzalez", email = "lilggamegenius@gmail.com" }, + { name = "Andrew McCann", email = "amccann@gmail.com" }, + { name = "fwcd", email = "fwcd@fwcd.dev" }, + { name = "christoph", email = "christoph.diesch@t-online.de" }, + { name = "neil", email = "github@neilpang.com" }, + { name = "Yuri Victorovich", email = "yuri@FreeBSD.org" }, + { name = "Ivan Hawkes", email = "ivan.hawkes@gmail.com" }, + { name = "Jan Schuerman", email = "jan.schuerman@on-hertz.com" }, + { name = "tmwsnrx", email = "xrnswmt@protonmail.com" }, + { name = "Martin Stimpfl", email = "martin.stimpfl@gmail.com" }, + { name = "HyperLan-git", email = "youness.rekik@epita.fr" }, + { name = "Dimitre", email = "dimitre@users.noreply.github.com" }, + { name = "bratner", email = "ratner2@gmail.com" }, + { name = "Curve", email = "fynnbwdt@gmail.com" }, + { name = "Christopher P. Yarger", email = "cpyarger@gmail.com" }, + { name = "Jonathan Lidbeck", email = "admin@12toneinteractive.com" }, + { name = "Christopher P Yarger", email = "cpyarger@gmail.com" }, + { name = "Cacodemon345", email = "wahil1976@outlook.com" }, + { name = "Yuriy Yashchenko", email = "yyashchenko@inmusicbrands.com" }, + { name = "Yuriy Yashchenko", email = "yuriy.yashchenko@gmail.com" }, + + # Original rtmidi authors + { name = "Adam Avramov", email = "fallenblood@gmail.com" }, + { name = "aib", email = "aibok42@gmail.com" }, + { name = "Alexandros Theodotou", email = "alex@zrythm.org" }, + { name = "amosonn", email = "amosonn@gmail.com" }, + { name = "andrew morton", email = "drewish@katherinehouse.com" }, + { name = "Ashley Hedges", email = "ashley@soundswitch.com" }, + { name = "Atsushi Eno", email = "atsushieno@gmail.com" }, + { name = "Bartek Łukawski", email = "bwmn.peter@gmail.com" }, + { name = "Bart Spaans", email = "bart.spaans@gmail.com" }, + { name = "Ben Swift", email = "ben@benswift.me" }, + { name = "Chris Chronopoulos", email = "chronopoulos.chris@gmail.com" }, + { name = "Christian Köstlin", email = "christian.koestlin@esrlabs.com" }, + { name = "Christopher Arndt", email = "chris@chrisarndt.de" }, + { name = "emlai", email = "emil@cs.helsinki.fi" }, + { name = "Francisco Demartino", email = "demartino.francisco@gmail.com" }, + { name = "Gary Scavone", email = "gary@music.mcgill.ca" }, + { name = "garyscavone", email = "garyscavone@users.noreply.github.com" }, + { name = "Hugo Hromic", email = "hugo.hromic@deri.org" }, + { name = "IOhannes m zmölnig", email = "zmoelnig@umlautQ.umlaeute.mur.at" }, + { name = "Jake Sandlund", email = "jake@jakesandlund.com" }, + { name = "Jean-Michaël Celerier", email = "jeanmichael.celerier+github@gmail.com" }, + { name = "jgvictores", email = "jcgvicto@gmail.com" }, + { name = "johnty", email = "johntywang@gmail.com" }, + { name = "JP Cimalando", email = "jpcima@users.noreply.github.com" }, + { name = "kidproquo", email = "kidproquo@users.noreply.github.com" }, + { name = "Lane Spangler", email = "las4vc@virginia.edu" }, + { name = "Martin Delille", email = "martin@phonations.com" }, + { name = "Mattes D", email = "github@xoft.cz" }, + { name = "mcc", email = "andi.m.mcclure@gmail.com" }, + { name = "Michael Dahl", email = "micdah@gmail.com" }, + { name = "Nicolas Boulenguez", email = "nicolas.boulenguez@free.fr" }, + { name = "Nicolas Boulenguez", email = "nicolas@debian.org" }, + { name = "Oli Larkin", email = "olilarkin@googlemail.com" }, + { name = "Phildo", email = "phildo211@gmail.com" }, + { name = "philip", email = "me@filou.se" }, + { name = "Przemyslaw Wegrzyn", email = "pwegrzyn@codepainters.com" }, + { name = "Rémy Mouëza", email = "remy.moueza@gmail.com" }, + { name = "Rian Hunter", email = "rian@alum.mit.edu" }, + { name = "Rory Jaffe", email = "rsjaffe@gmail.com" }, + { name = "Ryan Schmidt", email = "git@ryandesign.com" }, + { name = "sagamusix", email = "saga-games@arcor.de" }, + { name = "Saga Musix", email = "sagamusix@users.noreply.github.com" }, + { name = "Sam Hocevar", email = "sam@hocevar.net" }, + { name = "Sebastien Alaiwan", email = "sebastien.alaiwan@gmail.com" }, + { name = "Serge A. Zaitsev", email = "zaitsev.serge@gmail.com" }, + { name = "Stephen Sinclair", email = "radarsat1@gmail.com" }, + { name = "Stephen Sinclair", email = "radarsat1@users.noreply.github.com" }, + { name = "Stephen Sinclair", email = "sinclair@music.mcgill.ca" }, + { name = "Stephen Sinclair", email = "stephen.sinclair@inria.cl" }, + { name = "Szymon Kaliski", email = "kaliskiszymon@gmail.com" }, + { name = "Thiago Goulart", email = "thiagosonego@gmail.com" }, + { name = "Tiago Morais Morgado", email = "eremitatm88@gmail.com" }, + { name = "Tobias Schlemmer", email = "keinstein@users.sourcforge.net" }, + { name = "Yuri", email = "yuri@tsoft.com" }, + + # Original ModernMIDI authors + { name = "Dimitri Diakopoulos", email = "ddiakopoulos@gmail.com" }, + { name = "Lauren Hughes", email = "lh0xfb@gmail.com" }, + +] +license-files = [ + "LICENSE.md" +] +license = "MIT AND BSD-2-Clause" + +[project.urls] +Homepage = "https://github.com/celtera/libremidi" + +[tool.scikit-build] +# Protect the configuration against future changes in scikit-build-core +minimum-version = "0.4" +cmake.source-dir = "./bindings/python" + +# Setuptools-style build caching in a local directory +build-dir = "build/{wheel_tag}" + +# Build stable ABI wheels for CPython 3.10+ +wheel.py-api = "cp310" \ No newline at end of file