pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Fixes for building pd on OpenBSD
[ CC'ing Pure Data developer Miller Puckette <msp%ucsd.edu@localhost> ]
Package "audio/pd" will not build on OpenBSD as it is. In order to build
it, I had to make changes to source files, as outlined in the attached
patches.
This with pkgsrc-2013Q1 (featuring pd version 0.43-0) and OpenBSD
5.3/i386. Provisions are made for OpenBSD/amd64, but I could not test
those.
Also, the CFLAGS environment variable needs to be set to:
'-DAPI_DEFAULT=API_OSS -DAPI_DEFSTRING=\"OSS\"'
=====BEGIN PATCHES=====
======================================== patch-extra_pd~_pd~.c-2
$NetBSD$
Adds variable definitions for OpenBSD
--- extra/pd~/pd~.c.pkgsrc Thu May 23 17:20:22 2013
+++ extra/pd~/pd~.c Thu May 23 17:21:48 2013
@@ -66,6 +66,15 @@
pd_tilde_dllextent2[] = ".pd_netbsd";
#endif
#endif
+#if defined(__OpenBSD__)
+#ifdef __x86_64__
+static char pd_tilde_dllextent[] = ".b_ia64",
+ pd_tilde_dllextent2[] = ".pd_openbsd";
+#else
+static char pd_tilde_dllextent[] = ".b_i386",
+ pd_tilde_dllextent2[] = ".pd_openbsd";
+#endif
+#endif
#if defined(__sun)
#ifdef __x86_64__
static char pd_tilde_dllextent[] = ".s_ia64",
======================================== patch-src_d__array.c-2
$NetBSD$
OpenBSD too defines BYTE_ORDER in <sys/endian.h>
--- src/d_array.c.pkgsrc Thu May 23 15:08:33 2013
+++ src/d_array.c Thu May 23 15:09:25 2013
@@ -498,7 +498,7 @@
/* this is all copied from d_osc.c... what include file could this go in? */
#define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
-#ifdef IRIX
+#if defined(IRIX) || defined(__OpenBSD__)
#include <sys/endian.h>
#endif
======================================== patch-src_d__osc.c-2
$NetBSD$
OpenBSD too defines BYTE_ORDER in <sys/endian.h>
--- src/d_osc.c.pkgsrc Thu May 23 14:53:36 2013
+++ src/d_osc.c Thu May 23 14:57:23 2013
@@ -11,7 +11,7 @@
#define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
-#ifdef IRIX
+#if defined(IRIX) || defined(__OpenBSD__)
#include <sys/endian.h>
#endif
======================================== patch-src_s__audio__oss.c-2
$NetBSD$
Include correct "soundcard.h" for OpenBSD
--- src/s_audio_oss.c.pkgsrc Thu May 23 16:28:41 2013
+++ src/s_audio_oss.c Thu May 23 16:30:24 2013
@@ -7,6 +7,8 @@
#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__sun)
# include <sys/soundcard.h>
+#elif defined(__OpenBSD__)
+# include <soundcard.h>
#else
# include <linux/soundcard.h>
#endif
======================================== patch-src_s__file.c-2
$NetBSD$
Compile the following funcs for OpenBSD too
--- src/s_file.c.pkgsrc Thu May 23 16:52:48 2013
+++ src/s_file.c Thu May 23 16:53:54 2013
@@ -36,7 +36,7 @@
t_symbol *sys_flags = &s_;
void sys_doflags( void);
-#if defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD_kernel__)
|| defined(__GNU__) || defined(ANDROID) || defined(__NetBSD__) || defined(__sun)
+#if defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD_kernel__)
|| defined(__GNU__) || defined(ANDROID) || defined(__NetBSD__) ||
defined(__OpenBSD__) || defined(__sun)
static char *sys_prefbuf;
static int sys_prefbufsize;
======================================== patch-src_s__loader.c-2
$NetBSD$
Define extensions for OpenBSD.
--- src/s_loader.c.pkgsrc Thu May 23 13:31:50 2013
+++ src/s_loader.c Thu May 23 13:38:22 2013
@@ -44,6 +44,12 @@
# else
static char sys_dllextent[] = ".n_i386", sys_dllextent2[] = ".pd_netbsd";
# endif
+#elif defined(__OpenBSD__)
+# ifdef __x86_64__
+static char sys_dllextent[] = ".b_ia64", sys_dllextent2[] = ".pd_openbsd";
+# else
+static char sys_dllextent[] = ".b_i386", sys_dllextent2[] = ".pd_openbsd";
+# endif
#elif defined(__sun)
# ifdef __x86_64__
static char sys_dllextent[] = ".s_ia64", sys_dllextent2[] = ".pd_sunos";
======================================== patch-src_x__misc.c-2
$NetBSD$
Define CLOCKHZ for OpenBSD too
--- src/x_misc.c.pkgsrc Thu May 23 16:10:14 2013
+++ src/x_misc.c Thu May 23 16:11:12 2013
@@ -20,7 +20,7 @@
#include <unistd.h>
#endif /* _WIN32 */
-#if defined (__APPLE__) || defined (__FreeBSD__) || defined(__NetBSD__) ||
defined(__sun)
+#if defined (__APPLE__) || defined (__FreeBSD__) || defined(__NetBSD__) ||
defined(__OpenBSD__) || defined(__sun)
#define CLOCKHZ CLK_TCK
#endif
#if defined (__linux__) || defined (__CYGWIN__) || defined (ANDROID)
=====END PATCHES=====
Home |
Main Index |
Thread Index |
Old Index