From dc9135dae8c92f81d58a7a5bc1b34dcda2cccb8f Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 26 Nov 2024 23:20:35 +0900 Subject: [PATCH 1/7] openh264: add version 2.5.0 --- recipes/openh264/all/conandata.yml | 3 +++ recipes/openh264/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/openh264/all/conandata.yml b/recipes/openh264/all/conandata.yml index 952b7e0034b6e..4d8902d954f8b 100644 --- a/recipes/openh264/all/conandata.yml +++ b/recipes/openh264/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.5.0": + url: "https://github.com/cisco/openh264/archive/refs/tags/v2.5.0.tar.gz" + sha256: "94c8ca364db990047ec4ec3481b04ce0d791e62561ef5601443011bdc00825e3" "2.4.1": url: "https://github.com/cisco/openh264/archive/refs/tags/v2.4.1.tar.gz" sha256: "8ffbe944e74043d0d3fb53d4a2a14c94de71f58dbea6a06d0dc92369542958ea" diff --git a/recipes/openh264/config.yml b/recipes/openh264/config.yml index db64052e6d83c..9d2abec6a5e96 100644 --- a/recipes/openh264/config.yml +++ b/recipes/openh264/config.yml @@ -1,4 +1,6 @@ versions: + "2.5.0": + folder: all "2.4.1": folder: all "2.3.1": From aa95014c01a717269e1e361ade293310b9bc30e8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 27 Nov 2024 01:06:20 +0900 Subject: [PATCH 2/7] remove rename static library on msvc in 2.5.0 or later --- recipes/openh264/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 5b20e84d4fa4c..7e6ff73ef0361 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -109,7 +109,7 @@ def package(self): # INFO: Preserve same old library name as when building with Make on Windows but using Meson rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), os.path.join(self.package_folder, "lib", "openh264_dll.lib")) - else: + elif Version(self.version) < "2.5.0": rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) From b732f0099a9fc87d417407285f7c7e901b073726 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 27 Nov 2024 02:50:34 +0900 Subject: [PATCH 3/7] revert library name --- recipes/openh264/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 7e6ff73ef0361..5b20e84d4fa4c 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -109,7 +109,7 @@ def package(self): # INFO: Preserve same old library name as when building with Make on Windows but using Meson rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), os.path.join(self.package_folder, "lib", "openh264_dll.lib")) - elif Version(self.version) < "2.5.0": + else: rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) From 098f634bcf6d3665566d15c5cd743583f2c95da8 Mon Sep 17 00:00:00 2001 From: toge Date: Wed, 27 Nov 2024 09:57:42 +0900 Subject: [PATCH 4/7] fix rename error on shared build --- recipes/openh264/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 5b20e84d4fa4c..f3118be2bcc63 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -109,7 +109,7 @@ def package(self): # INFO: Preserve same old library name as when building with Make on Windows but using Meson rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), os.path.join(self.package_folder, "lib", "openh264_dll.lib")) - else: + elif not(Version(self.version) >= "2.5.0" and self.options.shared): rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) From 600bec3b249176137fc468e21d80b8f0c711e68e Mon Sep 17 00:00:00 2001 From: PerseoGI Date: Wed, 27 Nov 2024 11:12:51 +0100 Subject: [PATCH 5/7] Conan v2 refactor and simplify expression --- recipes/openh264/all/conanfile.py | 36 ++++++++----------- .../all/test_v1_package/CMakeLists.txt | 8 ----- .../openh264/all/test_v1_package/conanfile.py | 17 --------- 3 files changed, 15 insertions(+), 46 deletions(-) delete mode 100644 recipes/openh264/all/test_v1_package/CMakeLists.txt delete mode 100644 recipes/openh264/all/test_v1_package/conanfile.py diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index f3118be2bcc63..b3abffad4e119 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -12,17 +12,17 @@ import os -required_conan_version = ">=1.54.0" +required_conan_version = ">=2.0.9" class OpenH264Conan(ConanFile): name = "openh264" + description = "Open Source H.264 Codec" + license = "BSD-2-Clause" url = "https://github.com/conan-io/conan-center-index" homepage = "http://www.openh264.org/" - description = "Open Source H.264 Codec" topics = ("h264", "codec", "video", "compression", ) - license = "BSD-2-Clause" - + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,6 +32,7 @@ class OpenH264Conan(ConanFile): "shared": False, "fPIC": True, } + implements = ["auto_shared_fpic"] @property def _is_clang_cl(self): @@ -41,21 +42,13 @@ def _is_clang_cl(self): def _preserve_dll_name(self): return (is_msvc(self) or self._is_clang_cl) and Version(self.version) <= "2.4.1" and self.options.shared - def config_options(self): - if self.settings.os == "Windows": - del self.options.fPIC - - def configure(self): - if self.options.shared: - self.options.rm_safe("fPIC") - def layout(self): basic_layout(self, src_folder="src") def build_requirements(self): self.tool_requires("meson/1.4.1") - if not self.conf.get("tools.gnu:pkg_config", check_type=str): - self.tool_requires("pkgconf/2.2.0") + if not self.conf.get("tools.gnu:pkg_config", default=False, check_type=str): + self.tool_requires("pkgconf/[>=2.2 <3]") if self.settings.arch in ["x86", "x86_64"]: self.tool_requires("nasm/2.16.01") @@ -105,13 +98,14 @@ def package(self): if is_msvc(self) or self._is_clang_cl: rm(self, "*.pdb", os.path.join(self.package_folder, "bin")) - if self._preserve_dll_name: - # INFO: Preserve same old library name as when building with Make on Windows but using Meson - rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), - os.path.join(self.package_folder, "lib", "openh264_dll.lib")) - elif not(Version(self.version) >= "2.5.0" and self.options.shared): - rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), - os.path.join(self.package_folder, "lib", "openh264.lib")) + if Version(self.version) <= "2.4.1": + if self.options.shared: + # INFO: Preserve same old library name as when building with Make on Windows but using Meson + rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), + os.path.join(self.package_folder, "lib", "openh264_dll.lib")) + else: + rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), + os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) def package_info(self): diff --git a/recipes/openh264/all/test_v1_package/CMakeLists.txt b/recipes/openh264/all/test_v1_package/CMakeLists.txt deleted file mode 100644 index 2f6b1a2f7ec79..0000000000000 --- a/recipes/openh264/all/test_v1_package/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(test_package C) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ - ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/openh264/all/test_v1_package/conanfile.py b/recipes/openh264/all/test_v1_package/conanfile.py deleted file mode 100644 index f4b0754b85efb..0000000000000 --- a/recipes/openh264/all/test_v1_package/conanfile.py +++ /dev/null @@ -1,17 +0,0 @@ -from conans import ConanFile, CMake, tools -import os - - -class TestPackageConan(ConanFile): - settings = "os", "arch", "compiler", "build_type" - generators = "cmake", "cmake_find_package_multi" - - def build(self): - cmake = CMake(self) - cmake.configure() - cmake.build() - - def test(self): - if not tools.cross_building(self, skip_x64_x86=True): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) From 99b3f88ab76205234cd1f05a6742e435190e1c85 Mon Sep 17 00:00:00 2001 From: toge Date: Thu, 28 Nov 2024 02:44:04 +0900 Subject: [PATCH 6/7] support static build on msvc in 2.5.0 --- recipes/openh264/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index b3abffad4e119..8e093f571aa36 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -106,6 +106,10 @@ def package(self): else: rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), os.path.join(self.package_folder, "lib", "openh264.lib")) + else: + if not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), + os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) def package_info(self): From 1a2396a16287af38a8d2a890dae8ba4e46b5869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abril=20Rinc=C3=B3n=20Blanco?= Date: Thu, 28 Nov 2024 11:10:57 +0100 Subject: [PATCH 7/7] Simplify --- recipes/openh264/all/conanfile.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/recipes/openh264/all/conanfile.py b/recipes/openh264/all/conanfile.py index 8e093f571aa36..cfdd6104e9efb 100644 --- a/recipes/openh264/all/conanfile.py +++ b/recipes/openh264/all/conanfile.py @@ -103,13 +103,9 @@ def package(self): # INFO: Preserve same old library name as when building with Make on Windows but using Meson rename(self, os.path.join(self.package_folder, "lib", "openh264.lib"), os.path.join(self.package_folder, "lib", "openh264_dll.lib")) - else: - rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), - os.path.join(self.package_folder, "lib", "openh264.lib")) - else: - if not self.options.shared: - rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), - os.path.join(self.package_folder, "lib", "openh264.lib")) + if not self.options.shared: + rename(self, os.path.join(self.package_folder, "lib", "libopenh264.a"), + os.path.join(self.package_folder, "lib", "openh264.lib")) fix_apple_shared_install_name(self) def package_info(self):