FreeBSD Bugzilla – Attachment 220977 Details for
Bug 252186
[NEW PORT] audio/portmidi: Library for real time input and output of MIDI data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
audio_portmidi.shar
audio_portmidi.shar (text/plain), 21.01 KB, created by
Timothy Beyer
on 2020-12-27 06:25:18 UTC
(
hide
)
Description:
audio_portmidi.shar
Filename:
MIME Type:
Creator:
Timothy Beyer
Created:
2020-12-27 06:25:18 UTC
Size:
21.01 KB
patch
obsolete
># This is a shell archive. Save it in a file, remove anything before ># this line, and then unpack it by entering "sh file". Note, it may ># create directories; files and directories will be owned by you and ># have default permissions. ># ># This archive contains: ># ># audio ># audio/portmidi ># audio/portmidi/Makefile ># audio/portmidi/distinfo ># audio/portmidi/files ># audio/portmidi/files/pm_sndio ># audio/portmidi/files/pm_sndio/pmsndio.c ># audio/portmidi/files/pm_sndio/pmsndio.h ># audio/portmidi/files/portmidi.pc.in ># audio/portmidi/files/patch-CMakeLists.txt ># audio/portmidi/files/patch-pm__common_CMakeLists.txt ># audio/portmidi/files/patch-pm__dylib_CMakeLists.txt ># audio/portmidi/files/patch-pm__test_CMakeLists.txt ># audio/portmidi/files/patch-porttime_ptlinux.c ># audio/portmidi/pkg-descr ># >echo c - audio >mkdir -p audio > /dev/null 2>&1 >echo c - audio/portmidi >mkdir -p audio/portmidi > /dev/null 2>&1 >echo x - audio/portmidi/Makefile >sed 's/^X//' >audio/portmidi/Makefile << 'cdda3a3107534f9ac76742f5a05f693b' >X# $FreeBSD$ >X >XPORTNAME= portmidi >XPORTVERSION= 217 >XCATEGORIES= audio >XMASTER_SITES= http://sourceforge.net/projects/portmedia/files/ >XDISTNAME= ${PORTNAME}-src-${PORTVERSION} >X >XMAINTAINER= beyert@cs.ucr.edu >XCOMMENT= Library for real time input and output of MIDI data >X >XLICENSE= MIT >XLICENSE_FILE= ${WRKSRC}/license.txt >X >XLIB_DEPENDS= libsndio.so:audio/sndio >X >XUSES= cmake zip dos2unix >X >XPLIST_FILES= include/portmidi.h \ >X include/porttime.h \ >X lib/libportmidi.so \ >X lib/libportmidi_s.a \ >X libdata/pkgconfig/portmidi.pc >X >XDOS2UNIX_FILES= porttime/ptlinux.c >X >XCFLAGS+= -I${LOCALBASE}/include >XLDFLAGS+= -L${LOCALBASE}/lib >XUSE_LDCONFIG= yes >XMAKE_JOBS_UNSAFE= yes >X >XCMAKE_ARGS+= -DPROJECT_BINARY_DIR=Release \ >X -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${WRKSRC}/Release \ >X -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${WRKSRC}/Release \ >X -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${WRKSRC}/Release >X >XNO_TEST= Yes >X >XWRKSRC= ${WRKDIR}/${PORTNAME} >X >Xpost-extract: >X ${CP} ${FILESDIR}/portmidi.pc.in ${WRKSRC}/ >X ${CP} -r ${FILESDIR}/pm_sndio ${WRKSRC}/ >X >X.include <bsd.port.mk> >cdda3a3107534f9ac76742f5a05f693b >echo x - audio/portmidi/distinfo >sed 's/^X//' >audio/portmidi/distinfo << 'e8b62b221eb0c179ce08a5a870ae7014' >XTIMESTAMP = 1594081114 >XSHA256 (portmidi-src-217.zip) = 08e9a892bd80bdb1115213fb72dc29a7bf2ff108b378180586aa65f3cfd42e0f >XSIZE (portmidi-src-217.zip) = 1030830 >e8b62b221eb0c179ce08a5a870ae7014 >echo c - audio/portmidi/files >mkdir -p audio/portmidi/files > /dev/null 2>&1 >echo c - audio/portmidi/files/pm_sndio >mkdir -p audio/portmidi/files/pm_sndio > /dev/null 2>&1 >echo x - audio/portmidi/files/pm_sndio/pmsndio.c >sed 's/^X//' >audio/portmidi/files/pm_sndio/pmsndio.c << 'be0b4e4ee296da3379e44e52539b9727' >X/* pmsndio.c -- PortMidi os-dependent code */ >X >X#include <stdlib.h> >X#include <stdio.h> >X#include <sndio.h> >X#include <string.h> >X#include <poll.h> >X#include <errno.h> >X#include <pthread.h> >X#include <glob.h> >X#include "portmidi.h" >X#include "pmutil.h" >X#include "pminternal.h" >X#include "porttime.h" >X >X#define NDEVS 1024 >X#define SYSEX_MAXLEN 1024 >X >X#define SYSEX_START 0xf0 >X#define SYSEX_END 0xf7 >X >XPmDeviceID pm_default_input_device_id = -1; >XPmDeviceID pm_default_output_device_id = -1; >X >Xextern pm_fns_node pm_sndio_in_dictionary; >Xextern pm_fns_node pm_sndio_out_dictionary; >X >X/* length of voice and common messages (status byte included) */ >Xunsigned int voice_len[] = { 3, 3, 3, 3, 2, 2, 3 }; >Xunsigned int common_len[] = { 0, 2, 3, 2, 0, 0, 1, 1 }; >X >Xstruct mio_dev { >X char name[16]; >X struct mio_hdl *hdl; >X int mode; >X char errmsg[PM_HOST_ERROR_MSG_LEN]; >X pthread_t thread; >X} devs[NDEVS]; >X >Xstatic void set_mode(struct mio_dev *, unsigned int); >X >Xvoid pm_init() >X{ >X int i, j, k = 0; >X char devices[][16] = {"midithru", "rmidi", "midi", "snd"}; >X glob_t out; >X >X /* default */ >X strcpy(devs[0].name, MIO_PORTANY); >X pm_add_device("SNDIO", devs[k].name, TRUE, (void *) &devs[k], >X &pm_sndio_in_dictionary); >X pm_add_device("SNDIO", devs[k].name, FALSE, (void *) &devs[k], >X &pm_sndio_out_dictionary); >X k++; >X >X glob("/dev/umidi*.0", GLOB_TILDE, NULL, &out); >X int umidi_num_major_devs = out.gl_pathc; >X globfree(&out); >X >X for (i = 0; i < 4; i++) { >X for (j = 0; j < umidi_num_major_devs; j++) { >X sprintf(devs[k].name, "%s/%d", devices[i], j); >X pm_add_device("SNDIO", devs[k].name, TRUE, (void *) &devs[k], >X &pm_sndio_in_dictionary); >X pm_add_device("SNDIO", devs[k].name, FALSE, (void *) &devs[k], >X &pm_sndio_out_dictionary); >X k++; >X } >X } >X >X // this is set when we return to Pm_Initialize, but we need it >X // now in order to (successfully) call Pm_CountDevices() >X pm_initialized = TRUE; >X pm_default_input_device_id = 0; >X pm_default_output_device_id = 1; >X} >X >Xvoid pm_term(void) >X{ >X int i; >X glob_t out; >X >X glob("/dev/umidi*.0", GLOB_TILDE, NULL, &out); >X int umidi_num_major_devs = out.gl_pathc; >X /* each device has matching midithru, rmidi, midi and snd devices */ >X int ndevs = (umidi_num_major_devs * 4) + 1; >X globfree(&out); >X >X for(i = 0; i < ndevs; i++) { >X if (devs[i].mode != 0) { >X set_mode(&devs[i], 0); >X if (devs[i].thread) { >X pthread_join(devs[i].thread, NULL); >X devs[i].thread = NULL; >X } >X } >X } >X} >X >XPmDeviceID Pm_GetDefaultInputDeviceID() { >X Pm_Initialize(); >X return pm_default_input_device_id; >X} >X >XPmDeviceID Pm_GetDefaultOutputDeviceID() { >X Pm_Initialize(); >X return pm_default_output_device_id; >X} >X >Xvoid *pm_alloc(size_t s) { return malloc(s); } >X >Xvoid pm_free(void *ptr) { free(ptr); } >X >X/* midi_message_length -- how many bytes in a message? */ >Xstatic int midi_message_length(PmMessage message) >X{ >X unsigned char st = message & 0xff; >X if (st >= 0xf8) >X return 1; >X else if (st >= 0xf0) >X return common_len[st & 7]; >X else if (st >= 0x80) >X return voice_len[(st >> 4) & 7]; >X else >X return 0; >X} >X >Xvoid* input_thread(void *param) >X{ >X PmInternal *midi = (PmInternal*)param; >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X struct pollfd pfd[1]; >X nfds_t nfds; >X unsigned char st = 0, c = 0; >X int rc, revents, idx = 0, len = 0; >X size_t todo = 0; >X unsigned char buf[0x200], *p; >X PmEvent pm_ev, pm_ev_rt; >X unsigned char sysex_data[SYSEX_MAXLEN]; >X >X while(dev->mode & MIO_IN) { >X if (todo == 0) { >X nfds = mio_pollfd(dev->hdl, pfd, POLLIN); >X rc = poll(pfd, nfds, 100); >X if (rc < 0) { >X if (errno == EINTR) >X continue; >X break; >X } >X revents = mio_revents(dev->hdl, pfd); >X if (!(revents & POLLIN)) >X continue; >X >X todo = mio_read(dev->hdl, buf, sizeof(buf)); >X if (todo == 0) >X continue; >X p = buf; >X } >X c = *p++; >X todo--; >X >X if (c >= 0xf8) { >X pm_ev_rt.message = c; >X pm_ev_rt.timestamp = Pt_Time(); >X pm_read_short(midi, &pm_ev_rt); >X } else if (c == SYSEX_END) { >X if (st == SYSEX_START) { >X sysex_data[idx++] = c; >X pm_read_bytes(midi, sysex_data, idx, Pt_Time()); >X } >X st = 0; >X idx = 0; >X } else if (c == SYSEX_START) { >X st = c; >X idx = 0; >X sysex_data[idx++] = c; >X } else if (c >= 0xf0) { >X pm_ev.message = c; >X len = common_len[c & 7]; >X st = c; >X idx = 1; >X } else if (c >= 0x80) { >X pm_ev.message = c; >X len = voice_len[(c >> 4) & 7]; >X st = c; >X idx = 1; >X } else if (st == SYSEX_START) { >X if (idx == SYSEX_MAXLEN) { >X fprintf(stderr, "the message is too long\n"); >X idx = st = 0; >X } else { >X sysex_data[idx++] = c; >X } >X } else if (st) { >X if (idx == 0 && st != SYSEX_START) >X pm_ev.message |= (c << (8 * idx++)); >X pm_ev.message |= (c << (8 * idx++)); >X if (idx == len) { >X pm_read_short(midi, &pm_ev); >X if (st >= 0xf0) >X st = 0; >X idx = 0; >X } >X } >X } >X >X pthread_exit(NULL); >X return NULL; >X} >X >Xstatic void set_mode(struct mio_dev *dev, unsigned int mode) { >X if (dev->mode != 0) >X mio_close(dev->hdl); >X dev->mode = 0; >X if (mode != 0) >X dev->hdl = mio_open(dev->name, mode, 0); >X if (dev->hdl) >X dev->mode = mode; >X} >X >Xstatic PmError sndio_out_open(PmInternal *midi, void *driverInfo) >X{ >X descriptor_type desc = &descriptors[midi->device_id]; >X struct mio_dev *dev = (struct mio_dev *) desc->descriptor; >X >X if (dev->mode & MIO_OUT) >X return pmNoError; >X >X set_mode(dev, dev->mode | MIO_OUT); >X if (!(dev->mode & MIO_OUT)) { >X snprintf(dev->errmsg, PM_HOST_ERROR_MSG_LEN, >X "mio_open (output) failed: %s\n", dev->name); >X return pmHostError; >X } >X >X midi->descriptor = (void *)dev; >X return pmNoError; >X} >X >Xstatic PmError sndio_in_open(PmInternal *midi, void *driverInfo) >X{ >X descriptor_type desc = &descriptors[midi->device_id]; >X struct mio_dev *dev = (struct mio_dev *) desc->descriptor; >X >X if (dev->mode & MIO_IN) >X return pmNoError; >X >X set_mode(dev, dev->mode | MIO_IN); >X if (!(dev->mode & MIO_IN)) { >X snprintf(dev->errmsg, PM_HOST_ERROR_MSG_LEN, >X "mio_open (input) failed: %s\n", dev->name); >X return pmHostError; >X } >X midi->descriptor = (void *)dev; >X pthread_attr_t attr; >X pthread_attr_init(&attr); >X pthread_create(&dev->thread, &attr, input_thread, ( void* )midi); >X return pmNoError; >X} >X >Xstatic PmError sndio_out_close(PmInternal *midi) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X >X if (dev->mode & MIO_OUT) >X set_mode(dev, dev->mode & ~MIO_OUT); >X return pmNoError; >X} >X >Xstatic PmError sndio_in_close(PmInternal *midi) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X >X if (dev->mode & MIO_IN) { >X set_mode(dev, dev->mode & ~MIO_IN); >X pthread_join(dev->thread, NULL); >X dev->thread = NULL; >X } >X return pmNoError; >X} >X >Xstatic PmError sndio_abort(PmInternal *midi) >X{ >X return pmNoError; >X} >X >Xstatic PmTimestamp sndio_synchronize(PmInternal *midi) >X{ >X return 0; >X} >X >Xstatic PmError do_write(struct mio_dev *dev, const void *addr, size_t nbytes) >X{ >X size_t w = mio_write(dev->hdl, addr, nbytes); >X >X if (w != nbytes) { >X snprintf(dev->errmsg, PM_HOST_ERROR_MSG_LEN, >X "mio_write failed, bytes written:%zu\n", w); >X return pmHostError; >X } >X return pmNoError; >X} >X >Xstatic PmError sndio_write_byte(PmInternal *midi, unsigned char byte, >X PmTimestamp timestamp) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X >X return do_write(dev, &byte, 1); >X} >X >Xstatic PmError sndio_write_short(PmInternal *midi, PmEvent *event) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X int nbytes = midi_message_length(event->message); >X >X if (midi->latency > 0) { >X /* XXX the event should be queued for later playback */ >X return do_write(dev, &event->message, nbytes); >X } else { >X return do_write(dev, &event->message, nbytes); >X } >X return pmNoError; >X} >X >Xstatic PmError sndio_write_flush(PmInternal *midi, PmTimestamp timestamp) >X{ >X return pmNoError; >X} >X >XPmError sndio_sysex(PmInternal *midi, PmTimestamp timestamp) >X{ >X return pmNoError; >X} >X >Xstatic unsigned int sndio_has_host_error(PmInternal *midi) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X >X return (dev->errmsg[0] != '\0'); >X} >X >Xstatic void sndio_get_host_error(PmInternal *midi, char *msg, unsigned int len) >X{ >X struct mio_dev *dev = (struct mio_dev *) midi->descriptor; >X >X strlcpy(msg, dev->errmsg, len); >X dev->errmsg[0] = '\0'; >X} >X >Xpm_fns_node pm_sndio_in_dictionary = { >X none_write_short, >X none_sysex, >X none_sysex, >X none_write_byte, >X none_write_short, >X none_write_flush, >X sndio_synchronize, >X sndio_in_open, >X sndio_abort, >X sndio_in_close, >X success_poll, >X sndio_has_host_error, >X sndio_get_host_error >X}; >X >Xpm_fns_node pm_sndio_out_dictionary = { >X sndio_write_short, >X sndio_sysex, >X sndio_sysex, >X sndio_write_byte, >X sndio_write_short, >X sndio_write_flush, >X sndio_synchronize, >X sndio_out_open, >X sndio_abort, >X sndio_out_close, >X none_poll, >X sndio_has_host_error, >X sndio_get_host_error >X}; >X >be0b4e4ee296da3379e44e52539b9727 >echo x - audio/portmidi/files/pm_sndio/pmsndio.h >sed 's/^X//' >audio/portmidi/files/pm_sndio/pmsndio.h << '167e91cb6414cb7648ca1eac601e20b2' >X/* pmsndio.h */ >X >Xextern PmDeviceID pm_default_input_device_id; >Xextern PmDeviceID pm_default_output_device_id; >X >167e91cb6414cb7648ca1eac601e20b2 >echo x - audio/portmidi/files/portmidi.pc.in >sed 's/^X//' >audio/portmidi/files/portmidi.pc.in << 'd61f2813c15ddd5da1df4ec5bc33c738' >Xprefix=@DEST_DIR@ >Xexec_prefix=${prefix} >Xlibdir=${prefix}/lib >Xincludedir=${prefix}/include >X >XName: libportmidi >XDescription: Portable midi I/O >XVersion: 217 >X >XLibs: -L${libdir} -lportmidi >XCflags: -I${includedir} >d61f2813c15ddd5da1df4ec5bc33c738 >echo x - audio/portmidi/files/patch-CMakeLists.txt >sed 's/^X//' >audio/portmidi/files/patch-CMakeLists.txt << 'efc1b1fefe6f59132e4de41b10fdfb8a' >X--- CMakeLists.txt.orig 2010-09-20 19:57:48 UTC >X+++ CMakeLists.txt >X@@ -73,5 +73,11 @@ add_subdirectory(pm_test) >X add_subdirectory(pm_dylib) >X >X # Cannot figure out how to make an xcode Java application with CMake >X-add_subdirectory(pm_java) >X+#add_subdirectory(pm_java) >X >X+set(DEST_DIR "${CMAKE_INSTALL_PREFIX}") >X+CONFIGURE_FILE("portmidi.pc.in" "portmidi.pc" @ONLY) >X+install(FILES >X+ "${CMAKE_CURRENT_BINARY_DIR}/portmidi.pc" >X+ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" >X+) >efc1b1fefe6f59132e4de41b10fdfb8a >echo x - audio/portmidi/files/patch-pm__common_CMakeLists.txt >sed 's/^X//' >audio/portmidi/files/patch-pm__common_CMakeLists.txt << '0731001fe41459b2939384d94589ba2b' >X--- pm_common/CMakeLists.txt.orig 2010-09-20 19:57:48 UTC >X+++ pm_common/CMakeLists.txt >X@@ -66,21 +66,12 @@ if(UNIX) >X set(JAVA_INCLUDE_PATHS ${JAVAVM_LIB}/Headers) >X message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) >X else(APPLE) >X- # LINUX settings... >X- include(FindJNI) >X- message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) >X- message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) >X- message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2}) >X- message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY}) >X- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2}) >X- # libjvm.so is found relative to JAVA_INCLUDE_PATH: >X- set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so) >X >X- set(LINUXSRC pmlinuxalsa pmlinux finddefault) >X- prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) >X+ set(LINUXSRC pmsndio) >X+ prepend_path(LIBSRC ../pm_sndio/ ${LINUXSRC}) >X list(APPEND LIBSRC ../porttime/ptlinux) >X >X- set(PM_NEEDED_LIBS pthread asound) >X+ set(PM_NEEDED_LIBS pthread sndio) >X endif(APPLE) >X else(UNIX) >X if(WIN32) >X@@ -99,7 +90,6 @@ else(UNIX) >X set(PM_NEEDED_LIBS winmm.lib) >X endif(WIN32) >X endif(UNIX) >X-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY}) >X >X # this completes the list of library sources by adding shared code >X list(APPEND LIBSRC pmutil portmidi) >X@@ -109,17 +99,10 @@ add_library(portmidi-static ${LIBSRC}) >X set_target_properties(portmidi-static PROPERTIES OUTPUT_NAME "portmidi_s") >X target_link_libraries(portmidi-static ${PM_NEEDED_LIBS}) >X >X-# define the jni library >X-include_directories(${JAVA_INCLUDE_PATHS}) >X >X-set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c) >X-add_library(pmjni SHARED ${JNISRC}) >X-target_link_libraries(pmjni ${JNI_EXTRA_LIBS}) >X-set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib") >X- >X # install the libraries (Linux and Mac OS X command line) >X if(UNIX) >X- INSTALL(TARGETS portmidi-static pmjni >X+ INSTALL(TARGETS portmidi-static >X LIBRARY DESTINATION /usr/local/lib >X ARCHIVE DESTINATION /usr/local/lib) >X # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here >0731001fe41459b2939384d94589ba2b >echo x - audio/portmidi/files/patch-pm__dylib_CMakeLists.txt >sed 's/^X//' >audio/portmidi/files/patch-pm__dylib_CMakeLists.txt << '6f9389cd2581606b3b2727895adf0831' >X--- pm_dylib/CMakeLists.txt.orig 2009-11-20 05:41:09 UTC >X+++ pm_dylib/CMakeLists.txt >X@@ -62,30 +62,11 @@ if(UNIX) >X set(INSTALL_NAME_DIR "/usr/local/lib") >X message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT}) >X else(APPLE) >X- # LINUX settings... >X- include(FindJNI) >X- # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH}) >X- # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH}) >X- # note: should use JAVA_JVM_LIB_PATH, but it is not set properly >X- # note: user might need to set JAVA_INCLUDE_PATH manually >X- # >X- # this will probably break on BSD and other Unix systems; the fix >X- # depends on whether FindJNI can find Java or not. If yes, then >X- # we should try to rely on automatically set JAVA_INCLUDE_PATH and >X- # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH >X- # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation >X- # because JAVA_INCLUDE_PATH2 is pretty obscure) >X- set(JAVA_INCLUDE_PATH ${JAVA_INCLUDE_PATH-UNKNOWN} >X- CACHE STRING "where to find Java SDK include directory") >X- set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux) >X- # libjvm.so is found relative to JAVA_INCLUDE_PATH: >X- set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so) >X- >X- set(LINUXSRC pmlinuxalsa pmlinux finddefault) >X- prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC}) >X+ set(LINUXSRC pmsndio) >X+ prepend_path(LIBSRC ../pm_sndio/ ${LINUXSRC}) >X list(APPEND LIBSRC ../porttime/ptlinux) >X >X- set(PM_NEEDED_LIBS pthread asound) >X+ set(PM_NEEDED_LIBS pthread sndio) >X endif(APPLE) >X else(UNIX) >X if(WIN32) >6f9389cd2581606b3b2727895adf0831 >echo x - audio/portmidi/files/patch-pm__test_CMakeLists.txt >sed 's/^X//' >audio/portmidi/files/patch-pm__test_CMakeLists.txt << '429f62f58586222443d64594cf485dc0' >X--- pm_test/CMakeLists.txt.orig 2010-09-20 19:57:48 UTC >X+++ pm_test/CMakeLists.txt >X@@ -1,4 +1,5 @@ >X # pm_test >X+cmake_policy(SET CMP0037 OLD) >X >X # set the build directory to be in portmidi, not in portmidi/pm_test >X # this is required for Xcode: >429f62f58586222443d64594cf485dc0 >echo x - audio/portmidi/files/patch-porttime_ptlinux.c >sed 's/^X//' >audio/portmidi/files/patch-porttime_ptlinux.c << 'd7f9b79fe030cb97fdbb0ca07554dbec' >X--- porttime/ptlinux.c.orig 2020-07-07 04:53:18 UTC >X+++ porttime/ptlinux.c >X@@ -31,14 +31,13 @@ CHANGE LOG >X #include "porttime.h" >X #include "sys/time.h" >X #include "sys/resource.h" >X-#include "sys/timeb.h" >X #include "pthread.h" >X >X #define TRUE 1 >X #define FALSE 0 >X >X static int time_started_flag = FALSE; >X-static struct timeb time_offset = {0, 0, 0, 0}; >X+static struct timespec time_offset = {0, 0}; >X static pthread_t pt_thread_pid; >X static int pt_thread_created = FALSE; >X >X@@ -79,7 +78,7 @@ static void *Pt_CallbackProc(void *p) >X PtError Pt_Start(int resolution, PtCallback *callback, void *userData) >X { >X if (time_started_flag) return ptNoError; >X- ftime(&time_offset); /* need this set before process runs */ >X+ clock_gettime(CLOCK_MONOTONIC, &time_offset); /* need this set before process runs */ >X if (callback) { >X int res; >X pt_callback_parameters *parms = (pt_callback_parameters *) >X@@ -120,12 +119,12 @@ int Pt_Started() >X >X PtTimestamp Pt_Time() >X { >X- long seconds, milliseconds; >X- struct timeb now; >X- ftime(&now); >X- seconds = now.time - time_offset.time; >X- milliseconds = now.millitm - time_offset.millitm; >X- return seconds * 1000 + milliseconds; >X+ long seconds, nanoseconds; >X+ struct timespec now; >X+ clock_gettime(CLOCK_MONOTONIC, &now); >X+ seconds = now.tv_sec - time_offset.tv_sec; >X+ nanoseconds = now.tv_nsec - time_offset.tv_nsec; >X+ return seconds * 1000 + nanoseconds / 1000000; >X } >X >X >d7f9b79fe030cb97fdbb0ca07554dbec >echo x - audio/portmidi/pkg-descr >sed 's/^X//' >audio/portmidi/pkg-descr << 'f58398d4a280177fac1332a007beaf44' >XPortMidi is a computer library for real time input and output of MIDI data. >XIt is designed to be portable to many different operating systems. PortMidi is >Xpart of the PortMusic project. >X >XThe MIDI support implemented in this port is derived from Raphael Graf's >Xpatches for a sndio backend on the OpenBSD audio/portmidi port, enhanced to >Xdetect a variable number of MIDI (umidi) devices: >Xhttp://openbsd-archive.7691.n7.nabble.com/audio-portmidi-input-td363848.html >Xhttps://marc.info/?l=openbsd-ports&m=155221816900336&w=2 >X >XWWW: http://portmedia.sourceforge.net/ >f58398d4a280177fac1332a007beaf44 >exit >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 252186
: 220977