From 87fb30839c255ff6e2cf00b9f44aaa46e2403fb9 Mon Sep 17 00:00:00 2001 From: dirkju Date: Tue, 6 Mar 2018 02:35:31 +0100 Subject: [PATCH] Added Gamma library (#2957) --- ports/gamma/CMakeLists.txt | 44 ++++++++++++++++++++++++++++++++++++++ ports/gamma/CONTROL | 4 ++++ ports/gamma/portfile.cmake | 27 +++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 ports/gamma/CMakeLists.txt create mode 100644 ports/gamma/CONTROL create mode 100644 ports/gamma/portfile.cmake diff --git a/ports/gamma/CMakeLists.txt b/ports/gamma/CMakeLists.txt new file mode 100644 index 0000000000..6bb48f193a --- /dev/null +++ b/ports/gamma/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required (VERSION 3.0) + +project (gamma) + +# dependent on libsndfile and portaudio +find_path(LIBSNDFILE_H sndfile.h) +find_library(LIBSNDFILE_LIB NAMES libsndfile-1 libsndfile) +find_path(PORTAUDIO_H portaudio.h) +find_library(PORTAUDIO_LIB NAMES portaudio) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +set(SOURCEFILES + src/arr.cpp + src/AudioIO.cpp + src/Conversion.cpp + src/Domain.cpp + src/DFT.cpp + src/FFT_fftpack.cpp + src/fftpack++1.cpp + src/fftpack++2.cpp + src/SoundFile.cpp + src/Print.cpp + src/Recorder.cpp + src/scl.cpp + src/Scheduler.cpp + src/Timer.cpp + src/SoundFile.cpp) + +include_directories(. Gamma ${CMAKE_INSTALL_FULL_INCLUDEDIR} ${PORTAUDIO_H} ${LIBSNDFILE_H}) + +add_library (gamma ${SOURCEFILES}) +target_link_libraries(gamma PUBLIC ${LIBSNDFILE_LIB} ${PORTAUDIO_LIB}) + +install( + TARGETS gamma + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + +if(NOT DISABLE_INSTALL_HEADERS) + install(DIRECTORY Gamma DESTINATION include FILES_MATCHING PATTERN "*.h") +endif() diff --git a/ports/gamma/CONTROL b/ports/gamma/CONTROL new file mode 100644 index 0000000000..b70639ea68 --- /dev/null +++ b/ports/gamma/CONTROL @@ -0,0 +1,4 @@ +Source: gamma +Version: gamma-2018-01-27 +Build-Depends: libsndfile, portaudio +Description: Gamma is a cross-platform, C++ library for doing generic synthesis and filtering of signals. It is oriented towards real-time sound and graphics applications, but is equally useful for non-real-time tasks. Gamma is designed to be "light-footed" in terms of memory and processing making it highly suitable for plug-in development or embedding in other C++ projects. diff --git a/ports/gamma/portfile.cmake b/ports/gamma/portfile.cmake new file mode 100644 index 0000000000..139e6a48a0 --- /dev/null +++ b/ports/gamma/portfile.cmake @@ -0,0 +1,27 @@ +# Instead of official release, base on commit hash for now. +set(GAMMA_RELEASE_TAG "cc442ad0c5da369966cd937a96925c7b9a04e9e5") + +include(vcpkg_common_functions) + +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/Gamma-${GAMMA_RELEASE_TAG}) + +vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/LancePutnam/Gamma/archive/cc442ad0c5da369966cd937a96925c7b9a04e9e5.zip" + FILENAME "gamma-${GAMMA_RELEASE_TAG}.zip" + SHA512 de44f4d07db0b2cf09e77508d993273d09788dfa919d549393bb77534922b65e9d8a1b8193b4b02c72e6bc4dd060b41b18ff3520a36d4c28f6e2fb4b1e859ee7 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1 +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/gamma RENAME copyright)