Here are some fixes for the OpenAL port.

- Use CMake options via CONFIGURE_ARGS to disable unnecessary backends
  and unwanted features which also means being able to remove some
  patching of CMakeLists.
- Fix hardcoded path in the OpenAL code.
- Fix the pkg-config file to properly list the library dependencies.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/audio/openal/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    25 Jun 2011 18:42:02 -0000      1.20
+++ Makefile    25 Jun 2011 23:37:31 -0000
@@ -5,26 +5,33 @@ COMMENT =     cross-platform 3D audio API
 V =            20110624
 DISTNAME =     openal-soft-$V
 PKGNAME =      openal-$V
+REVISION =     0
 CATEGORIES =   audio
 SHARED_LIBS =  openal  2.0
 
 HOMEPAGE =     http://kcat.strangesoft.net/openal.html
 
-# LGPL
+# LGPLv2+
 PERMIT_PACKAGE_CDROM = Yes
 PERMIT_PACKAGE_FTP =   Yes
 PERMIT_DISTFILES_CDROM =Yes
 PERMIT_DISTFILES_FTP = Yes
 
-WANTLIB =              c m pthread sndio portaudio
+WANTLIB =              c m pthread sndio
 
 MASTER_SITES =         ${HOMEPAGE:S,.html,-releases/,} \
                        http://openbsd.fi/dist/
 
-LIB_DEPENDS =          audio/portaudio-svn
 MODULES =              devel/cmake
 
+CONFIGURE_STYLE =      cmake
+CONFIGURE_ARGS =       -DALSA=off -DOSS=off -DSOLARIS=off -DPORTAUDIO=off 
-DPULSEAUDIO=off \
+                       -DDLOPEN=off
+
 NO_REGRESS =           Yes
+
+pre-build:
+       @${SUBST_CMD} ${WRKSRC}/Alc/alcConfig.c
 
 post-install:
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/openal
Index: patches/patch-Alc_alcConfig_c
===================================================================
RCS file: patches/patch-Alc_alcConfig_c
diff -N patches/patch-Alc_alcConfig_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Alc_alcConfig_c       25 Jun 2011 23:40:46 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- Alc/alcConfig.c.orig       Sat Jun 25 19:34:30 2011
++++ Alc/alcConfig.c    Sat Jun 25 19:34:48 2011
+@@ -226,7 +226,7 @@ void ReadALConfig(void)
+         }
+     }
+ #else
+-    f = fopen("/etc/openal/alsoft.conf", "r");
++    f = fopen("${SYSCONFDIR}/openal/alsoft.conf", "r");
+     if(f)
+     {
+         LoadConfigFromFile(f);
Index: patches/patch-Alc_portaudio_c
===================================================================
RCS file: patches/patch-Alc_portaudio_c
diff -N patches/patch-Alc_portaudio_c
--- patches/patch-Alc_portaudio_c       25 Jun 2011 18:42:02 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-Alc_portaudio_c,v 1.1 2011/06/25 18:42:02 jasper Exp $
---- Alc/portaudio.c.orig       Sat Jun 25 19:34:32 2011
-+++ Alc/portaudio.c    Sat Jun 25 19:34:36 2011
-@@ -112,6 +112,8 @@ void *pa_load(void)
- {
-     if(!pa_handle)
-     {
-+        PaError err;
-+
-         pa_handle = (void*)0xDEADBEEF;
-         if((err=Pa_Initialize()) != paNoError)
-         {
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /home/cvs/ports/audio/openal/patches/patch-CMakeLists_txt,v
retrieving revision 1.1
diff -u -p -r1.1 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt        25 Jun 2011 18:42:02 -0000      1.1
+++ patches/patch-CMakeLists_txt        25 Jun 2011 23:28:01 -0000
@@ -1,15 +1,6 @@
 $OpenBSD: patch-CMakeLists_txt,v 1.1 2011/06/25 18:42:02 jasper Exp $
---- CMakeLists.txt.orig        Fri Jun 24 03:02:57 2011
-+++ CMakeLists.txt     Sat Jun 25 20:46:26 2011
-@@ -50,7 +50,7 @@ OPTION(REQUIRE_PULSEAUDIO "Require PulseAudio backend"
- OPTION(REQUIRE_COREAUDIO  "Require CoreAudio backend"          OFF)
- OPTION(REQUIRE_OPENSL     "Require OpenSL backend"             OFF)
- 
--OPTION(DLOPEN  "Check for the dlopen API for loading optional libs"  ON)
-+OPTION(DLOPEN  "Check for the dlopen API for loading optional libs"  OFF)
- 
- OPTION(WERROR  "Treat compile warnings as errors"      OFF)
- 
+--- CMakeLists.txt.orig        Thu Jun 23 20:02:57 2011
++++ CMakeLists.txt     Sat Jun 25 19:27:55 2011
 @@ -145,13 +145,13 @@ ELSE()
          ADD_DEFINITIONS(-Werror)
      ENDIF()
@@ -27,19 +18,3 @@ $OpenBSD: patch-CMakeLists_txt,v 1.1 201
          "Flags used by the compiler during release builds"
          FORCE)
      SET(CMAKE_C_FLAGS_DEBUG "-g3 -D_DEBUG" CACHE STRING
-@@ -508,6 +508,15 @@ ENDIF()
- 
- # Check PortAudio backend
- IF(PORTAUDIO)
-+    IF(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
-+        INCLUDE(FindPkgConfig)
-+        PKG_CHECK_MODULES(PORTAUDIO REQUIRED portaudio-2.0)
-+        INCLUDE_DIRECTORIES("${PORTAUDIO_INCLUDE_DIRS}")
-+        LINK_DIRECTORIES("${PORTAUDIO_LIBRARY_DIRS}")
-+        SET(HAVE_PORTAUDIO 1)
-+        SET(HAVE_LIBPORTAUDIO 1)
-+        SET(HAVE_PORTAUDIO_H 1)
-+    ENDIF()
-     CHECK_INCLUDE_FILE(portaudio.h HAVE_PORTAUDIO_H)
-     IF(HAVE_PORTAUDIO_H)
-         CHECK_SHARED_LIBRARY_EXISTS(portaudio Pa_Initialize 0 "" 
HAVE_LIBPORTAUDIO)
Index: patches/patch-openal_pc_in
===================================================================
RCS file: patches/patch-openal_pc_in
diff -N patches/patch-openal_pc_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-openal_pc_in  26 Jun 2011 01:29:10 -0000
@@ -0,0 +1,10 @@
+$OpenBSD$
+--- openal.pc.in.orig  Sat Jun 25 21:24:40 2011
++++ openal.pc.in       Sat Jun 25 21:28:26 2011
+@@ -7,5 +7,5 @@ Name: OpenAL
+ Description: OpenAL is a cross-platform 3D audio API
+ Requires: @PKG_CONFIG_REQUIRES@
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@
++Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@ -lm -lsndio -pthread
+ Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Reply via email to