types.stk 2.56 KB
Newer Older
1 2
;;;;
;;;; types.stk	-- The package class
3 4 5 6
;;;;
;;;; Copyright © 2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
7 8 9 10
;;;; 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.
11
;;;;
12 13 14 15
;;;; 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.
16
;;;;
17 18
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
19
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20
;;;; USA.
21
;;;;
22 23
;;;;           Author: Erick Gallesio [eg@essi.fr]
;;;;    Creation date: 13-Jan-2007 23:24 (eg)
Erick Gallesio's avatar
Erick Gallesio committed
24
;;;; Last file update:  5-Jun-2007 15:13 (eg)
25 26 27 28 29 30 31 32
;;;;

;; ----------------------------------------------------------------------
;; 	structure package ...
;; ----------------------------------------------------------------------
(define-struct package
  name
  version
Erick Gallesio's avatar
Erick Gallesio committed
33
  release
34 35 36 37 38 39 40 41 42 43
  language
  category
  path
  url
  md5
  description
  author
  failures
  dependencies
  provides
Erick Gallesio's avatar
Erick Gallesio committed
44 45
  tuning
  suffix)
46

Erick Gallesio's avatar
Erick Gallesio committed
47 48 49
(define (new-package name :key version release language category path url md5
		               description author failures dependencies
			       provides tuning suffix)
50 51 52
  (unless path
    ;; Build a path in the cache for this package
    (set! path (make-path (stklos-pkg-cache-directory)
Erick Gallesio's avatar
Erick Gallesio committed
53 54
			  (format "~a-~a~a.tar.gz" name version
				  (if release (- release) "")))))
55 56 57
  (when (string? language)
    (set! language (string->symbol language)))

Erick Gallesio's avatar
Erick Gallesio committed
58 59 60 61 62
  (unless suffix
    (set! suffix (case language
		   ((stklos ".stk"))
		   (else ".scm"))))

Erick Gallesio's avatar
Erick Gallesio committed
63
  (make-package name version release language category path url md5 description
Erick Gallesio's avatar
Erick Gallesio committed
64
		author failures dependencies provides tuning suffix))
65 66 67 68 69 70 71

;; ----------------------------------------------------------------------
;; 	structure tuning ...
;; ----------------------------------------------------------------------
(define-struct tuning
  name
  version
Erick Gallesio's avatar
Erick Gallesio committed
72
  release
73 74 75 76 77
  host
  path
  url
  md5)

Erick Gallesio's avatar
Erick Gallesio committed
78
(define (new-tuning name :key version release host path url md5)
79 80 81
  (unless path
    ;; Build a path in the cache for this tuning
    (set! path (make-path (stklos-pkg-cache-directory)
Erick Gallesio's avatar
Erick Gallesio committed
82 83 84
			  (format "~a_~a-~a~a.tar.gz" name host version
				  (if release (- release) "")))))
  (make-tuning name version release host path url md5))