Changeset 13800 in project for chicken


Ignore:
Timestamp:
03/17/09 17:26:52 (11 years ago)
Author:
felix winkelmann
Message:

small cleanups; tested make-egg-index script

Location:
chicken/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/csc.scm

    r13713 r13800  
    127127    -check-syntax -case-insensitive -benchmark-mode -shared -compile-syntax -no-lambda-info
    128128    -lambda-lift -dynamic -disable-stack-overflow-checks -local
    129     -emit-external-prototypes-first -inline -extension -release
     129    -emit-external-prototypes-first -inline -release
    130130    -analyze-only -keep-shadowed-macros -inline-global -ignore-repository
    131131    -no-symbol-escape -no-parentheses-synonyms -r5rs-syntax))
     
    141141  '((-h "-help")
    142142    (-s "-shared")
    143     (|-E| "-extension")
    144143    (|-P| "-check-syntax")
    145144    (|-V| "-version")
     
    374373    -prologue FILENAME             include file before main source file
    375374    -epilogue FILENAME             include file after main source file
    376     -ignore-repository             do not refer to repository for extensions
    377375
    378376    -e  -embedded                  compile as embedded
     
    436434                                   emit protoypes for callbacks before foreign
    437435                                    declarations
     436    -ignore-repository             do not refer to repository for extensions
    438437    -keep-shadowed-macros          do not remove shadowed macro
    439438    -host                          compile for host when configured for
  • chicken/trunk/rules.make

    r13736 r13800  
    815815endif
    816816ifdef WINDOWS
    817         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) libchickengui$(SO) \
    818           $(DESTDIR)$(IBINDIR)
     817        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) libchickengui$(SO) $(DESTDIR)$(IBINDIR)
    819818endif
    820819endif
     
    11891188chicken-profile.c: $(SRCDIR)chicken-profile.scm
    11901189        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    1191 chicken-install.c: $(SRCDIR)chicken-install.scm setup-download.import.scm
     1190chicken-install.c: $(SRCDIR)chicken-install.scm setup-download.c
    11921191        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -ignore-repository -output-file $@
    11931192chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm
     
    12031202        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-api \
    12041203          -ignore-repository -output-file $@
    1205 setup-download.c: $(SRCDIR)setup-download.scm setup-api.import.scm
     1204setup-download.c: $(SRCDIR)setup-download.scm setup-api.c
    12061205        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-download \
    12071206          -ignore-repository -output-file $@
  • chicken/trunk/scripts/make-egg-index.scm

    r13783 r13800  
    33(load-relative "tools.scm")
    44
    5 (use setup-download matchable htmlprag)
     5(use setup-download matchable htmlprag data-structures)
    66
    77(define *major-version* (##sys#fudge 41))
     8
     9(define +stylesheet+ "")
    810
    911(define +categories+
     
    3739    (obsolete "Unsupported or redundant") ) )
    3840
     41(define (d fstr . args)
     42  (fprintf (current-error-port) "~?~%" fstr args))
     43
    3944(define (usage code)
    4045  (print "make-egg-index.scm [--major-version=MAJOR] [DIR]")
     
    4550         (sprintf "Eggs Unlimited (release branch ~a, updated ~a)"
    4651                  *major-version*
    47                   (string-chomp (seconds->string (current-seconds))))))
    48     (shtml->html
     52                  (string-chomp (seconds->string (current-seconds)))))
     53        (eggs (gather-egg-information dir)))
     54    (write-shtml-as-html
    4955     `(html
    5056       ,(header title)
    5157       (body
    5258        ,@(prelude title)
    53         ,@(emit-egg-information (gather-egg-information dir))
     59        ,@(emit-egg-information eggs)
    5460        ,@(trailer))))))
    5561
     
    5763  `(head
    5864    (style (@ (type "text/css"))
    59       ,(sprintf "@import url(~a);~%" +stylesheet+) )
     65      ,+stylesheet+)
    6066    (title ,title)))
    6167
     
    6773    (pre "  chicken-install EXTENSIONNAME\n")
    6874    (p "This will download anything needed to compile and install the library. "
    69        "If your" (i "extension repository") "is placed at a location for which "
     75       "If your " (i "extension repository") " is placed at a location for which "
    7076       "you don't have write permissions, then run " (tt "chicken-install")
    7177       "with the " (tt "-sudo") " option or run it as root (not recommended).")
     
    8692    (p "If you are looking for 3rd party libraries used by one the extensions, "
    8793       "check out the CHICKEN "
    88        (a (@ (href "http://www.call-with-current-continuation.org/tarballs/")
    89              (i "tarball repository"))) )
     94       (a (@ (href "http://www.call-with-current-continuation.org/tarballs/") )
     95          (i "tarball repository")))
    9096    (h3 "List of available eggs")))
    9197
     
    97103   (match-lambda
    98104     ((cat catname)
     105      (d "category: ~a" catname)
    99106      `((h3 ,catname)
    100107        (table
    101108         (tr (th "Name") (th "Description") (th "License") (th "author") (th "maintainer") (th "version"))
    102          ,@(map make-egg-entry
    103                 (sort
    104                  (filter (lambda (info)
    105                            (and (eq? cat (cadr (or (assq 'category (cdr info))
    106                                                    '(#f uncategorized))))
    107                                 (not (assq 'hidden (cdr info)))))
    108                          eggs)
    109                  (lambda (e1 e2)
    110                    (string<? (symbol->string (car e1)) (symbol->string (car e2))))))))))
     109         ,@(append-map
     110            make-egg-entry
     111            (sort
     112             (filter (lambda (info)
     113                       (and (eq? cat (cadr (or (assq 'category (cdr info))
     114                                               '(#f uncategorized))))
     115                            (not (assq 'hidden (cdr info)))))
     116                     eggs)
     117             (lambda (e1 e2)
     118               (string<? (symbol->string (car e1)) (symbol->string (car e2))))))))))
    111119   +categories+))
    112120
    113121(define (make-egg-entry egg)
    114   (define (prop name def)
    115     (cond ((assq name (cdr egg)) => cadr)
    116           (else def)))
    117   `(tr (td ,(symbol->string (car egg)))
    118        (td ,(prop 'synopsis "unknown"))
    119        (td ,(prop 'license "unknown"))
    120        (td ,(prop 'author "unknown"))
    121        (td ,(prop 'maintainer ""))
    122        (td ,(prop 'version ""))))
     122  (call/cc
     123   (lambda (return)
     124     (define (prop name def pred)
     125       (cond ((assq name (cdr egg)) => (o (cut check pred <> name) cadr))
     126             (else def)))
     127     (define (check pred x p)
     128       (cond ((pred x) x)
     129             (else
     130              (warning "extension has incorrectly typed .meta entry and will not be listed" (car egg) p x)
     131              (return '()))))
     132     (d "  ~a   ~a" (car egg) (prop 'version "HEAD" any?))
     133     `((tr (td ,(symbol->string (car egg)))
     134           (td ,(prop 'synopsis "unknown" string?))
     135           (td ,(prop 'license "unknown" name?))
     136           (td ,(prop 'author "unknown" name?))
     137           (td ,(prop 'maintainer "" name?))
     138           (td ,(prop 'version "" version?)))))))
     139
     140(define name?
     141  (disjoin string? symbol?))
     142
     143(define version?
     144  (disjoin string? number?))
    123145
    124146(define (main args)
     
    126148    ((dir)
    127149     (make-egg-index dir))
     150    (() (make-egg-index "."))
    128151    (_ (usage 1))))
    129152
  • chicken/trunk/setup-download.scm

    r13783 r13800  
    9696           (let ((meta (make-pathname (list dir loc) egg "meta")))
    9797             (and (file-exists? meta)
    98                   (cons (string->symbol egg)
    99                         (cons (list 'version version)
    100                               (with-input-from-file meta read)))))))
     98                  (call/cc
     99                   (lambda (return)
     100                     (cons (string->symbol egg)
     101                           (cons (list 'version version)
     102                                 (handle-exceptions ex
     103                                     (begin
     104                                       (warning "extension has syntactically invalid .meta file" egg)
     105                                       (return #f))
     106                                   (with-input-from-file meta read))))))))))
    101107       ls)))
    102108
  • chicken/trunk/support.scm

    r13713 r13800  
    13251325    -static-extension NAME       import extension NAME but link statically
    13261326                                  (if available)
    1327     -extension                   compile as extension (dynamic or static)
    1328     -ignore-repository           do not refer to repository for extensions
    13291327
    13301328  Obscure options:
     
    13371335                                 emit protoypes for callbacks before foreign
    13381336                                  declarations
     1337    -ignore-repository           do not refer to repository for extensions
    13391338
    13401339EOF
Note: See TracChangeset for help on using the changeset viewer.