Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openal: deprecate in favor of openal-soft + download official tarballs + modernize more #15590

Merged
merged 4 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions recipes/openal/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
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"
"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: "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"
25 changes: 11 additions & 14 deletions recipes/openal/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
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):
Expand Down Expand Up @@ -48,21 +47,20 @@ 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":
del self.options.fPIC

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")
Expand All @@ -73,10 +71,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:
Expand All @@ -91,8 +89,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)
Expand Down Expand Up @@ -161,7 +158,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:
Expand Down
8 changes: 3 additions & 5 deletions recipes/openal/all/test_v1_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)