diff --git a/AUTHORS b/AUTHORS index 7c4b105..f172918 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1,3 @@ Christoph de Mattia +Eric Knauel +Martin Gasbichler diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..1154e3f --- /dev/null +++ b/COPYING @@ -0,0 +1,28 @@ +Copyright (c) 2004 Christoph de Mattia +Copyright (c) 2004-2005 Eric Knauel +Copyright (c) 2004-2005 Martin Gasbichler + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..59b47c5 --- /dev/null +++ b/INSTALL @@ -0,0 +1,43 @@ +These are generic installation instructions for scsh packages. + +Prerequisites +============= + +The scsh installation library is required to install this package. +This library *must* be present on your system before the current +package can be installed. It can be obtained from the following Web +page: + + http://lamp.epfl.ch/~schinz/scsh_packages/ + +The installation library comes with its own documentation which +explains in detail how to install and use scsh packages. It is +recommended that you read it before installing your first scsh +package. What follows is a very brief summary of this documentation, +intended to get you started quickly. + + +Installation +============ + +Installation of a scsh package is performed by launching the +"scsh-install-pkg" script, which is part of the scsh installation +library. This script must be launched from within the directory which +resulted from the expansion of the current package's archive, i.e. the +one containing the file you are reading now. + +A list of all the arguments accepted by the "scsh-install-pkg" script +can be obtained by launching it with the "--help" option. One of these +arguments, "--prefix", is mandatory and specifies the location where +installation should be performed. Ideally, you should use the same +prefix to install all scsh packages, as this makes them easier to +manage and use. + +For example, to install the current package in +"/usr/local/share/scsh-modules", you should type the following: + + scsh-install-pkg --prefix=/usr/local/share/scsh-modules + +Provided that no errors are encountered during installation, a +message will be printed at the end explaining how to use the newly +installed package. diff --git a/Makefile.am b/Makefile.am index 0ec1954..725b34e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,8 @@ SUBDIRS = c -EXTRA_DIST = c/ncurses.c \ - scheme/ncurses-interfaces.scm \ - scheme/scsh-package.scm \ +EXTRA_DIST = \ + scheme/ncurses-packages.scm \ scheme/ncurses.scm \ scheme/ncurses-constants.scm \ + scheme/input-buffer.scm \ pkg-def.scm diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..f1ccb2b --- /dev/null +++ b/NEWS @@ -0,0 +1,4 @@ +* Version 1.0 (released 2005-10-31) + +First public release. + diff --git a/README b/README new file mode 100644 index 0000000..5ef7c83 --- /dev/null +++ b/README @@ -0,0 +1,51 @@ +scsh-ncurses 1.0 README -*-outline -*- + + + scsh ncurses bindings + ===================== + + +This library adds bindings for the ncurses library to scsh, the Scheme +shell. + +* Installation +============== + +scsh-ncurses conforms to the packaging proposal for +scsh by Michel Schinz. Please see: + + + +In short, this means that you can install scsh-ncurses by unpacking +the scsh-ncurses tarball and issuing the following command in the +created directory: + +scsh-install-pkg --prefix /path/to/your/package/root + +See the file INSTALL for the generic installation instructions for +scsh packages. + +* Documentation +=============== + +There is currently no documentation specific to scsh-ncurses. However, +this library maps most of the C functions directly to Scheme +procedures, hence the man pages for ncurses are sufficient in most +cases. + + +* Loading the code +================== + +Start scsh like this: + +scsh -lel scsh-ncurses/load.scm + + +* Support +========= + +Please direct questions, comments, answers about scsh-ncurses to the regular +scsh mailing list at + +scsh-users@scsh.net diff --git a/configure.in b/configure.in index 13bf091..b53d9c5 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(scsh-ncurses, 0.1) +AC_INIT(scsh-ncurses, 1.0) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(configure.in) @@ -27,4 +27,4 @@ AC_SUBST(libsysdir) AC_SUBST(schemedir) AC_SUBST(LIBS) AC_SUBST(CC) -AC_OUTPUT([Makefile c/Makefile]) \ No newline at end of file +AC_OUTPUT([Makefile c/Makefile]) diff --git a/pkg-def.scm b/pkg-def.scm index 81f2953..d007373 100644 --- a/pkg-def.scm +++ b/pkg-def.scm @@ -1,5 +1,5 @@ -(define-package "scsh-ncurses" (0 2) - ((install-lib-version (1 0))) +(define-package "scsh-ncurses" (1 0) + ((install-lib-version (1 1 2))) (display "configuring, compiling and installing c-stubs") (newline) @@ -31,25 +31,51 @@ (let ((schemedir (get-directory 'scheme #f)) (libdir (get-directory 'lib #f))) (write-to-load-script - `((user) + `((new-package) + (structure 'load-scsh-ncurses '(export)) + (open 'scheme-with-scsh) + (open 'srfi-13) (load-package 'dynamic-externals) (open 'dynamic-externals) (open 'external-calls) (open 'configure) (open 'signals) - ,@(map (lambda (x) `(run ',x)) tmpl-libtool-la-reader) - (run '(let* ((lib-dir (string-append ,libdir "/" (host))) - (la-file-name (string-append lib-dir "/libscshncurses.la")) - (initializer-name "s48_init_ncurses")) - (let ((la-alist (read-libtool-la la-file-name))) - (cond - ((assoc 'dlname la-alist) - => (lambda (p) - (let ((module-file (string-append lib-dir "/" (cdr p)))) - (dynamic-load module-file) - (call-external (get-external initializer-name))))) - (else - (error "Could not figure out libscshncurses' name" la-file-name)))))) + (open 'define-record-types) + (open 'records) + (open 'i/o) + (run '(define (scsh-ncurses-init) + ,@tmpl-libtool-la-reader + + (let* ((lib-dir (string-append ,libdir "/" (host))) + (la-file-name (string-append lib-dir "/libscshncurses.la")) + (initializer-name "s48_init_ncurses")) + (let ((la-alist (read-libtool-la la-file-name))) + + (cond + ((assoc 'dlname la-alist) + => (lambda (p) + (let ((module-file (string-append lib-dir "/" (cdr p)))) + (dynamic-load module-file) + (lookup-all-externals) ;;; important when resuming images + (call-external (get-external initializer-name))))) + (else + (error "Could not figure out libscshncurses' name" ))))))) + + (run '(scsh-ncurses-init)) + + ;; TODO: This is also in sunterlib/heap-images/reinitializer.scm + (run '(define-record-type reinitializer :reinitializer + (make-reinitializer thunk) + reinitializer? + (thunk reinitializer-thunk))) + + (run '(define-record-resumer :reinitializer + (lambda (r) + ((reinitializer-thunk r))))) + + (run '(define scsh-ncurses-reinitializer + (make-reinitializer scsh-ncurses-init))) + (config) (load ,(string-append schemedir "/ncurses-packages.scm")) (user)))) @@ -58,5 +84,5 @@ (newline) (install-directory-contents "scheme" 'scheme) -; (install-file '("COPYING" . "LICENSE") 'doc) + (install-file '("COPYING" . "LICENSE") 'doc) )