Skip to content

Commit

Permalink
(conan-io#21221) openal-soft: add v1.23.1, swith URLs to GitHub, drop…
Browse files Browse the repository at this point in the history
… old missing versions

* openal-soft: bump version and dependencies

* openal-soft: switch URLs to GitHub, drop versions that are not available online

* openal-soft: remove outdated version checks

* openal-soft: bump minimal GCC version

* openal-soft: add libatomic dependency

* openal-soft: don't require libalsa on FreeBSD

---------

Co-authored-by: Daniel <danimanzaneque@gmail.com>
  • Loading branch information
2 people authored and Haisang Yu committed Apr 12, 2024
1 parent 8e6051d commit 96ed001
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 295 deletions.
41 changes: 9 additions & 32 deletions recipes/openal-soft/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
sources:
"1.23.1":
url:
- "https://github.com/kcat/openal-soft/releases/download/1.23.1/openal-soft-1.23.1.tar.bz2"
- "https://openal-soft.org/openal-releases/openal-soft-1.23.1.tar.bz2"
sha256: "796f4b89134c4e57270b7f0d755f0fa3435b90da437b745160a49bd41c845b21"
"1.22.2":
url: "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2"
url:
- "https://github.com/kcat/openal-soft/releases/download/1.22.2/openal-soft-1.22.2.tar.bz2"
- "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2"
sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20"
"1.21.1":
url: "https://openal-soft.org/openal-releases/openal-soft-1.21.1.tar.bz2"
sha256: "c8ad767e9a3230df66756a21cc8ebf218a9d47288f2514014832204e666af5d8"
"1.21.0":
url: "https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2"
sha256: "2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297"
"1.20.1":
url: "https://openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2"
sha256: "b6ceb051325732c23f5c8b6d37dbd89534517e6439a87e970882b447c3025d6d"
"1.19.1":
url: "https://openal-soft.org/openal-releases/openal-soft-1.19.1.tar.bz2"
sha256: "5c2f87ff5188b95e0dc4769719a9d89ce435b8322b4478b95dd4b427fe84b2e9"
patches:
"1.22.2":
- patch_file: "patches/1.22.2-0001-fix-al-optional-in-if-compile-error.patch"
- patch_file: "patches/1.22.2-0002-fix-pulseaudio-find-package-vars.patch"
"1.21.0":
- patch_file: "patches/1.21.0-0001-c++14-does-not-have-std-aligned_alloc.patch"
- patch_file: "patches/1.21.0-0002-fix-windows-sdk.patch"
patch_description: "Avoid explicitly searching for the WindowsSDK"
patch_type: "portability"
patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614"
"1.20.1":
- patch_file: "patches/1.20.1-0001-fix-windows-sdk.patch"
patch_description: "Avoid explicitly searching for the WindowsSDK"
patch_type: "portability"
patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614"
"1.19.1":
- patch_file: "patches/1.19.1-0001-aligned-alloc.patch"
- patch_file: "patches/1.19.1-0002-gcc-10-fnocommon.patch"
- patch_file: "patches/1.19.1-0003-fix-windows-sdk.patch"
patch_description: "Avoid explicitly searching for the WindowsSDK"
patch_type: "portability"
patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614"
patch_source: "https://github.com/kcat/openal-soft/commit/650a6d49e9a511d005171940761f6dd6b440ee66"
45 changes: 20 additions & 25 deletions recipes/openal-soft/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,16 @@ class OpenALSoftConan(ConanFile):
"fPIC": True,
}

@property
def _openal_cxx_backend(self):
return Version(self.version) >= "1.20"

@property
def _min_cppstd(self):
return "11" if Version(self.version) < "1.21" else "14"
return 14

@property
def _minimum_compilers_version(self):
return {
"Visual Studio": "13" if Version(self.version) < "1.21" else "15",
"msvc": "180" if Version(self.version) < "1.21" else "191",
"gcc": "5",
"Visual Studio": "15",
"msvc": "191",
"gcc": "6",
"clang": "5",
}

Expand All @@ -59,8 +55,6 @@ def configure(self):
# OpenAL's API is pure C, thus the c++ standard does not matter
# Because the backend is C++, the C++ STL matters
self.settings.rm_safe("compiler.cppstd")
if not self._openal_cxx_backend:
self.settings.rm_safe("compiler.libcxx")

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -70,23 +64,22 @@ def requirements(self):
self.requires("libalsa/1.2.10")

def validate(self):
if self._openal_cxx_backend:
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, self._min_cppstd)

compiler = self.settings.compiler
compiler = self.settings.compiler

minimum_version = self._minimum_compilers_version.get(str(compiler), False)
if minimum_version and Version(compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.",
)
minimum_version = self._minimum_compilers_version.get(str(compiler), False)
if minimum_version and Version(compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.",
)

if compiler == "clang" and Version(compiler.version) < "9" and \
compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"):
raise ConanInvalidConfiguration(
f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime",
)
if compiler == "clang" and Version(compiler.version) < "9" and \
compiler.get_safe("libcxx") in ("libstdc++", "libstdc++11"):
raise ConanInvalidConfiguration(
f"{self.ref} cannot be built with {compiler} {compiler.version} and stdlibc++(11) c++ runtime",
)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand Down Expand Up @@ -155,9 +148,11 @@ def package_info(self):
self.cpp_info.frameworks.append("ApplicationServices")
elif self.settings.os == "Windows":
self.cpp_info.system_libs.extend(["winmm", "ole32", "shell32", "user32"])
if self._openal_cxx_backend and not self.options.shared:
if not self.options.shared:
libcxx = stdcpp_library(self)
if libcxx:
self.cpp_info.system_libs.append(libcxx)
if not self.options.shared:
self.cpp_info.defines.append("AL_LIBTYPE_STATIC")
if self.settings.get_safe("compiler.libcxx") in ["libstdc++", "libstdc++11"]:
self.cpp_info.system_libs.append("atomic")
11 changes: 0 additions & 11 deletions recipes/openal-soft/all/patches/1.19.1-0001-aligned-alloc.patch

This file was deleted.

15 changes: 0 additions & 15 deletions recipes/openal-soft/all/patches/1.19.1-0002-gcc-10-fnocommon.patch

This file was deleted.

38 changes: 0 additions & 38 deletions recipes/openal-soft/all/patches/1.19.1-0003-fix-windows-sdk.patch

This file was deleted.

76 changes: 0 additions & 76 deletions recipes/openal-soft/all/patches/1.20.1-0001-fix-windows-sdk.patch

This file was deleted.

This file was deleted.

74 changes: 0 additions & 74 deletions recipes/openal-soft/all/patches/1.21.0-0002-fix-windows-sdk.patch

This file was deleted.

10 changes: 2 additions & 8 deletions recipes/openal-soft/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
versions:
"1.22.2":
folder: all
"1.21.1":
folder: all
"1.21.0":
"1.23.1":
folder: all
"1.20.1":
folder: all
"1.19.1":
"1.22.2":
folder: all

0 comments on commit 96ed001

Please sign in to comment.