diff options
author | David Elsing <david.elsing@posteo.net> | 2022-10-13 21:04:17 +0000 |
---|---|---|
committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2022-10-15 12:04:54 +0200 |
commit | 696f20f0f68326065eb30b491e2e71fd0d492ad8 (patch) | |
tree | a257fa1d761ff858b45542a9b2827e453799f098 /gnu/packages/patches | |
parent | 3cbb634a8900f1cb0a9bb057c06fcac3079b7bea (diff) | |
download | guix-696f20f0f68326065eb30b491e2e71fd0d492ad8.tar.gz guix-696f20f0f68326065eb30b491e2e71fd0d492ad8.zip |
gnu: Add gemmi.
* gnu/packages/patches/gemmi-fix-pegtl-usage.patch: New file.
* gnu/packages/patches/gemmi-fix-sajson-types.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register them here.
* gnu/packages/chemistry.scm (gemmi): New variable.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/gemmi-fix-pegtl-usage.patch | 31 | ||||
-rw-r--r-- | gnu/packages/patches/gemmi-fix-sajson-types.patch | 11 |
2 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/patches/gemmi-fix-pegtl-usage.patch b/gnu/packages/patches/gemmi-fix-pegtl-usage.patch new file mode 100644 index 0000000000..3667474847 --- /dev/null +++ b/gnu/packages/patches/gemmi-fix-pegtl-usage.patch @@ -0,0 +1,31 @@ +Use the definitions from (newer) upstream PEGTL. + +diff --git a/include/gemmi/cif.hpp b/include/gemmi/cif.hpp +index c7ffdb44..35d24210 100644 +--- a/include/gemmi/cif.hpp ++++ b/include/gemmi/cif.hpp +@@ -37,7 +37,6 @@ namespace pegtl = tao::pegtl; + namespace rules { + + template<int TableVal> struct lookup_char { +- using analyze_t = pegtl::analysis::generic<pegtl::analysis::rule_type::ANY>; + template<typename Input> static bool match(Input& in) { + if (!in.empty() && cif::char_table(in.peek_char()) == TableVal) { + if (TableVal == 2) // this set includes new-line +@@ -71,11 +70,11 @@ namespace rules { + struct ws_or_eof : pegtl::sor<whitespace, pegtl::eof> {}; + + // (b) Reserved words. +- struct str_data : TAOCPP_PEGTL_ISTRING("data_") {}; +- struct str_loop : TAOCPP_PEGTL_ISTRING("loop_") {}; +- struct str_global : TAOCPP_PEGTL_ISTRING("global_") {}; +- struct str_save : TAOCPP_PEGTL_ISTRING("save_") {}; +- struct str_stop : TAOCPP_PEGTL_ISTRING("stop_") {}; ++ struct str_data : TAO_PEGTL_ISTRING("data_") {}; ++ struct str_loop : TAO_PEGTL_ISTRING("loop_") {}; ++ struct str_global : TAO_PEGTL_ISTRING("global_") {}; ++ struct str_save : TAO_PEGTL_ISTRING("save_") {}; ++ struct str_stop : TAO_PEGTL_ISTRING("stop_") {}; + struct keyword : pegtl::sor<str_data, str_loop, str_global, + str_save, str_stop> {}; + diff --git a/gnu/packages/patches/gemmi-fix-sajson-types.patch b/gnu/packages/patches/gemmi-fix-sajson-types.patch new file mode 100644 index 0000000000..9633ddac8b --- /dev/null +++ b/gnu/packages/patches/gemmi-fix-sajson-types.patch @@ -0,0 +1,11 @@ +diff -ur a/include/gemmi/json.hpp b/include/gemmi/json.hpp +--- a/include/gemmi/json.hpp ++++ b/include/gemmi/json.hpp +@@ -38,6 +38,7 @@ + + inline std::string as_cif_value(const sajson::value& val) { + switch (val.get_type()) { ++ case sajson::TYPE_INTEGER: + case sajson::TYPE_DOUBLE: + return val.as_string(); + case sajson::TYPE_NULL: |