From: Matt Birkholz Date: Sat, 13 Oct 2018 06:32:26 +0000 (-0700) Subject: Install plugin html/pdf documentation in project docdir. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~225 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6f360560c3f66be3987bce5bdfa48fa0c6a0a179;p=mit-scheme.git Install plugin html/pdf documentation in project docdir. Override docdir. Enhance the update-html-index procedure to look for PROJECT-PLUGIN.html as well as PLUGIN.html. --- diff --git a/src/berkeley-db/configure.ac b/src/berkeley-db/configure.ac index 69ab50a15..6dfa8e1de 100644 --- a/src/berkeley-db/configure.ac +++ b/src/berkeley-db/configure.ac @@ -37,8 +37,4 @@ fi MIT_SCHEME_PROJECT=mit-scheme -# Install plugin docs in Scheme's docdir subdirectories. -htmldir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/html' -pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf' - AC_SUBST([MIT_SCHEME_PROJECT]) diff --git a/src/blowfish/Makefile.am b/src/blowfish/Makefile.am index 8f4e9cf3c..1c48110db 100644 --- a/src/blowfish/Makefile.am +++ b/src/blowfish/Makefile.am @@ -106,10 +106,6 @@ install-html: install-html-am echo ' "$(DESTDIR)$(scmdocdir)")' ) \ | $(MIT_SCHEME_EXE) --batch-mode -install-info-am: - -uninstall-info-am: - uninstall-hook: ( echo '(remove-plugin "blowfish" "@MIT_SCHEME_PROJECT@"'; \ echo ' ""'; \ diff --git a/src/blowfish/configure.ac b/src/blowfish/configure.ac index 5b2c72531..62ec85164 100644 --- a/src/blowfish/configure.ac +++ b/src/blowfish/configure.ac @@ -159,6 +159,9 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +# Install plugin docs in Scheme's docdir. +docdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)' + AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_SCHEME_EXE]) AC_SUBST([MIT_CFLAGS]) diff --git a/src/edwin/configure.ac b/src/edwin/configure.ac index 484b14542..187cf70c8 100644 --- a/src/edwin/configure.ac +++ b/src/edwin/configure.ac @@ -44,10 +44,6 @@ MIT_SCHEME_OS_SUFFIX=`echo "(display (microcode-id/operating-system-suffix))" \ MIT_SCHEME_SOURCES=`./sources.sh scm` MIT_SCHEME_BINARIES=`./sources.sh com` -# Install plugin docs in Scheme's docdir subdirectories. -htmldir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/html' -pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf' - AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_SCHEME_SOURCES]) AC_SUBST([MIT_SCHEME_BINARIES]) diff --git a/src/ffi/build.scm b/src/ffi/build.scm index b30e635a9..f108574a2 100644 --- a/src/ffi/build.scm +++ b/src/ffi/build.scm @@ -75,7 +75,7 @@ USA. operation))))))) (update-optiondb plugins scmlibdir) (update-info-index project plugins infodir scmdocdir) - (update-html-index plugins scmdocdir))))) + (update-html-index project plugins scmdocdir))))) (define (delete-plugin-list) ;; For the prerm script: delete the database of plugins (plugins.scm @@ -102,7 +102,7 @@ USA. (begin (update-optiondb plugins scmlibdir) (update-info-index project plugins infodir scmdocdir) - (update-html-index plugins scmdocdir)))))) + (update-html-index project plugins scmdocdir)))))) (define (update-optiondb plugins scmlibdir) (let ((filename (string scmlibdir"optiondb.scm"))) @@ -157,7 +157,7 @@ USA. (substring line (fix:+ index str-len))) line)))))))))) -(define (update-html-index plugins scmdocdir) +(define (update-html-index project plugins scmdocdir) (let* ((scmhtmldir (if (file-exists? (string scmdocdir"html/index.html")) (string scmdocdir"html/") scmdocdir)) @@ -173,18 +173,19 @@ USA. "\n") out) ;; Write new list. - (let ((names.titles (sort (html-names.titles plugins scmhtmldir) - (lambda (a b) - (string" out) - (write-string (cdr name.title) out) + (write-string (car filename.title) out) + (write-string "\">" out) + (write-string (cdr filename.title) out) (write-string "\n" out)) - names.titles) - (if (null? names.titles) + filenames.titles) + (if (null? filenames.titles) (write-string "None currently installed.\n" out))) ;; Skip old list. @@ -204,13 +205,23 @@ USA. (newline out)))) (warn "Scheme html index not found:" filename)))) -(define (html-names.titles plugins scmhtmldir) - (append-map! (lambda (plugin) - (let ((filename (string scmhtmldir plugin".html"))) - (if (file-exists? filename) - (list (cons plugin (read-html-title filename))) - '()))) - plugins)) +(define (html-filenames.titles project plugins scmhtmldir) + + (define (existing-file . strings) + (let ((filename (string* strings))) + (and (file-exists? filename) + filename))) + + (append-map! + (lambda (plugin) + (let ((filename + (or (existing-file scmhtmldir plugin".html") + (existing-file scmhtmldir project"-"plugin".html") + (existing-file scmhtmldir project"-"plugin"/index.html")))) + (if filename + (list (cons filename (read-html-title filename))) + '()))) + plugins)) (define (read-html-title filename) (let ((patt (compile-regsexp '(seq "" diff --git a/src/gdbm/Makefile.am b/src/gdbm/Makefile.am index 20b01cd9e..3df4736cf 100644 --- a/src/gdbm/Makefile.am +++ b/src/gdbm/Makefile.am @@ -106,10 +106,6 @@ install-html: install-html-am echo ' "$(DESTDIR)$(scmdocdir)")' ) \ | $(MIT_SCHEME_EXE) --batch-mode -install-info-am: - -uninstall-info-am: - uninstall-hook: ( echo '(remove-plugin "gdbm" "@MIT_SCHEME_PROJECT@"'; \ echo ' ""'; \ diff --git a/src/gdbm/configure.ac b/src/gdbm/configure.ac index 401a53172..73e4b5cf1 100644 --- a/src/gdbm/configure.ac +++ b/src/gdbm/configure.ac @@ -114,6 +114,9 @@ done MIT_SCHEME_DEPS="${MIT_SCHEME_DEPS} ${MIT_SCHEME_PKD}: stamp-scheme" +# Install plugin docs in Scheme's docdir. +docdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)' + AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_CFLAGS]) AC_SUBST([MIT_SCHEME_EXE]) diff --git a/src/imail/Makefile.am b/src/imail/Makefile.am index cf40c0355..ba473a838 100644 --- a/src/imail/Makefile.am +++ b/src/imail/Makefile.am @@ -106,10 +106,6 @@ install-html: install-html-am echo ' "$(DESTDIR)$(scmdocdir)")' ) \ | $(MIT_SCHEME_EXE) --batch-mode -install-info-am: - -uninstall-info-am: - uninstall-hook: ( echo '(remove-plugin "imail" "@MIT_SCHEME_PROJECT@"'; \ echo ' ""'; \ diff --git a/src/imail/configure.ac b/src/imail/configure.ac index 7ec4ebb83..62006b380 100644 --- a/src/imail/configure.ac +++ b/src/imail/configure.ac @@ -42,9 +42,8 @@ MIT_SCHEME_LIBDIR=`( echo "(display (->namestring" ;\ MIT_SCHEME_OS_SUFFIX=`echo "(display (microcode-id/operating-system-suffix))" \ | ${MIT_SCHEME_EXE} --batch-mode` -# Install plugin docs in Scheme's docdir subdirectories. -htmldir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/html' -pdfdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)/pdf' +# Install plugin docs in Scheme's docdir. +docdir='$(datarootdir)/doc/$(MIT_SCHEME_PROJECT)' AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_SCHEME_EXE])