commit: f740ee8ee532576e98c44b1824b14387eea77184 Author: Markus Meier <maekke <AT> gentoo <DOT> org> AuthorDate: Fri Jan 2 18:31:24 2015 +0000 Commit: Markus Meier <maekke <AT> gentoo <DOT> org> CommitDate: Fri Jan 2 18:31:24 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=dev/maekke.git;a=commit;h=f740ee8e
fix building with dev-libs/boost-1.56, bug #525400 Package-Manager: portage-2.2.15 Manifest-Sign-Key: 072AD062 --- media-gfx/hugin/Manifest | 11 +- .../hugin/files/hugin-2014.0.0-ParseExp.patch | 527 +++++++++++++++++++++ media-gfx/hugin/hugin-2014.0.0-r1.ebuild | 5 +- media-gfx/hugin/hugin-2014.0.0.ebuild | 5 +- 4 files changed, 541 insertions(+), 7 deletions(-) diff --git a/media-gfx/hugin/Manifest b/media-gfx/hugin/Manifest index 9441812..6be43ff 100644 --- a/media-gfx/hugin/Manifest +++ b/media-gfx/hugin/Manifest @@ -6,20 +6,21 @@ AUX hugin-2011.4.0-gcc47.patch 1243 SHA256 ff1e2f55eb94e22546c3185cde458f51a503f AUX hugin-2012.0.0-boost.patch 1690 SHA256 024354bf8c6fea9cc113f8645224eb8402c4406e310db5b72b27c2d6bd188182 SHA512 78dbeb9e2e0450f354ea2920a8081f34024a512db6a2536508401db622be5cce292661b244788eebec9fb03c89c5c3b17c5c8eef7c6a9bde31cca78e68de416b WHIRLPOOL 42452ac88ad1fc0dd2d7a94c5ea0c412c9742c1a255943242614bad1f459aed46de44ef281f3d443dd4377549bef3f4dfd86561e2ebbf14f42b8d508e3c1dc82 AUX hugin-2012.0.0-perl.patch 272 SHA256 2e21c6cbffe4d06a9a97787f22fbe6e6eff6130906c791d051cb7e1a6a05a92a SHA512 0f0e6d42012ae70ccf3ede51a24763f6e9cd6e46e7cc287c2a52b5b2753928dcda630568811a23d6cc5e836e11a9b3bec5202844a878e4ac58349ea379c7d9d8 WHIRLPOOL 82256829f4083bd043aa8105088a19bb0c04e7de9deb6802f33d1055f56663630437419a6b8830ff95a2904a9bc5ed74de1969aa45774723f650074db79bfcfb AUX hugin-2013.0.0-boost.patch 1690 SHA256 4a4e507546d344811f16390dcfc90f42d70807bc3ace8e7b1df3ceb9dea7cc30 SHA512 280d3555dc3774ccead2a962a8efd3a3942da296d6565185b9f84e79f03b9a6398e103357b80496b121fa07822fd1cfb9b580ef0c4da8fbaf6ddd7665d135cd7 WHIRLPOOL 60770064bb4fb292a4a12308ee4a004b6b114ada751cd713a2df061dc7670e0b0c7f39c50d3f6510f037a9e987a69f9e4aef645d6d9674dfc0306d4e155982fa +AUX hugin-2014.0.0-ParseExp.patch 16829 SHA256 d4c9b4770bcac21aaa476646c08654885829eb2c05f03943e07f4c92d134d633 SHA512 8058e693c2bc0e80483d716dc033784828cf8c34c59c2108b9cccffb65ca818f4107b9af8d9acc1a82abb65e3498e69ec39708d2a359c99d14b286ed39e02cf4 WHIRLPOOL a2e498485b620d9cbece1e3a91215b95f2c08614b52cd3bca138f5b4050766df31abd608299288244c336023fb6d0a8830737fbf0d3cd5d2b2eb2a83f931678b AUX hugin-2014.0.0-lensfun-0.3.0.patch 612 SHA256 d4099a2ebc2203bd23807823c0370364bf65faba1ec5ebc596053fda3e6333db SHA512 3fbea4e1c123bfd797514703a32311e5fa19bae1f531f5e81e9cbc4e72a5c4547c3e707709c8c7e3589f6b591c277c0f99600d4ca0d69b4676990e471040f485 WHIRLPOOL 63841447a3f7ef940b9b4e660097e5ff2df3fc2e66568bba8ef605e28a1fe00c235ecf057644a887216a0da2f8cf936c2aac006fab934868284f2f896ad9966f DIST hugin-2012.0.0.tar.bz2 11658665 SHA256 63dfd88ac90d3af4b958111db951bb7fbf2c66ad6b0246e6305403eb5de971b3 SHA512 acf97d383091eca300074a8e207ec5500a8b96a5116708a6ff23fb8f5359a77016867ee2ae21a4e40c4d07d056b5c27844c03c275ec29c0b604ecb31b73ee0a8 WHIRLPOOL d058639202aef1f6beb475bc8c170ac4269bf5050bfcbc48678ddde67188e12eb29c216b6ce8f79571c91ff43e271dac706bd4f432d3f640d549f87b371caa43 DIST hugin-2013.0.0.tar.bz2 11247583 SHA256 484e1ed58fa6fe4bae1f423967101549345bcca2653b992afbc0ed9ec0dbebd5 SHA512 dea1682c16991441278a881e5e0916ffdbe8e0012f0dcf45875ee97fe7dc698d4d98037916e63c9a651557adc45c89e4e350ad976fec020562bc17a31f608a86 WHIRLPOOL c3d8e175ff23c8761815406039a8027da327925f07a18b00bde4d457228a2562f30f5df3fb5dff17f8003f985d7b51ec39d557a064c7e228b09ff73473c41e6a DIST hugin-2014.0.0.tar.bz2 10974274 SHA256 f098aa0ede44010d3bb2bb38693177533fd776c45063a338c4c483d7e471ec29 SHA512 f4dd7a59f96d4574d420691d221265309d1ff18b7df04df2c2f0946f3d669e78823e2a53f038ac7bddaaf2037e21c45bf54f19d2a90ce9d5d95a836331e34ca5 WHIRLPOOL e8915454fcc5d54037289b0e91b8c441288706874891b72541414cad83556f6587d15d18be38405917da6c69b590121bc74a2ffa130bb9f1abea223c6fb1375d EBUILD hugin-2012.0.0.ebuild 1649 SHA256 263d0a369e9c552afdb170e11e1e2965106f3d97d5d8cbdc771c14c578ce4e43 SHA512 ce0c63b945690dcbe2d0bac11a87073127505d0bf15809ac95f99c04399e211eb132d51e7c8de82909225651e8f01f5be66fd640131360f2568187af5f476855 WHIRLPOOL df1ce0cb4f1728145a3ba69608dbc03f2373d97976052bfec37a9bc9353a4f184a8cc2476471f3153ed786dbd98267ca6eca10c1077f00997defaf284892f54d EBUILD hugin-2013.0.0-r1.ebuild 2035 SHA256 1e6dc81a4fa7cda22bfd3181587588e22be6f8269fbe3328f0419d8718ba5c6e SHA512 a69d73c96eef15fc1ceea490c6a7014f44f08fc6845c0679e4b6656e171ac4f5d78636aaa746fd46e96abc3f0228ca6f7458115080d9c6e2dfb6a2a2845bedf8 WHIRLPOOL 79a39aca4bec1406bf066e3e70bde7c11e18384de2a13c16793b232435676773db2f6ad0b6eca73a0e213c56fb22f3e548470874ab46aef6822b74d9d07d7811 -EBUILD hugin-2014.0.0-r1.ebuild 2060 SHA256 40940f37d48d0468dd372a82ed10219fbfe2ae920afc0c5366f4341b7c8f684e SHA512 c03a9ad8dafc5682417433519b3c6f0067b478414727de19c6443ca4a0e5086bbea6da5e7e36c7c7ae0c111bde5510ee4952a782704be025be407065f82cb688 WHIRLPOOL eeb7d1e0ada2b7e75d3515a2eb626f91b02074a3c9d9f66e36dbc28bf72230d991e29103d1e5e79f43ab359b8bdddd375c1627945827ac921709bf6579290723 -EBUILD hugin-2014.0.0.ebuild 2063 SHA256 38fc3ee06e20de44394423a65d194fec9c30a5eb1d320f2dfa22e6d4aa00a858 SHA512 e7d92f001d79bda595f550f84caf84e6bf79e8267142b30c505d253eb5327d58f7302fb79b00ac9fecd8e7abba5503cac40f88473aeba2ea55cb2bd1f6afd4dd WHIRLPOOL c1deb0032c37b5a11ca324c8d5b11f27c60a36bafd059cfa84e23de5b9f605ae2ae6185086b029614cc8d7ac5aa57bff239763feb04eb12cc961dc33c9674190 +EBUILD hugin-2014.0.0-r1.ebuild 2096 SHA256 7ffd51acefe25d17e44c5df9d56bc74045b118e2c07a43a3ea48875aec6b9dfc SHA512 33048905f4db1bb0a67334b60ab50b7d8bf926ace7e67374f02f250f4a232999f09a7c0b82fda9bad5065f4bec963a37c02b863758ffc539e42b4e3059eb3c6e WHIRLPOOL bc555f22030f7377fcf85d649904a6c634b8f0d8f1c1322572c9ac3e56683d9454ed9b66da9aca189dc6789e8182c7c539551146625b964a4b76ec8b3b9a4fb1 +EBUILD hugin-2014.0.0.ebuild 2099 SHA256 8e9dd0277346f198b0cac3fc1dda21db341c662ad67c00128f270bf327cb71e7 SHA512 565610edddfd4031b964803951d5d254d82e00a9d8c8d4958bedf52889a2617a6dffebbaef2057b40ca7b70222c75ae66c510df7f0118bd06844a3532124653d WHIRLPOOL d53da4f8669b3179f65bd463babd44b7e31692d0d38a61c126c293c7f24923715616fceedaf6c7130dda141156b90e2a04ed4110759c3071b99ae4270e9137a0 EBUILD hugin-9999.ebuild 2033 SHA256 4ecb687517f373ffe547edee0dba76948d19b434a08b1298c8708bb2c79ba1dc SHA512 be3f2fdb1ad69ab8197b82be34e9061431381c1581bbaecb6092ff1da8ba44d2fa5eebec08c222676e150bc10627ca440ce74bff4b1a2dbfd34c427bd4199d3e WHIRLPOOL aa82437f1b2cdcb3d50fe1c6712a51a63033da2a34343ad08dd0de957dc0b6b980622dd00e510a639cc6e892a272c0788aa02e1daed93232a71167cff2eece1f MISC metadata.xml 395 SHA256 1e88681d08863b52f3ae17f149901c3d84b6c6197913f7538d17572b33adbf9b SHA512 52848e953af2d3a398f9309a8af40261df0bb78365a3065f805ad06fbc40bea2a44b23ca70aa898b7dbb39a1c2e1309f036762de81d66824bdea09f767039a21 WHIRLPOOL dbdfadbbd20f6acd3961b786bb7bc5e57fd8fd954373cf4a645a008ddaf9273406072cc5ab1497ca1bdefbb77834996d8210c4d9f8cf1a716a7a788b29431684 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iEYEAREIAAYFAlSmy74ACgkQkKaRLQcq0GLKmgCgi9vrXeNL3b5xqlDqjREPIh3g -hXEAoKadz06RU+ipFGg8i5Q922J5Boq/ -=Lp5C +iEYEAREIAAYFAlSm4/wACgkQkKaRLQcq0GIGPgCcCuWDu1KaQNrgRv7h66eieKjr +HnMAnjCynW5ixznFnCjY3z/TvMpIYqGQ +=byVF -----END PGP SIGNATURE----- diff --git a/media-gfx/hugin/files/hugin-2014.0.0-ParseExp.patch b/media-gfx/hugin/files/hugin-2014.0.0-ParseExp.patch new file mode 100644 index 0000000..3ee0dee --- /dev/null +++ b/media-gfx/hugin/files/hugin-2014.0.0-ParseExp.patch @@ -0,0 +1,527 @@ +Contains revisions 6407:917d117ba6b0 6597:5b768c308932 6688:dde84e96b755 6689:e237d6d1d873 of ParseExp.cpp/h + +diff -r 917d117ba6b0 -r e237d6d1d873 src/tools/ParseExp.cpp +--- a/src/tools/ParseExp.cpp Sun Dec 15 18:20:14 2013 +0100 ++++ b/src/tools/ParseExp.cpp Sat Sep 13 11:22:39 2014 +0200 +@@ -1,262 +1,246 @@ +-// -*- c-basic-offset: 4 -*- +- +-/** @file ParseExp.cpp +- * +- * @brief functions to parse expressions from strings +- * +- * @author T. Modes +- * +- */ +- +-/* This program is free software; you can redistribute it and/or +- * modify it under the terms of the GNU General Public +- * License as published by the Free Software Foundation; either +- * version 2 of the License, or (at your option) any later version. +- * +- * This software is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * You should have received a copy of the GNU General Public +- * License along with this software; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- */ +- +-// implementation is based on blog at +-// http://agentzlerich.blogspot.de/2011/06/using-boost-spirit-21-to-evaluate.html +-// modified to Hugins need +-// added if statement +- +-#include "ParseExp.h" +- +-#include <limits> +-#include <iterator> +- +-#include <boost/spirit/version.hpp> +-#if !defined(SPIRIT_VERSION) || SPIRIT_VERSION < 0x2010 +-#error "At least Spirit version 2.1 required" +-#endif +-#include <boost/math/constants/constants.hpp> +-#include <boost/spirit/include/phoenix.hpp> +-#include <boost/spirit/include/qi.hpp> +- +-namespace Parser +-{ +- +-// helper classes to implement operators +- +-//power function +-struct lazy_pow_ +-{ +- template <typename X, typename Y> +- struct result { typedef X type; }; +- +- template <typename X, typename Y> +- X operator()(X x, Y y) const +- { +- return std::pow(x, y); +- } +-}; +- +-// modulus for double values +-struct lazy_mod_ +-{ +- template <typename X, typename Y> +- struct result { typedef X type; }; +- +- template <typename X, typename Y> +- X operator()(X x, Y y) const +- { +- return std::fmod(x,y); +- } +-}; +- +-// if statement +-struct lazy_if_ +-{ +- template <typename X, typename Y, typename Z> +- struct result { typedef Y type; }; +- +- template <typename X, typename Y, typename Z> +- X operator()(X x, Y y, Z z) const +- { +- return x ? y : z; +- } +-}; +- +-// wrapper for unary function +-struct lazy_ufunc_ +-{ +- template <typename F, typename A1> +- struct result { typedef A1 type; }; +- +- template <typename F, typename A1> +- A1 operator()(F f, A1 a1) const +- { +- return f(a1); +- } +-}; +- +-// convert rad into deg +-double deg(const double d) +-{ +- return d*180.0/boost::math::constants::pi<double>(); +-}; +- +-// convert deg into rad +-double rad(const double d) +-{ +- return d*boost::math::constants::pi<double>()/180; +-}; +- +-// the main grammar class +-struct grammar:boost::spirit::qi::grammar<std::string::const_iterator, double(), boost::spirit::ascii::space_type> +-{ +- +- // symbol table for constants like "pi", e.g. image number and value +- struct constant_ : boost::spirit::qi::symbols<char, double> +- { +- constant_(const ConstantMap constMap) +- { +- this->add("pi", boost::math::constants::pi<double>()); +- if(constMap.size()>0) +- { +- for(ConstantMap::const_iterator it=constMap.begin(); it!=constMap.end(); it++) +- { +- this->add(it->first, it->second); +- }; +- }; +- }; +- }; +- +- // symbol table for unary functions like "abs" +- struct ufunc_ : boost::spirit::qi::symbols<char, double(*)(double) > +- { +- ufunc_() +- { +- this->add +- ("abs" , (double (*)(double)) std::abs ) +- ("acos" , (double (*)(double)) std::acos ) +- ("asin" , (double (*)(double)) std::asin ) +- ("atan" , (double (*)(double)) std::atan ) +- ("ceil" , (double (*)(double)) std::ceil ) +- ("sin" , (double (*)(double)) std::sin ) +- ("cos" , (double (*)(double)) std::cos ) +- ("tan" , (double (*)(double)) std::tan ) +- ("exp" , (double (*)(double)) std::exp ) +- ("floor" , (double (*)(double)) std::floor) +- ("sqrt" , (double (*)(double)) std::sqrt ) +- ("deg" , (double (*)(double)) deg ) +- ("rad" , (double (*)(double)) rad ) +- ; +- } +- } ufunc; +- +- boost::spirit::qi::rule<std::string::const_iterator, double(), boost::spirit::ascii::space_type> expression, term, factor, primary, compExpression, compTerm, numExpression; +- +- grammar(const ConstantMap constMap) : grammar::base_type(expression) +- { +- using boost::spirit::qi::real_parser; +- using boost::spirit::qi::real_policies; +- real_parser<double,real_policies<double> > real; +- +- using boost::spirit::qi::_1; +- using boost::spirit::qi::_2; +- using boost::spirit::qi::_3; +- using boost::spirit::qi::no_case; +- using boost::spirit::qi::_val; +- struct constant_ constant(constMap); +- +- boost::phoenix::function<lazy_pow_> lazy_pow; +- boost::phoenix::function<lazy_mod_> lazy_mod; +- boost::phoenix::function<lazy_if_> lazy_if; +- boost::phoenix::function<lazy_ufunc_> lazy_ufunc; +- +- expression = +- (compExpression >> '\?' >> compExpression >> ':' >> compExpression) [_val = lazy_if(_1, _2, _3)] +- | compExpression [_val=_1] +- ; +- +- compExpression= +- compTerm [_val=_1] +- >> * ( ("&&" >> compTerm [_val = _val && _1] ) +- |("||" >> compTerm [_val = _val || _1] ) +- ) +- ; +- +- compTerm = +- numExpression [_val = _1 ] +- >>*( ( '<' >> numExpression [_val = _val < _1]) +- |( '>' >> numExpression [_val = _val > _1]) +- |( "<=" >> numExpression [_val = _val <= _1]) +- |( ">=" >> numExpression [_val = _val >= _1]) +- |( "==" >> numExpression [_val = _val == _1]) +- |( "!=" >> numExpression [_val = _val != _1]) +- ) +- ; +- +- numExpression = +- term [_val = _1] +- >> *( ('+' >> term [_val += _1]) +- | ('-' >> term [_val -= _1]) +- ) +- ; +- +- term = +- factor [_val = _1] +- >> *( ('*' >> factor [_val *= _1]) +- | ('/' >> factor [_val /= _1]) +- | ('%' >> factor [_val = lazy_mod(_val, _1)]) +- ) +- ; +- +- factor = +- primary [_val = _1] +- >> *( ('^' >> factor [_val = lazy_pow(_val, _1)]) ) +- ; +- +- primary = +- real [_val = _1] +- | '(' >> expression [_val = _1] >> ')' +- | ('-' >> primary [_val = -_1]) +- | ('+' >> primary [_val = _1]) +- | no_case[constant] [_val = _1] +- | (no_case[ufunc] >> '(' >> expression >> ')') [_val = lazy_ufunc(_1, _2) ] +- ; +- +- }; +-}; +- +-//template <typename ParserType, typename Iterator> +-bool parse(std::string::const_iterator &iter, +- std::string::const_iterator end, +- const grammar &g, +- double& result) +-{ +- if(!boost::spirit::qi::phrase_parse(iter, end, g, boost::spirit::ascii::space, result)) +- { +- return false; +- }; +- // we check if the full string could parsed +- return iter==end; +-} +- +-// the function which exposes the interface to external +-// version without pre-defined constants +-bool ParseExpression(const std::string& expression, double& result) +-{ +- ConstantMap constants; +- return ParseExpression(expression, result, constants); +-}; +- +-// version with pre-defined constants +-bool ParseExpression(const std::string& expression, double& result, const ConstantMap& constants) +-{ +- grammar g(constants); +- std::string::const_iterator it=expression.begin(); +- return parse(it, expression.end(), g, result); +-}; +- +-} // namespace ++// -*- c-basic-offset: 4 -*- ++ ++/** @file ParseExp.cpp ++ * ++ * @brief functions to parse expressions from strings ++ * ++ * @author T. Modes ++ * ++ */ ++ ++/* This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This software is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public ++ * License along with this software; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ */ ++ ++// implementation is based on blog at ++// http://agentzlerich.blogspot.de/2011/06/using-boost-spirit-21-to-evaluate.html ++// modified to Hugins need ++// added if statement ++ ++#include "ParseExp.h" ++ ++#include <limits> ++#include <iterator> ++ ++#define BOOST_SPIRIT_USE_PHOENIX_V3 1 ++#include <boost/spirit/version.hpp> ++#if !defined(SPIRIT_VERSION) || SPIRIT_VERSION < 0x2010 ++#error "At least Spirit version 2.1 required" ++#endif ++#include <boost/math/constants/constants.hpp> ++#include <boost/spirit/include/phoenix.hpp> ++#include <boost/spirit/include/qi.hpp> ++ ++namespace Parser ++{ ++ ++// helper classes to implement operators ++ ++//power function ++struct lazy_pow_ ++{ ++ typedef double result_type; ++ ++ double operator()(double x, double y) const ++ { ++ return std::pow(x, y); ++ } ++}; ++ ++// modulus for double values ++struct lazy_mod_ ++{ ++ typedef double result_type; ++ ++ double operator()(double x, double y) const ++ { ++ return std::fmod(x,y); ++ } ++}; ++ ++// if statement ++struct lazy_if_ ++{ ++ typedef double result_type; ++ ++ double operator()(double x, double y, double z) const ++ { ++ return (std::fabs(x)>1e-5) ? y : z; ++ } ++}; ++ ++// wrapper for unary function ++struct lazy_ufunc_ ++{ ++ typedef double result_type; ++ ++ double operator()(double (*f)(double), double a1) const ++ { ++ return f(a1); ++ } ++}; ++ ++// convert rad into deg ++const double deg(const double d) ++{ ++ return d*180.0/boost::math::constants::pi<double>(); ++}; ++ ++// convert deg into rad ++const double rad(const double d) ++{ ++ return d*boost::math::constants::pi<double>()/180; ++}; ++ ++// the main grammar class ++struct grammar:boost::spirit::qi::grammar<std::string::const_iterator, double(), boost::spirit::ascii::space_type> ++{ ++ ++ // symbol table for constants like "pi", e.g. image number and value ++ struct constant_ : boost::spirit::qi::symbols<char, double> ++ { ++ constant_(const ConstantMap constMap) ++ { ++ this->add("pi", boost::math::constants::pi<double>()); ++ if (constMap.size()>0) ++ { ++ for (ConstantMap::const_iterator it = constMap.begin(); it != constMap.end(); it++) ++ { ++ this->add(it->first, it->second); ++ }; ++ }; ++ }; ++ }; ++ ++ // symbol table for unary functions like "abs" ++ struct ufunc_ : boost::spirit::qi::symbols<char, double(*)(double) > ++ { ++ ufunc_() ++ { ++ this->add ++ ("abs", (double(*)(double)) std::abs) ++ ("acos", (double(*)(double)) std::acos) ++ ("asin", (double(*)(double)) std::asin) ++ ("atan", (double(*)(double)) std::atan) ++ ("ceil", (double(*)(double)) std::ceil) ++ ("sin", (double(*)(double)) std::sin) ++ ("cos", (double(*)(double)) std::cos) ++ ("tan", (double(*)(double)) std::tan) ++ ("exp", (double(*)(double)) std::exp) ++ ("floor", (double(*)(double)) std::floor) ++ ("sqrt", (double(*)(double)) std::sqrt) ++ ("deg", (double(*)(double)) deg) ++ ("rad", (double(*)(double)) rad) ++ ; ++ } ++ } ufunc; ++ ++ boost::spirit::qi::rule<std::string::const_iterator, double(), boost::spirit::ascii::space_type> expression, term, factor, primary, compExpression, compTerm, numExpression; ++ ++ grammar(const ConstantMap constMap) : grammar::base_type(expression) ++ { ++ using boost::spirit::qi::real_parser; ++ using boost::spirit::qi::real_policies; ++ real_parser<double, real_policies<double> > real; ++ ++ using boost::spirit::qi::_1; ++ using boost::spirit::qi::_2; ++ using boost::spirit::qi::_3; ++ using boost::spirit::qi::no_case; ++ using boost::spirit::qi::_val; ++ struct constant_ constant(constMap); ++ ++ boost::phoenix::function<lazy_pow_> lazy_pow; ++ boost::phoenix::function<lazy_mod_> lazy_mod; ++ boost::phoenix::function<lazy_if_> lazy_if; ++ boost::phoenix::function<lazy_ufunc_> lazy_ufunc; ++ ++ expression = ++ (compExpression >> '\?' >> compExpression >> ':' >> compExpression)[_val = lazy_if(_1, _2, _3)] ++ | compExpression[_val = _1] ++ ; ++ ++ compExpression = ++ compTerm[_val = _1] ++ >> *(("&&" >> compTerm[_val = _val && _1]) ++ | ("||" >> compTerm[_val = _val || _1]) ++ ) ++ ; ++ ++ compTerm = ++ numExpression[_val = _1] ++ >> *(('<' >> numExpression[_val = _val < _1]) ++ | ('>' >> numExpression[_val = _val > _1]) ++ | ("<=" >> numExpression[_val = _val <= _1]) ++ | (">=" >> numExpression[_val = _val >= _1]) ++ | ("==" >> numExpression[_val = _val == _1]) ++ | ("!=" >> numExpression[_val = _val != _1]) ++ ) ++ ; ++ ++ numExpression = ++ term[_val = _1] ++ >> *(('+' >> term[_val += _1]) ++ | ('-' >> term[_val -= _1]) ++ ) ++ ; ++ ++ term = ++ factor[_val = _1] ++ >> *(('*' >> factor[_val *= _1]) ++ | ('/' >> factor[_val /= _1]) ++ | ('%' >> factor[_val = lazy_mod(_val, _1)]) ++ ) ++ ; ++ ++ factor = ++ primary[_val = _1] ++ >> *(('^' >> factor[_val = lazy_pow(_val, _1)])) ++ ; ++ ++ primary = ++ real[_val = _1] ++ | '(' >> expression[_val = _1] >> ')' ++ | ('-' >> primary[_val = -_1]) ++ | ('+' >> primary[_val = _1]) ++ | no_case[constant][_val = _1] ++ | (no_case[ufunc] >> '(' >> expression >> ')')[_val = lazy_ufunc(_1, _2)] ++ ; ++ ++ }; ++}; ++ ++bool parse(std::string::const_iterator& iter, ++ std::string::const_iterator end, ++ const grammar& g, ++ double& result) ++{ ++ if(!boost::spirit::qi::phrase_parse(iter, end, g, boost::spirit::ascii::space, result)) ++ { ++ return false; ++ }; ++ // we check if the full string could parsed ++ return iter==end; ++} ++ ++// version with pre-defined constants ++bool ParseExpression(const std::string& expression, double& result, const ConstantMap& constants) ++{ ++ grammar g(constants); ++ std::string::const_iterator it=expression.begin(); ++ return parse(it, expression.end(), g, result); ++}; ++ ++} // namespace +diff -r 917d117ba6b0 -r e237d6d1d873 src/tools/ParseExp.h +--- a/src/tools/ParseExp.h Sun Dec 15 18:20:14 2013 +0100 ++++ b/src/tools/ParseExp.h Sat Sep 13 11:22:39 2014 +0200 +@@ -33,8 +33,7 @@ + { + typedef std::map<const char*, double> ConstantMap; + +-bool ParseExpression(const std::string& expression, double& result); +-bool ParseExpression(const std::string& expression, double& result, const ConstantMap& constants); ++bool ParseExpression(const std::string& expression, double& result, const ConstantMap& constants=ConstantMap()); + + }; + diff --git a/media-gfx/hugin/hugin-2014.0.0-r1.ebuild b/media-gfx/hugin/hugin-2014.0.0-r1.ebuild index 284490e..8481afe 100644 --- a/media-gfx/hugin/hugin-2014.0.0-r1.ebuild +++ b/media-gfx/hugin/hugin-2014.0.0-r1.ebuild @@ -51,7 +51,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" S=${WORKDIR}/${PN}-$(get_version_component_range 1-3) -PATCHES=( "${FILESDIR}"/${P}-lensfun-0.3.0.patch ) +PATCHES=( + "${FILESDIR}"/${P}-lensfun-0.3.0.patch + "${FILESDIR}"/${P}-ParseExp.patch +) pkg_setup() { DOCS="authors.txt README TODO" diff --git a/media-gfx/hugin/hugin-2014.0.0.ebuild b/media-gfx/hugin/hugin-2014.0.0.ebuild index 527fd4e..05f7dff 100644 --- a/media-gfx/hugin/hugin-2014.0.0.ebuild +++ b/media-gfx/hugin/hugin-2014.0.0.ebuild @@ -51,7 +51,10 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" S=${WORKDIR}/${PN}-$(get_version_component_range 1-3) -PATCHES=( "${FILESDIR}"/${P}-lensfun-0.3.0.patch ) +PATCHES=( + "${FILESDIR}"/${P}-lensfun-0.3.0.patch + "${FILESDIR}"/${P}-ParseExp.patch +) pkg_setup() { DOCS="authors.txt README TODO"
