diff --git a/hyphenate/hyphenate/info.rkt b/hyphenate/hyphenate/info.rkt index 36b9b109..f67642ca 100644 --- a/hyphenate/hyphenate/info.rkt +++ b/hyphenate/hyphenate/info.rkt @@ -1,3 +1,4 @@ #lang info (define scribblings '(("scribblings/hyphenate.scrbl" ()))) (define compile-omit-paths '("tests.rkt")) +(define post-install-collection "post-installer.rkt") \ No newline at end of file diff --git a/hyphenate/hyphenate/post-installer.rkt b/hyphenate/hyphenate/post-installer.rkt new file mode 100644 index 00000000..90fafc35 --- /dev/null +++ b/hyphenate/hyphenate/post-installer.rkt @@ -0,0 +1,8 @@ +#lang racket/base +(provide (all-defined-out)) + +(define (post-installer home-dir) + (for ([mod '(hyphenate/us hyphenate/fr)]) + (displayln (format "running post-installer in ~a" mod)) + (define proc (dynamic-require mod 'post-installer)) + (proc home-dir))) \ No newline at end of file diff --git a/hyphenate/hyphenate/private/bootstrap.rkt b/hyphenate/hyphenate/private/bootstrap.rkt index 0e658f27..7ac68e61 100644 --- a/hyphenate/hyphenate/private/bootstrap.rkt +++ b/hyphenate/hyphenate/private/bootstrap.rkt @@ -4,6 +4,7 @@ sugar/define racket/contract racket/file + racket/fasl (only-in xml xexpr/c) (prefix-in core: hyphenate/private/core)) @@ -51,8 +52,8 @@ (unless (and (file-exists? cache-path) (> (file-or-directory-modify-seconds cache-path) (file-or-directory-modify-seconds module-path))) - (write-to-file (dynamic-require module-path id-sym) cache-path #:exists 'replace)) - (file->value cache-path)) + (s-exp->fasl (dynamic-require module-path id-sym) (open-output-file cache-path #:exists 'replace))) + (fasl->s-exp (open-input-file cache-path))) (define-syntax (mb stx) (syntax-case stx () @@ -67,12 +68,15 @@ [PATTERNS-ID 'patterns] [EXCEPTIONS-ID 'exceptions]) #'(#%module-begin - (define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID)) - ;; a file-cached hash is immutable, so convert it - (define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)))) - (define+provide+safe hyphenate - hyphenate/c - (make-hyphenate-function PATTERNS-ID EXCEPTIONS-ID)) - (define+provide+safe unhyphenate - unhyphenate/c - (make-unhyphenate-function)))))])) \ No newline at end of file + (define PATTERNS-ID (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID)) + ;; a file-cached hash is immutable, so convert it + (define EXCEPTIONS-ID (make-hash (hash->list (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)))) + (define+provide (post-installer home-dir) + (load-from-cache-if-possible PATTERNS-PATH PATTERN-CACHE-PATH 'PATTERNS-ID) + (load-from-cache-if-possible EXCEPTIONS-PATH EXCEPTIONS-CACHE-PATH 'EXCEPTIONS-ID)) + (define+provide+safe hyphenate + hyphenate/c + (make-hyphenate-function PATTERNS-ID EXCEPTIONS-ID)) + (define+provide+safe unhyphenate + unhyphenate/c + (make-unhyphenate-function)))))])) \ No newline at end of file