From a5a86d12573da5931babb34b74e8a4b95142328c Mon Sep 17 00:00:00 2001 From: Cheney-Wang Date: Tue, 22 Feb 2022 18:39:59 -0800 Subject: [PATCH 1/3] [libao] Add parameter to control whether to detect dlfcn --- ports/libao/Fix-C2065.patch | 27 +++++++++++++++++++++++++++ ports/libao/portfile.cmake | 5 +++++ ports/libao/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/l-/libao.json | 5 +++++ 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 ports/libao/Fix-C2065.patch diff --git a/ports/libao/Fix-C2065.patch b/ports/libao/Fix-C2065.patch new file mode 100644 index 00000000000000..3341dd45bb183e --- /dev/null +++ b/ports/libao/Fix-C2065.patch @@ -0,0 +1,27 @@ +diff --git a/configure.ac b/configure.ac +index 0e53752..503a59a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -42,10 +42,18 @@ dnl Check dlopen + dnl ==================================== + + dnl Currently use this to disable plugin support dlfcn.h +-AC_CHECK_HEADERS([dlfcn.h], +- [AC_SEARCH_LIBS([dlopen],[dl], +- [AC_DEFINE([HAVE_DLOPEN],[1], +- [support dynamic linking loader])])]) ++with_dlfcn="no" ++AC_ARG_ENABLE([dlfcn], ++ [AS_HELP_STRING( ++ [--enable-dlfcn])], ++ [with_dlfcn="$enableval"],[with_dlfcn="no"] ++) ++if test "x$with_dlfcn" == "xyes"; then ++ AC_CHECK_HEADERS([dlfcn.h], ++ [AC_SEARCH_LIBS([dlopen],[dl], ++ [AC_DEFINE([HAVE_DLOPEN],[1], ++ [support dynamic linking loader])])]) ++fi + + dnl ==================================== + dnl Set some general compile options diff --git a/ports/libao/portfile.cmake b/ports/libao/portfile.cmake index ae01234926115c..b18a0aec142e76 100644 --- a/ports/libao/portfile.cmake +++ b/ports/libao/portfile.cmake @@ -1,7 +1,11 @@ +set(with_dlfcn "yes") if(VCPKG_TARGET_IS_WINDOWS) list(APPEND PATCHES "0001-windows-build-patch.patch") + set(with_dlfcn "no") endif() +list(APPEND PATCHES "Fix-C2065.patch") + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xiph/libao @@ -19,6 +23,7 @@ vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG OPTIONS --disable-binaries + --enable-dlfcn=${with_dlfcn} ) vcpkg_install_make() diff --git a/ports/libao/vcpkg.json b/ports/libao/vcpkg.json index e9e38670cf3d4a..18f7a2675107f4 100644 --- a/ports/libao/vcpkg.json +++ b/ports/libao/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libao", "version": "1.2.2", - "port-version": 3, + "port-version": 4, "description": "libao - A Cross-platform Audio Library", "homepage": "https://github.com/xiph/libao", "license": "GPL-2.0", diff --git a/versions/baseline.json b/versions/baseline.json index fb07913cbcd95f..94cfd74d9cafd1 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3334,7 +3334,7 @@ }, "libao": { "baseline": "1.2.2", - "port-version": 3 + "port-version": 4 }, "libarchive": { "baseline": "3.5.2", diff --git a/versions/l-/libao.json b/versions/l-/libao.json index dcd2a4f41a1014..cb62b1b17d3384 100644 --- a/versions/l-/libao.json +++ b/versions/l-/libao.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "dddc94119554ec206d861b23a2aaca51748d4cce", + "version": "1.2.2", + "port-version": 4 + }, { "git-tree": "931d3ed363323bdc4de00c91165f3a09e23fb6b1", "version": "1.2.2", From f3cbd447fcd45e646237f023caa3778fc465a35e Mon Sep 17 00:00:00 2001 From: Cheney-Wang Date: Wed, 23 Feb 2022 01:04:53 -0800 Subject: [PATCH 2/3] Use Cache variables instead of patch file --- ports/libao/Fix-C2065.patch | 27 --------------------------- ports/libao/portfile.cmake | 9 +++------ versions/l-/libao.json | 2 +- 3 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 ports/libao/Fix-C2065.patch diff --git a/ports/libao/Fix-C2065.patch b/ports/libao/Fix-C2065.patch deleted file mode 100644 index 3341dd45bb183e..00000000000000 --- a/ports/libao/Fix-C2065.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 0e53752..503a59a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -42,10 +42,18 @@ dnl Check dlopen - dnl ==================================== - - dnl Currently use this to disable plugin support dlfcn.h --AC_CHECK_HEADERS([dlfcn.h], -- [AC_SEARCH_LIBS([dlopen],[dl], -- [AC_DEFINE([HAVE_DLOPEN],[1], -- [support dynamic linking loader])])]) -+with_dlfcn="no" -+AC_ARG_ENABLE([dlfcn], -+ [AS_HELP_STRING( -+ [--enable-dlfcn])], -+ [with_dlfcn="$enableval"],[with_dlfcn="no"] -+) -+if test "x$with_dlfcn" == "xyes"; then -+ AC_CHECK_HEADERS([dlfcn.h], -+ [AC_SEARCH_LIBS([dlopen],[dl], -+ [AC_DEFINE([HAVE_DLOPEN],[1], -+ [support dynamic linking loader])])]) -+fi - - dnl ==================================== - dnl Set some general compile options diff --git a/ports/libao/portfile.cmake b/ports/libao/portfile.cmake index b18a0aec142e76..cbd5c4297fc231 100644 --- a/ports/libao/portfile.cmake +++ b/ports/libao/portfile.cmake @@ -1,11 +1,8 @@ -set(with_dlfcn "yes") if(VCPKG_TARGET_IS_WINDOWS) list(APPEND PATCHES "0001-windows-build-patch.patch") - set(with_dlfcn "no") + set(NO_DLFCN "ac_cv_header_dlfcn_h=no") endif() -list(APPEND PATCHES "Fix-C2065.patch") - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO xiph/libao @@ -22,8 +19,8 @@ endif() vcpkg_configure_make( SOURCE_PATH ${SOURCE_PATH} AUTOCONFIG - OPTIONS --disable-binaries - --enable-dlfcn=${with_dlfcn} + OPTIONS --disable-binaries + ${NO_DLFCN} ) vcpkg_install_make() diff --git a/versions/l-/libao.json b/versions/l-/libao.json index cb62b1b17d3384..55ded6eb5d05f9 100644 --- a/versions/l-/libao.json +++ b/versions/l-/libao.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "dddc94119554ec206d861b23a2aaca51748d4cce", + "git-tree": "9be94059343a58211c59277720905bbd15a3c93f", "version": "1.2.2", "port-version": 4 }, From f9999f852a13352304729dd94df9c6295db78620 Mon Sep 17 00:00:00 2001 From: Cheney-Wang Date: Wed, 23 Feb 2022 01:17:05 -0800 Subject: [PATCH 3/3] Avoid using undefined variable --- ports/libao/portfile.cmake | 1 + versions/l-/libao.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/libao/portfile.cmake b/ports/libao/portfile.cmake index cbd5c4297fc231..274beec82ec25c 100644 --- a/ports/libao/portfile.cmake +++ b/ports/libao/portfile.cmake @@ -1,3 +1,4 @@ +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") diff --git a/versions/l-/libao.json b/versions/l-/libao.json index 55ded6eb5d05f9..e5186e1ae4eeb6 100644 --- a/versions/l-/libao.json +++ b/versions/l-/libao.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "9be94059343a58211c59277720905bbd15a3c93f", + "git-tree": "11240d91b73e6a968da37b8053a8a64a6d9ea55f", "version": "1.2.2", "port-version": 4 },