>From 1c58dbdc8ca652ec0c6e272910931f1e75e7fb4e Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Mon, 13 Mar 2023 18:52:14 -0400 Subject: [PATCH 3/3] Update guix.scm to build the latest glean from source. * guix.scm: Major overhaul. --- guix.scm | 86 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 61 insertions(+), 25 deletions(-) diff --git a/guix.scm b/guix.scm index aa7cddf..3c02545 100644 --- a/guix.scm +++ b/guix.scm @@ -17,15 +17,23 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages glean) - #:use-module ((guix licenses) - #:select (agpl3+)) - #:use-module (gnu packages) + #:use-module ((git bindings) #:select (libgit2-init! libgit2-shutdown!)) + #:use-module ((git commit) #:select (commit-id object->commit)) + #:use-module ((git oid) #:select (oid->string)) + #:use-module ((git repository) #:select (repository-open)) + #:use-module ((git rev-parse) #:select (revparse-single)) + #:use-module (guix build-system gnu) + #:use-module (guix gexp) + #:use-module ((guix git-download) #:select (git-predicate git-version)) + #:use-module ((guix licenses) #:select (agpl3+)) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages autotools) + #:use-module (gnu packages gettext) #:use-module (gnu packages gnupg) #:use-module (gnu packages guile) #:use-module (gnu packages pkg-config) - #:use-module (guix packages) - #:use-module (guix download) - #:use-module (guix build-system gnu)) + #:use-module (gnu packages texinfo)) ;;; Commentary: ;;; @@ -33,29 +41,57 @@ ;;; ;;; Code: +(libgit2-init!) +(define local-commit + ;; Using libgit for this was a mistake. I don't understand this arcane + ;; incantation. + (oid->string + (commit-id + (object->commit + (revparse-single (repository-open ".") "HEAD"))))) +(libgit2-shutdown!) + (define-public glean (package (name "glean") - (version "0.1") - (source (origin - (method url-fetch) - (uri (string-append "http://www.glean.eu/glean-" version - ".tar.gz")) - (sha256 - (base32 - "1ja518vhjzbz8drmdg4n94j487ivk03l4dsyyxrkrzx776vrl91r")))) + (version (git-version "0.1" "1" local-commit)) + (source (local-file "." "glean-checkout" + #:recursive? #t + #:select? + (git-predicate (current-source-directory)))) (build-system gnu-build-system) (arguments - `(#:configure-flags (list (string-append "--with-libgcrypt-prefix=" - (assoc-ref %build-inputs - "libgcrypt"))))) - (inputs `(("libgcrypt" ,libgcrypt) - ("guile" ,guile-2.0) - ("pkg-config" ,pkg-config))) - (synopsis "Glean test package.") - (description - "Glean is a...") - (home-page "http://glean.eu") + (list + #:configure-flags + #~(list (string-append "--with-libgcrypt-prefix=" + #$(this-package-input "libgcrypt"))) + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'no-auto-compile + (lambda _ + (setenv "GUILE_AUTO_COMPILE" "0")))))) + (home-page "https://www.gnu.org/software/glean/") + (native-inputs + (list + autoconf + automake + gnu-gettext + libtool + pkg-config + texinfo)) + (inputs + (list + guile-3.0 + libgcrypt + ;; TODO: Look at artanis stuff. Also enable optionable compilation of + ;; the files that rely on artanis in makefile.am + ;; artanis + )) + (synopsis "Extensible quizzing and tutorial for self-study") + (description "GNU glean is a modular system for self-study, considerably +more intricate than standard flash cards method. It is very customizable, allowing +the user to define subjects of interest and activities to study them. For now, it has +a text-based interface inside the Guile REPL and an experimental web interface.") (license agpl3+))) -;;; glean.scm ends here +glean -- 2.39.2