Commit a8053263 authored by Erick Gallesio's avatar Erick Gallesio

Adding the package manager directory pkgman

parent acb4240a
;;;;
;;;; split-record.stk -- ScmPkg record support
;;;;
;;;; Copyright 2006-2007 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [[email protected]]
;;;; Creation date: 21-Dec-2006 12:00 (eg)
;;;; Last file update: 18-Feb-2007 21:22 (eg)
;;;;
(define (%define-scmpkg-record->struct name parent slots exported?)
(let ((pred (string->symbol (format "~a?" name)))
(constr (string->symbol (format "make-~a" name)))
(arg (gensym))
(val (gensym)))
`(begin
;; Build the structure
(define ,name (make-struct-type ',name ,parent ',(map car slots)))
;; Build the constructor
(define (,constr . ,arg)
(apply make-struct ,name ,arg))
;; Build the predicate
(define (,pred ,arg)
(and (struct? ,arg) (struct-is-a? ,arg ,name)))
;; Build the slot readers
,@(map (lambda (x)
`(define ,(cadr x)
(lambda (,arg)
(%fast-struct-ref ,arg ,name ',(cadr x) ,(cadddr x)))))
slots)
;; Build the slot setters
,@(map (lambda (x)
`(define ,(caddr x)
(lambda (,arg ,val)
(%fast-struct-set! ,arg ,name ',(caddr x) ,(cadddr x) ,val))))
slots)
,(if exported?
`(export ,name ,constr ,pred
,@(map cadr slots)
,@(map caddr slots))
'(void))
;; Build the toplevel result
(values (void) ',name))))
(define (%define-scmpkg-record name body exported?)
(let Loop ((body body)
(parent #f)
(fields '())
(offset 0))
(cond
((null? body)
(%define-scmpkg-record->struct name parent (reverse! fields) exported?))
((not (pair? body))
(error "bad record ~S" body))
((keyword? (car body))
(cond
((null? (cdr body))
(error "value expected after keyword ~S" (car body)))
((eq? (car body) parent:)
(Loop (cddr body) (cadr body) fields offset))
(else ;; ignore this keyword for STklos
(Loop (cddr body) parent fields offset))))
(else
(match-case (car body)
((? symbol?)
(let ((fld (car body)))
(Loop (cdr body)
parent
(cons (list fld
(string->symbol (format "~a-~a" name fld))
(string->symbol (format "~a-~a-set!" name fld))
offset)
fields)
(+ offset 1))))
(((? symbol?) (? symbol?) (? symbol?))
(let ((fld (caar body))
(getter (cadar body))
(setter (cadar body)))
(Loop (cdr body)
parent
(cons (list fld getter setter offset) fields)
(+ offset 1))))
(else
(error "bad record field ~S" (car body))))))))
;; ======================================================================
;; define-record ...
;; ======================================================================
(define-macro (define-record name . body)
(%define-scmpkg-record name body #f))
;; ======================================================================
;; %define-exported-record ...
;; ======================================================================
(define-macro (define-exported-record name . body)
(%define-scmpkg-record name body #t))
;;
;; Exports
;;
(export %define-scmpkg-record %define-scmpkg-record->struct)
(provide "split-record")
;;;;
;;;; split-runtime.stk -- ScmPkg runtime for STklos
;;;;
;;;; Copyright 2007 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [[email protected]]
;;;; Creation date: 12-Feb-2007 18:51 (eg)
;;;; Last file update: 14-Feb-2007 15:08 (eg)
;;;;
;; ======================================================================
;; record ...
;; ======================================================================
;; ======================================================================
;; exception ...
;; ======================================================================
;;;;
;;;; definition of condition types for ScmPkg
;;;;
(define &scmpkg-cond (make-condition-type '&scmpkg-cond
&condition
'(location message backtrace)))
(define &@exception
(make-compound-condition-type '@exception
(list &condition &scmpkg-cond)))
(define &@error ;; &error-message)
(make-compound-condition-type '@error
(list &error-message &scmpkg-cond)))
(define &@io-error
(make-compound-condition-type '@io-error
(list &i/o-error &scmpkg-cond)))
(define &@type-error
(make-compound-condition-type '@type-error
(list &error-message &scmpkg-cond)))
(define &@not-implemented-error
(make-compound-condition-type '@not-implemented-error
(list &condition &scmpkg-cond)))
;;;;
;;;; @RAISE and @ERROR
;;;;
(define @raise raise)
(define (@error proc reason obj)
; (&raise (exception @error ?proc proc ?reason reason ?obj obj))
(error proc reason obj))
(define (@exception-message e)
(if (and (condition? e)
(condition-has-type? e &scmpkg-cond))
(condition-ref e 'message)
(error "cannot find a message associated to exception ~S" e)))
;; ======================================================================
;; File System Primitives ...
;; ======================================================================
(define (@directory-list dir)
(delete! "."
(delete! ".."
(directory-files dir))))
(define (@file-exists? filename)
(or (file-exists? filename)
(file-is-directory? filename)))
(define @file-directory? file-is-directory?)
(define @delete-file remove-file)
(define @rename-file rename-file)
(define (@create-directory dir)
(if (string? dir)
(with-handler (lambda (c) #f)
(make-directory dir)
#t)
(error "bad string ~S" dir)))
(define (@delete-directory dir)
(if (string? dir)
(with-handler (lambda (c) #f)
(remove-directory dir)
#t)
(error "bad string ~S" dir)))
;; ======================================================================
;; Host OS ...
;; ======================================================================
(define @exit exit)
(define @command-line (lambda () (cons (program-name) (argv))))
(define @getenv getenv)
(define @system system)
;; ======================================================================
;; Bit Operation ...
;; ======================================================================
(define @fxand bit-and)
(define @fxior bit-or)
(define @fxxor bit-xor)
(define @fxnot bit-not)
(define @fxarithmetic-shift-left bit-shift)
(define @fxarithmetic-shift-right bit-rshift)
;; ======================================================================
;; Misc ...
;; ======================================================================
(define @unspecified void)
(define @gensym gensym)
;;;;
;;;; split-support.stk -- SPLIT support
;;;;
;;;; Copyright © 2007 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [[email protected]]
;;;; Creation date: 7-Feb-2007 11:03 (eg)
;;;; Last file update: 14-Feb-2007 11:33 (eg)
;;;;
;; ======================================================================
;; Split Runtime
;; ======================================================================
(define-condition-type &type-error &message &type-error?)
(include "Split.d/split-runtime.stk")
(define (exception-get-message cond)
(if (condition? cond)
(if (condition-has-type? cond &message)
(condition-ref cond 'message)
(format "condition of type ~S raised" (struct-type-name (struct-type cond))))
(error "bad exception ~S" cond)))
;; ======================================================================
;; The SPLIT STklos module
;; ======================================================================
(define-module |SPLIT|
(include "Split.d/split-languages.stk")
(include "Split.d/split-interface.stk")
(include "Split.d/split-exception.stk")
(include "Split.d/split-parameter.stk")
(include "Split.d/split-define.stk")
(include "Split.d/split-record.stk")
; (include "Snow.d/snow-srfi89.stk")
; (include "Snow.d/snow-record.stk")
; (include "Snow.d/snow-package.stk")
; (include "Snow.d/snow-misc.stk")
)
(%redefine-module-exports (find-module '|SPLIT|))
(provide "split-support")
# Makefile for stklos-pkgman
# Author: Erick Gallesio [[email protected]]
# Creation date: 22-Dec-2006 12:00 (eg)
# Last file update: 16-Feb-2007 23:34 (eg)
makefiledir= $(prefix)/etc/stklos
makefile_DATA= etc/Makefile-stklospkg.tmpl
bin_SCRIPTS = stklos-pkg
SRC = main.stk add.stk extract.stk http.stk params.stk pkgball.stk \
repository.stk misc.stk tune.stk types.stk
SFLAGS = -l
RM = /bin/rm
SCC = ../utils/stklos-compile
$(bin_SCRIPTS): $(SRC)
$(SCC) $(SFLAGS) -o $(bin_SCRIPTS) main.stk
clean:
$(RM) -f $(bin_SCRIPTS) *~
distclean: clean
# Makefile.in generated by automake 1.10 from Makefile.am.
# @[email protected]
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@[email protected]
# Makefile for stklos-pkgman
# Author: Erick Gallesio [[email protected]]
# Creation date: 22-Dec-2006 12:00 (eg)
# Last file update: 16-Feb-2007 23:34 (eg)
VPATH = @[email protected]
pkgdatadir = $(datadir)/@[email protected]
pkglibdir = $(libdir)/@[email protected]
pkgincludedir = $(includedir)/@[email protected]
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = pkgman
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/stklosconf.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(makefiledir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
makefileDATA_INSTALL = $(INSTALL_DATA)
DATA = $(makefile_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @[email protected]
AMTAR = @[email protected]
AUTOCONF = @[email protected]
AUTOHEADER = @[email protected]
AUTOMAKE = @[email protected]
AWK = @[email protected]
BUILD_ARCH = @[email protected]
BUILD_OS = @[email protected]
CALLCC_STK = @[email protected]
CC = @[email protected]
CCDEPMODE = @[email protected]
CFLAGS = @[email protected]
COMPOBJ = @[email protected]
COMPSRC = @[email protected]
CPP = @[email protected]
CPPFLAGS = @[email protected]
CYGPATH_W = @[email protected]
DEFS = @[email protected]
DEF_PCRE = @[email protected]
DEPDIR = @[email protected]
ECHO_C = @[email protected]
ECHO_N = @[email protected]
ECHO_T = @[email protected]
EGREP = @[email protected]
EXAMPLES = @[email protected]
EXECDIR = @[email protected]
EXEEXT = @[email protected]
GC = @[email protected]
GCINC = @[email protected]
GCLIB = @[email protected]
GMP = @[email protected]
GMPINC = @[email protected]
GMPLIB = @[email protected]
GNOME_CONFIG = @[email protected]
GREP = @[email protected]
GTKLOS = @[email protected]
GTK_CONFIG = @[email protected]
GTK_CONFIG_CFLAGS = @[email protected]
GTK_CONFIG_LIBS = @[email protected]
HAVE_DLOPEN = @[email protected]
HAVE_GNOME = @[email protected]
HAVE_LDAP = @[email protected]
INSTALL = @[email protected]
INSTALL_DATA = @[email protected]
INSTALL_PROGRAM = @[email protected]
INSTALL_SCRIPT = @[email protected]
INSTALL_STRIP_PROGRAM = @[email protected]
LDAP_LIB = @[email protected]
LDFLAGS = @[email protected]
LIBOBJS = @[email protected]
LIBS = @[email protected]
LTLIBOBJS = @[email protected]
LURCDIR = @[email protected]
MAKEINFO = @[email protected]
MKDIR_P = @[email protected]
OBJEXT = @[email protected]
OS_FLAVOUR = @[email protected]
OS_NAME = @[email protected]
PACKAGE = @[email protected]
PACKAGE_BUGREPORT = @[email protected]
PACKAGE_NAME = @[email protected]
PACKAGE_STRING = @[email protected]
PACKAGE_TARNAME = @[email protected]
PACKAGE_VERSION = @[email protected]
PATH_SEPARATOR = @[email protected]
PCRE = @[email protected]
PCREINC = @[email protected]
PCRELIB = @[email protected]
PCRETARGET = @[email protected]
PREFIX = @[email protected]
RANLIB = @[email protected]
SCMDIR = @[email protected]
SET_MAKE = @[email protected]
SHELL = @[email protected]
SH_COMP_FLAGS = @[email protected]
SH_LOADER = @[email protected]
SH_LOAD_FLAGS = @[email protected]
SH_MAIN_LOAD_FLAGS = @[email protected]
SH_SUFFIX = @[email protected]
STACK_DIRECTION = @[email protected]
STKCFLAGS = @[email protected]
STRIP = @[email protected]
SVN_URL = @[email protected]
THREADS = @[email protected]
VERSION = @[email protected]
abs_builddir = @[email protected]
abs_srcdir = @[email protected]
abs_top_builddir = @[email protected]
abs_top_srcdir = @[email protected]
ac_ct_CC = @[email protected]
am__include = @[email protected]
am__leading_dot = @[email protected]
am__quote = @[email protected]
am__tar = @[email protected]
am__untar = @[email protected]
bindir = @[email protected]
build_alias = @[email protected]
builddir = @[email protected]
datadir = @[email protected]
datarootdir = @[email protected]
docdir = @[email protected]
dvidir = @[email protected]
exec_prefix = @[email protected]
host_alias = @[email protected]
htmldir = @[email protected]
includedir = @[email protected]
infodir = @[email protected]
install_sh = @[email protected]
libdir = @[email protected]
libexecdir = @[email protected]
localedir = @[email protected]
localstatedir = @[email protected]
mandir = @[email protected]
mkdir_p = @[email protected]
oldincludedir = @[email protected]
pdfdir = @[email protected]
prefix = @[email protected]
program_transform_name = @[email protected]
psdir = @[email protected]
sbindir = @[email protected]
sharedstatedir = @[email protected]
srcdir = @[email protected]
sysconfdir = @[email protected]
target_alias = @[email protected]
top_builddir = @[email protected]
top_srcdir = @[email protected]
makefiledir = $(prefix)/etc/stklos
makefile_DATA = etc/Makefile-stklospkg.tmpl
bin_SCRIPTS = stklos-pkg
SRC = main.stk add.stk extract.stk http.stk params.stk pkgball.stk \
repository.stk misc.stk tune.stk types.stk
SFLAGS = -l
RM = /bin/rm
SCC = ../utils/stklos-compile
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu pkgman/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu pkgman/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/[email protected] $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/[email protected] $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
install-makefileDATA: $(makefile_DATA)
@$(NORMAL_INSTALL)
test -z "$(makefiledir)" || $(MKDIR_P) "$(DESTDIR)$(makefiledir)"
@list='$(makefile_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(makefileDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(makefiledir)/$$f'"; \
$(makefileDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(makefiledir)/$$f"; \
done
uninstall-makefileDATA:
@$(NORMAL_UNINSTALL)
@list='$(makefile_DATA)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(makefiledir)/$$f'"; \
rm -f "$(DESTDIR)$(makefiledir)/$$f"; \
done