From f51e414272f78a01de7d29333c0e03df32bc6f73 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 3 Nov 2025 19:23:06 +0000 Subject: [PATCH] gnu: Add hardv. * gnu/packages/education.scm (hardv): New variable. Signed-off-by: jgart --- gnu/packages/education.scm | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gnu/packages/education.scm b/gnu/packages/education.scm index a4a28aa8e104a275a8e29dc3e46c1dddb3f3a204..45d6b728edd0f6a93e3cd3d5e22f9e642ace082a 100644 --- a/gnu/packages/education.scm +++ b/gnu/packages/education.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2023 Maxim Cournoyer ;;; Copyright © 2024 Luis Higino ;;; Copyright © 2025 Andreas Enge +;;; Copyright © 2025 Arun Isaac ;;; ;;; This file is part of GNU Guix. ;;; @@ -1074,6 +1075,61 @@ learning for programming languages.") simple concepts using multimedia flash cards and spaced reviews.") (license license:public-domain))) +(define-public hardv + (package + (name "hardv") + (version "5.0.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/dongyx/hardv") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0l1wb7hlyldl5hq0z9a1a1rrgn33rjyqb08jph3q7mcn5p3qx40i")))) + (build-system gnu-build-system) + (arguments + (list #:make-flags #~(list (string-append "prefix=" #$output) + (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* (list "hardv.man1" "learn.c") + (("/bin/sh") + (search-input-file inputs "/bin/sh"))))) + (delete 'configure) + (delete 'check) + (add-after 'install 'check + (lambda* (#:key tests? #:allow-other-keys) + ;; Tests can only be run after installation. + (when tests? + (setenv "PATH" + (string-append #$output "/bin:" (getenv "PATH"))) + (invoke "make" "test"))))))) + (home-page "https://github.com/dongyx/hardv") + (synopsis "Spaced repetition flash card program") + (description "HardV is a powerful spaced repetition flash card program. +The key features are: + +@itemize +@item HardV runs in the CLI mode by default, but you may configure it +to be a TUI program, or to view images in a GUI window. +@item HardV can open the editor, send the content you wrote to an online +judging system, and determine the next quiz time by the judging result. +@item It can be used to implement keyboard shortcut practice, cloze deletion, +text-to-speech review, typing in the answer, and more. +@item The format of input files are easy to be parsed by both human and other +Unix utilities like grep, sed, and awk. +@item Metadata like scheduled time is written back to input files; thus all +your data is in files created and managed by yourself. +@item HardV is a Unix filter in the default mode; that makes it easy to be +called by other programs. For example, you could pipe HardV to a voice +synthesizer to make an audio quiz. +@end itemize") + (license license:bsd-2))) + (define-public tagainijisho (package (name "tagainijisho")