Changeset 13555 in project


Ignore:
Timestamp:
03/07/09 07:01:13 (11 years ago)
Author:
Kon Lovett
Message:

Rqrs 'setup-helper'.

Location:
release/4/box
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/box/tags/2.0.0/box.meta

    r13461 r13555  
    77 (doc-from-wiki #t)
    88 (author "[[kon lovett]]")
     9 (needs setup-helper)
    910 (files
    1011  "tests"
  • release/4/box/tags/2.0.0/box.setup

    r13512 r13555  
    11;;;; box.setup
    22
    3 ;;;
     3(include "setup-helper")
    44
    5 (required-chicken-version 4.0)
     5(verify-extension-name 'box)
    66
    7 ;;
    8 
    9 (define (make-fn bn . en)
    10   (apply make-pathname #f (->string bn) en) )
    11 
    12 (define (doc-fn bn)
    13   (make-fn bn "html") )
    14 
    15 (define (source-fn bn)
    16   (make-fn bn "scm") )
    17 
    18 (define (shared-fn bn)
    19   (make-fn bn ##sys#load-dynamic-extension) )
    20 
    21 (define (static-fn bn)
    22   (make-fn bn "o") )
    23 
    24 (define (import-fn bn)
    25   (make-fn bn "import") )
    26 
    27 (define (source-import-fn bn)
    28   (source-fn (import-fn bn)) )
    29 
    30 (define (shared-import-fn bn)
    31   (shared-fn (import-fn bn)) )
    32 
    33 ;;
    34 
    35 (define (compile-static-extension nam . args)
    36   (compile ,(source-fn nam)
    37     -optimize-level 2 -debug-level 1
    38     -c -unit ,nam -output-file ,(static-fn nam)
    39     ,@args) )
    40 
    41 (define (compile-shared-extension nam . args)
    42   (compile ,(source-fn nam)
    43     -optimize-level 2 -debug-level 1
    44     -shared -output-file ,(shared-fn nam)
    45     -emit-import-library ,nam
    46     ,@args)
    47   (compile ,(source-import-fn nam)
    48     -optimize-level 2 -debug-level 0
    49     -shared -output-file ,(shared-import-fn nam)) )
    50 
    51 ;;
    52 
    53 (define (install-shared-extension nam #!key (compile '()) (install '()))
    54   (apply compile-shared-extension nam compile)
    55   (install-extension nam
    56    `(,(shared-fn nam) ,(shared-import-fn nam))
    57    `((version ,*version*)
    58      (documentation ,(doc-fn nam))
    59      ,@install)) )
    60 
    61 (define (install-shared-static-extension nam  #!key (compile '()) (install '()))
    62   (apply compile-shared-extension nam compile)
    63   (apply compile-static-extension nam compile)
    64   (install-extension nam
    65    `(,(shared-fn nam) ,(static-fn nam) ,(shared-import-fn nam))
    66    `((version ,*version*)
    67      (static ,(static-fn nam))
    68      (documentation ,(doc-fn nam))
    69      ,@install)) )
    70 
    71 ;;;
    72 
    73 (define *version* "2.0.0")
    74 
    75 (install-shared-extension 'box)
     7(setup-shared-extension (extension-name) (extension-version "2.0.0"))
  • release/4/box/trunk/box.meta

    r13461 r13555  
    77 (doc-from-wiki #t)
    88 (author "[[kon lovett]]")
     9 (needs setup-helper)
    910 (files
    1011  "tests"
  • release/4/box/trunk/box.setup

    r13547 r13555  
    11;;;; box.setup
    22
    3 ;;; Release 4 Only!
     3(include "setup-helper")
    44
    5 (required-chicken-version 4.0)
     5(verify-extension-name 'box)
    66
    7 ;;; Extension Information
    8 
    9 (define *extension-name* 'box)
    10 (define *extension-version* (extension-version "2.0.0"))
    11 
    12 (let ([extnam (symbol->string *extension-name*)])
    13   (unless (string=? extnam (extension-name))
    14     (warning "expecting extension-name - got: " extnam (extension-name)) ) )
    15 
    16 ;;; Support
    17 
    18 ;; Filename Support
    19 
    20 (define (make-fn bn . en)
    21   (apply make-pathname #f (->string bn) en) )
    22 
    23 (define (doc-fn bn)
    24   (make-fn bn "html") )
    25 
    26 (define (source-fn bn)
    27   (make-fn bn "scm") )
    28 
    29 (define (shared-fn bn)
    30   (make-fn bn ##sys#load-dynamic-extension) )
    31 
    32 (define (static-fn bn)
    33   (make-fn bn "o") )
    34 
    35 (define (import-fn bn)
    36   (make-fn bn "import") )
    37 
    38 (define (source-import-fn bn)
    39   (source-fn (import-fn bn)) )
    40 
    41 (define (shared-import-fn bn)
    42   (shared-fn (import-fn bn)) )
    43 
    44 (define (inline-fn bn)
    45   (make-fn bn "inline") )
    46 
    47 (define (program-fn bn)
    48   (make-fn bn (and (eq? 'windows (software-type)) "exe")) )
    49 
    50 ;; File Support
    51 
    52 (define (copy-file-to-directory fn dn)
    53   (copy-file fn (make-pathname dn fn)) )
    54 
    55 (define (copy-to-repository fn)
    56   (copy-file-to-directory fn (repository-path)) )
    57 
    58 (define (copy-to-home fn)
    59   (copy-file-to-directory fn (chicken-home)) )
    60 
    61 ;; SRFI-29 Bundle Support
    62 
    63 (define *srfi-29-bundles-path* (make-pathname (repository-path) "srfi-29-bundles"))
    64 
    65 (define (srfi-29-bundle-directory spec)
    66   (let ([dir (append (list *srfi-29-bundles-path*) (take spec (sub1 (length spec))))]
    67         [nam (last spec)])
    68     (make-pathname dir nam) ) )
    69 
    70 (define (install-srfi-29-bundle nam . spec)
    71   (unless (directory? *srfi-29-bundles-path*)
    72           (error "missing SRFI-29 bundles directory; please install SRFI-29") )
    73         (let ([bundle-dir (srfi-29-bundle-directory spec)])
    74     (unless (directory? bundle-dir) (create-directory/parents bundle-dir)) )
    75         (let* ([namstr (->string nam)]
    76                [bundle-src (make-pathname (append '(".") spec) namstr)]
    77                [bundle-dst (make-pathname (append (list *srfi-29-bundles-path*) spec) namstr)])
    78                 (copy-file bundle-src bundle-dst) ) )
    79 
    80 ;; Compile Support
    81 
    82 (define (compile-static-extension nam . args)
    83   (compile ,(source-fn nam)
    84     -optimize-level 2 -debug-level 1
    85     -c -unit ,nam -output-file ,(static-fn nam)
    86     ,@args) )
    87 
    88 (define (compile-shared-extension nam . args)
    89   (compile ,(source-fn nam)
    90     -optimize-level 2 -debug-level 1
    91     -shared -output-file ,(shared-fn nam)
    92     -emit-import-library ,nam
    93     ,@args)
    94   (compile ,(source-import-fn nam)
    95     -optimize-level 2 #;4 -debug-level 0
    96     -shared -output-file ,(shared-import-fn nam)) )
    97 
    98 ;; Install Support
    99 
    100 (define (install-shared-extension nam ver . args)
    101   (install-extension nam
    102    `(,(shared-fn nam) ,(shared-import-fn nam))
    103    `((version ,ver)
    104      (documentation ,(doc-fn nam))
    105      ,@args)) )
    106 
    107 (define (install-static-extension nam ver . args)
    108   (install-extension nam
    109    `(,(static-fn nam))
    110    `((version ,ver)
    111      (static ,(static-fn nam))
    112      (documentation ,(doc-fn nam))
    113      ,@args)) )
    114 
    115 (define (install-shared+static-extension ver nam . args)
    116   (install-extension nam
    117    `(,(shared-fn nam) ,(shared-import-fn nam) ,(static-fn nam))
    118    `((version ,ver)
    119      (static ,(static-fn nam))
    120      (documentation ,(doc-fn nam))
    121      ,@args)) )
    122 
    123 ;; Build Support
    124 
    125 (define (build-shared-extension nam ver #!key (compile '()) (install '()))
    126   (apply compile-shared-extension nam compile)
    127   (apply install-shared-extension nam ver install) )
    128 
    129 (define (build-static-extension nam ver #!key (compile '()) (install '()))
    130   (apply compile-static-extension nam compile)
    131   (apply install-static-extension nam ver install) )
    132 
    133 (define (build-shared+static-extension nam ver #!key (shared-compile '()) (static-compile '()) (install '()))
    134   (apply compile-shared-extension nam shared-compile)
    135   (apply compile-static-extension nam static-compile)
    136   (apply install-shared+static-extension nam ver install) )
    137 
    138 ;;;
    139 
    140 (build-shared-extension *extension-name* *extension-version*)
     7(setup-shared-extension (extension-name) (extension-version "2.0.0"))
Note: See TracChangeset for help on using the changeset viewer.