From dfead60060f6e338afcdbbfb386b0b561069acc4 Mon Sep 17 00:00:00 2001 From: danimtb Date: Wed, 22 Feb 2023 14:23:25 +0100 Subject: [PATCH 01/12] [config] Add some conan v2 ready refenrences to the list --- .c3i/conan_v2_ready_references.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.c3i/conan_v2_ready_references.yml b/.c3i/conan_v2_ready_references.yml index 0258ca726f964..8070dc4faf27e 100644 --- a/.c3i/conan_v2_ready_references.yml +++ b/.c3i/conan_v2_ready_references.yml @@ -1,2 +1,21 @@ required_for_references: + - asio + - b2 + - bzip2 +# - boost ? error with some configs + - catch2 + - cmake + - flex + - fmt + - jsoncpp + - libbacktrace + - libelf + - libiconv + - ninja + - nlohmann_json +# - openssl ? 3.0.0 version still not working + - ogg + - pcre2 + - yaml-cpp + - xz_utils - zlib From 752383797d2d7d94ab62cd6bba7a67b3e196e446 Mon Sep 17 00:00:00 2001 From: dmpriso Date: Wed, 20 Mar 2024 20:36:52 +0100 Subject: [PATCH 02/12] added opus 1.5.1 --- recipes/opus/all/conandata.yml | 3 +++ recipes/opus/all/conanfile.py | 9 +++++++++ recipes/opus/config.yml | 2 ++ 3 files changed, 14 insertions(+) diff --git a/recipes/opus/all/conandata.yml b/recipes/opus/all/conandata.yml index 5ac1b419900e1..762e1da2bf5ee 100644 --- a/recipes/opus/all/conandata.yml +++ b/recipes/opus/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.5.1": + url: "https://downloads.xiph.org/releases/opus/opus-1.5.1.tar.gz" + sha256: "b84610959b8d417b611aa12a22565e0a3732097c6389d19098d844543e340f85" "1.4": url: "https://github.com/xiph/opus/releases/download/v1.4/opus-1.4.tar.gz" sha256: "c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f" diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 2dfefae5f4332..514ae8d1b3f01 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -21,12 +21,18 @@ class OpusConan(ConanFile): "fPIC": [True, False], "fixed_point": [True, False], "stack_protector": [True, False], + "osce": [True, False], + "deep_plc": [True, False], + "dred": [True, False], } default_options = { "shared": False, "fPIC": True, "fixed_point": False, "stack_protector": True, + "osce": False, + "deep_plc": False, + "dred": False, } def export_sources(self): @@ -56,6 +62,9 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["OPUS_FIXED_POINT"] = self.options.fixed_point tc.variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector + tc.variables["OPUS_OSCE"] = self.options.osce + tc.variables["OPUS_DEEP_PLC"] = self.options.deep_plc + tc.variables["OPUS_DRED"] = self.options.dred tc.generate() def build(self): diff --git a/recipes/opus/config.yml b/recipes/opus/config.yml index 3360afdd0ecab..bb785e6568864 100644 --- a/recipes/opus/config.yml +++ b/recipes/opus/config.yml @@ -1,4 +1,6 @@ versions: + "1.5.1": + folder: all "1.4": folder: all "1.3.1": From 00fb85d7add2aab14427653c4561c44a0d43dc2d Mon Sep 17 00:00:00 2001 From: dmpriso Date: Wed, 27 Mar 2024 13:44:35 +0100 Subject: [PATCH 03/12] Added CMP0077 as suggested Co-authored-by: Martin Valgur --- recipes/opus/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 514ae8d1b3f01..5e2ccb4644bc7 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -65,6 +65,7 @@ def generate(self): tc.variables["OPUS_OSCE"] = self.options.osce tc.variables["OPUS_DEEP_PLC"] = self.options.deep_plc tc.variables["OPUS_DRED"] = self.options.dred + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" tc.generate() def build(self): From ffa8dcae87be8d098674812ea72a4903830cde41 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 6 Sep 2024 12:11:34 +0200 Subject: [PATCH 04/12] Change sources url --- recipes/opus/all/conandata.yml | 6 +++--- recipes/opus/config.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/opus/all/conandata.yml b/recipes/opus/all/conandata.yml index 762e1da2bf5ee..1f964a05797f4 100644 --- a/recipes/opus/all/conandata.yml +++ b/recipes/opus/all/conandata.yml @@ -1,7 +1,7 @@ sources: - "1.5.1": - url: "https://downloads.xiph.org/releases/opus/opus-1.5.1.tar.gz" - sha256: "b84610959b8d417b611aa12a22565e0a3732097c6389d19098d844543e340f85" + "1.5.2": + url: "https://gitlab.xiph.org/xiph/opus/-/archive/v1.5.2/opus-v1.5.2.tar.gz" + sha256: "5cf92b5b577d8ed203424f1e0f618f30bc6b6e42a26eae88bdb649ea63961cc9" "1.4": url: "https://github.com/xiph/opus/releases/download/v1.4/opus-1.4.tar.gz" sha256: "c9b32b4253be5ae63d1ff16eea06b94b5f0f2951b7a02aceef58e3a3ce49c51f" diff --git a/recipes/opus/config.yml b/recipes/opus/config.yml index bb785e6568864..e9cd861cf2166 100644 --- a/recipes/opus/config.yml +++ b/recipes/opus/config.yml @@ -1,5 +1,5 @@ versions: - "1.5.1": + "1.5.2": folder: all "1.4": folder: all From 3532fe99fbddb57ceb2ec5c4dc071c60cb48dded Mon Sep 17 00:00:00 2001 From: danimtb Date: Fri, 6 Sep 2024 13:04:46 +0200 Subject: [PATCH 05/12] add cmake 3.16 or higher br --- recipes/opus/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 5e2ccb4644bc7..cc067a29e2feb 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -35,6 +35,10 @@ class OpusConan(ConanFile): "dred": False, } + def build_requirements(self): + if self.version == "1.5.2": + self.tool_requires("cmake/[>=3.16 <4]") + def export_sources(self): export_conandata_patches(self) From 8675b48b9e63d1312ec89bb6e9dd0783f470396a Mon Sep 17 00:00:00 2001 From: danimtb Date: Fri, 6 Sep 2024 13:29:24 +0200 Subject: [PATCH 06/12] gcc5 invalid --- recipes/opus/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index cc067a29e2feb..d31f4907bb795 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import check_min_vs @@ -57,6 +58,8 @@ def layout(self): def validate(self): check_min_vs(self, 190) + if self.version == ".1.5.2" and self.settings.compiler == "gcc" and self.settings.compiler.version == "5": + raise ConanInvalidConfiguration("GCC 5 not supported due to lack of AVX2 support") def source(self): get(self, **self.conan_data["sources"][self.version], From c0c1f6134ea22de7f6056c5bd08d92fc1b69a6e3 Mon Sep 17 00:00:00 2001 From: danimtb Date: Fri, 6 Sep 2024 14:05:35 +0200 Subject: [PATCH 07/12] gcc7 invalid --- recipes/opus/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index d31f4907bb795..3a360ff612bd9 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -58,8 +58,8 @@ def layout(self): def validate(self): check_min_vs(self, 190) - if self.version == ".1.5.2" and self.settings.compiler == "gcc" and self.settings.compiler.version == "5": - raise ConanInvalidConfiguration("GCC 5 not supported due to lack of AVX2 support") + if self.version == "1.5.2" and self.settings.compiler == "gcc" and self.settings.compiler.version in ["5", "7"]: + raise ConanInvalidConfiguration(f"GCC {self.settings.compiler.version} not supported due to lack of AVX2 support") def source(self): get(self, **self.conan_data["sources"][self.version], From f8d45624e6008df82223f67b45f3797d68b3296e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Sep 2024 13:26:17 +0200 Subject: [PATCH 08/12] Update cmake variables Signed-off-by: Uilian Ries --- recipes/opus/all/conanfile.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 3a360ff612bd9..a9b8aa909fa93 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -2,7 +2,8 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir -from conan.tools.microsoft import check_min_vs +from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" @@ -15,7 +16,6 @@ class OpusConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://opus-codec.org" license = "BSD-3-Clause" - settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -67,12 +67,17 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["OPUS_FIXED_POINT"] = self.options.fixed_point - tc.variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector - tc.variables["OPUS_OSCE"] = self.options.osce - tc.variables["OPUS_DEEP_PLC"] = self.options.deep_plc - tc.variables["OPUS_DRED"] = self.options.dred - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + + tc.cache_variables["OPUS_BUILD_SHARED_LIBRARY"] = self.options.shared + tc.cache_variables["OPUS_FIXED_POINT"] = self.options.fixed_point + tc.cache_variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector + # INFO: Any of the following options require DNN and will fail without pre-build steps + # https://gitlab.xiph.org/xiph/opus/-/blob/v1.5.2/dnn/torch/fargan/README.md#L37 + tc.cache_variables["OPUS_OSCE"] = self.options.osce + tc.cache_variables["OPUS_DEEP_PLC"] = self.options.deep_plc + tc.cache_variables["OPUS_DRED"] = self.options.dred + if Version(self.version) >= "1.5.2" and is_msvc(self): + tc.cache_variables["OPUS_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() def build(self): From cd41697eaa95ca1ccbeb772b1cde0064a30784c5 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Sep 2024 13:27:36 +0200 Subject: [PATCH 09/12] Remove new options due dnn Signed-off-by: Uilian Ries --- recipes/opus/all/conanfile.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index a9b8aa909fa93..140a96a2b7004 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -22,18 +22,12 @@ class OpusConan(ConanFile): "fPIC": [True, False], "fixed_point": [True, False], "stack_protector": [True, False], - "osce": [True, False], - "deep_plc": [True, False], - "dred": [True, False], } default_options = { "shared": False, "fPIC": True, "fixed_point": False, "stack_protector": True, - "osce": False, - "deep_plc": False, - "dred": False, } def build_requirements(self): @@ -71,11 +65,6 @@ def generate(self): tc.cache_variables["OPUS_BUILD_SHARED_LIBRARY"] = self.options.shared tc.cache_variables["OPUS_FIXED_POINT"] = self.options.fixed_point tc.cache_variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector - # INFO: Any of the following options require DNN and will fail without pre-build steps - # https://gitlab.xiph.org/xiph/opus/-/blob/v1.5.2/dnn/torch/fargan/README.md#L37 - tc.cache_variables["OPUS_OSCE"] = self.options.osce - tc.cache_variables["OPUS_DEEP_PLC"] = self.options.deep_plc - tc.cache_variables["OPUS_DRED"] = self.options.dred if Version(self.version) >= "1.5.2" and is_msvc(self): tc.cache_variables["OPUS_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() From dd244bbda4f31b4ba67939a2fd0fd5ce75b00350 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Sep 2024 13:29:53 +0200 Subject: [PATCH 10/12] Add Virtualbuildenv for cmake Signed-off-by: Uilian Ries --- recipes/opus/all/conanfile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 140a96a2b7004..72d4c61c95953 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -3,6 +3,7 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime +from conan.tools.env import VirtualBuildEnv from conan.tools.scm import Version import os @@ -31,7 +32,7 @@ class OpusConan(ConanFile): } def build_requirements(self): - if self.version == "1.5.2": + if self.version >= "1.5.2": self.tool_requires("cmake/[>=3.16 <4]") def export_sources(self): @@ -52,16 +53,18 @@ def layout(self): def validate(self): check_min_vs(self, 190) - if self.version == "1.5.2" and self.settings.compiler == "gcc" and self.settings.compiler.version in ["5", "7"]: - raise ConanInvalidConfiguration(f"GCC {self.settings.compiler.version} not supported due to lack of AVX2 support") + if self.version >= "1.5.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + raise ConanInvalidConfiguration(f"{self.ref} GCC-{self.settings.compiler.version} not supported due to lack of AVX2 support. Use GCC >=8.") def source(self): get(self, **self.conan_data["sources"][self.version], destination=self.source_folder, strip_root=True) def generate(self): + if Version(self.version) >= "1.5.2": + env = VirtualBuildEnv(self) + env.generate() tc = CMakeToolchain(self) - tc.cache_variables["OPUS_BUILD_SHARED_LIBRARY"] = self.options.shared tc.cache_variables["OPUS_FIXED_POINT"] = self.options.fixed_point tc.cache_variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector From a7895ae112c7340d6508b06ba82c664fb50126b0 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Sep 2024 13:35:43 +0200 Subject: [PATCH 11/12] Add missing Version Signed-off-by: Uilian Ries --- recipes/opus/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 72d4c61c95953..000c45984bbe8 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -32,7 +32,7 @@ class OpusConan(ConanFile): } def build_requirements(self): - if self.version >= "1.5.2": + if Version(self.version) >= "1.5.2": self.tool_requires("cmake/[>=3.16 <4]") def export_sources(self): @@ -53,7 +53,7 @@ def layout(self): def validate(self): check_min_vs(self, 190) - if self.version >= "1.5.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": + if Version(self.version) >= "1.5.2" and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "8": raise ConanInvalidConfiguration(f"{self.ref} GCC-{self.settings.compiler.version} not supported due to lack of AVX2 support. Use GCC >=8.") def source(self): From 73bc849be05d27f0cdbb6984a0f24b2423f5545e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Thu, 12 Sep 2024 13:38:52 +0200 Subject: [PATCH 12/12] Apply lint suggestiongs Signed-off-by: Uilian Ries --- recipes/opus/all/conandata.yml | 2 ++ recipes/opus/all/conanfile.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/opus/all/conandata.yml b/recipes/opus/all/conandata.yml index 1f964a05797f4..a7288d00d394f 100644 --- a/recipes/opus/all/conandata.yml +++ b/recipes/opus/all/conandata.yml @@ -11,3 +11,5 @@ sources: patches: "1.3.1": - patch_file: "patches/1.3.1-add-opus_buildtype-cmake.patch" + patch_description: "Set a default build type if none was specified" + patch_type: "portability" diff --git a/recipes/opus/all/conanfile.py b/recipes/opus/all/conanfile.py index 000c45984bbe8..f1ca41949ac83 100644 --- a/recipes/opus/all/conanfile.py +++ b/recipes/opus/all/conanfile.py @@ -17,6 +17,7 @@ class OpusConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://opus-codec.org" license = "BSD-3-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -69,7 +70,7 @@ def generate(self): tc.cache_variables["OPUS_FIXED_POINT"] = self.options.fixed_point tc.cache_variables["OPUS_STACK_PROTECTOR"] = self.options.stack_protector if Version(self.version) >= "1.5.2" and is_msvc(self): - tc.cache_variables["OPUS_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.cache_variables["OPUS_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.generate() def build(self):