summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Bavier <bavier@posteo.net>2022-04-13 09:45:34 -0500
committerEric Bavier <bavier@posteo.net>2022-04-13 09:48:04 -0500
commitb5e32d96202e58bb0e7d640fe54f728d0ca2b4b1 (patch)
treebfbf71bbdb1b4d07c12ca016cedc875cde6ca391
parent8d82d817bc609d128ba9af694503deecd2348c08 (diff)
downloadguix-b5e32d96202e58bb0e7d640fe54f728d0ca2b4b1.tar.gz
gnu: idris: Fixes test failure.
* gnu/packages/patches/idris-test-ffi008.patch: New file.
* gnu/packages/idris.scm (source): Use it.
* gnu/local.mk (dist_patch_DATA): Register it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/idris.scm5
-rw-r--r--gnu/packages/patches/idris-test-ffi008.patch26
3 files changed, 30 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index dbb904e89e..70133e6502 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1286,6 +1286,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/idris-disable-test.patch			\
   %D%/packages/patches/idris-build-with-haskeline-0.8.patch	\
   %D%/packages/patches/idris-build-with-megaparsec-9.patch	\
+  %D%/packages/patches/idris-test-ffi008.patch			\
   %D%/packages/patches/ilmbase-fix-tests.patch			\
   %D%/packages/patches/imagemagick-CVE-2020-27829.patch		\
   %D%/packages/patches/imagemagick-ReadDCMImage-fix.patch	\
diff --git a/gnu/packages/idris.scm b/gnu/packages/idris.scm
index 3e480e06b4..cdf76244fb 100644
--- a/gnu/packages/idris.scm
+++ b/gnu/packages/idris.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
 ;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com>
-;;; Copyright © 2019, 2021 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2019, 2022 Eric Bavier <bavier@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -49,7 +49,8 @@
                 "1pachwc6msw3n1mz2z1r1w6h518w9gbhdvbaa5vi1qp3cn3wm6q4"))
               (patches (search-patches "idris-disable-test.patch"
                                        "idris-build-with-haskeline-0.8.patch"
-                                       "idris-build-with-megaparsec-9.patch"))))
+                                       "idris-build-with-megaparsec-9.patch"
+                                       "idris-test-ffi008.patch"))))
     (build-system haskell-build-system)
     (native-inputs                      ;For tests
      (list perl ghc-cheapskate ghc-tasty ghc-tasty-golden
diff --git a/gnu/packages/patches/idris-test-ffi008.patch b/gnu/packages/patches/idris-test-ffi008.patch
new file mode 100644
index 0000000000..530813c20e
--- /dev/null
+++ b/gnu/packages/patches/idris-test-ffi008.patch
@@ -0,0 +1,26 @@
+Avoid "multiple definition of `mystruct'" error from `ld`:
+
+Submitted upstream at https://github.com/idris-lang/Idris-dev/issues/4914
+
+--- a/test/ffi008/ffi008.h	1969-12-31 18:00:01.000000000 -0600
++++ a/test/ffi008/ffi008.h	2022-04-13 00:32:35.561262598 -0500
+@@ -10,7 +10,7 @@
+     int16_t b;
+ };
+ 
+-struct test2 mystruct;
++extern struct test2 mystruct;
+ 
+ int size1(void);
+ int size2(void);
+--- a/test/ffi008/ffi008.c	1969-12-31 18:00:01.000000000 -0600
++++ a/test/ffi008/ffi008.c	2022-04-13 00:32:53.145186302 -0500
+@@ -11,6 +11,8 @@
+     return sizeof(struct test2);
+ }
+ 
++struct test2 mystruct;
++
+ void print_mystruct(void) {
+     printf("a: %d b: %d\n", mystruct.a, mystruct.b);
+ }