Commit 92e09863 authored by Erick Gallesio's avatar Erick Gallesio

snowman improvements

parent 55bf5cf2
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 11-Dec-2006 14:39 (eg)
;;;; Last file update: 31-Jan-2007 08:33 (eg)
;;;; Last file update: 1-Feb-2007 11:02 (eg)
;;;;
......@@ -115,7 +115,8 @@
;; Meta informations
(((? keyword?) . ?args)
(eprintf "J'ai vu le keyword ~S\n" x))
; Skip this information
(void))
(else
(error "bad implementation requirement: ~S" x))))
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 18-Jan-2007 16:59 (eg)
;;;; Last file update: 31-Jan-2007 14:57 (eg)
;;;; Last file update: 1-Feb-2007 11:00 (eg)
;;;;
......@@ -54,9 +54,14 @@
;; ----------------------------------------------------------------------
(define (local-snowfort-add-package! snowball package version directory)
(define (find-src name)
(let ((snow (make-path directory name (format "~a.snow" name)))
(scm (make-path directory name (format "~a.scm" name))))
(if (file-exists? snow) snow scm)))
(when (> (snowman-verbosity) 0)
(eprintf "Adding package ~S (~a) to local repository\n" package version))
(let* ((src (find-source-file directory package))
(let* ((src (find-src package))
(in (open-file src "r")))
(unless in
(die (format "Cannot open source file ~S ~S" directory src)))
......
......@@ -23,8 +23,8 @@ all: $(OSTK) $(PKGVERS).$(SO)
clean:
/bin/rm -f $(OSTK) $(PKGVERS).{c,stk,$(SO),o}
$(PKGVERS).ostk: src/$(PKG)/$(PKGSRC)
(cd src/$(PKG); $(SCC) $(SFLAGS) -o ../../$(PKG).ostk $(PKGSRC))
$(PKGVERS).ostk: $(PKG)/$(PKGSRC)
(cd $(PKG); $(SCC) $(SFLAGS) -o ../$(PKG).ostk $(PKGSRC))
$(PKGVERS).$(SO): $(PKGVERS).c
$(SCOMP) -c -DMODULE_ENTRY=1 -o $(PKGVERS).o $(PKGVERS).c
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 15-Jan-2007 12:10 (eg)
;;;; Last file update: 31-Jan-2007 11:13 (eg)
;;;; Last file update: 1-Feb-2007 10:57 (eg)
;;;;
;; ----------------------------------------------------------------------
......@@ -30,12 +30,14 @@
(define (write-extract-makefile package version targets dir)
(define (find-src name)
(find-source-file (make-path "src" dir) name))
(let ((snow (make-path name (format "~a.snow" name)))
(scm (make-path name (format "~a.scm" name))))
(if (file-exists? (make-path dir snow)) snow scm)))
(define (make-entry name)
(let ((src (find-src name)))
(printf "~a.ostk: ~a\n" name src)
(printf "\t(cd src/~a; $(SCC) $(SFLAGS) -o ../../~a.ostk ~a)\n\n"
(printf "\t(cd ~a; $(SCC) $(SFLAGS) -o ../~a.ostk ~a)\n\n"
name name (basename src))))
(define (make-library-entry)
......@@ -90,25 +92,24 @@
(define (find-and-extract-package package dir)
(define (extract-package pkg dir)
(let ((src-dir (make-path dir "src"))
(snowball (package-snowball pkg))
(let ((snowball (package-snowball pkg))
(tuning (package-tuning pkg)))
;; create directory
(unless (file-exists? src-dir)
(make-directories src-dir))
(unless (file-exists? dir)
(make-directories dir))
;; extract package
(unless (file-exists? snowball)
(die (format "cannot find snowball in cache ~s" (basename snowball))))
(untar snowball src-dir)
(untar snowball dir)
;; if the package has a tuning extract it too.
(when tuning
(let ((tuneball (tuning-snowball tuning)))
(unless (file-exists? snowball)
(die (format "cannot find tuning snowball in cache ~s"
(basename tuneball))))
(untar tuneball src-dir)
(untar tuneball dir)
;; Tune the original package
(tune-package pkg src-dir)))))
(tune-package pkg dir)))))
(let ((pkg (download-package package))
(deps (package-deps* package)))
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 14-Jan-2007 13:37 (eg)
;;;; Last file update: 31-Jan-2007 11:20 (eg)
;;;; Last file update: 1-Feb-2007 11:00 (eg)
;;;;
;; ----------------------------------------------------------------------
......@@ -42,14 +42,6 @@
(string->number (format "~A~A~A" (car v) (fmt (cadr v)) (fmt (caddr v))))
0)))
;; ----------------------------------------------------------------------
;; find-source-file ...
;; ----------------------------------------------------------------------
(define (find-source-file dir name)
(let ((snow (make-path dir name (format "~a.snow" name)))
(scm (make-path dir name (format "~a.scm" name))))
(if (file-exists? snow) snow scm)))
;; ----------------------------------------------------------------------
;; package<? ...
;; ----------------------------------------------------------------------
......
......@@ -21,7 +21,7 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 18-Jan-2007 16:44 (eg)
;;;; Last file update: 31-Jan-2007 08:50 (eg)
;;;; Last file update: 1-Feb-2007 10:55 (eg)
;;;;
;; ----------------------------------------------------------------------
......@@ -125,7 +125,7 @@
(define (replace orig id)
(let ((c (assq id replacements)))
(if (pair? c)
(begin (DEBUG "==> ~S" (cadr c)) (cadr c))
(cadr c)
orig)))
(map (lambda (orig)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment