From 53eb88ff721968299dd59e1c604e1b5714c5f0a5 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 10 Aug 2016 19:06:20 -0400 Subject: guix: Fix build. Include only Git files in the build. --- guix.scm | 29 +++++++++++++++++++++++++++-- 1 file 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 -- cgit v1.2.3