diff --git a/eaassert/all/conandata.yml b/eaassert/all/conandata.yml index 97f0b60..1ded3d4 100644 --- a/eaassert/all/conandata.yml +++ b/eaassert/all/conandata.yml @@ -2,3 +2,8 @@ sources: "25082026": url: "https://github.com/electronicarts/EAAssert/archive/e5e181255de2e883dd1f987c78ccc42ac81d3bca.zip" sha256: "72940e194f00466d23aac969b129819f9538aa716bfacfbc1d3a5d5ad235a5b3" +patches: + "25082026": + - patch_file: "patches/25082026-0001-use-conan.patch" + patch_description: "bump cmake_minimum_required past what CMake >= 4 accepts, drop the submodule-only CommonCppFlags include, use cci's EABase, add install definitions" + patch_type: "conan" diff --git a/eaassert/all/conanfile.py b/eaassert/all/conanfile.py index f667b31..e702d89 100644 --- a/eaassert/all/conanfile.py +++ b/eaassert/all/conanfile.py @@ -2,7 +2,7 @@ import os from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir required_conan_version = ">=1.52.0" @@ -26,6 +26,9 @@ class EAAssertConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -48,33 +51,8 @@ class EAAssertConan(ConanFile): tc.generate() CMakeDeps(self).generate() - def _patch_sources(self): - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - - # The upstream CMakeLists.txt expects a EASTL git submodule for CommonCppFlags and a bare - # "EABase" target from the same submodule setup - neither of which exist when building from - # the release archive via Conan. Point it at Conan's EABase instead, and add install rules - # (upstream has none). - # CMake >= 4 dropped support for the compatibility policies VERSION 3.1 requires. - replace_in_file(self, cmakelists, "cmake_minimum_required(VERSION 3.1)", "cmake_minimum_required(VERSION 3.5)") - replace_in_file(self, cmakelists, "include(CommonCppFlags)", "") - replace_in_file( - self, - cmakelists, - "target_link_libraries(EAAssert EABase)", - "find_package(EABase REQUIRED CONFIG)\n" - "target_link_libraries(EAAssert EABase::EABase)\n" - "\n" - "include(GNUInstallDirs)\n" - "install(TARGETS EAAssert\n" - " RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n" - " LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n" - " ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\n" - "install(DIRECTORY include/EAAssert DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\n", - ) - def build(self): - self._patch_sources() + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/eaassert/all/patches/25082026-0001-use-conan.patch b/eaassert/all/patches/25082026-0001-use-conan.patch new file mode 100644 index 0000000..a632dd0 --- /dev/null +++ b/eaassert/all/patches/25082026-0001-use-conan.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a60892b..02619df 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + #------------------------------------------------------------------------------------------- + # Copyright (C) Electronic Arts Inc. All rights reserved. + #------------------------------------------------------------------------------------------- +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.5) + project(EAAssert CXX) + + #------------------------------------------------------------------------------------------- +@@ -13,7 +13,6 @@ option(EAASSERT_BUILD_TESTS "Enable generation of build files for tests" OFF) + # Compiler Flags + #------------------------------------------------------------------------------------------- + set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/test/packages/EASTL/scripts/CMake") +-include(CommonCppFlags) + + #------------------------------------------------------------------------------------------- + # Library definition +@@ -41,5 +40,16 @@ target_include_directories(EAAssert PUBLIC include) + #------------------------------------------------------------------------------------------- + # Package Dependencies + #------------------------------------------------------------------------------------------- +-target_link_libraries(EAAssert EABase) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EAAssert EABase::EABase) ++ ++#------------------------------------------------------------------------------------------- ++# Installation ++#------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EAAssert ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY include/EAAssert DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + diff --git a/eastdc/all/conandata.yml b/eastdc/all/conandata.yml index 01f0c0c..95884b1 100644 --- a/eastdc/all/conandata.yml +++ b/eastdc/all/conandata.yml @@ -2,3 +2,8 @@ sources: "25082026": url: "https://github.com/electronicarts/EAStdC/archive/fbcc34e89c63636054334888f3a5bd7ac2fd4b76.zip" sha256: "023ddb703c824d2e7a9a670b8d5f4a9d9989e07b068f148448c6bb87402bd67d" +patches: + "25082026": + - patch_file: "patches/25082026-0001-use-conan.patch" + patch_description: "bump cmake_minimum_required past what CMake >= 4 accepts, drop the submodule-only CommonCppFlags include, use cci's EABase/EAAssert/EAThread, add install definitions" + patch_type: "conan" diff --git a/eastdc/all/conanfile.py b/eastdc/all/conanfile.py index f7862bd..3510508 100644 --- a/eastdc/all/conanfile.py +++ b/eastdc/all/conanfile.py @@ -2,7 +2,7 @@ import os from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir required_conan_version = ">=1.52.0" @@ -27,6 +27,9 @@ class EAStdCConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -51,37 +54,8 @@ class EAStdCConan(ConanFile): tc.generate() CMakeDeps(self).generate() - def _patch_sources(self): - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - - # CMake >= 4 dropped support for the compatibility policies VERSION 3.1 requires. - replace_in_file(self, cmakelists, "cmake_minimum_required(VERSION 3.1)", "cmake_minimum_required(VERSION 3.5)") - replace_in_file(self, cmakelists, "include(CommonCppFlags)", "") - - # The upstream CMakeLists.txt expects bare "EABase"/"EAAssert"/"EAThread" targets from a git - # submodule setup that doesn't exist when building from the release archive via Conan. Point - # it at Conan's packages instead, and add install rules (upstream has none). - replace_in_file( - self, - cmakelists, - "target_link_libraries(EAStdC EABase)\n" - "target_link_libraries(EAStdC EAAssert)\n" - "target_link_libraries(EAStdC EAThread)\n", - "find_package(EABase REQUIRED CONFIG)\n" - "find_package(EAAssert REQUIRED CONFIG)\n" - "find_package(EAThread REQUIRED CONFIG)\n" - "target_link_libraries(EAStdC EABase::EABase EAAssert::EAAssert EAThread::EAThread)\n" - "\n" - "include(GNUInstallDirs)\n" - "install(TARGETS EAStdC\n" - " RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n" - " LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n" - " ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\n" - "install(DIRECTORY include/EAStdC DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\n", - ) - def build(self): - self._patch_sources() + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/eastdc/all/patches/25082026-0001-use-conan.patch b/eastdc/all/patches/25082026-0001-use-conan.patch new file mode 100644 index 0000000..cd588e6 --- /dev/null +++ b/eastdc/all/patches/25082026-0001-use-conan.patch @@ -0,0 +1,43 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9bf3131..36ab616 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,7 @@ + #------------------------------------------------------------------------------------------- + # Copyright (C) Electronic Arts Inc. All rights reserved. + #------------------------------------------------------------------------------------------- +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.5) + project(EAStdC CXX) + + #------------------------------------------------------------------------------------------- +@@ -13,7 +13,6 @@ option(EASTDC_BUILD_TESTS "Enable generation of build files for tests" OFF) + # Compiler Flags + #------------------------------------------------------------------------------------------- + set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/test/packages/EASTL/scripts/CMake") +-include(CommonCppFlags) + + #------------------------------------------------------------------------------------------- + # Library definition +@@ -41,7 +40,18 @@ target_include_directories(EAStdC PUBLIC include) + #------------------------------------------------------------------------------------------- + # Dependencies + #------------------------------------------------------------------------------------------- +-target_link_libraries(EAStdC EABase) +-target_link_libraries(EAStdC EAAssert) +-target_link_libraries(EAStdC EAThread) ++find_package(EABase REQUIRED CONFIG) ++find_package(EAAssert REQUIRED CONFIG) ++find_package(EAThread REQUIRED CONFIG) ++target_link_libraries(EAStdC EABase::EABase EAAssert::EAAssert EAThread::EAThread) ++ ++#------------------------------------------------------------------------------------------- ++# Installation ++#------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EAStdC ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY include/EAStdC DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + diff --git a/eathread/all/conandata.yml b/eathread/all/conandata.yml index 50126ce..7a8dfa9 100644 --- a/eathread/all/conandata.yml +++ b/eathread/all/conandata.yml @@ -2,3 +2,11 @@ sources: "25082026": url: "https://github.com/electronicarts/EAThread/archive/a77e2276a3fe1489a7c6206c3f77ea10f7a5daf7.zip" sha256: "19f6ed95e38e9580bcdcd8190a31952b9d27af7a7b27a9b86802cadb44ac4579" +patches: + "25082026": + - patch_file: "patches/25082026-0001-use-conan.patch" + patch_description: "drop the submodule-only CommonCppFlags include and the FetchContent EABase pull, use cci's EABase, add install definitions" + patch_type: "conan" + - patch_file: "patches/25082026-0002-fix-char8t-thread-naming.patch" + patch_description: "unix thread-naming code used char8_t as a stand-in for plain char (a pre-C++20 convention) - fails to compile against char*-based strncpy/prctl/pthread_setname_np now that char8_t is a real, distinct type" + patch_type: "portability" diff --git a/eathread/all/conanfile.py b/eathread/all/conanfile.py index 2cdc98c..b4f48c6 100644 --- a/eathread/all/conanfile.py +++ b/eathread/all/conanfile.py @@ -2,7 +2,7 @@ import os from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import copy, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir required_conan_version = ">=1.52.0" @@ -26,6 +26,9 @@ class EAThreadConan(ConanFile): "fPIC": True, } + def export_sources(self): + export_conandata_patches(self) + def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -48,39 +51,8 @@ class EAThreadConan(ConanFile): tc.generate() CMakeDeps(self).generate() - def _patch_sources(self): - cmakelists = os.path.join(self.source_folder, "CMakeLists.txt") - - replace_in_file(self, cmakelists, "include(CommonCppFlags)", "") - - # The upstream CMakeLists.txt pulls EABase in via FetchContent from a pinned commit - - # replace it with Conan's EABase, and add install rules (upstream has none). - replace_in_file( - self, - cmakelists, - "FetchContent_Declare(\n" - " EABase\n" - " GIT_REPOSITORY https://github.com/electronicarts/EABase.git\n" - " GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12\n" - " GIT_SUBMODULES \"\" # This should be temporary until we update the cyclic submodule dependencies in EABase.\n" - ")\n" - "\n" - "FetchContent_MakeAvailable(EABase)\n" - "\n" - "target_link_libraries(EAThread EABase)\n", - "find_package(EABase REQUIRED CONFIG)\n" - "target_link_libraries(EAThread EABase::EABase)\n" - "\n" - "include(GNUInstallDirs)\n" - "install(TARGETS EAThread\n" - " RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n" - " LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n" - " ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\n" - "install(DIRECTORY include/eathread DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\n", - ) - def build(self): - self._patch_sources() + apply_conandata_patches(self) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/eathread/all/patches/25082026-0001-use-conan.patch b/eathread/all/patches/25082026-0001-use-conan.patch new file mode 100644 index 0000000..6cbdc59 --- /dev/null +++ b/eathread/all/patches/25082026-0001-use-conan.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7884456..6d51ebc 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -14,7 +14,6 @@ option(EATHREAD_BUILD_TESTS "Enable generation of build files for tests" OFF) + # Compiler Flags (TODO: do we really need this?) + #------------------------------------------------------------------------------------------- + set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts/Cmake" CACHE INTERNAL "Inject path to CommonCppFlags") +-include(CommonCppFlags) + + #------------------------------------------------------------------------------------------- + # Library definition +@@ -36,16 +35,18 @@ target_include_directories(EAThread PUBLIC include) + #------------------------------------------------------------------------------------------- + # Package Dependencies + #------------------------------------------------------------------------------------------- +-FetchContent_Declare( +- EABase +- GIT_REPOSITORY https://github.com/electronicarts/EABase.git +- GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12 +- GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase. +-) ++find_package(EABase REQUIRED CONFIG) ++target_link_libraries(EAThread EABase::EABase) + +-FetchContent_MakeAvailable(EABase) +- +-target_link_libraries(EAThread EABase) ++#------------------------------------------------------------------------------------------- ++# Installation ++#------------------------------------------------------------------------------------------- ++include(GNUInstallDirs) ++install(TARGETS EAThread ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++install(DIRECTORY include/eathread DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + if(EATHREAD_BUILD_TESTS) + add_subdirectory(test) diff --git a/eathread/all/patches/25082026-0002-fix-char8t-thread-naming.patch b/eathread/all/patches/25082026-0002-fix-char8t-thread-naming.patch new file mode 100644 index 0000000..c26b044 --- /dev/null +++ b/eathread/all/patches/25082026-0002-fix-char8t-thread-naming.patch @@ -0,0 +1,31 @@ +diff --git a/source/unix/eathread_unix.cpp b/source/unix/eathread_unix.cpp +index 5be260a..f716caf 100644 +--- a/source/unix/eathread_unix.cpp ++++ b/source/unix/eathread_unix.cpp +@@ -402,7 +402,7 @@ + // This function is not currently used if the thread name can be set from any other thread + #if !EATHREAD_OTHER_THREAD_NAMING_SUPPORTED + +- void SetCurrentThreadName(const char8_t* pName) ++ void SetCurrentThreadName(const char* pName) + { + #if defined(EA_PLATFORM_LINUX) + // http://manpages.courier-mta.org/htmlman2/prctl.2.html +@@ -417,7 +417,7 @@ + // (/proc/$PID/task/$TID/comm on newer kernels, /proc/$PID/task/$TID/stat's second field + // on older kernels), and hence distinguish which thread might be responsible for the high + // CPU load or similar problems. +- char8_t nameBuf[16]; // Limited to 16 bytes, null terminated if < 16 bytes ++ char nameBuf[16]; // Limited to 16 bytes, null terminated if < 16 bytes + strncpy(nameBuf, pName, sizeof(nameBuf)); + nameBuf[15] = 0; + prctl(PR_SET_NAME, (unsigned long)nameBuf, 0, 0, 0); +@@ -434,7 +434,7 @@ + if(pthread_setname_np_ptr) + { + // Mac OS X does not expose the length limit of the name, so hardcode it. +- char8_t nameBuf[63]; // It is not clear what the size limit actually is, though 63 is known to work because it was seen on the Internet. ++ char nameBuf[63]; // It is not clear what the size limit actually is, though 63 is known to work because it was seen on the Internet. + strncpy(nameBuf, pName, sizeof(nameBuf)); + nameBuf[62] = 0; + pthread_setname_np_ptr(nameBuf);