~ruther/guix-local

4cb2e664bde0e419f2f7d3231d64474f7c9006de — Liliana Marie Prikler 10 months ago 00af47b
gnu: fmt@9: Fix tests on i686.

* gnu/packages/patches/fmt-9-overspecified-tests.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/pretty-print.scm (fmt-9)[arguments]: Add #:configure-flags
from fmt-10.  Add #:phases to apply fmt-9-overspecified-tests.patch on i686.

Change-Id: Ifc2854b98db1500e6c57521ee31b294e8712783e
Signed-off-by: Andreas Enge <andreas@enge.fr>
M gnu/local.mk => gnu/local.mk +1 -0
@@ 1325,6 1325,7 @@ dist_patch_DATA =						\
  %D%/packages/patches/flatpak-unset-gdk-pixbuf-for-sandbox.patch	\
  %D%/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch	\
  %D%/packages/patches/fluxbox-1.3.7-gcc.patch			\
  %D%/packages/patches/fmt-9-overspecified-tests.patch	\
  %D%/packages/patches/font-gnu-freefont-python3-compat.patch	\
  %D%/packages/patches/fontconfig-cache-ignore-mtime.patch	\
  %D%/packages/patches/fontforge-hurd.patch			\

A gnu/packages/patches/fmt-9-overspecified-tests.patch => gnu/packages/patches/fmt-9-overspecified-tests.patch +29 -0
@@ 0,0 1,29 @@
These tests were dropped upstream in version 10.1.0 and are arguable broken
before that.

diff --git a/test/chrono-test.cc b/test/chrono-test.cc
index 33c0c2c6653e..f047c1ea90c8 100644
--- a/test/chrono-test.cc
+++ b/test/chrono-test.cc
@@ -730,9 +730,6 @@ TEST(chrono_test, special_durations) {
             "03:33");
   EXPECT_EQ(fmt::format("{:%T}", std::chrono::duration<char, std::mega>{2}),
             "03:33:20");
-  EXPECT_EQ("44.000000000000",
-            fmt::format("{:%S}", std::chrono::duration<float, std::pico>(
-                                     1.54213895E+26)));
 }
 
 TEST(chrono_test, unsigned_duration) {
diff --git a/test/format-test.cc b/test/format-test.cc
index baf33569f96d..52ac2cafeade 100644
--- a/test/format-test.cc
+++ b/test/format-test.cc
@@ -1427,7 +1427,6 @@ TEST(format_test, prettify_float) {
   EXPECT_EQ("12.34", fmt::format("{}", 1234e-2));
   EXPECT_EQ("0.001234", fmt::format("{}", 1234e-6));
   EXPECT_EQ("0.1", fmt::format("{}", 0.1f));
-  EXPECT_EQ("0.10000000149011612", fmt::format("{}", double(0.1f)));
   EXPECT_EQ("1.3563156e-19", fmt::format("{}", 1.35631564e-19f));
 }
 
\ No newline at end of file

M gnu/packages/pretty-print.scm => gnu/packages/pretty-print.scm +15 -1
@@ 272,7 272,21 @@ a fast alternative to @code{IOStreams}.")
       (uri (string-append "https://github.com/fmtlib/fmt/releases/download/"
                           version "/fmt-" version ".zip"))
       (sha256
        (base32 "15n9yi6xzzs7g9rm87kg8y5yhl2zrqj3bjr845saa63f6swlrsyc"))))))
        (base32 "15n9yi6xzzs7g9rm87kg8y5yhl2zrqj3bjr845saa63f6swlrsyc"))))
    (arguments
     (list
      #:configure-flags ''("-DBUILD_SHARED_LIBS=ON")
      #:phases
      (cond
       ((string-prefix? "i686" (%current-system))
        #~(modify-phases %standard-phases
          (add-after 'unpack 'patch
            (lambda _
              (invoke
               "patch" "-p1" "-i"
               #$(local-file
                  (search-patch "fmt-9-overspecified-tests.patch")))))))
       (else #~%standard-phases))))))

(define-public fmt-8
  (package