aboutsummaryrefslogtreecommitdiff
path: root/audio/drumstick
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2017-11-11 08:01:16 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2017-11-11 08:01:16 +0000
commitad0b4f5ea49c59b81d8b44f1d55a313a421fab57 (patch)
tree0bd2edd687e96c227b7adc273d580f12dbeb2795 /audio/drumstick
parent6e1a0c3266ab7db70575811cd7d89ddee05641cd (diff)
downloadports-ad0b4f5ea49c59b81d8b44f1d55a313a421fab57.tar.gz
ports-ad0b4f5ea49c59b81d8b44f1d55a313a421fab57.zip
New port: audio/drumstick: MIDI libraries for Qt5/C++
PR: 221459 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D12999
Notes
Notes: svn path=/head/; revision=453956
Diffstat (limited to 'audio/drumstick')
-rw-r--r--audio/drumstick/Makefile37
-rw-r--r--audio/drumstick/distinfo3
-rw-r--r--audio/drumstick/files/patch-CMakeLists.txt87
-rw-r--r--audio/drumstick/files/patch-library_include_drumstickcommon.h48
-rw-r--r--audio/drumstick/files/patch-library_rt-backends_CMakeLists.txt11
-rw-r--r--audio/drumstick/files/patch-library_rt-backends_eassynth_src_synthrenderer.cpp10
-rw-r--r--audio/drumstick/files/patch-library_rt_backendmanager.cpp11
-rw-r--r--audio/drumstick/pkg-descr7
-rw-r--r--audio/drumstick/pkg-plist42
9 files changed, 256 insertions, 0 deletions
diff --git a/audio/drumstick/Makefile b/audio/drumstick/Makefile
new file mode 100644
index 000000000000..d6b58336523d
--- /dev/null
+++ b/audio/drumstick/Makefile
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+PORTNAME= drumstick
+DISTVERSION= 1.1.0
+CATEGORIES= audio multimedia
+MASTER_SITES= SF/${PORTNAME}/${PORTVERSION}/
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= MIDI libraries for Qt5/C++
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/COPYING
+
+LIB_DEPENDS= libfluidsynth.so:audio/fluidsynth
+RUN_DEPENDS= ${LOCALBASE}/share/sounds/sf2/FluidR3_GM.sf2:audio/fluid-soundfont
+
+USES= cmake:outsource pkgconfig shared-mime-info tar:bz2
+USE_QT5= core gui network svg testlib widgets buildtools_build qmake_build
+USE_LDCONFIG= yes
+
+OPTIONS_DEFINE= PULSEAUDIO MANPAGES
+OPTIONS_DEFAULT= PULSEAUDIO
+OPTIONS_SUB= yes
+PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
+PULSEAUDIO_CMAKE_BOOL= USE_PULSEAUDIO
+MANPAGES_BUILD_DEPENDS= xsltproc:textproc/libxslt \
+ docbook-xsl>0:textproc/docbook-xsl
+MANPAGES_CMAKE_BOOL= BUILD_DOCS
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|"default.sf2"|"${LOCALBASE}/share/sounds/sf2/FluidR3_GM.sf2"|' \
+ ${WRKSRC}/utils/vpiano/fluidsettingsdialog.cpp \
+ ${WRKSRC}/library/rt-backends/synth/synthengine.cpp
+ @${REINPLACE_CMD} -e 's|"$${CMAKE_INSTALL_DATAROOTDIR}/man/man1"|"${PREFIX}/man/man1"|' \
+ ${WRKSRC}/cmake_admin/CreateManpages.cmake
+
+.include <bsd.port.mk>
diff --git a/audio/drumstick/distinfo b/audio/drumstick/distinfo
new file mode 100644
index 000000000000..32e59caaf645
--- /dev/null
+++ b/audio/drumstick/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1510117698
+SHA256 (drumstick-1.1.0.tar.bz2) = ae1d2c0d21b45d144e181b873ffbc2979a294fab31b8d71a5b0b8cad3276f38e
+SIZE (drumstick-1.1.0.tar.bz2) = 1012405
diff --git a/audio/drumstick/files/patch-CMakeLists.txt b/audio/drumstick/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..32f1d6a36790
--- /dev/null
+++ b/audio/drumstick/files/patch-CMakeLists.txt
@@ -0,0 +1,87 @@
+--- CMakeLists.txt.orig 2016-09-24 21:08:24 UTC
++++ CMakeLists.txt
+@@ -24,7 +24,7 @@ endif()
+ project(DRUMSTICK)
+
+ if(CMAKE_SIZEOF_VOID_P MATCHES "8")
+- set(_INIT_LIB_SUFFIX "64")
++ set(_INIT_LIB_SUFFIX "")
+ else()
+ set(_INIT_LIB_SUFFIX "")
+ endif()
+@@ -65,13 +65,13 @@ add_definitions(-DVERSION=${VERSION})
+ message(STATUS "drumstick ${VERSION} prefix: ${CMAKE_INSTALL_PREFIX}")
+
+ set(_DBUS_INIT OFF)
+-if(${CMAKE_SYSTEM} MATCHES "Linux")
++if(${CMAKE_SYSTEM} MATCHES "Linux|FreeBSD")
+ set(_DBUS_INIT ON)
+ endif()
+
+ # User options
+ option(STATIC_DRUMSTICK "Build static libraries instead of dynamic" OFF)
+-option(USE_DBUS "Include DBus support (required for RealtimeKit)" ${_DBUS_INIT})
++#option(USE_DBUS "Include DBus support (required for RealtimeKit)" ${_DBUS_INIT})
+
+ message(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}")
+
+@@ -99,8 +99,8 @@ else()
+ message(FATAL_ERROR "Program pkg-config not found")
+ endif()
+
+-if(${CMAKE_SYSTEM} MATCHES "Linux")
+- pkg_check_modules(ALSA alsa>=1.0.0)
++if(${CMAKE_SYSTEM} MATCHES "Linux|FreeBSD")
++ #pkg_check_modules(ALSA alsa>=1.0.0)
+ if(ALSA_FOUND)
+ set(ALSA_LIBS ${ALSA_LIBRARIES})
+ list(APPEND ALSA_LIB_DIR ${ALSA_LIBRARY_DIRS} ${ALSA_LIBDIR})
+@@ -108,7 +108,9 @@ if(${CMAKE_SYSTEM} MATCHES "Linux")
+ else()
+ message(STATUS "Warning: ALSA library not found.")
+ endif()
+- pkg_check_modules(PULSE libpulse-simple)
++ if (USE_PULSEAUDIO)
++ pkg_check_modules(PULSE libpulse-simple)
++ endif()
+ if(NOT PULSE_FOUND)
+ message(STATUS "Warning: PulseAudio library not found.")
+ endif()
+@@ -128,7 +130,7 @@ if(BUILD_TESTING)
+ add_subdirectory(tests)
+ endif()
+
+-if(${CMAKE_SYSTEM} MATCHES "Linux")
++if(${CMAKE_SYSTEM} MATCHES "Linux|FreeBSD")
+ find_package(Doxygen)
+ if(DOXYGEN_FOUND)
+ configure_file(
+@@ -139,12 +141,14 @@ if(${CMAKE_SYSTEM} MATCHES "Linux")
+ ${DOXYGEN} Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+- add_subdirectory(doc)
+- configure_file(drumstick-alsa.pc.in drumstick-alsa.pc IMMEDIATE @ONLY)
++ if (BUILD_DOCS)
++ add_subdirectory(doc)
++ endif()
++ #configure_file(drumstick-alsa.pc.in drumstick-alsa.pc IMMEDIATE @ONLY)
+ configure_file(drumstick.spec.in drumstick.spec IMMEDIATE @ONLY)
+- install(FILES
+- ${CMAKE_CURRENT_BINARY_DIR}/drumstick-alsa.pc
+- DESTINATION lib${LIB_SUFFIX}/pkgconfig )
++ #install(FILES
++ # ${CMAKE_CURRENT_BINARY_DIR}/drumstick-alsa.pc
++ # DESTINATION lib${LIB_SUFFIX}/pkgconfig )
+ # XML mime types
+ set( SHARED_MIME_INFO_MINIMUM_VERSION "0.30" )
+ set( XDG_MIME_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages" )
+@@ -174,7 +178,7 @@ configure_file(
+ add_custom_target( uninstall
+ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
+
+-if(${CMAKE_SYSTEM} MATCHES "Linux")
++if(${CMAKE_SYSTEM} MATCHES "Linux|FreeBSD")
+ # tarball target
+ add_custom_target( tarball
+ COMMAND mkdir -p drumstick-${VERSION}
diff --git a/audio/drumstick/files/patch-library_include_drumstickcommon.h b/audio/drumstick/files/patch-library_include_drumstickcommon.h
new file mode 100644
index 000000000000..c2e4c746d360
--- /dev/null
+++ b/audio/drumstick/files/patch-library_include_drumstickcommon.h
@@ -0,0 +1,48 @@
+--- library/include/drumstickcommon.h.orig 2016-09-24 21:08:23 UTC
++++ library/include/drumstickcommon.h
+@@ -27,7 +27,8 @@
+ #include <QtDebug>
+
+ extern "C" {
+-#include <alsa/asoundlib.h>
++// ALSA isn't disabled cleanly, see https://sourceforge.net/p/drumstick/bugs/9
++//#include <alsa/asoundlib.h>
+ }
+
+ /**
+@@ -73,7 +74,7 @@ public:
+ */
+ const QString qstrError() const
+ {
+- return QString(snd_strerror(m_errCode));
++ return QString((m_errCode));
+ }
+
+ /**
+@@ -110,7 +111,7 @@ private:
+ inline int checkErrorAndThrow(int rc, const char *where)
+ {
+ if (rc < 0) {
+- qDebug() << "Error code:" << rc << "(" << snd_strerror(rc) << ")";
++ qDebug() << "Error code:" << rc << "(" << (rc) << ")";
+ qDebug() << "Location:" << where;
+ throw SequencerError(QString(where), rc);
+ }
+@@ -127,7 +128,7 @@ inline int checkErrorAndThrow(int rc, co
+ inline int checkWarning(int rc, const char *where)
+ {
+ if (rc < 0) {
+- qWarning() << "Exception code:" << rc << "(" << snd_strerror(rc) << ")";
++ qWarning() << "Exception code:" << rc << "(" << (rc) << ")";
+ qWarning() << "Location:" << where;
+ }
+ return rc;
+@@ -152,7 +153,7 @@ inline int checkWarning(int rc, const ch
+ * different to the runtime library.
+ * @see getRuntimeALSALibraryVersion
+ */
+-const QString LIBRARY_VERSION(SND_LIB_VERSION_STR);
++const QString LIBRARY_VERSION("???");
+
+ } /* namespace drumstick */
+
diff --git a/audio/drumstick/files/patch-library_rt-backends_CMakeLists.txt b/audio/drumstick/files/patch-library_rt-backends_CMakeLists.txt
new file mode 100644
index 000000000000..535589a79b30
--- /dev/null
+++ b/audio/drumstick/files/patch-library_rt-backends_CMakeLists.txt
@@ -0,0 +1,11 @@
+--- library/rt-backends/CMakeLists.txt.orig 2016-09-24 21:08:23 UTC
++++ library/rt-backends/CMakeLists.txt
+@@ -19,7 +19,7 @@
+ #add_subdirectory(dummy-in)
+ #add_subdirectory(dummy-out)
+
+-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+ if(ALSA_FOUND)
+ add_subdirectory(alsa-in)
+ add_subdirectory(alsa-out)
diff --git a/audio/drumstick/files/patch-library_rt-backends_eassynth_src_synthrenderer.cpp b/audio/drumstick/files/patch-library_rt-backends_eassynth_src_synthrenderer.cpp
new file mode 100644
index 000000000000..ecb2a64aac6a
--- /dev/null
+++ b/audio/drumstick/files/patch-library_rt-backends_eassynth_src_synthrenderer.cpp
@@ -0,0 +1,10 @@
+--- library/rt-backends/eassynth/src/synthrenderer.cpp.orig 2016-09-24 21:08:23 UTC
++++ library/rt-backends/eassynth/src/synthrenderer.cpp
+@@ -29,6 +29,7 @@
+ #include <pulse/simple.h>
+ #include "synthrenderer.h"
+ #include "drumstickcommon.h"
++#include <assert.h>
+
+ namespace drumstick {
+ namespace rt {
diff --git a/audio/drumstick/files/patch-library_rt_backendmanager.cpp b/audio/drumstick/files/patch-library_rt_backendmanager.cpp
new file mode 100644
index 000000000000..8f98273875e3
--- /dev/null
+++ b/audio/drumstick/files/patch-library_rt_backendmanager.cpp
@@ -0,0 +1,11 @@
+--- library/rt/backendmanager.cpp.orig 2016-09-24 21:08:23 UTC
++++ library/rt/backendmanager.cpp
+@@ -140,7 +140,7 @@ namespace rt {
+ d->appendDir( appPath + QStringLiteral("../PlugIns/") + QSTR_DRUMSTICK, result );
+ #endif // Linux, Unix...
+ QStringList libs;
+- libs << "../lib/" << "../lib32/" << "../lib64/";
++ libs << "../lib/";
+ foreach(const QString& lib, libs) {
+ d->appendDir( appPath + lib + QSTR_DRUMSTICK, result );
+ }
diff --git a/audio/drumstick/pkg-descr b/audio/drumstick/pkg-descr
new file mode 100644
index 000000000000..81b68cf02470
--- /dev/null
+++ b/audio/drumstick/pkg-descr
@@ -0,0 +1,7 @@
+Drumstick is a tool to play music. This is a set of C++ MIDI libraries using
+Qt5 objects, idioms and style. It contains a C++ wrapper around software
+support for MIDI. A complementary library provides classes for SMF
+(Standard MIDI files: .MID/.KAR), Cakewalk (.WRK), and Overture (.OVE) file
+formats processing. A multiplatform realtime MIDI I/O library is also provided.
+
+WWW: https://sourceforge.net/projects/drumstick
diff --git a/audio/drumstick/pkg-plist b/audio/drumstick/pkg-plist
new file mode 100644
index 000000000000..4e18d30a29f9
--- /dev/null
+++ b/audio/drumstick/pkg-plist
@@ -0,0 +1,42 @@
+bin/drumstick-dumpove
+bin/drumstick-dumpsmf
+bin/drumstick-dumpwrk
+bin/drumstick-vpiano
+include/drumstick/backendmanager.h
+include/drumstick/macros.h
+include/drumstick/qove.h
+include/drumstick/qsmf.h
+include/drumstick/qwrk.h
+include/drumstick/rtmidiinput.h
+include/drumstick/rtmidioutput.h
+lib/drumstick/libdrumstick-rt-net-in.so
+lib/drumstick/libdrumstick-rt-net-out.so
+lib/drumstick/libdrumstick-rt-oss-in.so
+lib/drumstick/libdrumstick-rt-oss-out.so
+lib/drumstick/libdrumstick-rt-synth.so
+%%PULSEAUDIO%%lib/drumstick/libdrumstick-rt-eassynth.so
+lib/libdrumstick-file.so
+lib/libdrumstick-file.so.1
+lib/libdrumstick-file.so.1.1.0
+lib/libdrumstick-rt.so
+lib/libdrumstick-rt.so.1
+lib/libdrumstick-rt.so.1.1.0
+libdata/pkgconfig/drumstick-file.pc
+libdata/pkgconfig/drumstick-rt.pc
+share/applications/drumstick-vpiano.desktop
+share/icons/hicolor/16x16/apps/drumstick.png
+share/icons/hicolor/32x32/apps/drumstick.png
+share/icons/hicolor/48x48/apps/drumstick.png
+share/icons/hicolor/64x64/apps/drumstick.png
+share/icons/hicolor/scalable/apps/drumstick.svgz
+%%MANPAGES%%man/man1/drumstick-drumgrid.1.gz
+%%MANPAGES%%man/man1/drumstick-dumpmid.1.gz
+%%MANPAGES%%man/man1/drumstick-dumpove.1.gz
+%%MANPAGES%%man/man1/drumstick-dumpsmf.1.gz
+%%MANPAGES%%man/man1/drumstick-dumpwrk.1.gz
+%%MANPAGES%%man/man1/drumstick-guiplayer.1.gz
+%%MANPAGES%%man/man1/drumstick-metronome.1.gz
+%%MANPAGES%%man/man1/drumstick-playsmf.1.gz
+%%MANPAGES%%man/man1/drumstick-sysinfo.1.gz
+%%MANPAGES%%man/man1/drumstick-vpiano.1.gz
+share/mime/packages/drumstick.xml