Silas Vedder
2 years ago
7 changed files with 54 additions and 339 deletions
@ -1,89 +0,0 @@
|
||||
bin_SCRIPTS = scripts/bible-app \
|
||||
scripts/word-counter \
|
||||
scripts/bible2latex
|
||||
|
||||
# Handle substitution of fully-expanded Autoconf variables.
|
||||
do_subst = $(SED) \
|
||||
-e 's,[@]GUILE[@],$(GUILE),g' \
|
||||
-e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \
|
||||
-e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \
|
||||
-e 's,[@]localedir[@],$(localedir),g'
|
||||
|
||||
nodist_noinst_SCRIPTS = pre-inst-env
|
||||
|
||||
GOBJECTS = $(SOURCES:%.scm=%.go)
|
||||
|
||||
moddir=$(prefix)/share/guile/site/$(GUILE_EFFECTIVE_VERSION)
|
||||
godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
|
||||
ccachedir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
|
||||
|
||||
nobase_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
|
||||
nobase_go_DATA = $(GOBJECTS)
|
||||
|
||||
# Make sure source files are installed first, so that the mtime of
|
||||
# installed compiled files is greater than that of installed source
|
||||
# files. See
|
||||
# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
|
||||
# for details.
|
||||
guile_install_go_files = install-nobase_goDATA
|
||||
$(guile_install_go_files): install-nobase_modDATA |
||||
|
||||
EXTRA_DIST = $(SOURCES) $(NOCOMP_SOURCES)
|
||||
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
|
||||
SUFFIXES = .scm .go
|
||||
.scm.go: |
||||
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILE_TOOLS) compile $(GUILE_WARNINGS) -o "$@" "$<"
|
||||
|
||||
SOURCES = bible-tools/latex-export.scm \
|
||||
bible-tools/count-words.scm \
|
||||
bible-tools.scm
|
||||
|
||||
TESTS =
|
||||
|
||||
TEST_EXTENSIONS = .scm
|
||||
SCM_LOG_DRIVER = \
|
||||
$(top_builddir)/pre-inst-env \
|
||||
$(GUILE) --no-auto-compile -e main \
|
||||
$(top_srcdir)/build-aux/test-driver.scm
|
||||
|
||||
# Tell 'build-aux/test-driver.scm' to display only source file names,
|
||||
# not indivdual test names.
|
||||
AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
|
||||
|
||||
AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
|
||||
|
||||
AM_TESTS_ENVIRONMENT = abs_top_srcdir="$(abs_top_srcdir)"
|
||||
|
||||
info_TEXINFOS = doc/bible-tools.texi
|
||||
dvi: # Don't build dvi docs
|
||||
|
||||
EXTRA_DIST += ChangeLog \
|
||||
AUTHORS \
|
||||
NEWS \
|
||||
README \
|
||||
README.org \
|
||||
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 \
|
||||
guix.scm \
|
||||
.gitignore \
|
||||
hall.scm \
|
||||
build-aux/test-driver.scm \
|
||||
$(TESTS)
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
clean-go: |
||||
-$(RM) $(GOBJECTS)
|
||||
.PHONY: clean-go |
||||
|
||||
CLEANFILES = \
|
||||
$(GOBJECTS) \
|
||||
$(TESTS:tests/%.scm=%.log)
|
@ -1,36 +0,0 @@
|
||||
dnl -*- Autoconf -*- |
||||
|
||||
AC_INIT(bible-tools, 1.0) |
||||
AC_SUBST(HVERSION, "\"1.0\"") |
||||
AC_SUBST(AUTHOR, "\"\"") |
||||
AC_SUBST(COPYRIGHT, "'(2022)") |
||||
AC_SUBST(LICENSE, gpl3+) |
||||
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]) |
||||
|
||||
AC_CONFIG_FILES([Makefile]) |
||||
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) |
||||
AC_CONFIG_FILES([scripts/bible-app],[chmod +x scripts/bible-app]) |
||||
AC_CONFIG_FILES([scripts/word-counter],[chmod +x scripts/word-counter]) |
||||
AC_CONFIG_FILES([scripts/bible2latex],[chmod +x scripts/bible2latex]) |
||||
dnl Search for 'guile' and 'guild'. This macro defines |
||||
dnl 'GUILE_EFFECTIVE_VERSION'. |
||||
GUILE_PKG([3.0 2.2 2.0]) |
||||
GUILE_PROGS |
||||
GUILE_SITE_DIR |
||||
if test "x$GUILD" = "x"; then |
||||
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.]) |
||||
fi |
||||
|
||||
dnl Hall auto-generated guile-module dependencies |
||||
|
||||
|
||||
dnl Installation directories for .scm and .go files. |
||||
guilemoduledir="${datarootdir}/guile/site/$GUILE_EFFECTIVE_VERSION" |
||||
guileobjectdir="${libdir}/guile/$GUILE_EFFECTIVE_VERSION/site-ccache" |
||||
AC_SUBST([guilemoduledir]) |
||||
AC_SUBST([guileobjectdir]) |
||||
|
||||
AC_OUTPUT |
@ -1,13 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`" |
||||
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`" |
||||
|
||||
GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH" |
||||
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH" |
||||
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH |
||||
|
||||
PATH="$abs_top_builddir/scripts:$PATH" |
||||
export PATH |
||||
|
||||
exec "$@" |
@ -0,0 +1,41 @@
|
||||
#! /usr/bin/env sh |
||||
exec guile -e '(@ (read-bible) main)' -s "$0" "$@" |
||||
!# |
||||
|
||||
(define-module (read-bible) |
||||
#:use-module (bible-tools) |
||||
#:use-module (srfi srfi-1) |
||||
#:use-module (srfi srfi-26) |
||||
#:export (main)) |
||||
|
||||
(define (verse->string v) |
||||
(string-append (book v) " " (chapter v) ":" (verse v) "\t" (text v))) |
||||
|
||||
(define (print-text txt) |
||||
(for-each (lambda (str) (display str) (newline)) |
||||
(map verse->string txt))) |
||||
|
||||
(define (help) |
||||
(display "Usage: read-bible bible [-b book] [-c chapter] [-h] [-v]\n") |
||||
(display "\t-b book\t\tthe book to read\n") |
||||
(display "\t-c chapter\tthe chapter to read\n") |
||||
(display "\t-h\t\tdisplay this help message\n") |
||||
(display "\t-v\t\tdisplay the current version\n")) |
||||
|
||||
(define (version) |
||||
(display "read-bible v1.0.0\n")) |
||||
|
||||
(define (main args) |
||||
(define flag? (cut member <> args)) |
||||
(define get (compose cadr flag?)) |
||||
(define-syntax conf |
||||
(syntax-rules (else) |
||||
((_ (f e)... (else g)) (cond ((flag? f) e)... (else g))))) |
||||
(with-bible (cadr args) |
||||
(conf ("-h" (help)) |
||||
("-v" (version)) |
||||
("-b" (if (flag? "-c") |
||||
(call-with-chapter (get "-b") (get "-c") |
||||
print-text) |
||||
(call-with-book (get "-b") print-text))) |
||||
(else (help))))) |
Loading…
Reference in new issue