Fix building with Python 3.x.

This commit is contained in:
adam 2016-04-28 19:23:21 +00:00
parent cc171b7594
commit 6b76c78f36
3 changed files with 44 additions and 3 deletions

View file

@ -1,8 +1,9 @@
$NetBSD: distinfo,v 1.8 2015/11/04 16:45:52 adam Exp $
$NetBSD: distinfo,v 1.9 2016/04/28 19:23:21 adam Exp $
SHA1 (audiotools-3.1.1.tar.gz) = 61e9107acd0c2d0630de1bf099a170254119c253
RMD160 (audiotools-3.1.1.tar.gz) = 86436a2e6d80b35153168699a2bd32299ed1a254
SHA512 (audiotools-3.1.1.tar.gz) = dfba0dab8ef1573a12366bb4d46552eeb6c23c4abde34d9df51238fc97f573135b564cc3e5dbcaf7691c4502d8173dc926d8eb5ecd169fe619278ae89ff24c3a
Size (audiotools-3.1.1.tar.gz) = 6325408 bytes
SHA1 (patch-src_cdiomodule.h) = f7624e9c0923dfeceb422039a711e95697548e5a
SHA1 (patch-src_samplerate_src__sinc.c) = c069c78096f444fc686f5ea6d5319a6e5ed458d1
SHA1 (patch-src_output_core__audio.c) = 24b2c727ccefc859a1a728f1a04eba1cb1736a41
SHA1 (patch-src_samplerate_src__sinc.c) = a888e23da6dd5dc4628eb3adfc53c66c2ef1e5e1

View file

@ -0,0 +1,39 @@
$NetBSD: patch-src_output_core__audio.c,v 1.1 2016/04/28 19:23:21 adam Exp $
Fix building with Python 3.x.
--- src/output/core_audio.c.orig 2015-10-31 21:51:57.000000000 +0000
+++ src/output/core_audio.c
@@ -95,31 +95,10 @@ CoreAudio_init(output_CoreAudio *self, P
at init-time, we'll need to temporarily redirect
stdout to /dev/null*/
- /*first, determine the location of /dev/null from os.devnull*/
- if ((os_module_obj = PyImport_ImportModule("os")) == NULL) {
- return -1;
- }
- if ((devnull_obj =
- PyObject_GetAttrString(os_module_obj, "devnull")) == NULL) {
- Py_DECREF(os_module_obj);
- return -1;
- }
- if ((devnull = PyString_AsString(devnull_obj)) == NULL) {
- Py_DECREF(os_module_obj);
- Py_DECREF(devnull_obj);
- return -1;
- }
-
/*open /dev/null*/
- if ((devnull_stdout = open(devnull, O_WRONLY | O_TRUNC)) == -1) {
- Py_DECREF(os_module_obj);
- Py_DECREF(devnull_obj);
+ if ((devnull_stdout = open("/dev/null", O_WRONLY | O_TRUNC)) == -1) {
PyErr_SetFromErrno(PyExc_IOError);
return -1;
- } else {
- /*close unneeded Python objects once descriptor is open*/
- Py_DECREF(os_module_obj);
- Py_DECREF(devnull_obj);
}
/*swap file descriptors*/

View file

@ -1,6 +1,7 @@
$NetBSD: patch-src_samplerate_src__sinc.c,v 1.1 2014/02/24 13:05:39 wiedi Exp $
$NetBSD: patch-src_samplerate_src__sinc.c,v 1.2 2016/04/28 19:23:21 adam Exp $
Needed for int32_t on SunOS
--- src/samplerate/src_sinc.c.orig 2013-08-19 23:51:25.000000000 +0000
+++ src/samplerate/src_sinc.c
@@ -26,6 +26,9 @@