From 20d814a617728f9270ee0ede002e9aa0c578ea8a Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 10 May 2024 20:11:35 +0200 Subject: [PATCH 01/13] Add recipe for the bmx library provided by the BBC --- recipes/bmx/all/conandata.yml | 16 +++ recipes/bmx/all/conanfile.py | 129 ++++++++++++++++++ recipes/bmx/all/patches/1.2-cmake-fixes.patch | 55 ++++++++ recipes/bmx/all/test_package/CMakeLists.txt | 7 + recipes/bmx/all/test_package/conanfile.py | 26 ++++ recipes/bmx/all/test_package/test_package.cpp | 14 ++ recipes/bmx/config.yml | 5 + 7 files changed, 252 insertions(+) create mode 100644 recipes/bmx/all/conandata.yml create mode 100644 recipes/bmx/all/conanfile.py create mode 100644 recipes/bmx/all/patches/1.2-cmake-fixes.patch create mode 100644 recipes/bmx/all/test_package/CMakeLists.txt create mode 100644 recipes/bmx/all/test_package/conanfile.py create mode 100644 recipes/bmx/all/test_package/test_package.cpp create mode 100644 recipes/bmx/config.yml diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml new file mode 100644 index 0000000000000..b839e4c213d1b --- /dev/null +++ b/recipes/bmx/all/conandata.yml @@ -0,0 +1,16 @@ +sources: + "1.2": + url: "https://github.com/bbc/bmx/archive/refs/tags/v1.2.tar.gz" + sha256: "e64d91b2d27478d6b892d72183e1ecf79c99880b079ce04442432f3caed1e259" + "cci.20240510": + url: "https://github.com/bbc/bmx/archive/38204bbb2637da99c288b61d02c60f1d2d926a7d.tar.gz" + sha256: "c2c650461fe4c0bde83e1145a064d6ff4295350246d8c9ee0456b86013dfb79e" +patches: + "1.2": + - patch_file: "patches/1.2-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" + "cci.20240510": + - patch_file: "patches/1.2-cmake-fixes.patch" + patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" + patch_type: "conan" diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py new file mode 100644 index 0000000000000..28cb68416e038 --- /dev/null +++ b/recipes/bmx/all/conanfile.py @@ -0,0 +1,129 @@ +from conan import ConanFile +from conan.tools.build import check_min_cppstd +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rm, rmdir +import os + +required_conan_version = ">=1.53.0" + + +class BmxConan(ConanFile): + name = "bmx" + description = ( + "Library for handling broadcast/production oriented media file formats. " + "Allows reading, modifying and writing media metadata and file essences." + ) + topics = ("vfx", "image", "picture", "video", "multimedia", "mxf") + license = "BSD-3-Clause" + homepage = "https://github.com/bbc/bmx" + url = "https://github.com/conan-io/conan-center-index" + + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_libcurl": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_libcurl": True, + } + + def export_sources(self): + export_conandata_patches(self) + + 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 requirements(self): + # Required libraries + self.requires("uriparser/0.9.8") + self.requires("expat/2.6.2") + + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + self.requires('libuuid/1.0.3') + + # Configuration dependent requirements + if self.options.with_libcurl: + self.requires("libcurl/8.6.0") + + def validate(self): + if self.settings.compiler.cppstd: + check_min_cppstd(self, 11) + + def layout(self): + cmake_layout(self, src_folder="src") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + cd = CMakeDeps(self) + cd.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "COPYING", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + + @staticmethod + def _conan_comp(name): + return f"bmx_{name.lower()}" + + def _add_component(self, name): + component = self.cpp_info.components[self._conan_comp(name)] + component.set_property("cmake_target_name", f"bmx::{name}") + component.names["cmake_find_package"] = name + component.names["cmake_find_package_multi"] = name + return component + + def package_info(self): + self.cpp_info.set_property("cmake_file_name", "bmx") + self.cpp_info.set_property("pkg_config_name", "bmx") + + self.cpp_info.names["cmake_find_package"] = "bmx" + self.cpp_info.names["cmake_find_package_multi"] = "bmx" + + # bbc-bmx::MXF + libmxf = self._add_component("MXF") + libmxf.libs = ["MXF"] + libmxf.requires = [] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libmxf.requires.append("libuuid::libuuid") + + # bbc-bmx::MXF++ + libmxfpp = self._add_component("MXF++") + libmxfpp.libs = ["MXF++"] + libmxfpp.requires = [ + "bmx_mxf" + ] + + # bbc-bmx::bmx + libbmx = self._add_component("bmx") + libbmx.libs = ["bmx"] + libbmx.requires = [ + "bmx_mxf", + "bmx_mxf++", + "expat::expat", + "uriparser::uriparser", + ] + if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): + libbmx.requires.append("libuuid::libuuid") + + if self.options.with_libcurl: + libbmx.requires.append("libcurl::libcurl") diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch new file mode 100644 index 0000000000000..22a98752baf21 --- /dev/null +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -0,0 +1,55 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 6fe9540e..4847ba3e 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -93,11 +93,25 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) +- include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 1c0824d8..ed95310a 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -65,13 +65,13 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) + target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/all/test_package/CMakeLists.txt b/recipes/bmx/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..252ce4d95cb16 --- /dev/null +++ b/recipes/bmx/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.8) +project(test_package LANGUAGES CXX) + +find_package(bmx REQUIRED) + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} PRIVATE bmx::bmx) diff --git a/recipes/bmx/all/test_package/conanfile.py b/recipes/bmx/all/test_package/conanfile.py new file mode 100644 index 0000000000000..a9fb96656f203 --- /dev/null +++ b/recipes/bmx/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/bmx/all/test_package/test_package.cpp b/recipes/bmx/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..708a858acfc27 --- /dev/null +++ b/recipes/bmx/all/test_package/test_package.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include + +int main() { + std::cout << bmx::get_bmx_library_name() << " library version " << bmx::get_bmx_version_string() << std::endl; + + const auto mxf_version = mxf_get_version(); + std::cout << "MXF library version " + << mxf_version->major << '.' << mxf_version->minor << '.' << mxf_version->patch << std::endl; + + return 0; +} diff --git a/recipes/bmx/config.yml b/recipes/bmx/config.yml new file mode 100644 index 0000000000000..e41fe0957202d --- /dev/null +++ b/recipes/bmx/config.yml @@ -0,0 +1,5 @@ +versions: + "1.2": + folder: all + "cci.20240510": + folder: all From 212bf986f5b92e9a1241066dfdc354a7363ebb0b Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 10 May 2024 20:35:27 +0200 Subject: [PATCH 02/13] Add libcurl flag to conanfile --- recipes/bmx/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py index 28cb68416e038..675341240b328 100644 --- a/recipes/bmx/all/conanfile.py +++ b/recipes/bmx/all/conanfile.py @@ -65,7 +65,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) + tc.variables["BMX_BUILD_WITH_LIBCURL"] = self.options.with_libcurl tc.generate() + cd = CMakeDeps(self) cd.generate() From 2b286d35664e14d0c4ca8f8df3afbd4a2c4b6696 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 10 May 2024 21:18:02 +0200 Subject: [PATCH 03/13] Add version ranges for expat & libcurl and remove fixed target C++ version --- recipes/bmx/all/conandata.yml | 6 ++++++ recipes/bmx/all/conanfile.py | 4 ++-- recipes/bmx/all/patches/1.2-cmake-fixes.patch | 11 ++++++++++- recipes/bmx/all/patches/1.2-fix-cpp20.patch | 13 +++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 recipes/bmx/all/patches/1.2-fix-cpp20.patch diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml index b839e4c213d1b..eb5cedefa32ba 100644 --- a/recipes/bmx/all/conandata.yml +++ b/recipes/bmx/all/conandata.yml @@ -10,7 +10,13 @@ patches: - patch_file: "patches/1.2-cmake-fixes.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" + - patch_file: "patches/1.2-fix-cpp20.patch" + patch_description: "Fix a compilation problem with C++20" + patch_type: "portability" "cci.20240510": - patch_file: "patches/1.2-cmake-fixes.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" + - patch_file: "patches/1.2-fix-cpp20.patch" + patch_description: "Fix a compilation problem with C++20" + patch_type: "portability" diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py index 675341240b328..92ceaafaf4510 100644 --- a/recipes/bmx/all/conanfile.py +++ b/recipes/bmx/all/conanfile.py @@ -44,14 +44,14 @@ def configure(self): def requirements(self): # Required libraries self.requires("uriparser/0.9.8") - self.requires("expat/2.6.2") + self.requires("expat/[>=2.6.2 <3]") if not (self.settings.os == 'Windows' or self.settings.os == 'Macos'): self.requires('libuuid/1.0.3') # Configuration dependent requirements if self.options.with_libcurl: - self.requires("libcurl/8.6.0") + self.requires("libcurl/[>=7.78.0 <9]") def validate(self): if self.settings.compiler.cppstd: diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch index 22a98752baf21..a6c72e3e78f0e 100644 --- a/recipes/bmx/all/patches/1.2-cmake-fixes.patch +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -1,7 +1,16 @@ diff --git CMakeLists.txt CMakeLists.txt -index 6fe9540e..4847ba3e 100644 +index 6fe9540e..69909e40 100644 --- CMakeLists.txt +++ CMakeLists.txt +@@ -34,7 +34,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(BMX_TEST_SAMPLES_DIR STREQUAL "") @@ -93,11 +93,25 @@ add_custom_target(bmx_test_data) include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") diff --git a/recipes/bmx/all/patches/1.2-fix-cpp20.patch b/recipes/bmx/all/patches/1.2-fix-cpp20.patch new file mode 100644 index 0000000000000..e5437879386cc --- /dev/null +++ b/recipes/bmx/all/patches/1.2-fix-cpp20.patch @@ -0,0 +1,13 @@ +diff --git src/common/Version.cpp src/common/Version.cpp +index a4f00e14..d51da64a 100644 +--- src/common/Version.cpp ++++ src/common/Version.cpp +@@ -219,7 +219,7 @@ mxfProductVersion bmx::get_bmx_mxf_product_version() + // Set the patch version value to the commit offset from the release tag. + // The commit offset is part of the git describe tag string which has the + // format "--g" +- string describe = bmx_git::DescribeTag(); ++ string describe = std::string(bmx_git::DescribeTag()); + #ifdef PACKAGE_GIT_VERSION_STRING + if (describe.empty() || describe == "unknown") + describe = PACKAGE_GIT_VERSION_STRING; From 93784ed62c3eeaa5541415809b35af23c7f69ba5 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 10 May 2024 21:53:46 +0200 Subject: [PATCH 04/13] Switch linking of CURL to public as otherwise on Linux there is a ton of undefined references --- recipes/bmx/all/patches/1.2-cmake-fixes.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch index a6c72e3e78f0e..85e62c48bdbfb 100644 --- a/recipes/bmx/all/patches/1.2-cmake-fixes.patch +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -45,7 +45,7 @@ diff --git src/CMakeLists.txt src/CMakeLists.txt index 1c0824d8..ed95310a 100644 --- src/CMakeLists.txt +++ src/CMakeLists.txt -@@ -65,13 +65,13 @@ target_link_libraries(bmx +@@ -65,13 +65,14 @@ target_link_libraries(bmx ${MXFpp_link_lib} PRIVATE ${uuid_link_lib} @@ -56,8 +56,10 @@ index 1c0824d8..ed95310a 100644 ) if(BMX_BUILD_WITH_LIBCURL) - target_link_libraries(bmx PRIVATE +- target_link_libraries(bmx PRIVATE - ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC + CURL::libcurl ) endif() From 2bcf4ecb728b12ac7628b51df0a9f6124c9878e7 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 10 May 2024 22:27:33 +0200 Subject: [PATCH 05/13] Add patch source for compatibility patch --- recipes/bmx/all/conandata.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml index eb5cedefa32ba..b0ef08f51b8f2 100644 --- a/recipes/bmx/all/conandata.yml +++ b/recipes/bmx/all/conandata.yml @@ -13,6 +13,7 @@ patches: - patch_file: "patches/1.2-fix-cpp20.patch" patch_description: "Fix a compilation problem with C++20" patch_type: "portability" + patch_source: "https://github.com/bbc/bmx/pull/69" "cci.20240510": - patch_file: "patches/1.2-cmake-fixes.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" @@ -20,3 +21,4 @@ patches: - patch_file: "patches/1.2-fix-cpp20.patch" patch_description: "Fix a compilation problem with C++20" patch_type: "portability" + patch_source: "https://github.com/bbc/bmx/pull/69" From 7c88047ccd69550629856d170de6ac3d5a257124 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Mon, 13 May 2024 12:46:08 +0200 Subject: [PATCH 06/13] Fix all the deps to not use their own CXX standard override --- recipes/bmx/all/patches/1.2-cmake-fixes.patch | 28 ++++++++++++++++++- recipes/bmx/all/patches/1.2-fix-cpp20.patch | 13 +++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch index 85e62c48bdbfb..518e4ae6052ea 100644 --- a/recipes/bmx/all/patches/1.2-cmake-fixes.patch +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -41,8 +41,34 @@ index 6fe9540e..69909e40 100644 endif() configure_file(config.h.in config.h) +diff --git deps/libMXF/CMakeLists.txt deps/libMXF/CMakeLists.txt +index d36fde6c..52eb78e7 100644 +--- deps/libMXF/CMakeLists.txt ++++ deps/libMXF/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + # Set the test samples output directory + if(LIBMXF_TEST_SAMPLES_DIR STREQUAL "") +diff --git deps/libMXFpp/CMakeLists.txt deps/libMXFpp/CMakeLists.txt +index 2272a270..06bb0116 100644 +--- deps/libMXFpp/CMakeLists.txt ++++ deps/libMXFpp/CMakeLists.txt +@@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + +-set(CMAKE_CXX_STANDARD 11) ++#set(CMAKE_CXX_STANDARD 11) + + if(MSVC) + add_compile_options(/W3 /EHsc) diff --git src/CMakeLists.txt src/CMakeLists.txt -index 1c0824d8..ed95310a 100644 +index 1c0824d8..4f7dbfb0 100644 --- src/CMakeLists.txt +++ src/CMakeLists.txt @@ -65,13 +65,14 @@ target_link_libraries(bmx diff --git a/recipes/bmx/all/patches/1.2-fix-cpp20.patch b/recipes/bmx/all/patches/1.2-fix-cpp20.patch index e5437879386cc..862806a6a30d2 100644 --- a/recipes/bmx/all/patches/1.2-fix-cpp20.patch +++ b/recipes/bmx/all/patches/1.2-fix-cpp20.patch @@ -1,3 +1,16 @@ +diff --git deps/libMXFpp/libMXF++/MXFVersion.cpp deps/libMXFpp/libMXF++/MXFVersion.cpp +index 333d5871..bb247a32 100644 +--- deps/libMXFpp/libMXF++/MXFVersion.cpp ++++ deps/libMXFpp/libMXF++/MXFVersion.cpp +@@ -33,6 +33,8 @@ + #include "config.h" + #endif + ++#include ++ + #include "git.h" + #include "fallback_git_version.h" + diff --git src/common/Version.cpp src/common/Version.cpp index a4f00e14..d51da64a 100644 --- src/common/Version.cpp From 6afb600e2fbdf54274acb83877e6ad6b0be8acce Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Mon, 13 May 2024 20:05:47 +0200 Subject: [PATCH 07/13] Bump the CCI tagged release build to the latest commit which integrates the patches to build with C++20 without non-cmake patches. --- recipes/bmx/all/conandata.yml | 12 ++++-------- recipes/bmx/config.yml | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml index b0ef08f51b8f2..3335c8b922f60 100644 --- a/recipes/bmx/all/conandata.yml +++ b/recipes/bmx/all/conandata.yml @@ -2,9 +2,9 @@ sources: "1.2": url: "https://github.com/bbc/bmx/archive/refs/tags/v1.2.tar.gz" sha256: "e64d91b2d27478d6b892d72183e1ecf79c99880b079ce04442432f3caed1e259" - "cci.20240510": - url: "https://github.com/bbc/bmx/archive/38204bbb2637da99c288b61d02c60f1d2d926a7d.tar.gz" - sha256: "c2c650461fe4c0bde83e1145a064d6ff4295350246d8c9ee0456b86013dfb79e" + "cci.20240513": + url: "https://github.com/bbc/bmx/archive/6e649809246822901f8b163cfcc39dbb74c04197.tar.gz" + sha256: "fba51793c3deef78c6ad987c6b38fa072a9f991f2d94c96204aa28ee03565ac3" patches: "1.2": - patch_file: "patches/1.2-cmake-fixes.patch" @@ -14,11 +14,7 @@ patches: patch_description: "Fix a compilation problem with C++20" patch_type: "portability" patch_source: "https://github.com/bbc/bmx/pull/69" - "cci.20240510": + "cci.20240513": - patch_file: "patches/1.2-cmake-fixes.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" - - patch_file: "patches/1.2-fix-cpp20.patch" - patch_description: "Fix a compilation problem with C++20" - patch_type: "portability" - patch_source: "https://github.com/bbc/bmx/pull/69" diff --git a/recipes/bmx/config.yml b/recipes/bmx/config.yml index e41fe0957202d..29c5e5760fd9d 100644 --- a/recipes/bmx/config.yml +++ b/recipes/bmx/config.yml @@ -1,5 +1,5 @@ versions: "1.2": folder: all - "cci.20240510": + "cci.20240513": folder: all From 3a93aadea7eaf8affa9d58851690fc10170ce324 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Mon, 13 May 2024 20:14:12 +0200 Subject: [PATCH 08/13] Remove unused import --- recipes/bmx/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py index 92ceaafaf4510..89fae19d16918 100644 --- a/recipes/bmx/all/conanfile.py +++ b/recipes/bmx/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rm, rmdir +from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir import os required_conan_version = ">=1.53.0" From 8533171645852b1340ba6eb13786285dac92287d Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Fri, 17 May 2024 17:31:09 +0200 Subject: [PATCH 09/13] Remove -O2 flag & bump cci-version to current master with upstream changes to the CMake not requiering most of the patches --- recipes/bmx/all/conandata.yml | 10 ++-- recipes/bmx/all/patches/1.2-cmake-fixes.patch | 35 ++++++++++-- .../patches/cci.20240517-cmake-fixes.patch | 57 +++++++++++++++++++ recipes/bmx/config.yml | 2 +- 4 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch diff --git a/recipes/bmx/all/conandata.yml b/recipes/bmx/all/conandata.yml index 3335c8b922f60..0b6f6445f92a3 100644 --- a/recipes/bmx/all/conandata.yml +++ b/recipes/bmx/all/conandata.yml @@ -2,9 +2,9 @@ sources: "1.2": url: "https://github.com/bbc/bmx/archive/refs/tags/v1.2.tar.gz" sha256: "e64d91b2d27478d6b892d72183e1ecf79c99880b079ce04442432f3caed1e259" - "cci.20240513": - url: "https://github.com/bbc/bmx/archive/6e649809246822901f8b163cfcc39dbb74c04197.tar.gz" - sha256: "fba51793c3deef78c6ad987c6b38fa072a9f991f2d94c96204aa28ee03565ac3" + "cci.20240517": + url: "https://github.com/bbc/bmx/archive/52c7517923dde6e4de881fe1e47fbae5e60df731.tar.gz" + sha256: "b4a0545e2fa33bd7c25adce3b61fd4b06a68a192d037dd0e5eb14defd0b2c936" patches: "1.2": - patch_file: "patches/1.2-cmake-fixes.patch" @@ -14,7 +14,7 @@ patches: patch_description: "Fix a compilation problem with C++20" patch_type: "portability" patch_source: "https://github.com/bbc/bmx/pull/69" - "cci.20240513": - - patch_file: "patches/1.2-cmake-fixes.patch" + "cci.20240517": + - patch_file: "patches/cci.20240517-cmake-fixes.patch" patch_description: "Ensure project builds correctly with Conan (don't pick up disabled dependencies from the system, fix different spelling of libraries)" patch_type: "conan" diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch index 518e4ae6052ea..893e9bbc1bfad 100644 --- a/recipes/bmx/all/patches/1.2-cmake-fixes.patch +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -1,5 +1,5 @@ diff --git CMakeLists.txt CMakeLists.txt -index 6fe9540e..69909e40 100644 +index 6fe9540e7..8b2578852 100644 --- CMakeLists.txt +++ CMakeLists.txt @@ -34,7 +34,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) @@ -11,6 +11,15 @@ index 6fe9540e..69909e40 100644 # Set the test samples output directory if(BMX_TEST_SAMPLES_DIR STREQUAL "") +@@ -75,7 +75,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( @@ -93,11 +93,25 @@ add_custom_target(bmx_test_data) include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") @@ -42,7 +51,7 @@ index 6fe9540e..69909e40 100644 configure_file(config.h.in config.h) diff --git deps/libMXF/CMakeLists.txt deps/libMXF/CMakeLists.txt -index d36fde6c..52eb78e7 100644 +index d36fde6c0..6a1af100b 100644 --- deps/libMXF/CMakeLists.txt +++ deps/libMXF/CMakeLists.txt @@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) @@ -54,8 +63,17 @@ index d36fde6c..52eb78e7 100644 # Set the test samples output directory if(LIBMXF_TEST_SAMPLES_DIR STREQUAL "") +@@ -76,7 +76,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( diff --git deps/libMXFpp/CMakeLists.txt deps/libMXFpp/CMakeLists.txt -index 2272a270..06bb0116 100644 +index 2272a2709..924fdf770 100644 --- deps/libMXFpp/CMakeLists.txt +++ deps/libMXFpp/CMakeLists.txt @@ -35,7 +35,7 @@ if(BUILD_SHARED_LIBS OR NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) @@ -67,8 +85,17 @@ index 2272a270..06bb0116 100644 if(MSVC) add_compile_options(/W3 /EHsc) +@@ -61,7 +61,7 @@ if(MSVC) + endforeach() + endif() + else() +- add_compile_options(-W -Wall -O2) ++ add_compile_options(-W -Wall) + + # Enable large file support on 32-bit systems. + add_definitions( diff --git src/CMakeLists.txt src/CMakeLists.txt -index 1c0824d8..4f7dbfb0 100644 +index 1c0824d8a..4f7dbfb05 100644 --- src/CMakeLists.txt +++ src/CMakeLists.txt @@ -65,13 +65,14 @@ target_link_libraries(bmx diff --git a/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch b/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch new file mode 100644 index 0000000000000..51915e0cc5aa0 --- /dev/null +++ b/recipes/bmx/all/patches/cci.20240517-cmake-fixes.patch @@ -0,0 +1,57 @@ +diff --git CMakeLists.txt CMakeLists.txt +index 3139ef78e..a08fbb589 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -91,11 +91,26 @@ add_custom_target(bmx_test_data) + + include("${PROJECT_SOURCE_DIR}/cmake/libmxf.cmake") + include("${PROJECT_SOURCE_DIR}/cmake/libmxfpp.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") +-include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_expat.cmake") ++#include("${PROJECT_SOURCE_DIR}/cmake/ext_uriparser.cmake") ++#if(BMX_BUILD_WITH_LIBCURL) ++# include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++#endif() ++ ++find_package(expat REQUIRED) ++find_package(uriparser REQUIRED) ++if(UNIX AND NOT APPLE) ++ find_package(libuuid REQUIRED) ++ set(uuid_link_lib libuuid::libuuid) ++else() ++ # MSVC: "ole" will already be linked in ++ # APPLE: doesn't require uuid library ++ set(uuid_link_lib) ++endif() + if(BMX_BUILD_WITH_LIBCURL) + include("${PROJECT_SOURCE_DIR}/cmake/ext_libcurl.cmake") ++ find_package(CURL REQUIRED) + endif() + + configure_file(config.h.in config.h) +diff --git src/CMakeLists.txt src/CMakeLists.txt +index 59c94b8b9..94f9c00d6 100644 +--- src/CMakeLists.txt ++++ src/CMakeLists.txt +@@ -67,13 +67,14 @@ target_link_libraries(bmx + ${MXFpp_link_lib} + PRIVATE + ${uuid_link_lib} +- ${expat_link_lib} +- ${uriparser_link_lib} ++ expat::expat ++ uriparser::uriparser + ) + + if(BMX_BUILD_WITH_LIBCURL) +- target_link_libraries(bmx PRIVATE +- ${libcurl_link_lib} ++ # Linking public to see if the shared library for curls dependencies correctly link ++ target_link_libraries(bmx PUBLIC ++ CURL::libcurl + ) + endif() + diff --git a/recipes/bmx/config.yml b/recipes/bmx/config.yml index 29c5e5760fd9d..67c5069aa3fb3 100644 --- a/recipes/bmx/config.yml +++ b/recipes/bmx/config.yml @@ -1,5 +1,5 @@ versions: "1.2": folder: all - "cci.20240513": + "cci.20240517": folder: all From f4e1354bf2bcef6ad464bf633d2a3587b288d6ac Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Wed, 22 May 2024 15:46:48 +0200 Subject: [PATCH 10/13] Add the target_compile_features as applied by https://github.com/bbc/bmx/commit/b764c599ab474a81ea90dffae60412aa8efbcb55 --- recipes/bmx/all/patches/1.2-cmake-fixes.patch | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/recipes/bmx/all/patches/1.2-cmake-fixes.patch b/recipes/bmx/all/patches/1.2-cmake-fixes.patch index 893e9bbc1bfad..29a8742dbedbb 100644 --- a/recipes/bmx/all/patches/1.2-cmake-fixes.patch +++ b/recipes/bmx/all/patches/1.2-cmake-fixes.patch @@ -94,11 +94,33 @@ index 2272a2709..924fdf770 100644 # Enable large file support on 32-bit systems. add_definitions( +diff --git deps/libMXFpp/libMXF++/CMakeLists.txt deps/libMXFpp/libMXF++/CMakeLists.txt +index 94d48c905..e6c6a63f9 100644 +--- deps/libMXFpp/libMXF++/CMakeLists.txt ++++ deps/libMXFpp/libMXF++/CMakeLists.txt +@@ -32,6 +32,8 @@ add_library(MXFpp + ${MXFpp_sources} + ) + ++target_compile_features(MXFpp PUBLIC cxx_std_11) ++ + target_include_directories(MXFpp PUBLIC + ${PROJECT_SOURCE_DIR} + ) diff --git src/CMakeLists.txt src/CMakeLists.txt -index 1c0824d8a..4f7dbfb05 100644 +index 1c0824d8a..94f9c00d6 100644 --- src/CMakeLists.txt +++ src/CMakeLists.txt -@@ -65,13 +65,14 @@ target_link_libraries(bmx +@@ -26,6 +26,8 @@ target_include_directories(bmx PUBLIC + ${PROJECT_SOURCE_DIR}/include + ) + ++target_compile_features(bmx PUBLIC cxx_std_11) ++ + # Add path to header files if not included in MSVC distribution + if(MSVC) + include(CheckIncludeFile) +@@ -65,13 +67,14 @@ target_link_libraries(bmx ${MXFpp_link_lib} PRIVATE ${uuid_link_lib} From 2c10f67005eb9f31eec18649642944d1c5c96d5b Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Wed, 22 May 2024 16:10:56 +0200 Subject: [PATCH 11/13] Enforce minimum CXX11 for test package too --- recipes/bmx/all/test_package/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/bmx/all/test_package/CMakeLists.txt b/recipes/bmx/all/test_package/CMakeLists.txt index 252ce4d95cb16..e178912ec45f8 100644 --- a/recipes/bmx/all/test_package/CMakeLists.txt +++ b/recipes/bmx/all/test_package/CMakeLists.txt @@ -4,4 +4,5 @@ project(test_package LANGUAGES CXX) find_package(bmx REQUIRED) add_executable(${PROJECT_NAME} test_package.cpp) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) target_link_libraries(${PROJECT_NAME} PRIVATE bmx::bmx) From 4535a55e9d9416c121e8f243d28027e87dff0663 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Sat, 15 Jun 2024 22:14:19 +0200 Subject: [PATCH 12/13] Deactivate windows shared library building --- recipes/bmx/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py index 89fae19d16918..0d01f96d095ec 100644 --- a/recipes/bmx/all/conanfile.py +++ b/recipes/bmx/all/conanfile.py @@ -1,4 +1,5 @@ from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, copy, get, rmdir @@ -57,6 +58,11 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) + if self.settings.os == "Windows" and self.options.shared: + raise ConanInvalidConfiguration( + "Building as a shared library currently not supported on Windows!" + ) + def layout(self): cmake_layout(self, src_folder="src") From 97e76c5042fa48fa5933a93ac9979fa86d40bd06 Mon Sep 17 00:00:00 2001 From: Ingmar Rieger Date: Sun, 16 Jun 2024 07:42:40 +0200 Subject: [PATCH 13/13] Add a descriptive comment for the restriction to disallow shared builds on Windows --- recipes/bmx/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/bmx/all/conanfile.py b/recipes/bmx/all/conanfile.py index 0d01f96d095ec..2a7415f432502 100644 --- a/recipes/bmx/all/conanfile.py +++ b/recipes/bmx/all/conanfile.py @@ -58,6 +58,9 @@ def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, 11) + # Symbol export is currently not working properly on Windows so shared + # libraries are currently deactivated. This can later be revisited based + # on https://github.com/bbc/bmx/issues/80 if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration( "Building as a shared library currently not supported on Windows!"