From f06ccec532f9eaeeb6df2ac3696de8254bffa179 Mon Sep 17 00:00:00 2001 From: Chloe Brown Date: Wed, 6 Apr 2022 17:57:52 +0100 Subject: Add customisable README and Everything locations. --- yellowsquid/build-system/agda.scm | 2 ++ yellowsquid/build/agda-build-system.scm | 25 +++++++------------------ yellowsquid/packages/agda.scm | 2 ++ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/yellowsquid/build-system/agda.scm b/yellowsquid/build-system/agda.scm index 458ace0..d77bd1b 100644 --- a/yellowsquid/build-system/agda.scm +++ b/yellowsquid/build-system/agda.scm @@ -31,6 +31,8 @@ (define* (lower name #:key source inputs native-inputs outputs system target (agda (default-agda)) + (everything "Everything.agda") + (readme "README.agda") #:allow-other-keys #:rest arguments) (define private-keywords diff --git a/yellowsquid/build/agda-build-system.scm b/yellowsquid/build/agda-build-system.scm index c667410..1068614 100644 --- a/yellowsquid/build/agda-build-system.scm +++ b/yellowsquid/build/agda-build-system.scm @@ -44,7 +44,7 @@ (define (helper chars) (match chars (() '()) - ((#\- #\- (? char-whitespace?) rest ...) '()) + ((#\- #\- (? char-whitespace?) _ ...) '()) (((and c (? char-whitespace?)) rest ...) (let ((rec (helper rest))) (if (null? rec) @@ -90,7 +90,7 @@ (define* (duplicates xs #:optional (= equal?)) (match xs (() #f) - ((x) #f) + ((_) #f) ((x y rest ...) (or (= x y) (duplicates (cons y rest) =))))) (let* ((sorted (sort headers string<))) (if (duplicates sorted) @@ -192,17 +192,16 @@ (format #f "/share/agda/lib/~a.agda-lib" name))))) (agda-lib-depends agda-lib)))))) -(define* (build #:key outputs #:allow-other-keys) +(define* (build #:key everything #:allow-other-keys) "Build a given Agda library." (invoke "agda" "--include-path=." "--library-file=libraries" - "Everything.agda")) + everything)) -(define* (build-docs #:key outputs #:allow-other-keys) +(define* (build-docs #:key outputs readme #:allow-other-keys) "Build documentation for a given Agda library." - (let ((out (assoc-ref outputs "out")) - (readme (scandir "." (cut equal? "README.agda" <>)))) + (let ((out (assoc-ref outputs "out"))) (invoke "agda" "--include-path=." "--library-file=libraries" @@ -211,9 +210,7 @@ "--html-dir=~a/share/doc/~a/html" out (strip-store-file-name out)) - (match readme - ((filename) filename) - (_ "Everything.agda"))))) + readme))) (define* (install #:key inputs outputs #:allow-other-keys) "Install a given Agda library." @@ -234,14 +231,6 @@ (else (copy-file file dest)))))) - (define (serialize-configuration config fields) - (apply string-append - (map (lambda (field) - ((configuration-field-serializer field) - (configuration-field-name field) - ((configuration-field-getter field) config))) - fields))) - (let* ((my-agda-lib (find+parse-agda-lib)) (out (assoc-ref outputs "out")) (name (or (agda-lib-name my-agda-lib) (strip-store-file-name out))) diff --git a/yellowsquid/packages/agda.scm b/yellowsquid/packages/agda.scm index 334c42f..ad5dfc9 100644 --- a/yellowsquid/packages/agda.scm +++ b/yellowsquid/packages/agda.scm @@ -140,6 +140,8 @@ normalisation performance.") "1acb693ad2nrmnn6jxsyrlkc0di3kk2ksj2w9wnyfxrgvfsil7rn")))) (build-system agda-build-system) (inputs (list agda-stdlib-1.7)) + (arguments + '(#:readme "Everything.agda")) (synopsis "Categories library for Agda") (description "A proof-relevant category theory library for Agda. The library contains definitions for many important parts of category theory. -- cgit v1.2.3