From e599815069f11d05fa6d54d17506aa71b5f1e81f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 2 Sep 2009 09:55:33 +0200 Subject: [PATCH] Add media-libs/portmidi-82. --- media-libs/portmidi/Manifest | 3 + media-libs/portmidi/files/portmidi-82.diff | 154 +++++++++++++++++++++++++++++ media-libs/portmidi/portmidi-82.ebuild | 41 ++++++++ 3 files changed, 198 insertions(+) create mode 100644 media-libs/portmidi/Manifest create mode 100644 media-libs/portmidi/files/portmidi-82.diff create mode 100644 media-libs/portmidi/portmidi-82.ebuild diff --git a/media-libs/portmidi/Manifest b/media-libs/portmidi/Manifest new file mode 100644 index 0000000..adb7a63 --- /dev/null +++ b/media-libs/portmidi/Manifest @@ -0,0 +1,3 @@ +AUX portmidi-82.diff 6086 RMD160 fdfe56d9392e88de70edbb7fc9e843dfe56bf313 SHA1 c942d7791d3687ff7810a7d4dd56057db581be67 SHA256 5c48b1d54a87fc1efd9cf07a994fe36565c323738fc408cf55c29ab4542d2832 +DIST portmidi-src-82.zip 144345 RMD160 80de5145c8ffbefd1fe5237478c0649690b4743f SHA1 08eeaebc52ed30365e65a73e00259dbf59fe0412 SHA256 8717e5c2393eeac3acc19c63654a54052ef6bf2f803500e469360759d107cc2d +EBUILD portmidi-82.ebuild 1198 RMD160 59c1ae34077083968c6efb0b50ca650ba03f7bbe SHA1 a46e680aa0d98d013c73e351edaca0d3a1abfe44 SHA256 f77d96cee4b8626669c124f6d5245684d4d035fea9c35360ccb7a15f34535ba3 diff --git a/media-libs/portmidi/files/portmidi-82.diff b/media-libs/portmidi/files/portmidi-82.diff new file mode 100644 index 0000000..1ab1c76 --- /dev/null +++ b/media-libs/portmidi/files/portmidi-82.diff @@ -0,0 +1,154 @@ +diff -Nur portmidi/pm_linux/Makefile portmidi-new/pm_linux/Makefile +--- portmidi/pm_linux/Makefile 2008-06-14 02:23:43.000000000 +0200 ++++ portmidi-new/pm_linux/Makefile 2008-11-24 12:01:48.000000000 +0100 +@@ -16,7 +16,7 @@ + # simple to create.) + + # For debugging, define PM_CHECK_ERRORS +-PMFLAGS = -DPM_CHECK_ERRORS ++PMFLAGS = -DNEWBUFFER + # Otherwise do not define PM_CHECK_ERRORS + # PMFLAGS = + +@@ -31,10 +31,14 @@ + # VFLAGS = -DPMNULL + + pmlib = pm_linux/libportmidi.a ++pmslib = pm_linux/libportmidi.so.0.0.0 + + ptlib = porttime/libporttime.a ++ptslib = porttime/libporttime.so.0.0.0 + +-CC = gcc $(VFLAGS) $(PMFLAGS) -g -Ipm_common -Iporttime ++CC = gcc -fPIC $(CFLAGS) $(VFLAGS) $(PMFLAGS) -g -Ipm_common -Iporttime ++ ++INSTALL = install + + pmobjects = pm_common/pmutil.o $(versions) pm_linux/pmlinux.o \ + pm_common/portmidi.o +@@ -46,11 +50,13 @@ + all: $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread \ + pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm + +-$(pmlib): pm_linux/Makefile $(pmobjects) ++$(pmlib): pm_linux/Makefile $(pmobjects) $(ptlib) + ar -cr $(pmlib) $(pmobjects) ++ $(CC) -shared $(ptslib) $(ALSALIB) $(pmobjects) -Wl,-soname -Wl,libportmidi.so.0 -o $(pmslib) + + $(ptlib): pm_linux/Makefile $(ptobjects) + ar -cr $(ptlib) $(ptobjects) ++ $(CC) -shared $(ptobjects) -lpthread -Wl,-soname -Wl,libporttime.so.0 -o $(ptslib) + + pm_linux/pmlinuxalsa.o: pm_linux/Makefile pm_linux/pmlinuxalsa.c pm_linux/pmlinuxalsa.h + $(CC) -c pm_linux/pmlinuxalsa.c -o pm_linux/pmlinuxalsa.o +@@ -83,6 +89,14 @@ + pm_test/qtest: pm_linux/Makefile pm_test/qtest.o $(pmlib) $(ptlib) + $(CC) pm_test/qtest.o -o pm_test/qtest $(pmlib) $(ptlib) $(ALSALIB) + ++install: ++ $(INSTALL) -d $(DESTDIR)/usr/include ++ $(INSTALL) -m 644 pm_common/portmidi.h $(DESTDIR)/usr/include/ ++ $(INSTALL) -m 644 porttime/porttime.h $(DESTDIR)/usr/include/ ++ $(INSTALL) -d $(DESTDIR)/usr/lib ++ $(INSTALL) -m 644 pm_linux/libportmidi* $(DESTDIR)/usr/lib/ ++ $(INSTALL) -m 644 porttime/libporttime* $(DESTDIR)/usr/lib/ ++ + clean: + rm -f *.o *~ core* */*.o */*.so */*~ */core* pm_test/*/pm_dll.dll + rm -f *.opt *.ncb *.plg pm_win/Debug/pm_dll.lib pm_win/Release/pm_dll.lib +@@ -93,6 +107,9 @@ + cleanest: cleaner + rm -f $(pmlib) $(ptlib) pm_test/test pm_test/sysex pm_test/midithread + rm -f pm_test/latency pm_test/midithru pm_test/qtest pm_test/mm ++ rm -f pm_linux/libportmidi.a pm_linux/libportmidi.so.0.0.0 pm_test/test pm_test/sysex \ ++ pm_test/midithread pm_test/latency pm_test/midithru porttime/libporttime.a \ ++ porttime/libporttime.so.0.0.0 + + backup: cleanest + cd ..; zip -r portmidi.zip portmidi +diff -Nur portmidi/pm_linux/pmlinux.c portmidi-new/pm_linux/pmlinux.c +--- portmidi/pm_linux/pmlinux.c 2006-11-30 00:37:09.000000000 +0100 ++++ portmidi-new/pm_linux/pmlinux.c 2008-11-24 11:59:21.000000000 +0100 +@@ -28,10 +28,10 @@ + * devices. + */ + #ifdef PMALSA +- pm_linuxalsa_init(); ++ return pm_linuxalsa_init(); + #endif + #ifdef PMNULL +- pm_linuxnull_init(); ++ return pm_linuxnull_init(); + #endif + return pmNoError; + } +diff -Nur portmidi/pm_linux/pmlinuxalsa.c portmidi-new/pm_linux/pmlinuxalsa.c +--- portmidi/pm_linux/pmlinuxalsa.c 2008-06-14 02:23:43.000000000 +0200 ++++ portmidi-new/pm_linux/pmlinuxalsa.c 2008-11-24 11:58:30.000000000 +0100 +@@ -209,7 +209,7 @@ + if (when == 0) when = now; + when = (when - now) + midi->latency; + if (when < 0) when = 0; +- VERBOSE printf("timestamp %d now %d latency %d, ", ++ VERBOSE printf("timestamp %d now %d latency %li, ", + (int) timestamp, (int) now, midi->latency); + VERBOSE printf("scheduling event after %d\n", when); + /* message is sent in relative ticks, where 1 tick = 1 ms */ +@@ -243,8 +243,8 @@ + alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor; + if (!desc) return pmBadPtr; + +- if (pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port, +- desc->client, desc->port)) { ++ if ((pm_hosterror = snd_seq_disconnect_to(seq, desc->this_port, ++ desc->client, desc->port))) { + // if there's an error, try to delete the port anyway, but don't + // change the pm_hosterror value so we retain the first error + snd_seq_delete_port(seq, desc->this_port); +@@ -333,8 +333,8 @@ + { + alsa_descriptor_type desc = (alsa_descriptor_type) midi->descriptor; + if (!desc) return pmBadPtr; +- if (pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port, +- desc->client, desc->port)) { ++ if ((pm_hosterror = snd_seq_disconnect_from(seq, desc->this_port, ++ desc->client, desc->port))) { + snd_seq_delete_port(seq, desc->this_port); /* try to close port */ + } else { + pm_hosterror = snd_seq_delete_port(seq, desc->this_port); +diff -Nur portmidi/pm_test/Makefile portmidi-new/pm_test/Makefile +--- portmidi/pm_test/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ portmidi-new/pm_test/Makefile 2008-11-24 12:00:31.000000000 +0100 +@@ -0,0 +1,32 @@ ++# For debugging, define PM_CHECK_ERRORS ++PMFLAGS = -DPM_CHECK_ERRORS ++# Use this for linux alsa (0.9x) version ++ALSALIB = -lasound ++pmlib = -lportmidi ++ptlib = -lporttime ++VFLAGS = -DPMALSA ++ ++CC = gcc $(CFLAGS) $(VFLAGS) $(PMFLAGS) -g ++ ++all: test sysex midithread latency midithru ++ ++test: test.o ++ $(CC) test.c -o test $(pmlib) $(ptlib) $(ALSALIB) ++ ++sysex: sysex.o ++ $(CC) sysex.c -o sysex $(pmlib) $(ptlib) $(ALSALIB) ++ ++midithread: midithread.o ++ $(CC) midithread.c -o midithread \ ++ $(pmlib) $(ptlib) $(ALSALIB) ++ ++latency: latency.o ++ $(CC) latency.c -o latency $(pmlib) $(ptlib) \ ++ $(ALSALIB) -lpthread -lm ++ ++midithru: midithru.o ++ $(CC) midithru.c -o midithru $(pmlib) $(ptlib) \ ++ $(ALSALIB) -lpthread -lm ++ ++clean: ++ rm -f midithru latency midithread sysex test diff --git a/media-libs/portmidi/portmidi-82.ebuild b/media-libs/portmidi/portmidi-82.ebuild new file mode 100644 index 0000000..c9b6fe4 --- /dev/null +++ b/media-libs/portmidi/portmidi-82.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils + +DESCRIPTION="Platform Independent Library for MIDI" +HOMEPAGE="http://www.cs.cmu.edu/~music/portmusic/portmidi/" +MY_P="${PN}-src-${PV}" +SRC_URI="${HOMEPAGE}/${MY_P}.zip" +LICENSE="MIT" +SLOT="0" +KEYWORDS="~x86 ~amd64" +IUSE="" +DEPEND="media-libs/alsa-lib" +S="${WORKDIR}/${PN}" + +src_unpack() { + unpack ${A} || die "unpack failed" + cd ${S} + epatch "${FILESDIR}/${P}.diff" || die "epatch failed" +} + +src_compile() { + emake -f pm_linux/Makefile -j1 || die "emake failed" +} + +src_install() { + ln -s libportmidi.so.0.0.0 pm_linux/libportmidi.so.0 + ln -s libportmidi.so.0 pm_linux/libportmidi.so + ln -s libporttime.so.0.0.0 porttime/libporttime.so.0 + ln -s libporttime.so.0 porttime/libporttime.so + dolib.so pm_linux/libportmidi.so* porttime/libporttime.so* + dolib.a pm_linux/libportmidi.a porttime/libporttime.a + insinto /usr/include + doins pm_common/portmidi.h porttime/porttime.h + insinto /usr/lib/portmidi + INSOPTIONS="${EXEOPTIONS}" doins \ + pm_test/{latency,midithread,midithru,sysex,test} + dodoc license.txt README.txt pm_linux/README_LINUX.txt +} -- 2.7.4