Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lunasvg: add version 2.3.9 #21883

Merged
merged 3 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions recipes/lunasvg/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.3.9":
url: "https://github.com/sammycage/lunasvg/archive/v2.3.9.tar.gz"
sha256: "088bc9fd1191a004552c65bdcc260989b83da441b0bdaa965e79d984feba88fa"
"2.3.8":
url: "https://github.com/sammycage/lunasvg/archive/v2.3.8.tar.gz"
sha256: "54d697e271a5aca36f9999d546b1b346e98a8183140027330f69a3eb0c184194"
Expand All @@ -15,6 +18,13 @@ sources:
url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz"
sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25"
patches:
"2.3.9":
- patch_file: "patches/2.3.9-0001-fix-cmake.patch"
patch_description: "use external plutovg and fix installation path for conan"
patch_type: "conan"
- patch_file: "patches/2.3.9-0002-rename-inner-selector.patch"
patch_description: "rename inner selector to subselector"
patch_type: "portability"
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
"2.3.8":
- patch_file: "patches/2.3.5-0001-fix-cmake.patch"
patch_description: "use external plutovg and fix installation path for conan"
Expand Down
19 changes: 10 additions & 9 deletions recipes/lunasvg/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.microsoft import check_min_vs, is_msvc

Check warning on line 3 in recipes/lunasvg/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused check_min_vs imported from conan.tools.microsoft

Check warning on line 3 in recipes/lunasvg/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused is_msvc imported from conan.tools.microsoft
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
Expand Down Expand Up @@ -31,28 +31,29 @@
@property
def _min_cppstd(self):
if Version(self.version) <= "2.3.2":
return 14
else:
return 17
return "14"
if Version(self.version) <= "2.3.8":
return "17"
return "11"

@property
def _compilers_minimum_version(self):
if self._min_cppstd == 14:
return {
return {
"14": {
"gcc": "5",
"clang": "3.5",
"apple-clang": "10",
"Visual Studio": "15",
"msvc": "191",
}
else:
return {
},
"17": {
"gcc": "7.1",
"clang": "7",
"apple-clang": "12.0",
"Visual Studio": "16",
"msvc": "192",
}
},
}.get(self._min_cppstd, {})

def export_sources(self):
export_conandata_patches(self)
Expand Down
38 changes: 38 additions & 0 deletions recipes/lunasvg/all/patches/2.3.9-0001-fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bed8895..4698501 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)
if(BUILD_SHARED_LIBS)
target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED)
target_compile_definitions(lunasvg PRIVATE LUNASVG_EXPORT)
@@ -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}"
)
26 changes: 26 additions & 0 deletions recipes/lunasvg/all/patches/2.3.9-0002-rename-inner-selector.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/source/parser.cpp b/source/parser.cpp
index 714228b..3ade738 100644
--- a/source/parser.cpp
+++ b/source/parser.cpp
@@ -1226,8 +1226,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con
return element->parent == nullptr;

if(selector.type == PseudoClassSelector::Type::Is) {
- for(auto& selector : selector.subSelectors) {
- for(auto& sel : selector) {
+ for(auto& subselector : selector.subSelectors) {
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
+ for(auto& sel : subselector) {
if(!matchSimpleSelector(sel, element)) {
return false;
}
@@ -1238,8 +1238,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con
}

if(selector.type == PseudoClassSelector::Type::Not) {
- for(auto& selector : selector.subSelectors) {
- for(auto& sel : selector) {
+ for(auto& subselector : selector.subSelectors) {
+ for(auto& sel : subselector) {
if(matchSimpleSelector(sel, element)) {
return false;
}
4 changes: 3 additions & 1 deletion recipes/lunasvg/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg)
if (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.2")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
else()
elseif (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.8")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
endif()
2 changes: 2 additions & 0 deletions recipes/lunasvg/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"2.3.9":
folder: all
"2.3.8":
folder: all
"2.3.5":
Expand Down