Skip to content

Commit 582fdad

Browse files
authored
(#21883) lunasvg: add version 2.3.9
* lunasvg: add version 2.3.9 * support gcc 5 * add patch_source
1 parent 2732a31 commit 582fdad

File tree

6 files changed

+90
-10
lines changed

6 files changed

+90
-10
lines changed

recipes/lunasvg/all/conandata.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
sources:
2+
"2.3.9":
3+
url: "https://github.com/sammycage/lunasvg/archive/v2.3.9.tar.gz"
4+
sha256: "088bc9fd1191a004552c65bdcc260989b83da441b0bdaa965e79d984feba88fa"
25
"2.3.8":
36
url: "https://github.com/sammycage/lunasvg/archive/v2.3.8.tar.gz"
47
sha256: "54d697e271a5aca36f9999d546b1b346e98a8183140027330f69a3eb0c184194"
@@ -15,6 +18,14 @@ sources:
1518
url: "https://github.com/sammycage/lunasvg/archive/refs/tags/v2.3.1.tar.gz"
1619
sha256: "6492bf0f51982f5382f83f1a42f247bb1bbcbaef4a15963bbd53073cd4944a25"
1720
patches:
21+
"2.3.9":
22+
- patch_file: "patches/2.3.9-0001-fix-cmake.patch"
23+
patch_description: "use external plutovg and fix installation path for conan"
24+
patch_type: "conan"
25+
- patch_file: "patches/2.3.9-0002-rename-inner-selector.patch"
26+
patch_description: "rename inner selector to subselector"
27+
patch_type: "portability"
28+
patch_source: "https://github.com/sammycage/lunasvg/pull/147"
1829
"2.3.8":
1930
- patch_file: "patches/2.3.5-0001-fix-cmake.patch"
2031
patch_description: "use external plutovg and fix installation path for conan"

recipes/lunasvg/all/conanfile.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,29 @@ class LunaSVGConan(ConanFile):
3131
@property
3232
def _min_cppstd(self):
3333
if Version(self.version) <= "2.3.2":
34-
return 14
35-
else:
36-
return 17
34+
return "14"
35+
if Version(self.version) <= "2.3.8":
36+
return "17"
37+
return "11"
3738

3839
@property
3940
def _compilers_minimum_version(self):
40-
if self._min_cppstd == 14:
41-
return {
41+
return {
42+
"14": {
4243
"gcc": "5",
4344
"clang": "3.5",
4445
"apple-clang": "10",
4546
"Visual Studio": "15",
4647
"msvc": "191",
47-
}
48-
else:
49-
return {
48+
},
49+
"17": {
5050
"gcc": "7.1",
5151
"clang": "7",
5252
"apple-clang": "12.0",
5353
"Visual Studio": "16",
5454
"msvc": "192",
55-
}
55+
},
56+
}.get(self._min_cppstd, {})
5657

5758
def export_sources(self):
5859
export_conandata_patches(self)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index bed8895..4698501 100755
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -12,8 +12,8 @@ add_library(lunasvg)
6+
7+
add_subdirectory(include)
8+
add_subdirectory(source)
9+
-add_subdirectory(3rdparty/plutovg)
10+
-
11+
+find_package(plutovg CONFIG REQUIRED)
12+
+target_link_libraries(lunasvg plutovg::plutovg)
13+
if(BUILD_SHARED_LIBS)
14+
target_compile_definitions(lunasvg PUBLIC LUNASVG_SHARED)
15+
target_compile_definitions(lunasvg PRIVATE LUNASVG_EXPORT)
16+
@@ -25,16 +25,16 @@ if(LUNASVG_BUILD_EXAMPLES)
17+
target_include_directories(svg2png PRIVATE 3rdparty/stb)
18+
endif()
19+
20+
-set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
21+
-set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include)
22+
+#set(LUNASVG_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
23+
+#set(LUNASVG_INCDIR ${CMAKE_INSTALL_PREFIX}/include)
24+
25+
install(FILES
26+
include/lunasvg.h
27+
- DESTINATION ${LUNASVG_INCDIR}
28+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
29+
)
30+
31+
install(TARGETS lunasvg
32+
- LIBRARY DESTINATION ${LUNASVG_LIBDIR}
33+
- ARCHIVE DESTINATION ${LUNASVG_LIBDIR}
34+
- INCLUDES DESTINATION ${LUNASVG_INCDIR}
35+
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
36+
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
37+
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
38+
)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/source/parser.cpp b/source/parser.cpp
2+
index 714228b..3ade738 100644
3+
--- a/source/parser.cpp
4+
+++ b/source/parser.cpp
5+
@@ -1226,8 +1226,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con
6+
return element->parent == nullptr;
7+
8+
if(selector.type == PseudoClassSelector::Type::Is) {
9+
- for(auto& selector : selector.subSelectors) {
10+
- for(auto& sel : selector) {
11+
+ for(auto& subselector : selector.subSelectors) {
12+
+ for(auto& sel : subselector) {
13+
if(!matchSimpleSelector(sel, element)) {
14+
return false;
15+
}
16+
@@ -1238,8 +1238,8 @@ bool RuleData::matchPseudoClassSelector(const PseudoClassSelector& selector, con
17+
}
18+
19+
if(selector.type == PseudoClassSelector::Type::Not) {
20+
- for(auto& selector : selector.subSelectors) {
21+
- for(auto& sel : selector) {
22+
+ for(auto& subselector : selector.subSelectors) {
23+
+ for(auto& sel : subselector) {
24+
if(matchSimpleSelector(sel, element)) {
25+
return false;
26+
}

recipes/lunasvg/all/test_package/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ add_executable(${PROJECT_NAME} test_package.cpp)
77
target_link_libraries(${PROJECT_NAME} PRIVATE lunasvg::lunasvg)
88
if (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.2")
99
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_14)
10-
else()
10+
elseif (lunasvg_VERSION VERSION_LESS_EQUAL "2.3.8")
1111
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
12+
else()
13+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
1214
endif()

recipes/lunasvg/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
versions:
2+
"2.3.9":
3+
folder: all
24
"2.3.8":
35
folder: all
46
"2.3.5":

0 commit comments

Comments
 (0)