# HG changeset patch # User Arne Babenhauserheide # Date 1594762646 -7200 # Tue Jul 14 23:37:26 2020 +0200 # Node ID 005e2c650559e15e67f482de1d26d667425df6f2 # Parent 0fae96261d03a742922944be9ead56f05a43ee62 wisp-enter, cleanup and README diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -1,4 +1,8 @@ -conf +conf 0.2.5 +- add languages wisp and wisp-enter +- requirements in README.md + +conf 0.2.4 - conf new --lang=? lists supported languages - conf new --vcs=? lists supported version tracking systems - new language: latex-copernicus to write a paper for a copernicus journal diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -7,14 +7,33 @@ See NEWS for user-visible changes. See ChangeLog or the history for detailed changes. -## Usage: Create a new project +## Usage + +### Create a new project (example: hello) + + conf new hello --lang bash + +The filenames of projects are restricted to lowercase alphanumerics to +avoid any problems due to edge-cases in different languages. + +### Build and install a project (example: hello) - conf new hello_world --lang bash + cd hello && ./bootstrap.sh && ./configure && make && make install + +user installation: + + cd hello && ./bootstrap.sh && ./configure --prefix ~/.local && make && make install -Currently implemented languages: +And generally everything else you can do with autotools. Also see + + make help + +## Currently implemented languages: - bash (full): script with resources -- guile scheme +- guile scheme: http://gnu.org/s/guile +- wisp: see http://www.draketo.de/english/wisp +- wisp-enter: setup for writing executable fiction - python (partial) - latex-copernicus: write a paper for a copernicus journal @@ -43,6 +62,12 @@ For inspiration, look into template/bash since that includes some necessary tricks to access data paths with autotools under bash. +## Requirements + +- bash: http://gnu.org/s/bash +- sed: http://gnu.org/s/sed +- grep: http://gnu.org/s/grep + ## build conf ./bootstrap.sh ; make diff --git a/conf.in b/conf.in --- a/conf.in +++ b/conf.in @@ -302,8 +302,6 @@ for i in "${TEMPLATES}"/"${PROJLANG}"/*; do cp -r "${i}" "${PROJ}"/ done - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/* - sed -i "s,_TEMPLATE_AUTHOR_,${AUTHOR},g" "${PROJ}"/* # rename template files and folders for i in "${PROJ}"/*"_TEMPLATE_PROJ_"*; do mv "${i}" "${i//_TEMPLATE_PROJ_/$PROJ}" @@ -337,26 +335,29 @@ if test -e "${TAILTAIL}"; then cat "${TAILTAIL}" >> "${PROJ}"/"${i}" fi - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${i}" + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${i}" done # add a pregenerated skelleton if test x"${PROJLANG}" = x"bash"; then cp "${TEMPLATES}/${PROJLANG}/_TEMPLATE_PROJ_".in "${PROJ}"/"${PROJ}".in - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}".in + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}".in fi if test x"${PROJLANG}" = x"python"; then cp "${TEMPLATES}/${PROJLANG}/_TEMPLATE_PROJ_.py" "${PROJ}"/"${PROJ}.py" - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}.py" + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}.py" fi if test x"${PROJLANG}" = x"guile"; then - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}.scm" "${PROJ}"/"${PROJ}"/*".scm" "${PROJ}"/scripts/* + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"${PROJ}.scm" "${PROJ}"/"${PROJ}"/*".scm" "${PROJ}"/scripts/* fi - if test x"${PROJLANG}" = x"wisp"; then + if test x"${PROJLANG}" = x"wisp" || test x"${PROJLANG}" = x"wisp-enter"; then cp "${TEMPLATES}/${PROJLANG}/run-_TEMPLATE_PROJ_.w" "${PROJ}"/"run-${PROJ}.w" - sed -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"run-${PROJ}.w" "${PROJ}"/"${PROJ}"/*".w" "${PROJ}"/scripts/* + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${PROJ}"/"run-${PROJ}.w" "${PROJ}"/"${PROJ}"/*".w" "${PROJ}"/scripts/* fi - # replace the author - sed -i "s/_TEMPLATE_AUTHOR_/${AUTHOR}/g" "${PROJ}"/* + # replace the author and project name in all files + for i in "${PROJ}"/* "${PROJ}"/*/* "${PROJ}"/*/*/*; do + sed --separate -i "s,_TEMPLATE_PROJ_,${PROJ},g" "${i}" + sed --separate -i "s,_TEMPLATE_AUTHOR_,${AUTHOR},g" "${i}" + done chmod +x "${PROJ}"/bootstrap.sh vcs--${PROJVCS}-prepare "${PROJ}" diff --git a/templates/wisp/Makefile.am b/templates/wisp-enter/Makefile.am copy from templates/wisp/Makefile.am copy to templates/wisp-enter/Makefile.am diff --git a/templates/wisp/README.tail b/templates/wisp-enter/README.tail copy from templates/wisp/README.tail copy to templates/wisp-enter/README.tail diff --git a/templates/wisp/_TEMPLATE_PROJ_/doctests.w b/templates/wisp-enter/_TEMPLATE_PROJ_/doctests.w rename from templates/wisp/_TEMPLATE_PROJ_/doctests.w rename to templates/wisp-enter/_TEMPLATE_PROJ_/doctests.w diff --git a/templates/wisp/_TEMPLATE_PROJ_/enter.w b/templates/wisp-enter/_TEMPLATE_PROJ_/enter.w rename from templates/wisp/_TEMPLATE_PROJ_/enter.w rename to templates/wisp-enter/_TEMPLATE_PROJ_/enter.w diff --git a/templates/wisp/_TEMPLATE_PROJ_/hello.w b/templates/wisp-enter/_TEMPLATE_PROJ_/hello.w copy from templates/wisp/_TEMPLATE_PROJ_/hello.w copy to templates/wisp-enter/_TEMPLATE_PROJ_/hello.w diff --git a/templates/wisp/bootstrap.sh b/templates/wisp-enter/bootstrap.sh copy from templates/wisp/bootstrap.sh copy to templates/wisp-enter/bootstrap.sh diff --git a/templates/wisp/configure.ac b/templates/wisp-enter/configure.ac copy from templates/wisp/configure.ac copy to templates/wisp-enter/configure.ac diff --git a/templates/wisp/guile.am b/templates/wisp-enter/guile.am copy from templates/wisp/guile.am copy to templates/wisp-enter/guile.am diff --git a/templates/wisp/language/wisp.scm b/templates/wisp-enter/language/wisp.scm copy from templates/wisp/language/wisp.scm copy to templates/wisp-enter/language/wisp.scm diff --git a/templates/wisp/language/wisp/spec.scm b/templates/wisp-enter/language/wisp/spec.scm copy from templates/wisp/language/wisp/spec.scm copy to templates/wisp-enter/language/wisp/spec.scm diff --git a/templates/wisp/m4/guile.m4 b/templates/wisp-enter/m4/guile.m4 copy from templates/wisp/m4/guile.m4 copy to templates/wisp-enter/m4/guile.m4 diff --git a/templates/wisp/pre-inst-env.in b/templates/wisp-enter/pre-inst-env.in copy from templates/wisp/pre-inst-env.in copy to templates/wisp-enter/pre-inst-env.in diff --git a/templates/wisp/run-_TEMPLATE_PROJ_.w b/templates/wisp-enter/run-_TEMPLATE_PROJ_.w copy from templates/wisp/run-_TEMPLATE_PROJ_.w copy to templates/wisp-enter/run-_TEMPLATE_PROJ_.w diff --git a/templates/wisp/scripts/_TEMPLATE_PROJ_.in b/templates/wisp-enter/scripts/_TEMPLATE_PROJ_.in copy from templates/wisp/scripts/_TEMPLATE_PROJ_.in copy to templates/wisp-enter/scripts/_TEMPLATE_PROJ_.in diff --git a/templates/wisp/Makefile.am b/templates/wisp/Makefile.am --- a/templates/wisp/Makefile.am +++ b/templates/wisp/Makefile.am @@ -36,8 +36,6 @@ SOURCES = \ _TEMPLATE_PROJ_/hello.w \ - _TEMPLATE_PROJ_/enter.w \ - _TEMPLATE_PROJ_/doctest.w \ run-_TEMPLATE_PROJ_.w EXTRA_DIST = \ @@ -59,9 +57,8 @@ .w.go: $(GUILE) -L @abs_top_builddir@ -L @abs_top_srcdir@ -c '(import (language wisp spec))' && $(GUILE_TOOLS) compile -L @abs_top_builddir@ -L @abs_top_srcdir@ -x .w -f wisp $(GUILE_WARNINGS) -o "$@" "$<" ## run-_TEMPLATE_PROJ_.w needs cached files from dependencies that do not get created by guild, so we import from guile once -run-_TEMPLATE_PROJ_.go : run-_TEMPLATE_PROJ_.w _TEMPLATE_PROJ_/enter.go _TEMPLATE_PROJ_/doctests.go +run-_TEMPLATE_PROJ_.go : run-_TEMPLATE_PROJ_.w $(GUILE) -L @abs_top_builddir@ -L @abs_top_srcdir@ -c '(import (language wisp spec))' && $(GUILE) -L @abs_top_builddir@ -L @abs_top_srcdir@ --language=wisp -x .w -c 'import : run-_TEMPLATE_PROJ_' && $(GUILE_TOOLS) compile -L @abs_top_builddir@ -L @abs_top_srcdir@ -x .w -f wisp $(GUILE_WARNINGS) -o "$@" "$<" -_TEMPLATE_PROJ_/enter.go : _TEMPLATE_PROJ_/enter.w _TEMPLATE_PROJ_/doctests.go language/wisp/spec.go: language/wisp/spec.scm language/wisp.go ACLOCAL_AMFLAGS = -I m4 diff --git a/templates/wisp/run-_TEMPLATE_PROJ_.w b/templates/wisp/run-_TEMPLATE_PROJ_.w --- a/templates/wisp/run-_TEMPLATE_PROJ_.w +++ b/templates/wisp/run-_TEMPLATE_PROJ_.w @@ -6,22 +6,7 @@ . #:export : main import : _TEMPLATE_PROJ_ hello - _TEMPLATE_PROJ_ doctests - _TEMPLATE_PROJ_ enter define : main args hello-world - dialogue -define : dialogue - Enter : First Witch - First Witch - Welcome to ,(color 'cyan) enter three witches! ,(color #f) - -define %this-module : current-module -define : test - ## - tests - test-equal #t : not #f - doctests-testmod %this-module -