gash/guix.scm

68 lines
2.4 KiB
Scheme
Raw Normal View History

(use-modules (git)
(gnu packages)
2017-12-09 17:01:40 +00:00
(gnu packages autotools)
(gnu packages code)
(gnu packages guile)
(gnu packages pkg-config)
(gnu packages texinfo)
(guix build utils)
2017-12-09 17:01:40 +00:00
(guix build-system gnu)
(guix gexp)
2017-12-09 17:01:40 +00:00
((guix licenses) #:prefix license:)
(guix packages)
(guix utils)
(ice-9 popen)
(ice-9 textual-ports))
(define *srcdir* (canonicalize-path (current-source-directory)))
(define *version*
(with-directory-excursion *srcdir*
(let* ((script "./build-aux/git-version-gen")
(pipe (open-pipe* OPEN_READ script ".tarball-version"))
(version (get-string-all pipe)))
(close-pipe pipe)
version)))
2017-12-09 17:01:40 +00:00
(define (make-select)
(define paths
(or (false-if-exception
(let* ((directory (repository-discover *srcdir*))
(repository (repository-open directory))
(oid (reference-target (repository-head repository)))
(commit (commit-lookup repository oid))
(tree (commit-tree commit)))
(tree-list tree)))
(false-if-exception
(with-directory-excursion *srcdir*
(call-with-input-file ".tarball-manifest"
(lambda (port)
(let loop ((line (get-line port)) (acc '()))
(if (eof-object? line)
acc
(loop (get-line port) (cons line acc))))))))
(error "Cannot make file selector")))
(lambda (file stat)
(let ((relative (substring file (1+ (string-length *srcdir*)))))
(or (eq? (stat:type stat) 'directory)
(member relative paths)))))
2017-12-09 17:01:40 +00:00
(package
(name "gash")
(version *version*)
(source (local-file *srcdir* #:recursive? #t #:select? (make-select)))
2017-12-09 17:01:40 +00:00
(build-system gnu-build-system)
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
("lcov" ,lcov) ; For generating test coverage data
("pkg-config" ,pkg-config)
("texinfo" ,texinfo)))
2017-12-09 17:01:40 +00:00
(inputs
`(("guile" ,guile-2.2)))
(home-page "https://gitlab.com/samplet/gash")
(synopsis "POSIX-compatible shell written in Guile Scheme")
(description "Gash is a POSIX-compatible shell written in Guile
Scheme. It is designed to be capable of bootstrapping Bash.")
(license license:gpl3+))