diff --git a/recipes/openal/all/conandata.yml b/recipes/openal/all/conandata.yml index 909139e9bcbd7..39085eaa09938 100644 --- a/recipes/openal/all/conandata.yml +++ b/recipes/openal/all/conandata.yml @@ -1,19 +1,19 @@ sources: "1.22.2": - url: "https://github.com/kcat/openal-soft/archive/1.22.2.tar.gz" - sha256: "3e58f3d4458f5ee850039b1a6b4dac2343b3a5985a6a2e7ae2d143369c5b8135" + url: "https://openal-soft.org/openal-releases/openal-soft-1.22.2.tar.bz2" + sha256: "ae94cc95cda76b7cc6e92e38c2531af82148e76d3d88ce996e2928a1ea7c3d20" "1.21.1": - url: "https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz" - sha256: "8ac17e4e3b32c1af3d5508acfffb838640669b4274606b7892aa796ca9d7467f" + url: "https://openal-soft.org/openal-releases/openal-soft-1.21.1.tar.bz2" + sha256: "c8ad767e9a3230df66756a21cc8ebf218a9d47288f2514014832204e666af5d8" "1.21.0": - url: "https://github.com/kcat/openal-soft/archive/openal-soft-1.21.0.tar.gz" - sha256: "cd3650530866f3906058225f4bfbe0052be19e0a29dcc6df185a460f9948feec" + url: "https://openal-soft.org/openal-releases/openal-soft-1.21.0.tar.bz2" + sha256: "2916b4fc24e23b0271ce0b3468832ad8b6d8441b1830215b28cc4fee6cc89297" "1.20.1": - url: "https://github.com/kcat/openal-soft/archive/openal-soft-1.20.1.tar.gz" - sha256: "c32d10473457a8b545aab50070fe84be2b5b041e1f2099012777ee6be0057c13" + url: "https://openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2" + sha256: "b6ceb051325732c23f5c8b6d37dbd89534517e6439a87e970882b447c3025d6d" "1.19.1": - url: "https://github.com/kcat/openal-soft/archive/openal-soft-1.19.1.tar.gz" - sha256: "9f3536ab2bb7781dbafabc6a61e0b34b17edd16bd6c2eaf2ae71bc63078f98c7" + 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" @@ -21,17 +21,17 @@ patches: - 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: "backport" + 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: "backport" + 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: "backport" + patch_type: "portability" patch_source: "https://github.com/kcat/openal-soft/commit/13698362f1726326ab60180b04a86df79b518614" diff --git a/recipes/openal/all/conanfile.py b/recipes/openal/all/conanfile.py index 5aba9943f9a1f..4de9550fc2a4b 100644 --- a/recipes/openal/all/conanfile.py +++ b/recipes/openal/all/conanfile.py @@ -1,18 +1,19 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import check_min_cppstd +from conan.tools.build import check_min_cppstd, stdcpp_library from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, get, rmdir, save +from conan.tools.files import apply_conandata_patches, collect_libs, export_conandata_patches, copy, get, rmdir, save from conan.tools.scm import Version -from conans import tools as tools_legacy import os import textwrap -required_conan_version = ">=1.51.3" +required_conan_version = ">=1.54.0" class OpenALConan(ConanFile): + deprecated = "openal-soft" + name = "openal" description = "OpenAL Soft is a software implementation of the OpenAL 3D audio API." topics = ("openal", "audio", "api") @@ -48,8 +49,7 @@ def _minimum_compilers_version(self): } def export_sources(self): - for p in self.conan_data.get("patches", {}).get(self.version, []): - copy(self, p["patch_file"], self.recipe_folder, self.export_sources_folder) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": @@ -57,12 +57,12 @@ def config_options(self): def configure(self): if self.options.shared: - del self.options.fPIC + self.options.rm_safe("fPIC") # OpenAL's API is pure C, thus the c++ standard does not matter # Because the backend is C++, the C++ STL matters - del self.settings.compiler.cppstd + self.settings.rm_safe("compiler.cppstd") if not self._openal_cxx_backend: - del self.settings.compiler.libcxx + self.settings.rm_safe("compiler.libcxx") def layout(self): cmake_layout(self, src_folder="src") @@ -73,10 +73,10 @@ def requirements(self): def validate(self): if self._openal_cxx_backend: - if self.info.settings.compiler.get_safe("cppstd"): + if self.settings.compiler.get_safe("cppstd"): check_min_cppstd(self, self._min_cppstd) - compiler = self.info.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: @@ -91,8 +91,7 @@ def validate(self): ) def source(self): - get(self, **self.conan_data["sources"][self.version], - destination=self.source_folder, strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=True) def generate(self): tc = CMakeToolchain(self) @@ -161,7 +160,7 @@ def package_info(self): 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: - libcxx = tools_legacy.stdcpp_library(self) + libcxx = stdcpp_library(self) if libcxx: self.cpp_info.system_libs.append(libcxx) if not self.options.shared: diff --git a/recipes/openal/all/test_v1_package/CMakeLists.txt b/recipes/openal/all/test_v1_package/CMakeLists.txt index 6ea75c1516be0..0d20897301b68 100644 --- a/recipes/openal/all/test_v1_package/CMakeLists.txt +++ b/recipes/openal/all/test_v1_package/CMakeLists.txt @@ -1,10 +1,8 @@ cmake_minimum_required(VERSION 3.1) -project(test_package LANGUAGES C) +project(test_package) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(OpenAL REQUIRED) - -add_executable(${PROJECT_NAME} ../test_package/test_package.c) -target_link_libraries(${PROJECT_NAME} PRIVATE OpenAL::OpenAL) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package)