summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-08-10 19:06:20 -0400
committerDavid Thompson <dthompson2@worcester.edu>2016-08-10 19:06:20 -0400
commit53eb88ff721968299dd59e1c604e1b5714c5f0a5 (patch)
treeed663ac92c6df6b566501bcb9707bca01cd5de83
parent1f55f22287a436a578973dcd446eccc5246f9b17 (diff)
guix: Fix build.v0.1.2
Include only Git files in the build.
-rw-r--r--guix.scm29
1 files changed, 27 insertions, 2 deletions
diff --git a/guix.scm b/guix.scm
index 03996f0..37fa29c 100644
--- a/guix.scm
+++ b/guix.scm
@@ -29,21 +29,46 @@
;;
;;; Code:
-(use-modules (guix gexp)
+(use-modules (ice-9 match)
+ (ice-9 popen)
+ (ice-9 rdelim)
+ (srfi srfi-1)
+ (srfi srfi-26)
+ (guix gexp)
(guix packages)
(guix licenses)
(guix git-download)
(guix build-system gnu)
+ ((guix build utils) #:select (with-directory-excursion))
(gnu packages)
(gnu packages autotools)
(gnu packages guile)
(gnu packages pkg-config)
(gnu packages sdl))
+(define %source-dir (dirname (current-filename)))
+
+(define git-file?
+ (let* ((pipe (with-directory-excursion %source-dir
+ (open-pipe* OPEN_READ "git" "ls-files")))
+ (files (let loop ((lines '()))
+ (match (read-line pipe)
+ ((? eof-object?)
+ (reverse lines))
+ (line
+ (loop (cons line lines))))))
+ (status (close-pipe pipe)))
+ (lambda (file stat)
+ (match (stat:type stat)
+ ('directory #t)
+ ((or 'regular 'symlink)
+ (any (cut string-suffix? <> file) files))
+ (_ #f)))))
+
(package
(name "guile-sdl2")
(version "0.1.2")
- (source (local-file "." #:recursive? #t))
+ (source (local-file %source-dir #:recursive? #t #:select? git-file?))
(build-system gnu-build-system)
(arguments
'(#:configure-flags