Top level conversion to new package system.
This commit is contained in:
parent
9e42982490
commit
d27dba1aba
22
INSTALL
22
INSTALL
|
@ -6,20 +6,22 @@ The Scheme Untergrund Library requires that scsh is installed on your
|
|||
system. If you don't have it, please obtain and install it before
|
||||
building sunterlib. See the webpage <http://scsh.net/>.
|
||||
|
||||
CONFIGURING SUNTERLIB
|
||||
BUILD
|
||||
|
||||
Sunterlib does not require configuration at this time. You may want to
|
||||
adjust the Makefile's "prefix" variable to set the installation
|
||||
directory.
|
||||
|
||||
BUILDING SUNTERLIB
|
||||
|
||||
Type 'make' to build the package.
|
||||
If you obtained the source from cvs, type 'make' to build the
|
||||
package. This is not necessary if you have a tar distribution.
|
||||
|
||||
INSTALLATION
|
||||
|
||||
Type 'make install' to install the package.
|
||||
As of version 0.6, sunterlib follows Michel Schinz's scsh package
|
||||
proposal for installation and use. Please see:
|
||||
scsh/scsh-packages/doc/latex/proposal.tex
|
||||
|
||||
The top-level installation script is install-pkg. It will install all
|
||||
of the libraries.
|
||||
|
||||
TODO: install-pkg scripts for individual library subdirectories.
|
||||
|
||||
UNINSTALLATION
|
||||
|
||||
Type 'make uninstall' to uninstall the package.
|
||||
See the packaging proposal for details.
|
||||
|
|
130
Makefile
130
Makefile
|
@ -1,32 +1,13 @@
|
|||
SHELL = /bin/sh
|
||||
|
||||
prefix = /usr/local
|
||||
libdir = $(prefix)/lib
|
||||
docdir = $(prefix)/share/doc
|
||||
pkglibdir = $(libdir)/sunterlib
|
||||
pkgdocdir = $(docdir)/sunterlib
|
||||
|
||||
INSTALL = /usr/bin/install
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
version := 0.6
|
||||
major-version = 0
|
||||
minor-version = 6
|
||||
version := $(major-version).$(minor-version)
|
||||
|
||||
prefix = /tmp/sunterlib
|
||||
|
||||
s48-interfaces := $(shell find s48 \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name interfaces.scm)
|
||||
s48-packages := $(shell find s48 \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name packages.scm)
|
||||
s48-srcs := $(shell find s48 \
|
||||
-mindepth 2 \
|
||||
! -name interfaces.scm \
|
||||
! -name packages.scm \
|
||||
-name "*.scm")
|
||||
s48-docs := $(shell find s48 \
|
||||
-mindepth 2 \
|
||||
-name README)
|
||||
s48-authors := $(shell find s48 \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name AUTHORS)
|
||||
|
@ -34,20 +15,6 @@ s48-blurbs := $(shell find s48 \
|
|||
-maxdepth 2 -mindepth 2 \
|
||||
-name BLURB)
|
||||
|
||||
scsh-interfaces := $(shell find scsh \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name interfaces.scm)
|
||||
scsh-packages := $(shell find scsh \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name packages.scm)
|
||||
scsh-srcs := $(shell find scsh \
|
||||
-mindepth 2 \
|
||||
! -name interfaces.scm \
|
||||
! -name packages.scm \
|
||||
-name "*.scm")
|
||||
scsh-docs := $(shell find scsh \
|
||||
-mindepth 2 \
|
||||
-name README)
|
||||
scsh-authors := $(shell find scsh \
|
||||
-maxdepth 2 -mindepth 2 \
|
||||
-name AUTHORS)
|
||||
|
@ -55,83 +22,32 @@ scsh-blurbs := $(shell find scsh \
|
|||
-maxdepth 2 -mindepth 2 \
|
||||
-name BLURB)
|
||||
|
||||
s48-targets := s48-interfaces.scm s48-packages.scm sunterlib-s48.scm
|
||||
scsh-targets := interfaces.scm packages.scm sunterlib.scm
|
||||
targets := $(s48-targets) $(scsh-targets) DETAILS
|
||||
targets := DETAILS COPYING pkg-def.scm
|
||||
|
||||
.PHONY: all s48 scsh
|
||||
all : s48 scsh DETAILS
|
||||
s48 : $(s48-targets)
|
||||
scsh : $(scsh-targets)
|
||||
.PHONY: all
|
||||
all : $(targets)
|
||||
|
||||
s48-interfaces.scm : $(s48-interfaces) build/header.scm
|
||||
cat build/header.scm > s48-interfaces.scm
|
||||
for interface in $(s48-interfaces) ; \
|
||||
do \
|
||||
cat $${interface} >> s48-interfaces.scm ; \
|
||||
done
|
||||
|
||||
s48-packages.scm : $(s48-packages) build/header.scm
|
||||
build/xpackages.scm s48-packages.scm build/header.scm $(s48-packages)
|
||||
|
||||
interfaces.scm : $(s48-interfaces) $(scsh-interfaces) build/header.scm
|
||||
cat build/header.scm > interfaces.scm
|
||||
for interface in $(s48-interfaces) $(scsh-interfaces) ; \
|
||||
do \
|
||||
cat $${interface} >> interfaces.scm ; \
|
||||
done
|
||||
|
||||
packages.scm : $(s48-packages) $(scsh-packages) build/header.scm
|
||||
build/xpackages.scm packages.scm build/header.scm $(s48-packages) $(scsh-packages)
|
||||
|
||||
sunterlib-s48.scm : s48-interfaces.scm s48-packages.scm
|
||||
cat s48-interfaces.scm s48-packages.scm > sunterlib-s48.scm
|
||||
|
||||
sunterlib.scm : interfaces.scm packages.scm
|
||||
cat interfaces.scm packages.scm > sunterlib.scm
|
||||
|
||||
DETAILS : $(s48-authors) $(s48-blurbs) $(scsh-authors) $(scsh-blurbs)
|
||||
DETAILS : $(s48-authors) $(s48-blurbs) $(scsh-authors) $(scsh-blurbs) \
|
||||
build/details.scm build/dirs.scm build/header.scm
|
||||
build/details.scm
|
||||
|
||||
COPYING : $(s48-authors) $(scsh-authors) \
|
||||
build/copying.scm build/common.scm build/header.scm build/dirs.scm
|
||||
build/copying.scm
|
||||
|
||||
pkg-def.scm : $(s48-authors) $(scsh-authors) \
|
||||
build/make-pkg-def.scm build/common.scm build/header.scm \
|
||||
build/dirs.scm
|
||||
build/make-pkg-def.scm $(major-version) $(minor-version)
|
||||
|
||||
.PHONY : install uninstall
|
||||
install : s48 scsh DETAILS
|
||||
$(INSTALL) -d $(pkglibdir)
|
||||
$(INSTALL_DATA) s48-interfaces.scm s48-packages.scm sunterlib-s48.scm $(pkglibdir)
|
||||
$(INSTALL_DATA) interfaces.scm packages.scm sunterlib.scm $(pkglibdir)
|
||||
$(INSTALL) -d $(pkgdocdir)
|
||||
$(INSTALL_DATA) README $(pkgdocdir)
|
||||
$(INSTALL_DATA) COPYING $(pkgdocdir)
|
||||
$(INSTALL_DATA) DETAILS $(pkgdocdir)
|
||||
for s48src in $(s48-srcs); \
|
||||
do \
|
||||
$(INSTALL) -d $(pkglibdir)/`dirname $${s48src}`; \
|
||||
$(INSTALL_DATA) $${s48src} $(pkglibdir)/$${s48src}; \
|
||||
done
|
||||
for s48doc in $(s48-docs); \
|
||||
do \
|
||||
$(INSTALL) -d $(pkgdocdir)/`dirname $${s48doc}`; \
|
||||
$(INSTALL_DATA) $${s48doc} $(pkgdocdir)/$${s48doc}; \
|
||||
done
|
||||
for scshsrc in $(scsh-srcs); \
|
||||
do \
|
||||
$(INSTALL) -d $(pkglibdir)/`dirname $${scshsrc}`; \
|
||||
$(INSTALL_DATA) $${scshsrc} $(pkglibdir)/$${scshsrc}; \
|
||||
done
|
||||
for scshdoc in $(scsh-docs); \
|
||||
do \
|
||||
$(INSTALL) -d $(pkgdocdir)/`dirname $${scshdoc}`; \
|
||||
$(INSTALL_DATA) $${scshdoc} $(pkgdocdir)/$${scshdoc}; \
|
||||
done
|
||||
|
||||
uninstall :
|
||||
-rm -rf $(pkglibdir) $(pkgdocdir)
|
||||
|
||||
install : $(targets)
|
||||
./install-pkg --prefix $(prefix)
|
||||
|
||||
.PHONY : dist
|
||||
dist :
|
||||
dist : targets
|
||||
mkdir sunterlib-$(version)
|
||||
cp COPYING INSTALL Makefile NEWS README README.admin README.contrib sunterlib-$(version)/
|
||||
cp -r build sunterlib-$(version)/build
|
||||
cp pkg-def.scm COPYING INSTALL NEWS README README.admin README.contrib sunterlib-$(version)/
|
||||
cp -r s48 sunterlib-$(version)/s48
|
||||
cp -r scsh sunterlib-$(version)/scsh
|
||||
find sunterlib-$(version)/ -name CVS | xargs rm -rf
|
||||
|
|
9
NEWS
9
NEWS
|
@ -1,10 +1,17 @@
|
|||
version 0.6
|
||||
* COPYING is now autogenerated.
|
||||
* Libraries now have their own version numbers.
|
||||
* Libraries now have their own NEWS.
|
||||
* AUTHORS files now must contain copyrights.
|
||||
* New package system
|
||||
* interfaces.scm + packages.scm -> load.scm
|
||||
* add pkg-def.scm
|
||||
* New scsh library: scsh-packages
|
||||
* New s48 library: mini-profiler
|
||||
* New s48 library: reinitializer
|
||||
* New scsh libraries: file-mode
|
||||
* New s48 libraries: SRFI-34/SRFI-35 exceptions and conditions, SRFI-10
|
||||
|
||||
|
||||
version 0.5 2003-11-19
|
||||
* New s48 libraries: procedure-tables.
|
||||
* New scsh libraries: tiff.
|
||||
|
|
33
README
33
README
|
@ -1,40 +1,15 @@
|
|||
Scheme Untergrund Library
|
||||
|
||||
The Scheme Untergrund Library hosts contributed code for Scheme48 and
|
||||
Scsh. In addition to acting as host, the project provides a
|
||||
centralized way to access these packages from the languages' module
|
||||
system.
|
||||
Scsh.
|
||||
|
||||
Sunterlib is hosted at Savannah:
|
||||
http://savannah.nongnu.org/projects/sunterlib/
|
||||
|
||||
USE
|
||||
INSTALLATION AND USE
|
||||
|
||||
To use sunterlib, first make sure the library is installed (see
|
||||
INSTALL).
|
||||
|
||||
After installation, the library is available in
|
||||
/usr/local/lib/sunterlib,
|
||||
and the documentation is available in
|
||||
/usr/local/share/doc/sunterlib
|
||||
(or the corresponding subdirectories of the prefix used for
|
||||
installation).
|
||||
|
||||
The file "sunterlib.scm" is the full sunterlib interface for use with
|
||||
scsh ("sunterlib.scm" is composed of the deprecated "interfaces.scm"
|
||||
and "packages.scm").
|
||||
|
||||
The file "sunterlib-s48.scm" is the sunterlib subset interface for use
|
||||
with scheme48 ("sunterlib-s48.scm" is composed of the deprecated
|
||||
"s48-interfaces.scm" and "s48-packages.scm").
|
||||
|
||||
A typical scsh script might start like this:
|
||||
|
||||
#!/usr/local/bin/scsh \
|
||||
-lm /usr/local/lib/sunterlib/sunterlib.scm -o foo -s
|
||||
!#
|
||||
|
||||
where "foo" is a sunterlib package needed by your script.
|
||||
As of version 0.6, sunterlib follows Michel Schinz's scsh package
|
||||
proposal for installation and use. Please see INSTALL for details.
|
||||
|
||||
BUGS
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
How to make a release:
|
||||
|
||||
1. Make sure NEWS is up-to-date (at least add the distribution date).
|
||||
1. Make sure the NEWS files are up-to-date (at least add the
|
||||
distribution date).
|
||||
2. Check out a clean source tree from cvs.
|
||||
3. Make the distribution:
|
||||
make dist
|
||||
|
@ -10,4 +11,4 @@ How to make a release:
|
|||
6. Post the release:
|
||||
scp sunterlib-0.1.tar.gz subversions.gnu.org:/upload/sunterlib/release.pkg/0.1/
|
||||
7. Increment the version number in Makefile.
|
||||
8. Start a new version entry in NEWS.
|
||||
8. Start a new version entry in the top level NEWS file.
|
||||
|
|
|
@ -3,26 +3,38 @@ GUIDLINES FOR CONTRIBUTORS
|
|||
ADDING A NEW LIBRARY
|
||||
|
||||
0. This library only accepts code with the modified bsd license in the
|
||||
file COPYING. Add your name to the file COPYING.
|
||||
(generated) file COPYING.
|
||||
|
||||
1. Create a new subdirectory of s48 or scsh for your library. Only
|
||||
touch files in your library's tree.
|
||||
|
||||
2. Your library's tree should have at least these files:
|
||||
AUTHORS -- a list of your library's authors.
|
||||
AUTHORS -- (CHANGED in Sunterlib 0.6) a list of your library's
|
||||
copyright(s), keep the year up to date if you make changes to your
|
||||
library.
|
||||
BLURB -- a one or two line description of your library. It should
|
||||
start with the name of your library's directory followed by a colon.
|
||||
README -- a text file documenting your library.
|
||||
interfaces.scm -- the interfaces defined by your library.
|
||||
packages.scm -- the packages defined by your library.
|
||||
start with the name of your library's directory followed by a
|
||||
colon.
|
||||
NEWS -- (NEW in Sunterlib 0.6) each contributed library has
|
||||
its own version number. Start with whatever version
|
||||
number is appropriate for your library. To avoid releasing
|
||||
different versions under the same number, if the Sunterlib version
|
||||
has changed, then bump the local version number before changing
|
||||
your library. Remember to keep the local NEWS file up to date with
|
||||
your library. Remember to keep the version number up to date with
|
||||
your package definition.
|
||||
pkg-def.scm -- (NEW in Sunterlib 0.6) the package definition for
|
||||
your library. Use the COPYING procedure to generate the COPYING
|
||||
file. For an example, see s48/args-fold/pkg-def.scm
|
||||
load.scm -- (WAS interfaces.scm, packages.scm before Sunterlib 0.6)
|
||||
the interfaces and packages defined by your library.
|
||||
|
||||
Our administration and the build systems depends on these files.
|
||||
Our administration and the build systems depends on those files.
|
||||
|
||||
3. Currently, the install script only installs ".scm" source files and
|
||||
README documentation files.
|
||||
README -- a text file documenting your library. Recomended
|
||||
|
||||
4. Add an entry for your library to the NEWS file in the top-level
|
||||
directory of Sunterlib.
|
||||
3. Add an entry for your library to the NEWS file in the top-level
|
||||
directory of Sunterlib.
|
||||
|
||||
CONVENTIONS
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
Copyright (c) 2003 Anthony Carrico, Martin Gasbichler
|
||||
Copyright (c) 2003 Eric Knauel, Matthias Neubauer
|
||||
Copyright (c) 2003 RT Happe
|
||||
Copyright (c) 2003 Taylor Campbell
|
||||
Copyright (c) 2003 Michel Schinz
|
||||
Copyright (c) 2003 Oleg Kiselyov
|
||||
Copyright (c) 2003 Mike Sperber
|
||||
;;; This file is part of the Scheme Untergrund Library. For copyright
|
||||
;;; information, see the file COPYING which comes with the
|
||||
;;; distribution.
|
||||
|
||||
(define license
|
||||
"
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
@ -29,3 +27,23 @@ 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.
|
||||
")
|
||||
|
||||
(define port->string
|
||||
(lambda (port)
|
||||
(let loop ((result ""))
|
||||
(let ((chunk (read-string 1024 port)))
|
||||
(if chunk
|
||||
(loop (string-append result chunk))
|
||||
result)))))
|
||||
|
||||
(define get-copyrights
|
||||
(lambda ()
|
||||
(call-with-input-file
|
||||
"AUTHORS"
|
||||
(lambda (port)
|
||||
(port->string port)))))
|
||||
|
||||
(define COPYING
|
||||
(lambda ()
|
||||
(string-append (get-copyrights) license)))
|
|
@ -0,0 +1,28 @@
|
|||
#! /bin/sh
|
||||
exec scsh -o filenames -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; This file is part of the Scheme Untergrund Library. For copyright
|
||||
;;; information, see the file COPYING which comes with the
|
||||
;;; distribution.
|
||||
|
||||
(load "build/common.scm")
|
||||
(load "build/dirs.scm")
|
||||
|
||||
;; Create the COPYING file from the AUTHORS files.
|
||||
(define sunterlib-COPYING
|
||||
(lambda ()
|
||||
(string-append
|
||||
(call-with-input-file "build/header.scm" port->string)
|
||||
(apply
|
||||
string-append
|
||||
(delete-duplicates
|
||||
(cons (get-copyrights)
|
||||
(map (lambda (dir)
|
||||
(with-cwd dir (get-copyrights)))
|
||||
(append s48-dirs scsh-dirs)))))
|
||||
license)))
|
||||
|
||||
(with-current-output-port
|
||||
(open-output-file "COPYING")
|
||||
(display (sunterlib-COPYING)))
|
|
@ -2,28 +2,11 @@
|
|||
exec scsh -o filenames -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; details.scm
|
||||
;;;
|
||||
;;; This file is part of the Scheme Untergrund Library.
|
||||
;;; This file is part of the Scheme Untergrund Library. For copyright
|
||||
;;; information, see the file COPYING which comes with the
|
||||
;;; distribution.
|
||||
|
||||
;;; Copyright (c) 2003 by Anthony Carrico
|
||||
;;; For copyright information, see the file COPYING which comes with
|
||||
;;; the distribution.
|
||||
|
||||
(define s48-dirs
|
||||
(run/strings (find s48
|
||||
-maxdepth 1
|
||||
-mindepth 1
|
||||
-type d
|
||||
! -name CVS
|
||||
! -name rt-modules)))
|
||||
|
||||
(define scsh-dirs
|
||||
(run/strings (find scsh
|
||||
-maxdepth 1
|
||||
-mindepth 1
|
||||
-type d
|
||||
! -name CVS)))
|
||||
(load "build/dirs.scm")
|
||||
|
||||
(define entry
|
||||
(lambda (dir)
|
||||
|
@ -36,7 +19,6 @@ exec scsh -o filenames -s "$0" "$@"
|
|||
(begin
|
||||
(write-char ch)
|
||||
(loop))))))
|
||||
(display "Authors: ")
|
||||
(with-current-input-port
|
||||
(open-input-file (string-append dir "/AUTHORS"))
|
||||
(let loop ()
|
||||
|
@ -51,6 +33,7 @@ exec scsh -o filenames -s "$0" "$@"
|
|||
;; Create the details file from the AUTHORS and BLURB files.
|
||||
(with-current-output-port
|
||||
(open-output-file "DETAILS")
|
||||
(display (call-with-input-file "build/header.scm" port->string))
|
||||
(display "S48 LIBRARIES\n\n")
|
||||
(for-each entry s48-dirs)
|
||||
(display "SCSH LIBRARIES\n\n")
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
;;; This file is part of the Scheme Untergrund Library. For copyright
|
||||
;;; information, see the file COPYING which comes with the
|
||||
;;; distribution.
|
||||
|
||||
(define s48-dirs
|
||||
(run/strings (find s48
|
||||
-maxdepth 1
|
||||
-mindepth 1
|
||||
-type d
|
||||
! -name CVS
|
||||
! -name rt-modules)))
|
||||
|
||||
(define scsh-dirs
|
||||
(run/strings (find scsh
|
||||
-maxdepth 1
|
||||
-mindepth 1
|
||||
-type d
|
||||
! -name CVS)))
|
|
@ -0,0 +1,35 @@
|
|||
#! /bin/sh
|
||||
exec scsh -o filenames -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; This file is part of the Scheme Untergrund Library. For copyright
|
||||
;;; information, see the file COPYING which comes with the
|
||||
;;; distribution.
|
||||
|
||||
(load "build/common.scm")
|
||||
(load "build/dirs.scm")
|
||||
|
||||
(define version (map string->number command-line-arguments))
|
||||
|
||||
(define entry
|
||||
(lambda (dir)
|
||||
(display "(load-package-in \"")
|
||||
(display dir)
|
||||
(display "\")\n")))
|
||||
|
||||
(with-current-output-port
|
||||
(open-output-file "pkg-def.scm")
|
||||
(display (call-with-input-file "build/header.scm" port->string))
|
||||
(display (call-with-input-file "build/common.scm" port->string))
|
||||
(display "\n(define-package \"sunterlib\"\n ")
|
||||
(display version)
|
||||
(display "\n ()
|
||||
(install-file \"COPYING\" 'doc)
|
||||
(install-file \"DETAILS\" 'doc)
|
||||
(install-file \"NEWS\" 'doc)
|
||||
(install-file \"README\" 'doc)
|
||||
(install-file \"README.contrib\" 'doc))\n")
|
||||
(display "\n;; S48 LIBRARIES\n\n")
|
||||
(for-each entry s48-dirs)
|
||||
(display "\n;; SCSH LIBRARIES\n\n")
|
||||
(for-each entry scsh-dirs))
|
|
@ -1,101 +0,0 @@
|
|||
#! /bin/sh
|
||||
exec scsh -o filenames -o pp -s "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; xpackages.scm
|
||||
;;;
|
||||
;;; Copyright (c) 2003 Anthony Carrico
|
||||
;;;
|
||||
;;; 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.
|
||||
|
||||
(define copy-header
|
||||
(lambda (header)
|
||||
(with-current-input-port
|
||||
(open-input-file header)
|
||||
(let loop ()
|
||||
(let ((ch (read-char)))
|
||||
(if (eof-object? ch)
|
||||
(values)
|
||||
(begin
|
||||
(write-char ch)
|
||||
(loop))))))))
|
||||
|
||||
(define process-source
|
||||
(lambda (source)
|
||||
(let* ((directory (file-name-directory source))
|
||||
(massage-file-spec
|
||||
(lambda (file-spec)
|
||||
;; Uses "namestring" from the "filenames" structure to
|
||||
;; process the file-specs, this is the same procedure
|
||||
;; used by the module system.
|
||||
(namestring file-spec directory "scm")))
|
||||
(massage-clause
|
||||
(lambda (clause)
|
||||
(if (not (and (pair? clause) (eq? 'files (car clause))))
|
||||
clause
|
||||
(cons (car clause)
|
||||
(map massage-file-spec (cdr clause)))))))
|
||||
(with-current-input-port
|
||||
(open-input-file source)
|
||||
(let loop ((form (read)))
|
||||
(cond ((eof-object? form)
|
||||
(values))
|
||||
((pair? form)
|
||||
(p
|
||||
(let ((op (car form))
|
||||
(rest (cdr form)))
|
||||
(case op
|
||||
((define-structure define-structures)
|
||||
(if (pair? rest)
|
||||
(let* ((interface (car rest))
|
||||
(clauses (cdr rest)))
|
||||
(cons op
|
||||
(cons interface
|
||||
(map massage-clause clauses))))))
|
||||
((define-interface)
|
||||
form)
|
||||
((define-syntax)
|
||||
;; ISSUE: what does define-syntax mean in the
|
||||
;; configuration language?
|
||||
(error "unexpected form in packages" source form))
|
||||
(else
|
||||
(error "unexpected form in packages" source form)))))
|
||||
(newline)
|
||||
(loop (read)))
|
||||
(else
|
||||
(error "unexpected form in packages" source form))))))))
|
||||
|
||||
(define xpackages
|
||||
;; Copy the header and each source file to the target file, adding
|
||||
;; the source directory to each package's file-specs.
|
||||
(lambda (target header sources)
|
||||
(with-current-output-port
|
||||
(open-output-file target)
|
||||
(copy-header header)
|
||||
(for-each process-source sources))))
|
||||
|
||||
(xpackages (car command-line-arguments)
|
||||
(cadr command-line-arguments)
|
||||
(cddr command-line-arguments))
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
exec scsh -lm scsh/scsh-packages/scheme/install-lib/configure.scm -lm scsh/scsh-packages/scheme/install-lib/install-lib-module.scm -o pp -o configure -o install -e install-main -s "$0" "$@"
|
||||
!#
|
|
@ -1,8 +1,8 @@
|
|||
(define-package "scsh-packages"
|
||||
(0 0)
|
||||
()
|
||||
(install-file "load.scm" 'base)
|
||||
(install-file "README" 'doc)
|
||||
; (install-file "load.scm" 'base)
|
||||
; (install-file "README" 'doc)
|
||||
(install-file "NEWS" 'doc)
|
||||
(install-string (COPYING) "COPYING" 'doc)
|
||||
(install-file "scheme/install-lib/configure.scm" 'scheme)
|
||||
|
|
Loading…
Reference in New Issue