From: Markus Meier Date: Fri, 2 Jan 2015 18:36:34 +0000 (+0000) Subject: fix building with dev-libs/boost-1.56, bug #525400 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7503f5b94a394e865f42ed28f76053fe5e47be57;p=gentoo.git fix building with dev-libs/boost-1.56, bug #525400 Package-Manager: portage-2.2.15/cvs/Linux x86_64 Manifest-Sign-Key: 0x072AD062 --- diff --git a/media-gfx/hugin/ChangeLog b/media-gfx/hugin/ChangeLog index 878e2a01aa24..12380f1fd7fb 100644 --- a/media-gfx/hugin/ChangeLog +++ b/media-gfx/hugin/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-gfx/hugin -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/ChangeLog,v 1.155 2014/12/22 10:09:17 pinkbyte Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/ChangeLog,v 1.156 2015/01/02 18:36:29 maekke Exp $ + + 02 Jan 2015; Markus Meier hugin-2014.0.0.ebuild, + hugin-2014.0.0-r1.ebuild, +files/hugin-2014.0.0-ParseExp.patch: + fix building with dev-libs/boost-1.56, bug #525400 22 Dec 2014; Sergey Popov hugin-2014.0.0.ebuild: Stable on amd64 and x86, wrt bug #528330 diff --git a/media-gfx/hugin/Manifest b/media-gfx/hugin/Manifest index 36544f4fe5ab..7d6e5b2b0245 100644 --- a/media-gfx/hugin/Manifest +++ b/media-gfx/hugin/Manifest @@ -6,25 +6,22 @@ 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 bc39b72f20e906bb6311f2ba4806309bec6f7c983bfd1b031b8171b5338f0c48 SHA512 f4ac540e28739b8f5851c3e92a9815f4a6e8a5ef6b2bb721b3ee68e902dae91af51dba80d68de5b1d4e3b14340bd660817502b7899cb4897fba3a91d64623f31 WHIRLPOOL bf40a784c443994394c035654253e0d6de25346a393b12bd3fcdaa0cff6d3253f13ab6e4461886be133af34a0d4b9efcaaf713abf765a6833525443afc5f2b47 +EBUILD hugin-2014.0.0.ebuild 2097 SHA256 46796a312c60e413a824fff95b8624f1e33ec050b153ba13c3de6c26502697d8 SHA512 074310a4f0951790c6c8ebc43191ba3cc677937d0a7c1002693b40b7934cb599b9c3681fe5c9f4539ef8734439ebe8cc30624686263455c16dd8777756e559dd WHIRLPOOL 65da1b816638b3ec0d51b891cc3f1f195f4c3aea1e055e7185acecbc3217f426537efe37e57c87c9b7c08cbf7890174a2bf4c14a8e449fe6a521489669168a54 EBUILD hugin-9999.ebuild 2033 SHA256 4ecb687517f373ffe547edee0dba76948d19b434a08b1298c8708bb2c79ba1dc SHA512 be3f2fdb1ad69ab8197b82be34e9061431381c1581bbaecb6092ff1da8ba44d2fa5eebec08c222676e150bc10627ca440ce74bff4b1a2dbfd34c427bd4199d3e WHIRLPOOL aa82437f1b2cdcb3d50fe1c6712a51a63033da2a34343ad08dd0de957dc0b6b980622dd00e510a639cc6e892a272c0788aa02e1daed93232a71167cff2eece1f -MISC ChangeLog 25274 SHA256 70fa64f8747831a2ba19f313e5e693d99a3abad6140e9272fe14edf8bacc8658 SHA512 7df1efa5264fef4d66986b28707245b0a7a8c571d47390ff5ff18b591586449f68609904c4bda93df705bb90e6f5c81dd21271b6814a29086cccaa3122852e65 WHIRLPOOL d4a4693e75e314b93bf3c83673709d682c5450faa7f1a7486f83e1596f5c3ca71fcfd8cd17ee4df36aba2b660f5c78563c3e7a6a9e6913a70a0f7448d5ccaa2d +MISC ChangeLog 25463 SHA256 102865a1424a8bbd98f77fa6d124a457b08801bf68998539048a8437e45ad4a3 SHA512 0042bd8d45fd45c88c59a7170b74019385402f233e5ba6304bf74d777fb9e7606f970e5f631cacad8665bfdec16e74cba16f951c4e0beb67e50d9f99ddd80e9f WHIRLPOOL a193f8787caf08f52038d1bcead577c4cd63acad7a320d243677acfff4023873d749630988582b066bd18852a7a59072c58e8945c241458965160fdcfd3783da MISC metadata.xml 395 SHA256 1e88681d08863b52f3ae17f149901c3d84b6c6197913f7538d17572b33adbf9b SHA512 52848e953af2d3a398f9309a8af40261df0bb78365a3065f805ad06fbc40bea2a44b23ca70aa898b7dbb39a1c2e1309f036762de81d66824bdea09f767039a21 WHIRLPOOL dbdfadbbd20f6acd3961b786bb7bc5e57fd8fd954373cf4a645a008ddaf9273406072cc5ab1497ca1bdefbb77834996d8210c4d9f8cf1a716a7a788b29431684 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQEcBAEBCAAGBQJUl+3OAAoJECo/aRed9267OAIH/RJhPM999nVA7RlpacJ3iAyn -pRcrDxiwSqXtZPkLz7rb93Sg4kE0Dmk5LrMlJnJ3KkmVZ277vXqcG02jLTtiwFND -vFI45/oqg9RRhFUXfhSoqWKeyiHE41zu4kBRXE0SaU1zi3Nv+7c/1M9IAHPZeI8N -AAbLdtQ1GRSzEJ8FHMIJ4TIlkAHG60f78aYcvTttwWjczqeheAFhSLjEtFwuaYxb -H5gG7gqX3xCjFmsMmMo1Q0Lh2t12xPuQhgm6/6pA1OibmdNIt97yM0RaYBmOKadL -7n2f5fgp91YAtrGD32c3yGmxBe9ppyegD4lyp9qBGGErQSwiKcW510W7LNMMmxk= -=XdUF +iEYEAREIAAYFAlSm5TAACgkQkKaRLQcq0GIbIQCgroVqP7q/QVDcVPvRLoEj076m +qfwAoJbPm406IWWMomUGIhAnBof/K2Bq +=TQcj -----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 000000000000..3ee0dee0bff7 --- /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 +-#include +- +-#include +-#if !defined(SPIRIT_VERSION) || SPIRIT_VERSION < 0x2010 +-#error "At least Spirit version 2.1 required" +-#endif +-#include +-#include +-#include +- +-namespace Parser +-{ +- +-// helper classes to implement operators +- +-//power function +-struct lazy_pow_ +-{ +- template +- struct result { typedef X type; }; +- +- template +- X operator()(X x, Y y) const +- { +- return std::pow(x, y); +- } +-}; +- +-// modulus for double values +-struct lazy_mod_ +-{ +- template +- struct result { typedef X type; }; +- +- template +- X operator()(X x, Y y) const +- { +- return std::fmod(x,y); +- } +-}; +- +-// if statement +-struct lazy_if_ +-{ +- template +- struct result { typedef Y type; }; +- +- template +- X operator()(X x, Y y, Z z) const +- { +- return x ? y : z; +- } +-}; +- +-// wrapper for unary function +-struct lazy_ufunc_ +-{ +- template +- struct result { typedef A1 type; }; +- +- template +- 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(); +-}; +- +-// convert deg into rad +-double rad(const double d) +-{ +- return d*boost::math::constants::pi()/180; +-}; +- +-// the main grammar class +-struct grammar:boost::spirit::qi::grammar +-{ +- +- // symbol table for constants like "pi", e.g. image number and value +- struct constant_ : boost::spirit::qi::symbols +- { +- constant_(const ConstantMap constMap) +- { +- this->add("pi", boost::math::constants::pi()); +- 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 +- { +- 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 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 > 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; +- boost::phoenix::function lazy_mod; +- boost::phoenix::function lazy_if; +- boost::phoenix::function 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 +-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 ++#include ++ ++#define BOOST_SPIRIT_USE_PHOENIX_V3 1 ++#include ++#if !defined(SPIRIT_VERSION) || SPIRIT_VERSION < 0x2010 ++#error "At least Spirit version 2.1 required" ++#endif ++#include ++#include ++#include ++ ++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(); ++}; ++ ++// convert deg into rad ++const double rad(const double d) ++{ ++ return d*boost::math::constants::pi()/180; ++}; ++ ++// the main grammar class ++struct grammar:boost::spirit::qi::grammar ++{ ++ ++ // symbol table for constants like "pi", e.g. image number and value ++ struct constant_ : boost::spirit::qi::symbols ++ { ++ constant_(const ConstantMap constMap) ++ { ++ this->add("pi", boost::math::constants::pi()); ++ 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 ++ { ++ 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 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 > 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; ++ boost::phoenix::function lazy_mod; ++ boost::phoenix::function lazy_if; ++ boost::phoenix::function 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 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 284490e86230..389a999f0291 100644 --- a/media-gfx/hugin/hugin-2014.0.0-r1.ebuild +++ b/media-gfx/hugin/hugin-2014.0.0-r1.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/hugin-2014.0.0-r1.ebuild,v 1.3 2014/12/20 16:36:16 maekke Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/hugin-2014.0.0-r1.ebuild,v 1.4 2015/01/02 18:36:29 maekke Exp $ EAPI=5 @@ -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 527fd4ef8994..458cba2a4886 100644 --- a/media-gfx/hugin/hugin-2014.0.0.ebuild +++ b/media-gfx/hugin/hugin-2014.0.0.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/hugin-2014.0.0.ebuild,v 1.5 2014/12/22 10:09:17 pinkbyte Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/hugin/hugin-2014.0.0.ebuild,v 1.6 2015/01/02 18:36:29 maekke Exp $ EAPI=5 @@ -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"