update unixstyle-install for a source distribution

This commit is contained in:
Matthew Flatt 2020-07-29 05:45:20 -06:00
parent af651ca435
commit e42dfffa3a
2 changed files with 21 additions and 38 deletions

View File

@ -92,6 +92,7 @@
[(applications) #f]
[(src) 1]
[(ChezScheme) 1]
[(pb) 1]
[(README) #f] ; moved last
[else (error 'level-of "internal-error -- unknown dir: ~e" dir)])))
@ -567,14 +568,17 @@
(define do-tree (move/copy-tree #f))
(current-directory rktdir)
;; Copy source into place:
(current-skip-filter ; skip src/build
(lambda (p) (regexp-match? #rx"^build$" p)))
(do-tree "src" (build-path base-destdir "src"))
;; Copy Chez Scheme source, if present
(let ([src-cs "src/build/ChezScheme"])
(when (directory-exists? src-cs)
(current-skip-filter (make-chez-source-skip src-cs))
(do-tree src-cs (build-path base-destdir "src/ChezScheme") #:build-path? #t)))
(current-skip-filter ; skip src/build and Chez Scheme build output
(let ([chez-skip (make-chez-source-skip "src/ChezScheme")])
(lambda (p)
(or (regexp-match? #rx"^build$" (basename p))
(chez-skip p)))))
(do-tree "src" (build-path base-destdir "src") #:build-path? #t)
;; Copy pb boot files, if present
(let ([src-pb "src/ChezScheme/boot/pb"])
(when (directory-exists? src-pb)
(parameterize ([current-skip-filter (lambda (p) #f)])
(do-tree src-pb (build-path base-destdir src-pb) #:build-path? #t))))
;; Remove directories that get re-created:
(define (remove! dst*) (rm (dir: dst*)))
(remove! 'bin)
@ -599,7 +603,8 @@
(and (not (equal? (path->string name) "lib"))
(path? base)
(let-values ([(base name dir?) (split-path base)])
(and (equal? (explode-path base) src-cs-ex)
(and (path? base)
(equal? (explode-path base) src-cs-ex)
(equal? (path->string name) "lz4")))))
(lambda (p)
(or (dot-file? p)
@ -608,7 +613,8 @@
(lz4-skip? p))))
(define (read-git-ignore-paths subdir)
(define subdir-len (length (explode-path subdir)))
(define subdir-elems (explode-path subdir))
(define subdir-len (length subdir-elems))
(define pred-on-exploded
(call-with-input-file*
(build-path subdir ".gitignore")
@ -625,12 +631,14 @@
(loop (lambda (elems)
(or (pred elems)
(and (equal? (length elems) (+ subdir-len (length match-elems?)))
(equal? (take elems subdir-len) subdir-elems)
(andmap (lambda (m? e) (m? e)) match-elems? (list-tail elems subdir-len))))))]
[else
(define match-elems? (map elem->matcher (explode-path (substring l 1))))
(loop (lambda (elems)
(or (pred elems)
(and ((length elems) . >= . (+ subdir-len (length match-elems?)))
(equal? (take elems subdir-len) subdir-elems)
(andmap (lambda (m? e) (m? e)) match-elems? (take-right elems (length match-elems?)))))))])))))
(lambda (p)
(pred-on-exploded (explode-path p))))

31
racket/src/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Using `--enable-csonly` avoids running `cfg-racket`
# Using `--enable-csdefault` or `--enable-csonly` avoids running `cfg-racket`
# and only uses `cfg-cs` and `cs/c/configure`.
# Using `--enable-cs` or `--enable-csdefault` uses
@ -12,24 +12,16 @@ dir=`dirname "$0"`
use_cs=no
use_racket=yes
supplied_racket=no
supplied_scheme=no
for arg in $*; do
case "$arg" in
--enable-csdefault | --enable-cs)
--enable-cs)
use_cs=yes
;;
--enable-csonly)
--enable-csdefault | --enable-csonly)
use_racket=no
use_cs=yes
;;
--enable-racket=*)
supplied_racket=yes
;;
--enable-scheme=*)
supplied_scheme=yes
;;
--help | -h)
echo $0:
echo see --help-racket or --help-cs, since the traditional Racket "(3m/CGC)" build
@ -48,23 +40,6 @@ for arg in $*; do
done
if test "$use_cs" = "yes" ; then
if test "$supplied_scheme" = "no" ; then
if ! test -d ChezScheme ; then
if ! test -d "$dir/ChezScheme" ; then
echo $0: supply --enable-scheme=... or check out a Chez Scheme
echo build directory as '"ChezScheme"' in the current directory
exit 1
fi
fi
fi
if test "$use_racket" = "no" ; then
if test "$supplied_racket" = "no" ; then
echo $0: --enable-csonly needs --enable-racket=...
exit 1
fi
fi
# The "cs/c/configure" script doesn't report the installation
# configuration, so we run it first and let "cfg-cs" or
# "cfg-racket" report that information.