aboutsummaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2007-07-13 02:40:39 +0800
committertrasz <trasz@FreeBSD.org>2007-07-13 02:40:39 +0800
commit663eb859336223dcba61faa9ae401437df0af228 (patch)
tree8a4695d973c968e471c09994ffa5ff1ff3657804 /audio
parent9c6830c920cbd05af2dcdd69b9c826b457aa280d (diff)
downloadfreebsd-ports-gnome-663eb859336223dcba61faa9ae401437df0af228.tar.gz
freebsd-ports-gnome-663eb859336223dcba61faa9ae401437df0af228.tar.zst
freebsd-ports-gnome-663eb859336223dcba61faa9ae401437df0af228.zip
- Make it work on 7-CURRENT.
Submitted by: jkim Approved by: miwi (mentor)
Diffstat (limited to 'audio')
-rw-r--r--audio/oss/Makefile31
-rw-r--r--audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.c11
-rw-r--r--audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.h27
-rw-r--r--audio/oss/files/patch-setup-FreeBSD-oss-build-osscore.c15
4 files changed, 72 insertions, 12 deletions
diff --git a/audio/oss/Makefile b/audio/oss/Makefile
index a338f7f25c72..b14c5a9e982a 100644
--- a/audio/oss/Makefile
+++ b/audio/oss/Makefile
@@ -7,7 +7,7 @@
PORTNAME= oss
DISTVERSION= 4.0-build1003
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= audio kld
MASTER_SITES= http://developer.opensound.com/sources/stable/
DISTNAME= ${PORTNAME}-v${DISTVERSION}-src-gpl
@@ -25,6 +25,7 @@ USE_RC_SUBR= oss
WRKSRC= ${WRKDIR}/build
PATCH_WRKSRC= ${WRKDIR}/${DISTNAME}
SUB_FILES= pkg-install pkg-message
+ONLY_FOR_ARCHS= amd64 i386
MAN1= ossinfo.1 ossmix.1 ossplay.1 ossrecord.1 osstest.1 ossxmix.1
MAN8= ossctl.8 ossdevlinks.8 savemixer.8 ossdetect.8
@@ -33,17 +34,29 @@ MAN8= ossctl.8 ossdevlinks.8 savemixer.8 ossdetect.8
IGNORE= requires kernel source to be installed
.endif
-do-configure:
- ${MKDIR} ${WRKSRC}
- cd ${WRKSRC} && ${WRKDIR}/${DISTNAME}/configure
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 600000
+BROKEN= Does not compile on 5.x.
+.endif
+
+pre-patch:
${FIND} ${WRKDIR}/${DISTNAME} -type f -name '*.[hc]' -or -name '*.man' | ${XARGS} ${REINPLACE_CMD} \
- -e 's|"/usr/include/stdarg.h"|<stdarg.h>|g' \
+ -e 's|"/usr/include/stdarg.h"|<machine/stdarg.h>|g' \
-e 's|/usr/|${PREFIX}/|g' \
-e 's|/etc/oss|${PREFIX}/etc/oss|g'
- ${REINPLACE_CMD} -e "s|mkdir|mkdir -p|" ${WRKSRC}/build.sh
+ ${REINPLACE_CMD} -e "s|<i386/include/intr_machdep.h>|<${ARCH}/include/intr_machdep.h>|g" \
+ ${WRKDIR}/${DISTNAME}/setup/FreeBSD/oss/build/osscore.c
+ ${REINPLACE_CMD} -e "s|mkdir|mkdir -p|" ${WRKDIR}/${DISTNAME}/setup/FreeBSD/build.sh
+
+post-patch:
${FIND} ${WRKDIR} -name soundon -or -name soundoff -or -name build.sh | ${XARGS} ${REINPLACE_CMD} \
-e 's|%%PREFIX%%|${PREFIX}|g'
+do-configure:
+ ${MKDIR} ${WRKSRC}
+ cd ${WRKSRC} && ${WRKDIR}/${DISTNAME}/configure
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/prototype/usr/bin/* ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/prototype/usr//sbin/savemixer ${PREFIX}/sbin
@@ -70,10 +83,4 @@ do-install:
PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 600000 || ${OSVERSION} > 700000
-BROKEN= Does not compile on 5.x and 7.x
-.endif
-
.include <bsd.port.post.mk>
diff --git a/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.c b/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.c
new file mode 100644
index 000000000000..b738f690f972
--- /dev/null
+++ b/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.c
@@ -0,0 +1,11 @@
+--- kernel/OS/FreeBSD/os_freebsd.c.orig 2007-06-12 17:32:57.000000000 -0400
++++ kernel/OS/FreeBSD/os_freebsd.c 2007-07-11 20:41:43.000000000 -0400
+@@ -145,7 +145,7 @@
+ return 0;
+
+ wq->flags = 0;
+- flag = msleep (wq, *mutex, PRIBIO | PCATCH, "oss", ticks);
++ flag = msleep_spin (wq, *mutex, "oss", ticks);
+
+ if (flag == EWOULDBLOCK) /* Timeout */
+ {
diff --git a/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.h b/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.h
new file mode 100644
index 000000000000..b056c5e4942e
--- /dev/null
+++ b/audio/oss/files/patch-kernel-OS-FreeBSD-os_freebsd.h
@@ -0,0 +1,27 @@
+--- kernel/OS/FreeBSD/os_freebsd.h.orig 2007-06-12 17:32:57.000000000 -0400
++++ kernel/OS/FreeBSD/os_freebsd.h 2007-07-11 20:07:40.000000000 -0400
+@@ -16,7 +16,6 @@
+ * distribution. Please contact sales@opensound.com for further info.
+ *
+ */
+-#define OS_VERSION "6"
+ #define __inline__ inline
+ #define __inline inline
+ #define EXTERN_C extern "C"
+@@ -55,6 +54,16 @@
+ #include <vm/pmap.h>
+ #include <sys/selinfo.h>
+
++#define __FreeBSD_version_major ((__FreeBSD_version) / 100000)
++
++#if (__FreeBSD_version_major == 7)
++#define OS_VERSION "7"
++#elif (__FreeBSD_version_major == 6)
++#define OS_VERSION "6"
++#else
++#error Unsupported OS version
++#endif
++
+ #undef timeout
+ #define timeout oss_timeout
+ #undef untimeout
diff --git a/audio/oss/files/patch-setup-FreeBSD-oss-build-osscore.c b/audio/oss/files/patch-setup-FreeBSD-oss-build-osscore.c
new file mode 100644
index 000000000000..3b9b6c853e66
--- /dev/null
+++ b/audio/oss/files/patch-setup-FreeBSD-oss-build-osscore.c
@@ -0,0 +1,15 @@
+--- setup/FreeBSD/oss/build/osscore.c.orig 2007-06-12 08:22:35.000000000 -0400
++++ setup/FreeBSD/oss/build/osscore.c 2007-07-11 18:45:01.000000000 -0400
+@@ -164,7 +164,11 @@
+ }
+
+ intr->irq == bus_setup_intr (osdev->dip, intr->irqres,
+- INTR_TYPE_AV | INTR_MPSAFE, ossintr, intr,
++ INTR_TYPE_AV | INTR_MPSAFE,
++#if __FreeBSD_version >= 700031
++ NULL,
++#endif
++ ossintr, intr,
+ &(intr->cookie));
+
+ nintrs++;