Skip to content
Permalink
Browse files

dvisvgm: add patch from upstream to fix changed liquid-dsp API usage

rev-bump just in case

Closes: https://trac.macports.org/ticket/58347
  • Loading branch information
michaelld committed Apr 18, 2019
1 parent 76f726b commit 385eb361f7436ed9685832c59ed140e28c56e264
Showing with 128 additions and 1 deletion.
  1. +6 −1 graphics/dvisvgm/Portfile
  2. +122 −0 graphics/dvisvgm/files/patch-fix-make_array.diff
@@ -8,7 +8,7 @@ github.setup mgieseki dvisvgm 2.7
checksums rmd160 8ab80a1b75679bacd4926a0155ee205b322c1b88 \
sha256 c8276b5780f5a9aee6ab475449bcb7fd4e27b780f4e5525902238a5b88c3edf7 \
size 3037242
revision 0
revision 1

categories graphics textproc
platforms darwin
@@ -35,6 +35,11 @@ depends_lib port:brotli \
# but the dependency is bundled with the sources & taken from there
# port:xxhash

# temporary patch to move some c++14 features back to c++11 or
# earlier. This patch comes from upstream.
patchfiles-append patch-fix-make_array.diff
patch.pre_args -p1

# prevent opportunistic dependency on gawk
configure.env-append \
AWK=/usr/bin/awk
@@ -0,0 +1,122 @@
# HG changeset patch
# User Martin Gieseking <martin.gieseking@uos.de>
# Date 1555578878 -7200
# Thu Apr 18 11:14:38 2019 +0200
# Node ID 4fa1e45d2e2a5b50e385244813b3b8a34629a1f5
# Parent 736ab658460f07a5019a7cf049465ac1e14a3a2c
removed util::make_array() due to compatibility issues

diff --git a/src/optimizer/AttributeExtractor.cpp b/src/optimizer/AttributeExtractor.cpp
--- a/src/optimizer/AttributeExtractor.cpp
+++ b/src/optimizer/AttributeExtractor.cpp
@@ -113,14 +113,14 @@
* @return true if the element is groupable */
bool AttributeExtractor::groupable (const XMLElement &elem) {
// https://www.w3.org/TR/SVG/struct.html#GElement
- static constexpr auto names = util::make_array(
+ static const char *names[] = {
"a", "altGlyphDef", "animate", "animateColor", "animateMotion", "animateTransform",
"circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "filter",
"font", "font-face", "foreignObject", "g", "image", "line", "linearGradient", "marker",
"mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "set",
"style", "switch", "symbol", "text", "title", "use", "view"
- );
- return binary_search(names.begin(), names.end(), elem.name(), [](const string &name1, const string &name2) {
+ };
+ return binary_search(begin(names), end(names), elem.name(), [](const string &name1, const string &name2) {
return name1 < name2;
});
}
@@ -136,15 +136,15 @@
// clip-path is not inheritable but can be moved to the parent element as long as
// no child gets an different clip-path attribute
// https://www.w3.org/TR/SVG11/styling.html#Inheritance
- static constexpr auto names = util::make_array(
+ static const char *names[] = {
"clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile",
"color-rendering", "direction", "fill", "fill-opacity", "fill-rule", "font", "font-family", "font-size",
"font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "glyph-orientation-horizontal",
"glyph-orientation-vertical", "letter-spacing", "paint-order", "stroke", "stroke-dasharray", "stroke-dashoffset",
"stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "transform",
"visibility", "word-spacing", "writing-mode"
- );
- return binary_search(names.begin(), names.end(), attrib.name, [](const string &name1, const string &name2) {
+ };
+ return binary_search(begin(names), end(names), attrib.name, [](const string &name1, const string &name2) {
return name1 < name2;
});
}
@@ -159,13 +159,13 @@
// the 'fill' attribute of animation elements has different semantics than
// that of graphics elements => don't extract it from animation nodes
// https://www.w3.org/TR/SVG11/animate.html#TimingAttributes
- static constexpr auto names = util::make_array(
+ static const char *names[] = {
"animate", "animateColor", "animateMotion", "animateTransform", "set"
- );
- auto it = find_if(names.begin(), names.end(), [&](const string &name) {
+ };
+ auto it = find_if(begin(names), end(names), [&](const string &name) {
return element.name() == name;
});
- return it == names.end();
+ return it == end(names);
}


diff --git a/src/optimizer/GroupCollapser.cpp b/src/optimizer/GroupCollapser.cpp
--- a/src/optimizer/GroupCollapser.cpp
+++ b/src/optimizer/GroupCollapser.cpp
@@ -132,13 +132,13 @@
bool GroupCollapser::collapsible (const XMLElement &element) {
// the 'fill' attribute of animation elements has different semantics than
// that of graphics elements => don't collapse them
- static constexpr auto names = util::make_array(
+ static const char *names[] = {
"animate", "animateColor", "animateMotion", "animateTransform", "set"
- );
- auto it = find_if(names.begin(), names.end(), [&](const string &name) {
+ };
+ auto it = find_if(begin(names), end(names), [&](const string &name) {
return element.name() == name;
});
- return it == names.end();
+ return it == end(names);
}


@@ -155,11 +155,11 @@
}
}
// these attributes prevent a group from being unwrapped
- static constexpr auto attribs = util::make_array(
+ static const char *attribs[] = {
"class", "id", "filter", "mask", "style"
- );
- auto it = find_if(attribs.begin(), attribs.end(), [&](const string &name) {
+ };
+ auto it = find_if(begin(attribs), end(attribs), [&](const string &name) {
return source.hasAttribute(name) || dest.hasAttribute(name);
});
- return it == attribs.end();
+ return it == end(attribs);
}
diff --git a/src/utility.hpp b/src/utility.hpp
--- a/src/utility.hpp
+++ b/src/utility.hpp
@@ -103,15 +103,6 @@
return std::unique_ptr<T>{static_cast<T*>(old.release())};
}

-
-template <typename... T>
-constexpr auto make_array (T&&... values) ->
- std::array<typename std::decay<typename std::common_type<T...>::type>::type, sizeof...(T)> {
- return std::array<typename std::decay<typename std::common_type<T...>::type>::type, sizeof...(T)>{
- std::forward<T>(values)...
- };
- }
-
} // namespace util

#endif

0 comments on commit 385eb36

Please sign in to comment.
You can’t perform that action at this time.