From a631e808780ef94d4131950c1a680258bfda5b06 Mon Sep 17 00:00:00 2001 From: toge Date: Tue, 24 Sep 2024 15:50:43 +0900 Subject: [PATCH] (#25037) lunasvg: add version 2.4.1 * lunasvg: add version 2.4.1 * support msvc shared build * remove unused methods --------- Co-authored-by: Ernesto de Gracia Herranz Co-authored-by: Ernesto de Gracia Herranz --- recipes/lunasvg/all/conandata.yml | 7 ++++ recipes/lunasvg/all/conanfile.py | 6 ++- .../all/patches/2.4.1-0001-fix-cmake.patch | 38 +++++++++++++++++++ recipes/lunasvg/config.yml | 2 + 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch diff --git a/recipes/lunasvg/all/conandata.yml b/recipes/lunasvg/all/conandata.yml index c0096452d5b87..783b909d243fb 100644 --- a/recipes/lunasvg/all/conandata.yml +++ b/recipes/lunasvg/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2.4.1": + url: "https://github.com/sammycage/lunasvg/archive/v2.4.1.tar.gz" + sha256: "db9d2134c8c2545694e71e62fb0772a7d089fe53e1ace1e08c2279a89e450534" "2.4.0": url: "https://github.com/sammycage/lunasvg/archive/v2.4.0.tar.gz" sha256: "0682c60501c91d75f4261d9c1a5cd44c2c9da8dba76f8402eab628448c9a4591" @@ -21,6 +24,10 @@ sources: url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz" sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25" patches: + "2.4.1": + - patch_file: "patches/2.4.1-0001-fix-cmake.patch" + patch_description: "use external plutovg and fix installation path for conan" + patch_type: "conan" "2.4.0": - patch_file: "patches/2.3.9-0001-fix-cmake.patch" patch_description: "use external plutovg and fix installation path for conan" diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index e2d264c8bbac5..4182a4b8f27c6 100644 --- a/recipes/lunasvg/all/conanfile.py +++ b/recipes/lunasvg/all/conanfile.py @@ -1,6 +1,5 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import check_min_vs, is_msvc from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy from conan.tools.build import check_min_cppstd from conan.tools.scm import Version @@ -90,7 +89,8 @@ def source(self): def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_SHARED_LIBS"] = self.options.shared - tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True + if Version(self.version) < "2.4.1": + tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True tc.generate() tc = CMakeDeps(self) @@ -111,3 +111,5 @@ def package_info(self): self.cpp_info.libs = ["lunasvg"] if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.system_libs = ["m"] + if Version(self.version) >= "2.4.1" and not self.options.shared: + self.cpp_info.defines = ["LUNASVG_BUILD_STATIC"] diff --git a/recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch b/recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch new file mode 100644 index 0000000000000..190bb9b65c6b5 --- /dev/null +++ b/recipes/lunasvg/all/patches/2.4.1-0001-fix-cmake.patch @@ -0,0 +1,38 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3565911..e33555e 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,8 +12,8 @@ add_library(lunasvg) + + add_subdirectory(include) + add_subdirectory(source) +-add_subdirectory(3rdparty/plutovg) +- ++find_package(plutovg CONFIG REQUIRED) ++target_link_libraries(lunasvg plutovg::plutovg) + target_compile_definitions(lunasvg PRIVATE LUNASVG_BUILD) + if(NOT BUILD_SHARED_LIBS) + target_compile_definitions(lunasvg PRIVATE LUNASVG_BUILD_STATIC) +@@ -25,16 +25,16 @@ if(LUNASVG_BUILD_EXAMPLES) + target_include_directories(svg2png PRIVATE 3rdparty/stb) + endif() + +-set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) +-set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) ++# set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib) ++# set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include) + + install(FILES + include/lunasvg.h +- DESTINATION ${LUNASVG_INCDIR} ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + ) + + install(TARGETS lunasvg +- LIBRARY DESTINATION ${LUNASVG_LIBDIR} +- ARCHIVE DESTINATION ${LUNASVG_LIBDIR} +- INCLUDES DESTINATION ${LUNASVG_INCDIR} ++ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) diff --git a/recipes/lunasvg/config.yml b/recipes/lunasvg/config.yml index b01edffe69a57..71b261d0fe250 100644 --- a/recipes/lunasvg/config.yml +++ b/recipes/lunasvg/config.yml @@ -1,4 +1,6 @@ versions: + "2.4.1": + folder: all "2.4.0": folder: all "2.3.9":