git: 4efef974205a - main - audio/portmidi: New port: Library for real time MIDI input and output
Jose Alonso Cardenas Marquez
acm at FreeBSD.org
Sat Jul 17 02:32:30 UTC 2021
The branch main has been updated by acm:
URL: https://cgit.FreeBSD.org/ports/commit/?id=4efef974205a73ebe689bd11db595e7ef3f23437
commit 4efef974205a73ebe689bd11db595e7ef3f23437
Author: Jose Alonso Cardenas Marquez <acm at FreeBSD.org>
AuthorDate: 2021-07-17 02:31:07 +0000
Commit: Jose Alonso Cardenas Marquez <acm at FreeBSD.org>
CommitDate: 2021-07-17 02:31:07 +0000
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
---
audio/Makefile | 1 +
audio/portmidi/Makefile | 20 +++++++++
audio/portmidi/distinfo | 3 ++
.../files/patch-src_portmidi_linux_finddefault.c | 21 +++++++++
audio/portmidi/files/patch-src_porttime_ptlinux.c | 51 ++++++++++++++++++++++
audio/portmidi/pkg-descr | 6 +++
audio/portmidi/pkg-plist | 10 +++++
7 files changed, 112 insertions(+)
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 at 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
More information about the dev-commits-ports-all
mailing list