aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Alonso Cardenas Marquez <acm@FreeBSD.org>2021-07-17 02:31:07 +0000
committerJose Alonso Cardenas Marquez <acm@FreeBSD.org>2021-07-17 02:31:07 +0000
commit4efef974205a73ebe689bd11db595e7ef3f23437 (patch)
tree09658c735ce1285e8e079cee660be85ca6b303b5
parentd902630dfc4c9cc00cb97b7813f52ca0856acb0e (diff)
downloadports-4efef974205a73ebe689bd11db595e7ef3f23437.tar.gz
ports-4efef974205a73ebe689bd11db595e7ef3f23437.zip
audio/portmidi: New port: Library for real time MIDI input and output
PortMIDI is a cross platform (Windows, macOS, Linux, and BSDs which support alsalib) library for interfacing with operating systems' MIDI I/O APIs. It was started by Ross Bencina and Phil Burk, then maintained by Roger B. Dannenberg, and now maintained by the Mixxx DJ Software team. WWW: https://github.com/mixxxdj/portmidi
-rw-r--r--audio/Makefile1
-rw-r--r--audio/portmidi/Makefile20
-rw-r--r--audio/portmidi/distinfo3
-rw-r--r--audio/portmidi/files/patch-src_portmidi_linux_finddefault.c21
-rw-r--r--audio/portmidi/files/patch-src_porttime_ptlinux.c51
-rw-r--r--audio/portmidi/pkg-descr6
-rw-r--r--audio/portmidi/pkg-plist10
7 files changed, 112 insertions, 0 deletions
diff --git a/audio/Makefile b/audio/Makefile
index ddf0309c6e62..49276f145864 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -626,6 +626,7 @@
SUBDIR += poly-lv2
SUBDIR += polyphone
SUBDIR += portaudio
+ SUBDIR += portmidi
SUBDIR += praat
SUBDIR += pragha
SUBDIR += prelude-lv2
diff --git a/audio/portmidi/Makefile b/audio/portmidi/Makefile
new file mode 100644
index 000000000000..e3f859e0061d
--- /dev/null
+++ b/audio/portmidi/Makefile
@@ -0,0 +1,20 @@
+PORTNAME= portmidi
+PORTVERSION= 235.0
+CATEGORIES= audio
+
+MAINTAINER= acm@FreeBSD.org
+COMMENT= Library for real time MIDI input and output
+
+LICENSE= PL
+LICENSE_NAME= PortMidi license
+LICENSE_FILE= ${WRKSRC}/license.txt
+LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+LIB_DEPENDS= libasound.so:audio/alsa-lib
+
+USES= cmake dos2unix localbase:ldflags
+
+USE_GITHUB= yes
+GH_ACCOUNT= mixxxdj
+
+.include <bsd.port.mk>
diff --git a/audio/portmidi/distinfo b/audio/portmidi/distinfo
new file mode 100644
index 000000000000..b14169fd9758
--- /dev/null
+++ b/audio/portmidi/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1626464614
+SHA256 (mixxxdj-portmidi-235.0_GH0.tar.gz) = 34cb2761b54965b2ffccf0cc50896e3460e2fd5336562469bd2bf3ce7ce7ae88
+SIZE (mixxxdj-portmidi-235.0_GH0.tar.gz) = 725719
diff --git a/audio/portmidi/files/patch-src_portmidi_linux_finddefault.c b/audio/portmidi/files/patch-src_portmidi_linux_finddefault.c
new file mode 100644
index 000000000000..acff9dfac8cf
--- /dev/null
+++ b/audio/portmidi/files/patch-src_portmidi_linux_finddefault.c
@@ -0,0 +1,21 @@
+--- src/portmidi/linux/finddefault.c.orig 2021-07-17 02:14:06 UTC
++++ src/portmidi/linux/finddefault.c
+@@ -5,6 +5,9 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#if defined(__FreeBSD__)
++#include <ctype.h>
++#endif
+ #include "portmidi.h"
+
+ #define STRING_MAX 256
+@@ -27,7 +30,7 @@ int match_string(FILE *inf, char *s)
+
+
+ /*
+-/* Parse preference files, find default device, search devices --
++ * Parse preference files, find default device, search devices --
+ */
+ PmDeviceID find_default_device(char *path, int input, PmDeviceID id)
+ /* path -- the name of the preference we are searching for
diff --git a/audio/portmidi/files/patch-src_porttime_ptlinux.c b/audio/portmidi/files/patch-src_porttime_ptlinux.c
new file mode 100644
index 000000000000..6d04c73d9ca7
--- /dev/null
+++ b/audio/portmidi/files/patch-src_porttime_ptlinux.c
@@ -0,0 +1,51 @@
+--- src/porttime/ptlinux.c.orig 2021-07-17 02:14:06 UTC
++++ src/porttime/ptlinux.c
+@@ -1,3 +1,4 @@
++
+ /* ptlinux.c -- portable timer implementation for linux */
+
+
+@@ -31,14 +32,14 @@ CHANGE LOG
+ #include "porttime.h"
+ #include "sys/time.h"
+ #include "sys/resource.h"
+-#include "sys/timeb.h"
+ #include "pthread.h"
+
+ #define TRUE 1
+ #define FALSE 0
+
+ static int time_started_flag = FALSE;
+-static struct timeb time_offset = {0, 0, 0, 0};
++static struct timeval *time_offset;
++
+ static pthread_t pt_thread_pid;
+ static int pt_thread_created = FALSE;
+
+@@ -79,7 +80,8 @@ static void *Pt_CallbackProc(void *p)
+ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+ {
+ if (time_started_flag) return ptNoError;
+- ftime(&time_offset); /* need this set before process runs */
++ gettimeofday(time_offset, NULL);
++
+ if (callback) {
+ int res;
+ pt_callback_parameters *parms = (pt_callback_parameters *)
+@@ -121,10 +123,12 @@ int Pt_Started()
+ PtTimestamp Pt_Time()
+ {
+ long seconds, milliseconds;
+- struct timeb now;
+- ftime(&now);
+- seconds = now.time - time_offset.time;
+- milliseconds = now.millitm - time_offset.millitm;
++ struct timeval *now;
++
++ gettimeofday(now, NULL);
++
++ seconds = now->tv_sec - time_offset->tv_sec;
++ milliseconds = now->tv_usec - time_offset->tv_usec;
+ return seconds * 1000 + milliseconds;
+ }
+
diff --git a/audio/portmidi/pkg-descr b/audio/portmidi/pkg-descr
new file mode 100644
index 000000000000..3b263dd52be6
--- /dev/null
+++ b/audio/portmidi/pkg-descr
@@ -0,0 +1,6 @@
+PortMIDI is a cross platform (Windows, macOS, Linux, and BSDs which support
+alsalib) library for interfacing with operating systems' MIDI I/O APIs. It was
+started by Ross Bencina and Phil Burk, then maintained by Roger B. Dannenberg,
+and now maintained by the Mixxx DJ Software team.
+
+WWW: https://github.com/mixxxdj/portmidi
diff --git a/audio/portmidi/pkg-plist b/audio/portmidi/pkg-plist
new file mode 100644
index 000000000000..a2f8670ae7c6
--- /dev/null
+++ b/audio/portmidi/pkg-plist
@@ -0,0 +1,10 @@
+include/pmutil.h
+include/portmidi.h
+include/porttime.h
+lib/cmake/PortMidi/PortMidiConfig.cmake
+lib/cmake/PortMidi/PortMidiConfigVersion.cmake
+lib/cmake/PortMidi/PortMidiTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/PortMidi/PortMidiTargets.cmake
+lib/libportmidi.so
+lib/libporttime.so
+libdata/pkgconfig/portmidi.pc