From 230a6a943279fe462182e530fbde86d9ac973ba2 Mon Sep 17 00:00:00 2001 From: Silas Vedder Date: Mon, 17 Oct 2022 07:31:43 +0200 Subject: [PATCH] modules, installation with guix cleaned up --- Makefile.am | 25 ++- NEWS | 4 +- .../bible-tools.scm => bible-tools.scm | 0 bible-tools/count-words.scm | 2 +- bible-tools/latex-export.scm | 2 +- build-aux/test-driver.scm | 4 +- configure.ac | 2 +- guix.scm | 178 +++++++++--------- hall.scm | 32 ++-- scripts/bible-app.in | 4 +- scripts/bible2latex.in | 2 +- scripts/word-counter.in | 2 +- 12 files changed, 122 insertions(+), 135 deletions(-) rename bible-tools/bible-tools.scm => bible-tools.scm (100%) diff --git a/Makefile.am b/Makefile.am index ded7482..0d6e2df 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,7 +36,7 @@ SUFFIXES = .scm .go SOURCES = bible-tools/latex-export.scm \ bible-tools/count-words.scm \ - bible-tools/bible-tools.scm + bible-tools.scm TESTS = @@ -57,24 +57,23 @@ AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)" info_TEXINFOS = doc/bible-tools.texi dvi: # Don't build dvi docs -EXTRA_DIST += COPYING \ - HACKING \ - README \ - README.org \ - NEWS \ +EXTRA_DIST += ChangeLog \ AUTHORS \ - ChangeLog \ - hall.scm \ - .gitignore \ - guix.scm \ + NEWS \ + README \ + HACKING \ + COPYING \ + pre-inst-env.in \ + Makefile.am \ + configure.ac \ build-aux/test-driver.scm \ build-aux/texinfo.tex \ build-aux/mdate-sh \ build-aux/missing \ build-aux/install-sh \ - configure.ac \ - Makefile.am \ - pre-inst-env.in \ + guix.scm \ + .gitignore \ + hall.scm \ build-aux/test-driver.scm \ $(TESTS) diff --git a/NEWS b/NEWS index 20d1e3e..c058b7e 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,9 @@ # -*- mode: org; coding: utf-8; -*- -#+TITLE: Bible-Tools NEWS ? history of user-visible changes +#+TITLE: Bible-Tools NEWS – history of user-visible changes #+STARTUP: content hidestars -Copyright ? (2022) +Copyright © (2022) Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff --git a/bible-tools/bible-tools.scm b/bible-tools.scm similarity index 100% rename from bible-tools/bible-tools.scm rename to bible-tools.scm diff --git a/bible-tools/count-words.scm b/bible-tools/count-words.scm index 768016f..81c85d8 100644 --- a/bible-tools/count-words.scm +++ b/bible-tools/count-words.scm @@ -1,4 +1,4 @@ -(define-module (count-words) +(define-module (bible-tools count-words) #:use-module (bible-tools) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) diff --git a/bible-tools/latex-export.scm b/bible-tools/latex-export.scm index 73640eb..796d806 100644 --- a/bible-tools/latex-export.scm +++ b/bible-tools/latex-export.scm @@ -1,4 +1,4 @@ -(define-module (latex-export) +(define-module (bible-tools latex-export) #:use-module (bible-tools) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) diff --git a/build-aux/test-driver.scm b/build-aux/test-driver.scm index 99007e8..0c555ea 100644 --- a/build-aux/test-driver.scm +++ b/build-aux/test-driver.scm @@ -2,8 +2,8 @@ (define script-version "2019-01-15.13") ;UTC -;;; Copyright ? 2015, 2016 Mathieu Lirzin -;;; Copyright ? 2019 Alex Sassmannshausen +;;; Copyright © 2015, 2016 Mathieu Lirzin +;;; Copyright © 2019 Alex Sassmannshausen ;;; ;;; This program is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by diff --git a/configure.ac b/configure.ac index 654aa9a..02878dd 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_SUBST(HVERSION, "\"1.0\"") AC_SUBST(AUTHOR, "\"\"") AC_SUBST(COPYRIGHT, "'(2022)") AC_SUBST(LICENSE, gpl3+) -AC_CONFIG_SRCDIR(bible-tools) +AC_CONFIG_SRCDIR(bible-tools.scm) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.12 gnu silent-rules subdir-objects color-tests parallel-tests -Woverride -Wno-portability]) AM_SILENT_RULES([yes]) diff --git a/guix.scm b/guix.scm index 34d96df..5411ba3 100644 --- a/guix.scm +++ b/guix.scm @@ -1,95 +1,85 @@ -(use-modules (guix packages) - ((guix licenses) - #:prefix license:) - (guix download) - (guix git-download) - (guix build-system gnu) - (gnu packages) - (gnu packages autotools) - (gnu packages guile) - (gnu packages guile-xyz) - (gnu packages pkg-config) - (gnu packages texinfo)) +(use-modules + (guix packages) + ((guix licenses) #:prefix license:) + (guix download) + (guix build-system gnu) + (guix gexp) + (gnu packages) + (gnu packages autotools) + (gnu packages guile) + (gnu packages guile-xyz) + (gnu packages pkg-config) + (gnu packages texinfo)) -(define-public bible-tools - (package - (name "bible-tools") - (version "1.0") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.silasvedder.xyz/silasfox/bible-tools.git") - (commit "bc925d8"))) - (file-name "bible-tools-1.0-checkout") - (sha256 (base32 "07221jw4gl48cg45znwjkc7871in3pfq488ig4vnbjygqbg4wawh")))) - (build-system gnu-build-system) - (arguments - `(#:modules - ((ice-9 match) - (ice-9 ftw) - ,@%gnu-build-system-modules) - #:phases - (modify-phases - %standard-phases - (add-after - 'install - 'hall-wrap-binaries - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((compiled-dir - (lambda (out version) - (string-append - out - "/lib/guile/" - version - "/site-ccache"))) - (uncompiled-dir - (lambda (out version) - (string-append - out - "/share/guile/site" - (if (string-null? version) "" "/") - version))) - (dep-path - (lambda (env modules path) - (list env - ":" - 'prefix - (cons modules - (map (lambda (input) - (string-append - (assoc-ref inputs input) - path)) - ,''()))))) - (out (assoc-ref outputs "out")) - (bin (string-append out "/bin/")) - (site (uncompiled-dir out ""))) - (match (scandir site) - (("." ".." version) - (for-each - (lambda (file) - (wrap-program - (string-append bin file) - (dep-path - "GUILE_LOAD_PATH" - (uncompiled-dir out version) - (uncompiled-dir "" version)) - (dep-path - "GUILE_LOAD_COMPILED_PATH" - (compiled-dir out version) - (compiled-dir "" version)))) - ,''("bible-app" "word-counter" "bible2latex")) - #t)))))))) - (native-inputs - `(("autoconf" ,autoconf) - ("automake" ,automake) - ("pkg-config" ,pkg-config) - ("texinfo" ,texinfo))) - (inputs `(("guile" ,guile-3.0))) - (propagated-inputs `()) - (synopsis "") - (description "") - (home-page "") - (license license:gpl3+))) - -bible-tools +(package + (name "bible-tools") + (version "1.0") + (source (local-file "./bible-tools-1.0.tar.gz")) + (build-system gnu-build-system) + (arguments + `(#:modules + ((ice-9 match) + (ice-9 ftw) + ,@%gnu-build-system-modules) + #:phases + (modify-phases + %standard-phases + (add-after + 'install + 'hall-wrap-binaries + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((compiled-dir + (lambda (out version) + (string-append + out + "/lib/guile/" + version + "/site-ccache"))) + (uncompiled-dir + (lambda (out version) + (string-append + out + "/share/guile/site" + (if (string-null? version) "" "/") + version))) + (dep-path + (lambda (env modules path) + (list env + ":" + 'prefix + (cons modules + (map (lambda (input) + (string-append + (assoc-ref inputs input) + path)) + ,''()))))) + (out (assoc-ref outputs "out")) + (bin (string-append out "/bin/")) + (site (uncompiled-dir out ""))) + (match (scandir site) + (("." ".." version) + (for-each + (lambda (file) + (wrap-program + (string-append bin file) + (dep-path + "GUILE_LOAD_PATH" + (uncompiled-dir out version) + (uncompiled-dir "" version)) + (dep-path + "GUILE_LOAD_COMPILED_PATH" + (compiled-dir out version) + (compiled-dir "" version)))) + ,''("bible-app" "word-counter" "bible2latex")) + #t)))))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("pkg-config" ,pkg-config) + ("texinfo" ,texinfo))) + (inputs `(("guile" ,guile-3.0))) + (propagated-inputs `()) + (synopsis "") + (description "") + (home-page "") + (license license:gpl3+)) diff --git a/hall.scm b/hall.scm index cabf6e3..00ff5d8 100644 --- a/hall.scm +++ b/hall.scm @@ -14,8 +14,8 @@ ((directory "bible-tools" ((scheme-file "latex-export") - (scheme-file "count-words") - (scheme-file "bible-tools"))))) + (scheme-file "count-words"))) + (scheme-file "bible-tools"))) (tests ((directory "tests" ()))) (programs ((directory @@ -24,20 +24,18 @@ (in-file "word-counter") (in-file "bible2latex"))))) (documentation - ((directory - "doc" - ((texi-file "bible-tools"))) - (text-file "COPYING") - (text-file "HACKING") - (symlink "README" "README.org") - (org-file "README") - (text-file "NEWS") + ((text-file "ChangeLog") (text-file "AUTHORS") - (text-file "ChangeLog"))) + (text-file "NEWS") + (symlink "README" "README.org") + (org-file "README") + (text-file "HACKING") + (text-file "COPYING") + (directory "doc" ((texi-file "bible-tools"))))) (infrastructure - ((scheme-file "hall") - (text-file ".gitignore") - (scheme-file "guix") + ((in-file "pre-inst-env") + (automake-file "Makefile") + (autoconf-file "configure") (directory "build-aux" ((scheme-file "test-driver") @@ -45,6 +43,6 @@ (text-file "mdate-sh") (text-file "missing") (text-file "install-sh"))) - (autoconf-file "configure") - (automake-file "Makefile") - (in-file "pre-inst-env"))))) + (scheme-file "guix") + (text-file ".gitignore") + (scheme-file "hall"))))) diff --git a/scripts/bible-app.in b/scripts/bible-app.in index bdcc487..f7ec840 100644 --- a/scripts/bible-app.in +++ b/scripts/bible-app.in @@ -4,8 +4,8 @@ exec guile -e '(@ (bible-app) main)' -s "$0" "$@" (define-module (bible-app) #:use-module (bible-tools) - #:use-module (latex-export) - #:use-module (count-words) + #:use-module (bible-tools latex-export) + #:use-module (bible-tools count-words) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (main)) diff --git a/scripts/bible2latex.in b/scripts/bible2latex.in index 5fdd88c..ed309bb 100755 --- a/scripts/bible2latex.in +++ b/scripts/bible2latex.in @@ -4,7 +4,7 @@ exec guile -e '(@ (bible2latex) main)' -s "$0" "$@" (define-module (bible2latex) #:use-module (bible-tools) - #:use-module (latex-export) + #:use-module (bible-tools latex-export) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (main)) diff --git a/scripts/word-counter.in b/scripts/word-counter.in index 58050af..83d2d07 100644 --- a/scripts/word-counter.in +++ b/scripts/word-counter.in @@ -4,7 +4,7 @@ exec guile -e '(@ (word-counter) main)' -s "$0" "$@" (define-module (word-counter) #:use-module (bible-tools) - #:use-module (count-words) + #:use-module (bible-tools count-words) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:export (main))