From 096a8f320c7f2f7b5825b6629b8cd32e20b44556 Mon Sep 17 00:00:00 2001 From: Alexey Pavlov Date: Mon, 18 Jan 2021 09:58:49 +0300 Subject: [PATCH] openal: Update to 1.21.0 --- .../0001-versioned-w32-dll.mingw.patch | 22 ++++----- .../0003-openal-not-32.mingw.patch | 24 ++++------ .../0004-disable-OSS-windows.patch | 28 +++++------ .../0005-mingw-dont-check-libm.patch | 40 ++++++---------- ...6-mingw-use-own-import-library-winmm.patch | 48 +++++++++---------- mingw-w64-openal/PKGBUILD | 27 +++++++---- 6 files changed, 91 insertions(+), 98 deletions(-) diff --git a/mingw-w64-openal/0001-versioned-w32-dll.mingw.patch b/mingw-w64-openal/0001-versioned-w32-dll.mingw.patch index 286369a60e..9af2929d06 100644 --- a/mingw-w64-openal/0001-versioned-w32-dll.mingw.patch +++ b/mingw-w64-openal/0001-versioned-w32-dll.mingw.patch @@ -1,14 +1,14 @@ ---- openal-soft-1.18.1/CMakeLists.txt.orig 2017-08-15 10:18:37.065522000 +0200 -+++ openal-soft-1.18.1/CMakeLists.txt 2017-08-15 10:18:58.438744500 +0200 -@@ -1233,7 +1233,10 @@ - - ADD_LIBRARY(${IMPL_TARGET} SHARED ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS}) - IF(WIN32) -- SET_TARGET_PROPERTIES(${IMPL_TARGET} PROPERTIES PREFIX "") -+ SET_TARGET_PROPERTIES(OpenAL PROPERTIES +--- openal-soft-1.21.0/CMakeLists.txt.orig 2017-08-15 10:18:37.065522000 +0200 ++++ openal-soft-1.21.0/CMakeLists.txt 2017-08-15 10:18:58.438744500 +0200 +@@ -1257,7 +1257,10 @@ + add_library(${IMPL_TARGET} SHARED ${OPENAL_OBJS} ${ALC_OBJS} ${RC_CONFIG} + ${TARGET_PUBLIC_HEADERS}) + if(WIN32) +- set_target_properties(${IMPL_TARGET} PROPERTIES PREFIX "") ++ set_target_properties(${IMPL_TARGET} PROPERTIES + OUTPUT_NAME openal + RUNTIME_OUTPUT_NAME openal-${LIB_MAJOR_VERSION} + ARCHIVE_OUTPUT_NAME openal) - ENDIF() - ENDIF() - SET_TARGET_PROPERTIES(${IMPL_TARGET} PROPERTIES OUTPUT_NAME ${LIBNAME} + endif() + target_link_libraries(${IMPL_TARGET} PRIVATE common ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB}) + diff --git a/mingw-w64-openal/0003-openal-not-32.mingw.patch b/mingw-w64-openal/0003-openal-not-32.mingw.patch index 2fec1ddbed..cafd9c210f 100644 --- a/mingw-w64-openal/0003-openal-not-32.mingw.patch +++ b/mingw-w64-openal/0003-openal-not-32.mingw.patch @@ -1,15 +1,11 @@ ---- openal-soft-1.18.0/CMakeLists.txt.orig 2017-06-09 09:58:31.540585400 +0200 -+++ openal-soft-1.18.0/CMakeLists.txt 2017-06-09 10:00:24.729585500 +0200 -@@ -1152,7 +1152,11 @@ - IF(NOT WIN32) - SET(LIBNAME "openal") - ELSE() -- SET(LIBNAME "OpenAL32") -+ IF(MINGW) -+ SET(LIBNAME "openal") -+ ELSE() -+ SET(LIBNAME "OpenAL32") -+ ENDIF() - ENDIF() +--- openal-soft-1.21.0/CMakeLists.txt.orig 2017-06-09 09:58:31.540585400 +0200 ++++ openal-soft-1.21.0/CMakeLists.txt 2017-06-09 10:00:24.729585500 +0200 +@@ -1155,7 +1155,7 @@ + endif() + endif() - FIND_PACKAGE(Git) +-if(NOT WIN32) ++if(NOT MSVC) + set(LIBNAME "openal") + else() + set(LIBNAME "OpenAL32") diff --git a/mingw-w64-openal/0004-disable-OSS-windows.patch b/mingw-w64-openal/0004-disable-OSS-windows.patch index 9c96890e22..e7ab69c076 100644 --- a/mingw-w64-openal/0004-disable-OSS-windows.patch +++ b/mingw-w64-openal/0004-disable-OSS-windows.patch @@ -1,18 +1,18 @@ ---- openal-soft-1.16.0/CMakeLists.txt.orig 2015-11-03 09:47:33.546783000 +0300 -+++ openal-soft-1.16.0/CMakeLists.txt 2015-11-03 09:48:28.685268600 +0300 -@@ -758,6 +758,7 @@ +--- openal-soft-1.21.0/CMakeLists.txt.orig 2015-11-03 09:47:33.546783000 +0300 ++++ openal-soft-1.21.0/CMakeLists.txt 2015-11-03 09:48:28.685268600 +0300 +@@ -825,6 +825,7 @@ # Check OSS backend - OPTION(ALSOFT_REQUIRE_OSS "Require OSS backend" OFF) -+IF(NOT WIN32) - FIND_PACKAGE(OSS) - IF(OSS_FOUND) - OPTION(ALSOFT_BACKEND_OSS "Enable OSS backend" ON) -@@ -773,6 +774,7 @@ - IF(ALSOFT_REQUIRE_OSS AND NOT HAVE_OSS) - MESSAGE(FATAL_ERROR "Failed to enabled required OSS backend") - ENDIF() -+ENDIF() + option(ALSOFT_REQUIRE_OSS "Require OSS backend" OFF) ++if(NOT WIN32) + find_package(OSS) + if(OSS_FOUND) + option(ALSOFT_BACKEND_OSS "Enable OSS backend" ON) +@@ -841,6 +842,7 @@ + if(ALSOFT_REQUIRE_OSS AND NOT HAVE_OSS) + message(FATAL_ERROR "Failed to enabled required OSS backend") + endif() ++endif() # Check Solaris backend - OPTION(ALSOFT_REQUIRE_SOLARIS "Require Solaris backend" OFF) + option(ALSOFT_REQUIRE_SOLARIS "Require Solaris backend" OFF) diff --git a/mingw-w64-openal/0005-mingw-dont-check-libm.patch b/mingw-w64-openal/0005-mingw-dont-check-libm.patch index d00bcdd3eb..a275391676 100644 --- a/mingw-w64-openal/0005-mingw-dont-check-libm.patch +++ b/mingw-w64-openal/0005-mingw-dont-check-libm.patch @@ -1,38 +1,26 @@ ---- openal-soft-openal-soft-1.20.1/CMakeLists.txt.orig 2020-03-04 12:52:14.862006000 +0300 -+++ openal-soft-openal-soft-1.20.1/CMakeLists.txt 2020-03-04 12:52:40.355186300 +0300 -@@ -384,11 +384,13 @@ +--- openal-soft-openal-soft-1.21.0/CMakeLists.txt.orig 2020-03-04 12:52:14.862006000 +0300 ++++ openal-soft-openal-soft-1.21.0/CMakeLists.txt 2020-03-04 12:52:40.355186300 +0300 +@@ -429,11 +429,13 @@ # Some systems need libm for some math functions to work - SET(MATH_LIB ) -+IF(NOT MINGW) - CHECK_LIBRARY_EXISTS(m pow "" HAVE_LIBM) - IF(HAVE_LIBM) - SET(MATH_LIB ${MATH_LIB} m) - SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m) - ENDIF() -+ENDIF() + set(MATH_LIB ) ++if(NOT MINGW) + check_library_exists(m pow "" HAVE_LIBM) + if(HAVE_LIBM) + set(MATH_LIB ${MATH_LIB} m) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} m) + endif() ++endif() # Some systems need to link with -lrt for clock_gettime as used by the common # eaxmple functions. ---- openal-soft-openal-soft-1.20.1/native-tools/CMakeLists.txt.orig 2020-03-04 13:37:14.222573100 +0300 -+++ openal-soft-openal-soft-1.20.1/native-tools/CMakeLists.txt 2020-03-04 13:37:36.875492600 +0300 -@@ -9,7 +9,9 @@ - set(CPP_DEFS ${CPP_DEFS} _WIN32) - endif(WIN32) - -+if (NOT MINGW) - check_library_exists(m pow "" HAVE_LIBM) -+endif() - - add_executable(bin2h bin2h.c) - # Enforce no dressing for executable names, so the main script can find it ---- openal-soft-openal-soft-1.20.1/cmake/FindMySOFA.cmake.orig 2020-03-04 13:48:39.214749300 +0300 -+++ openal-soft-openal-soft-1.20.1/cmake/FindMySOFA.cmake 2020-03-04 13:49:02.945683400 +0300 +--- openal-soft-openal-soft-1.21.0/cmake/FindMySOFA.cmake.orig 2020-03-04 13:48:39.214749300 +0300 ++++ openal-soft-openal-soft-1.21.0/cmake/FindMySOFA.cmake 2020-03-04 13:49:02.945683400 +0300 @@ -49,9 +49,11 @@ DOC "The MySOFA library" ) -+if (NOT MINGW) ++if(NOT MINGW) find_library(MYSOFA_M_LIBRARY NAMES m DOC "The math library for MySOFA" ) diff --git a/mingw-w64-openal/0006-mingw-use-own-import-library-winmm.patch b/mingw-w64-openal/0006-mingw-use-own-import-library-winmm.patch index 507c90bb2c..e718076f44 100644 --- a/mingw-w64-openal/0006-mingw-use-own-import-library-winmm.patch +++ b/mingw-w64-openal/0006-mingw-use-own-import-library-winmm.patch @@ -1,29 +1,27 @@ ---- openal-soft-openal-soft-1.20.1/CMakeLists.txt.orig 2020-03-05 11:45:03.064395200 +0300 -+++ openal-soft-openal-soft-1.20.1/CMakeLists.txt 2020-03-05 11:49:21.032159600 +0300 -@@ -860,20 +860,26 @@ - IF(WIN32) - SET(WINSDK_LIB_DIRS ) - SET(WINSDK_INCLUDE_DIRS ) -+ IF(MSVC) - FIND_PACKAGE(WindowsSDK) - IF(WINDOWSSDK_FOUND) +--- openal-soft-openal-soft-1.21.0/CMakeLists.txt.orig 2020-03-05 11:45:03.064395200 +0300 ++++ openal-soft-openal-soft-1.21.0/CMakeLists.txt 2020-03-05 11:49:21.032159600 +0300 +@@ -884,11 +884,13 @@ + if(WIN32) + set(WINSDK_LIB_DIRS ) + set(WINSDK_INCLUDE_DIRS ) ++ if(MSVC) + find_package(WindowsSDK) + if(WINDOWSSDK_FOUND) get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS) - ENDIF() -+ ENDIF() - - SET(OLD_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}) - SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_WIN32_WINNT=0x0502) + endif() ++ endif() # Check MMSystem backend - CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) -+ IF(MSVC) - FIND_LIBRARY(WINMM_LIBRARY NAMES winmm - PATHS ${WINSDK_LIB_DIRS} - PATH_SUFFIXES lib lib/x86 lib/x64) -+ ELSE() -+ SET(WINMM_LIBRARY winmm) -+ ENDIF() - IF(HAVE_MMSYSTEM_H AND WINMM_LIBRARY) - OPTION(ALSOFT_BACKEND_WINMM "Enable Windows Multimedia backend" ON) - IF(ALSOFT_BACKEND_WINMM) + check_include_files("windows.h;mmsystem.h" HAVE_MMSYSTEM_H) +--- openal-soft-openal-soft-1.21.0/cmake/FindDSound.cmake.orig 2020-03-05 11:45:03.064395200 +0300 ++++ openal-soft-openal-soft-1.21.0/cmake/FindDSound.cmake 2020-03-05 11:49:21.032159600 +0300 +@@ -8,7 +8,7 @@ + # DSOUND_LIBRARY - the dsound library + # + +-if (WIN32) ++if (MSVC) + FIND_PACKAGE(WindowsSDK) + if (WINDOWSSDK_FOUND) + get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS) diff --git a/mingw-w64-openal/PKGBUILD b/mingw-w64-openal/PKGBUILD index e59f1d12b5..fdbbcce567 100644 --- a/mingw-w64-openal/PKGBUILD +++ b/mingw-w64-openal/PKGBUILD @@ -3,8 +3,8 @@ _realname=openal pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=1.20.1 -pkgrel=2 +pkgver=1.21.0 +pkgrel=1 pkgdesc="OpenAL audio library for use with opengl (mingw-w64)" arch=('any') url="https://github.com/kcat/openal-soft" @@ -22,13 +22,13 @@ source=(https://github.com/kcat/openal-soft/archive/openal-soft-${pkgver}.tar.gz 0004-disable-OSS-windows.patch 0005-mingw-dont-check-libm.patch 0006-mingw-use-own-import-library-winmm.patch) -sha256sums=('c32d10473457a8b545aab50070fe84be2b5b041e1f2099012777ee6be0057c13' - 'a594fade14f742ad203ec7c995e9e4772e15f133067c2d37cc9477b8c9787d5c' +sha256sums=('cd3650530866f3906058225f4bfbe0052be19e0a29dcc6df185a460f9948feec' + 'c3e56b5594ada0b95588373bd8ca062677805beae393c6551301518ab24a0cd3' 'f0bde7d3a8087530ab1bb2f48e59eec6f4cf60d59c5afe3a0c28c95e6b138751' - '93894676b54415ce9d5c8c75eea28730845ecacfd0726bede2f459ed136da080' - 'aa6fc2efb76424d0337d609f3002abb8ff179ed15ae633c53433bcb176e643ba' - 'd25ea2d6d7ee3995a0648f725edd1bfde71bb1a07c91886a1572390ee03f3d00' - '099f112cfa188f84a60570fdb9146baa6966e15b8739db83e605050acdc8cb4d') + '33dccfc603a48d265341e60bc801976d077e546ab5c91a93e8426eac01bb7ad4' + '8b8ff007d224a5267aead184dc6d24317e40be69c91064cdfdc35b78bb762cc6' + 'c2528ecc034ea993cb63893b3f2ce5ceeac8d63295decf6864f58cd646c74299' + '581af86e2191957bd8a8e5c6813a20c42eafeb82c2f2eb1c170f94507aa3fd5c') prepare() { cd openal-soft-openal-soft-${pkgver} @@ -41,6 +41,13 @@ prepare() { } build() { + declare -a extra_config + if check_option "debug" "n"; then + extra_config+=("-DCMAKE_BUILD_TYPE=Release") + else + extra_config+=("-DCMAKE_BUILD_TYPE=Debug") + fi + [[ -d "${srcdir}"/shared-${MINGW_CHOST} ]] && rm -rf ${srcdir}/shared-${MINGW_CHOST} mkdir -p "${srcdir}/shared-${MINGW_CHOST}" && cd "${srcdir}/shared-${MINGW_CHOST}" @@ -49,12 +56,14 @@ build() { ${MINGW_PREFIX}/bin/cmake \ -G"MSYS Makefiles" \ -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + "${extra_config[@]}" \ -DALSOFT_EXAMPLES=OFF \ -DALSOFT_UTILS=ON \ -DALSOFT_NO_CONFIG_UTIL=ON \ -DLIBTYPE=SHARED \ -DDSOUND_INCLUDE_DIR=${MINGW_PREFIX}/${MINGW_CHOST}/include \ -DDSOUND_LIBRARY=${MINGW_PREFIX}/${MINGW_CHOST}/lib/libdsound.a \ + -DWINMM_LIBRARY=${MINGW_PREFIX}/${MINGW_CHOST}/lib/libwinmm.a \ ../openal-soft-openal-soft-${pkgver} make @@ -67,12 +76,14 @@ build() { ${MINGW_PREFIX}/bin/cmake \ -G"MSYS Makefiles" \ -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ + "${extra_config[@]}" \ -DALSOFT_EXAMPLES=OFF \ -DALSOFT_UTILS=OFF \ -DALSOFT_NO_CONFIG_UTIL=ON \ -DLIBTYPE=STATIC \ -DDSOUND_INCLUDE_DIR=${MINGW_PREFIX}/${MINGW_CHOST}/include \ -DDSOUND_LIBRARY=${MINGW_PREFIX}/${MINGW_CHOST}/lib/libdsound.a \ + -DWINMM_LIBRARY=${MINGW_PREFIX}/${MINGW_CHOST}/lib/libwinmm.a \ ../openal-soft-openal-soft-${pkgver} make }