From f837475dca73686b8d0fe0b00ca786e42c639459 Mon Sep 17 00:00:00 2001 From: toge Date: Sun, 25 Aug 2024 03:25:05 +0900 Subject: [PATCH 1/3] lunasvg: add version 2.4.1 --- recipes/lunasvg/all/conandata.yml | 7 ++++ .../all/patches/2.4.1-0001-fix-cmake.patch | 38 +++++++++++++++++++ recipes/lunasvg/config.yml | 2 + 3 files changed, 47 insertions(+) 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/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": From 566c458b887742abf44d734ecd18412048532726 Mon Sep 17 00:00:00 2001 From: toge Date: Fri, 6 Sep 2024 00:51:36 +0900 Subject: [PATCH 2/3] support msvc shared build --- recipes/lunasvg/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index e2d264c8bbac5..506e7a96fe3bc 100644 --- a/recipes/lunasvg/all/conanfile.py +++ b/recipes/lunasvg/all/conanfile.py @@ -90,7 +90,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 +112,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"] From d53cd498c4936010bebb06f52dc9a464eef25fb4 Mon Sep 17 00:00:00 2001 From: Ernesto de Gracia Herranz Date: Fri, 6 Sep 2024 12:47:36 +0200 Subject: [PATCH 3/3] remove unused methods --- recipes/lunasvg/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/lunasvg/all/conanfile.py b/recipes/lunasvg/all/conanfile.py index 506e7a96fe3bc..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