On Sun, 06 Jun 2010, Christian Weisgerber wrote:

This is the py-ao fix (patches from debian/ubuntu).

Ciao, 
David

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/py-ao/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- Makefile    10 Mar 2009 22:21:48 -0000      1.9
+++ Makefile    7 Jun 2010 09:13:25 -0000
@@ -5,7 +5,7 @@ SHARED_ONLY=    Yes
 COMMENT=       Python wrapper module for the ao library
 
 DISTNAME=      pyao-0.82
-PKGNAME=       ${DISTNAME:S/py/py-/}p3
+PKGNAME=       ${DISTNAME:S/py/py-/}p4
 CATEGORIES=    audio
 HOMEPAGE=      http://ekyo.nerim.net/software/pyogg/
 
@@ -29,6 +29,7 @@ do-configure:
        @cd ${WRKSRC} && ${MODPY_BIN} ./config_unix.py --prefix ${PREFIX} 
 
 post-install:
+       @perl -pi -e 's,/usr/bin/python,${MODPY_BIN},g' ${WRKSRC}/test.py
        ${INSTALL_DATA_DIR} ${EXAMPLESDIR}
        ${INSTALL_DATA} ${WRKSRC}/test.py ${EXAMPLESDIR}
 
Index: patches/patch-src_aomodule_c
===================================================================
RCS file: patches/patch-src_aomodule_c
diff -N patches/patch-src_aomodule_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_aomodule_c        7 Jun 2010 09:13:25 -0000
@@ -0,0 +1,59 @@
+$OpenBSD$
+--- src/aomodule.c.orig        Thu Jul 24 08:52:59 2003
++++ src/aomodule.c     Mon Jun  7 09:31:46 2010
+@@ -4,7 +4,7 @@
+ static ao_option *
+ dict_to_options(PyObject *dict)
+ {
+-  int pos = 0;
++  Py_ssize_t pos = 0;
+   PyObject *key, *val;
+   ao_option *head = NULL;
+   int ret;
+@@ -71,7 +71,7 @@ parse_args(PyObject *args, PyObject *kwargs, 
+   
+   *overwrite = 0;
+ 
+-  if(PyArg_ParseTupleAndKeywords(args, kwargs, "s|llllO!sl", 
++  if(PyArg_ParseTupleAndKeywords(args, kwargs, "s|iiiiO!si", 
+                                (char **) driver_name_kwlist,
+                                &driver_name, 
+                                &format->bits, 
+@@ -84,7 +84,7 @@ parse_args(PyObject *args, PyObject *kwargs, 
+     *driver_id = ao_driver_id(driver_name);
+   } else {
+     PyErr_Clear();
+-    if(!(PyArg_ParseTupleAndKeywords(args, kwargs, "i|llllO!sl",
++    if(!(PyArg_ParseTupleAndKeywords(args, kwargs, "i|iiiiO!si",
+                                    (char **) driver_id_kwlist,
+                                    driver_id, 
+                                    &format->bits, 
+@@ -141,8 +141,9 @@ py_ao_new(PyObject *self, PyObject *args, PyObject *kw
+     return NULL;
+   }
+ 
+-  retobj = (ao_Object *) PyObject_NEW(ao_Object, &ao_Type);
++  retobj = (ao_Object *) PyObject_New(ao_Object, &ao_Type);
+   retobj->dev = dev;
++  retobj->driver_id = driver_id;
+   return (PyObject *) retobj;
+ }
+ 
+@@ -150,7 +151,7 @@ static void
+ py_ao_dealloc(ao_Object *self)
+ {
+   ao_close(self->dev);
+-  PyMem_DEL(self);
++  PyObject_Del(self);
+ }
+ 
+ static PyObject *
+@@ -184,7 +185,7 @@ py_ao_driver_info(PyObject *self, PyObject *args)
+ 
+     /* It's a method */
+     ao_Object *ao_self = (ao_Object *) self;
+-    info = ao_driver_info(ao_self->dev->driver_id);
++    info = ao_driver_info(ao_self->driver_id);
+ 
+   } else {
+ 
Index: patches/patch-src_aomodule_h
===================================================================
RCS file: patches/patch-src_aomodule_h
diff -N patches/patch-src_aomodule_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_aomodule_h        7 Jun 2010 09:13:25 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- src/aomodule.h.orig        Mon Jun  7 09:34:01 2010
++++ src/aomodule.h     Mon Jun  7 09:36:09 2010
+@@ -9,6 +9,7 @@
+ typedef struct {
+   PyObject_HEAD
+   ao_device *dev;
++  uint32_t driver_id;
+ } ao_Object;
+ 
+ static PyObject *Py_aoError;
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/py-ao/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   14 Sep 2004 23:16:55 -0000      1.2
+++ pkg/PLIST   7 Jun 2010 09:13:25 -0000
@@ -1,4 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.2 2004/09/14 23:16:55 espie Exp $
 lib/python${MODPY_VERSION}/site-packages/aomodule.so
+lib/python${MODPY_VERSION}/site-packages/pyao-0.82-py${MODPY_VERSION}.egg-info
 share/examples/py-ao/
 share/examples/py-ao/test.py

Reply via email to