[PATCH] gnu: chaiscript: Fix tests.

  • Done
  • quality assurance status badge
Details
2 participants
  • Adam Faiz
  • iyzsong
Owner
unassigned
Submitted by
iyzsong
Severity
normal
I
I
iyzsong wrote on 27 Aug 2023 14:30
(address . guix-patches@gnu.org)(name . ???)(address . iyzsong@member.fsf.org)
a0905c2eabff02f1b3e9f32a09a033ffc57c74b6.1693139413.git.iyzsong@member.fsf.org
From: ??? <iyzsong@member.fsf.org>

* gnu/packages/cpp.scm (chaiscript)[arguments]: Add fix-tests phase.
---
gnu/packages/cpp.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (24 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 3b949198c7..4681963794 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -511,6 +511,15 @@ (define-public chaiscript
(sha256
(base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
(build-system cmake-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'fix-tests
+ (lambda _
+ ;; Its bundled catch2 fails to build with glibc-2.35.
+ (copy-file #$(file-append catch2 "/include/catch2/catch.hpp")
+ "unittests/catch.hpp"))))))
(home-page "https://chaiscript.com/")
(synopsis "Embedded scripting language designed for C++")
(description

base-commit: 8b4a248fc4765212a4103c4520ae1f901937df41
--
2.41.0
A
A
Adam Faiz wrote on 27 Aug 2023 17:09
(address . iyzsong@envs.net)(address . 65565@debbugs.gnu.org)
5f570fe8-b63c-2792-a2a1-3155f4c0b3b2@disroot.org
Toggle quote (9 lines)
> + (arguments
> + (list
> + #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'fix-tests
> + (lambda _
> + ;; Its bundled catch2 fails to build with glibc-2.35.
> + (copy-file #$(file-append catch2 "/include/catch2/catch.hpp")
> + "unittests/catch.hpp")))))
Bundling a newer catch2 is not the solution, it's better to delete the bundled header so that it uses the catch2 provided in its inputs.
I
I
iyzsong wrote on 29 Aug 2023 12:40
[PATCH v2] gnu: chaiscript: Fix tests.
(address . 65565@debbugs.gnu.org)(name . ???)(address . iyzsong@member.fsf.org)
e3de824c24e6d856b51eff65932364b769f58c66.1693305601.git.iyzsong@member.fsf.org
From: ??? <iyzsong@member.fsf.org>

* gnu/packages/cpp.scm (chaiscript)[source]: Add snippet.
[inputs]: Add catch2.
---
gnu/packages/cpp.scm | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 3b949198c7..2f8cc2ce25 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -509,8 +509,17 @@ (define-public chaiscript
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))))
+ (base32 "0i1c88rn1wwz8nf3dpapcdkk4w623m3nksfy5yjai10k9irkzy3c"))
+ (modules '((guix build utils)))
+ ;; It's bundled catch2 fails to build.
+ (snippet '(begin
+ (delete-file "unittests/catch.hpp")
+ (substitute* "unittests/compiled_tests.cpp"
+ (("catch[.]hpp") "catch2/catch.hpp"))
+ (substitute* "unittests/type_info_test.cpp"
+ (("catch[.]hpp") "catch2/catch.hpp"))))))
(build-system cmake-build-system)
+ (inputs (list catch2))
(home-page "https://chaiscript.com/")
(synopsis "Embedded scripting language designed for C++")
(description

base-commit: 715d203b414727be43e405d09e86aa823125a4b3
--
2.41.0
?
Re: [bug#65565] [PATCH] gnu: chaiscript: Fix tests.
(name . Adam Faiz)(address . adam.faiz@disroot.org)(address . 65565@debbugs.gnu.org)
874jkidt2m.fsf@envs.net
Adam Faiz <adam.faiz@disroot.org> writes:

Toggle quote (12 lines)
>> + (arguments
>> + (list
>> + #:phases
>> + #~(modify-phases %standard-phases
>> + (add-after 'unpack 'fix-tests
>> + (lambda _
>> + ;; Its bundled catch2 fails to build with glibc-2.35.
>> + (copy-file #$(file-append catch2 "/include/catch2/catch.hpp")
>> + "unittests/catch.hpp")))))
> Bundling a newer catch2 is not the solution, it's better to delete the
> bundled header so that it uses the catch2 provided in its inputs.

Um, this copy-file has the same result, it replace the bundled one with
our catch2, anyway I sent a v2 with 'snippet' and 'inputs'.

Thanks.
?
Closing
877cpb7cgs.fsf@envs.net
Pushed now, closing!
Closed
?