aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libao
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/libao')
-rw-r--r--vcpkg/ports/libao/0001-windows-build-patch.patch127
-rw-r--r--vcpkg/ports/libao/portfile.cmake34
-rw-r--r--vcpkg/ports/libao/vcpkg.json16
3 files changed, 177 insertions, 0 deletions
diff --git a/vcpkg/ports/libao/0001-windows-build-patch.patch b/vcpkg/ports/libao/0001-windows-build-patch.patch
new file mode 100644
index 0000000..96bea61
--- /dev/null
+++ b/vcpkg/ports/libao/0001-windows-build-patch.patch
@@ -0,0 +1,127 @@
+From 129f8e155596199191cc005bcc257397d0d981ac Mon Sep 17 00:00:00 2001
+From: xiaoyifang <yifang.xiao@outlook.com>
+Date: Wed, 16 Feb 2022 21:58:40 +0800
+Subject: [PATCH] patch windows
+
+---
+ include/ao/ao_private.h | 30 +++++++++++++++---------------
+ src/ao_wmm.c | 1 +
+ src/audio_out.c | 1 -
+ 3 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/include/ao/ao_private.h b/include/ao/ao_private.h
+index 44fa03e..c3c50aa 100644
+--- a/include/ao/ao_private.h
++++ b/include/ao/ao_private.h
+@@ -138,13 +138,13 @@ struct ao_functions {
+
+ void ao_read_config_files (ao_config *config);
+
+-#define adebug(format, args...) {\
++#define adebug(format, ...) {\
+ if(!device || device->verbose==2){ \
+ if(strcmp(format,"\n")){ \
+ if(device && device->funcs->driver_info()->short_name){ \
+- fprintf(stderr,"ao_%s debug: " format,device->funcs->driver_info()->short_name,## args); \
++ fprintf(stderr,"ao_%s debug: " format,device->funcs->driver_info()->short_name,__VA_ARGS__); \
+ }else{ \
+- fprintf(stderr,"debug: " format,## args); \
++ fprintf(stderr,"debug: " format,__VA_ARGS__); \
+ } \
+ }else{ \
+ fprintf(stderr,"\n"); \
+@@ -152,13 +152,13 @@ void ao_read_config_files (ao_config *config);
+ } \
+ }
+
+-#define averbose(format, args...) {\
++#define averbose(format, ...) {\
+ if(!device || device->verbose>0){ \
+ if(strcmp(format,"\n")){ \
+ if(device && device->funcs->driver_info()->short_name){ \
+- fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \
++ fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,__VA_ARGS__); \
+ }else{ \
+- fprintf(stderr,"info: " format,## args); \
++ fprintf(stderr,"info: " format,__VA_ARGS__); \
+ } \
+ }else{ \
+ fprintf(stderr,"\n"); \
+@@ -166,13 +166,13 @@ void ao_read_config_files (ao_config *config);
+ } \
+ }
+
+-#define ainfo(format, args...) {\
++#define ainfo(format, ...) {\
+ if(!device || device->verbose>=0){ \
+ if(strcmp(format,"\n")){ \
+ if(device && device->funcs->driver_info()->short_name){ \
+- fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,## args); \
++ fprintf(stderr,"ao_%s info: " format,device->funcs->driver_info()->short_name,__VA_ARGS__); \
+ }else{ \
+- fprintf(stderr,"info: " format,## args); \
++ fprintf(stderr,"info: " format,__VA_ARGS__); \
+ } \
+ }else{ \
+ fprintf(stderr,"\n"); \
+@@ -180,13 +180,13 @@ void ao_read_config_files (ao_config *config);
+ } \
+ }
+
+-#define awarn(format, args...) {\
++#define awarn(format, ...) {\
+ if(!device || device->verbose>=0){ \
+ if(strcmp(format,"\n")){ \
+ if(device && device->funcs->driver_info()->short_name){ \
+- fprintf(stderr,"ao_%s WARNING: " format,device->funcs->driver_info()->short_name,## args); \
++ fprintf(stderr,"ao_%s WARNING: " format,device->funcs->driver_info()->short_name,__VA_ARGS__); \
+ }else{ \
+- fprintf(stderr,"WARNING: " format,## args); \
++ fprintf(stderr,"WARNING: " format,__VA_ARGS__); \
+ } \
+ }else{ \
+ fprintf(stderr,"\n"); \
+@@ -194,13 +194,13 @@ void ao_read_config_files (ao_config *config);
+ } \
+ }
+
+-#define aerror(format, args...) { \
++#define aerror(format, ...) { \
+ if(!device || device->verbose>=0){ \
+ if(strcmp(format,"\n")){ \
+ if(device && device->funcs->driver_info()->short_name){ \
+- fprintf(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,## args); \
++ fprintf(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,__VA_ARGS__); \
+ }else{ \
+- fprintf(stderr,"ERROR: " format,## args); \
++ fprintf(stderr,"ERROR: " format,__VA_ARGS__); \
+ } \
+ }else{ \
+ fprintf(stderr,"\n"); \
+diff --git a/src/ao_wmm.c b/src/ao_wmm.c
+index eec6b83..d18d2a4 100644
+--- a/src/ao_wmm.c
++++ b/src/ao_wmm.c
+@@ -33,6 +33,7 @@
+ #include <windows.h>
+ #include <mmreg.h>
+ #include <mmsystem.h>
++#include <ks.h>
+ #include <ksmedia.h>
+
+ #include <stdlib.h>
+diff --git a/src/audio_out.c b/src/audio_out.c
+index bd8f6fc..e3af366 100644
+--- a/src/audio_out.c
++++ b/src/audio_out.c
+@@ -49,7 +49,6 @@ static int dlclose(void *handle) { return 0; }
+ #ifndef _MSC_VER
+ # include <unistd.h>
+ #endif
+-#include <dirent.h>
+
+ #include "ao/ao.h"
+ #include "ao_private.h"
+--
+2.30.0.windows.2
+
diff --git a/vcpkg/ports/libao/portfile.cmake b/vcpkg/ports/libao/portfile.cmake
new file mode 100644
index 0000000..274beec
--- /dev/null
+++ b/vcpkg/ports/libao/portfile.cmake
@@ -0,0 +1,34 @@
+set(NO_DLFCN )
+if(VCPKG_TARGET_IS_WINDOWS)
+ list(APPEND PATCHES "0001-windows-build-patch.patch")
+ set(NO_DLFCN "ac_cv_header_dlfcn_h=no")
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xiph/libao
+ REF 1.2.2
+ SHA512 d2736d25b60862e7d7469611ce31b1df40a4366ab160e2ff1b46919ae91692d1596c8468e4f016303b306fc3ac1bddc7b727f535a362f403c3fe7c6532e9045a
+ HEAD_REF master
+ PATCHES ${PATCHES}
+)
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(ENV{LIBS} "-lwinmm -lksuser")
+endif()
+
+vcpkg_configure_make(
+ SOURCE_PATH ${SOURCE_PATH}
+ AUTOCONFIG
+ OPTIONS --disable-binaries
+ ${NO_DLFCN}
+)
+vcpkg_install_make()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+
+vcpkg_fixup_pkgconfig()
+
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/libao/vcpkg.json b/vcpkg/ports/libao/vcpkg.json
new file mode 100644
index 0000000..fe6117b
--- /dev/null
+++ b/vcpkg/ports/libao/vcpkg.json
@@ -0,0 +1,16 @@
+{
+ "name": "libao",
+ "version": "1.2.2",
+ "port-version": 5,
+ "description": "libao - A Cross-platform Audio Library",
+ "homepage": "https://github.com/xiph/libao",
+ "license": "GPL-2.0",
+ "supports": "!uwp & !xbox",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true,
+ "platform": "windows"
+ }
+ ]
+}