>From 1e5386ca1369dc45390203819a3e7179381dbad2 Mon Sep 17 00:00:00 2001 From: Amar Singh Date: Thu, 2 May 2019 01:31:43 +0530 Subject: [PATCH 09/10] Move todo to top, Add usage instructions Fix: Also removed a leftover test expression Signed-off-by: Amar Singh --- guix/import/golang.scm | 49 ++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/guix/import/golang.scm b/guix/import/golang.scm index 2f0aca3331..3eb74d4984 100644 --- a/guix/import/golang.scm +++ b/guix/import/golang.scm @@ -36,6 +36,30 @@ (srfi srfi-26) ;; cut ) +;;; To use, simply: +;;; 1. (load "golang.scm") +;;; 2. (define go-package (make-package go-name*)) +;;; 3. (package-sexp go-package) + +;;; STATUS +;;; 1. latest-release DONE +;;; 1.b latest-commit PENDING/STALLED +;;; 2. go-name->guix-name DONE +;;; 2.b style go-github-com-user-project DONE +;;; 4. go-name->url DONE +;;; 4.b go-name->tarball DONE +;;; 5. go-name->sha256 (go-name version) DONE +;;; 6. go-name->synopsis DONE +;;; 7. go-name->description DONE +;;; 4-7.b. Memoize, network procedures DONE +;;; 6-7.b try to extract sentences. TODO +;;; 8. go-name->license TODO +;;; 9. go-name->inputs DONE +;;; 9.b. inputs alist DONE +;;; 10. package-sexp DONE +;;; 10.a origin-sexp DONE +;;; 11. Package Builds TODO + (define-public go-name* "github.com/gohugoio/hugo") ;; for tests (define* (go-name->url go-name #:rest args) @@ -91,14 +115,13 @@ (call-with-input-file (url->store (go-name->readme go-name)) read-string)))) -;;; Maybe try to match the first sentence. +;;; TODO: try to match the first sentence. (define (go-name->synopsis go-name) (substring (go-name->readme-string go-name) 0 100)) -;;; Maybe try to match the the next two sentences. +;;; TODO: try to match the the next two sentences. (define (go-name->description go-name) (substring (go-name->readme-string go-name) 100 300)) -(go-name->description go-name*) (define shell-command (lambda* (command #:rest args) @@ -155,7 +178,6 @@ (define (filter-newlines string) (string-filter (lambda (x) (not (equal? x #\newline))) string)) -;;; Ask the upstream to export variable? (define bv->nix-base32 (@@ (guix packages) bytevector->nix-base32-string)) @@ -189,23 +211,4 @@ (native-inputs ,(format-inputs (map car (package-native-inputs package)))) (propagated-inputs ,(format-inputs (map car (package-propagated-inputs package)))))) - -;;; STATUS -;;; 1. latest-release DONE -;;; 1.b latest-commit PENDING/STALLED -;;; 2. go-name->guix-name DONE -;;; 2.b style go-github-com-user-project DONE -;;; 4. go-name->url DONE -;;; 4.b go-name->tarball DONE -;;; 5. go-name->sha256 (go-name version) DONE -;;; 6. go-name->synopsis DONE -;;; 7. go-name->description DONE -;;; 4-7.b. Memoize, network procedures DONE -;;; 6-7.b try to extract sentences. TODO -;;; 8. go-name->license TODO -;;; 9. go-name->inputs DONE -;;; 9.b. inputs alist DONE -;;; 10. package-sexp DONE -;;; 10.a origin-sexp DONE - ;;; golang.scm ends here -- 2.21.0