From 24ffb3930ed0e75ee0f72d55a7e53253f3a58e8e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 31 Dec 2021 12:54:53 +0530 Subject: Use git-predicate in guix.scm. * guix.scm: Do not import (ice-9 match), (ice-9 popen), (ice-9 rdelim), (srfi srfi-1), (srfi srfi-26) and (guix build utils). (git-file?): Delete function. (nsmc): Use git-predicate instead of git-file? --- guix.scm | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/guix.scm b/guix.scm index f077e26..9869e71 100644 --- a/guix.scm +++ b/guix.scm @@ -3,13 +3,7 @@ ;;; ;;; $ guix environment -l guix.scm -(use-modules (ice-9 match) - (ice-9 popen) - (ice-9 rdelim) - (srfi srfi-1) - (srfi srfi-26) - (guix build utils) - (guix build-system cmake) +(use-modules (guix build-system cmake) (guix build-system guile) (guix gexp) (guix git-download) @@ -25,23 +19,6 @@ (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))))) - ;; TODO: Contribute upstream to Guix and delete. (define sph-lib (package @@ -135,7 +112,7 @@ (home-page "https://git.systemreboot.net/nsmc") (source (local-file %source-dir #:recursive? #t - #:select? git-file?)) + #:select? (git-predicate %source-dir))) (build-system cmake-build-system) (arguments '(#:tests? #f ; no tests -- cgit v1.2.3