[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/15: gnu: Add tinydir.
From: |
guix-commits |
Subject: |
05/15: gnu: Add tinydir. |
Date: |
Sat, 15 Oct 2022 06:06:30 -0400 (EDT) |
lilyp pushed a commit to branch master
in repository guix.
commit d42f648c0ce7b99d57e65fd37ba27014097c3cec
Author: David Elsing <david.elsing@posteo.net>
AuthorDate: Thu Oct 13 21:04:14 2022 +0000
gnu: Add tinydir.
* gnu/packages/c.scm (tinydir): New variable.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
---
gnu/packages/c.scm | 41 ++++++++++++++++++++++
.../patches/tinydir-fix-cbehave-test.patch | 16 +++++++++
2 files changed, 57 insertions(+)
diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 84b537022d..e3d50b1190 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1183,6 +1183,47 @@ performance concurrent systems developed in C99+.")
(license (list license:bsd-2 ;everything except...
license:asl2.0)))) ;src/ck_hp.c
+(define-public tinydir
+ (package
+ (name "tinydir")
+ (version "1.2.5")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cxong/tinydir")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1nprgdfx4i8wzc1idw6chan4fjfa75b5ll8kghdc0q2278pny259"))
+ (patches (search-patches "tinydir-fix-cbehave-test.patch"))
+ (modules '((guix build utils)))
+ (snippet '(delete-file-recursively "tests/cbehave"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'path-cmake
+ (lambda _
+ (substitute* "tests/CMakeLists.txt"
+ (("^include_dir.*cbehave.*")
+ (string-append "include_directories("#$cbehave "/include)"))
+ (("^add_subdir.*cbeha.*") ""))))
+ (add-before 'configure 'chdir
+ (lambda _
+ (chdir "tests")))
+ (replace 'install
+ (lambda _
+ (install-file "../tinydir.h"
+ (string-append #$output "/include")))))))
+ (native-inputs (list cbehave))
+ (home-page "https://github.com/cxong/tinydir")
+ (synopsis "List directories programmatically")
+ (description "@code{tinydir} is a header-only C wrapper for listing
+directory contents.")
+ (license license:bsd-2)))
+
(define-public libdispatch
(package
(name "libdispatch")
diff --git a/gnu/packages/patches/tinydir-fix-cbehave-test.patch
b/gnu/packages/patches/tinydir-fix-cbehave-test.patch
new file mode 100644
index 0000000000..84ecee12c2
--- /dev/null
+++ b/gnu/packages/patches/tinydir-fix-cbehave-test.patch
@@ -0,0 +1,16 @@
+Make test work with upstream cbehave
+(tinydir bundles a modified version)
+
+diff --git a/tests/file_open_test.c b/tests/file_open_test.c
+index 3e659bc..9f6f88d 100644
+--- a/tests/file_open_test.c
++++ b/tests/file_open_test.c
+@@ -19,4 +19,7 @@ FEATURE(file_open, "File open")
+ SCENARIO_END
+ FEATURE_END
+
+-CBEHAVE_RUN("File open:", TEST_FEATURE(file_open))
++int main(void) {
++ cbehave_feature _cfeatures[] = {{feature_idx(file_open)}};
++ return cbehave_runner("File open:", _cfeatures);
++}
- branch master updated (d923cf1dea -> 18f95f9335), guix-commits, 2022/10/15
- 01/15: gnu: Add fast-float., guix-commits, 2022/10/15
- 02/15: gnu: Add pocketfft-cpp., guix-commits, 2022/10/15
- 04/15: gnu: Add cbehave., guix-commits, 2022/10/15
- 07/15: gnu: Add sajson-for-gemmi., guix-commits, 2022/10/15
- 09/15: gnu: Add freesasa., guix-commits, 2022/10/15
- 05/15: gnu: Add tinydir.,
guix-commits <=
- 11/15: gnu: Add coordgenlibs., guix-commits, 2022/10/15
- 12/15: gnu: Add yaehmop., guix-commits, 2022/10/15
- 15/15: gnu: Add rdkit., guix-commits, 2022/10/15
- 03/15: gnu: Add sajson., guix-commits, 2022/10/15
- 08/15: gnu: Add gemmi., guix-commits, 2022/10/15
- 10/15: gnu: Add maeparser., guix-commits, 2022/10/15
- 13/15: gnu: Add avalon-toolkit., guix-commits, 2022/10/15
- 14/15: gnu: Add ringdecomposerlib., guix-commits, 2022/10/15
- 06/15: gnu: Add optionparser., guix-commits, 2022/10/15