guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: potluck: Minor fixups


From: Andy Wingo
Subject: 01/01: potluck: Minor fixups
Date: Thu, 13 Apr 2017 09:24:48 -0400 (EDT)

wingo pushed a commit to branch wip-potluck
in repository guix.

commit 3bab9e4885c548b1e61f1951f051c442427a7432
Author: Andy Wingo <address@hidden>
Date:   Thu Apr 13 15:23:42 2017 +0200

    potluck: Minor fixups
    
    * guix/potluck/host.scm (process-update): Fix generated module name.
    * guix/potluck/packages.scm (lower-potluck-package-to-module): Define-public
    the package name.
---
 guix/potluck/host.scm     |  4 ++--
 guix/potluck/packages.scm | 42 ++++++++++++++++++++++--------------------
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/guix/potluck/host.scm b/guix/potluck/host.scm
index 948dbd4..666129a 100644
--- a/guix/potluck/host.scm
+++ b/guix/potluck/host.scm
@@ -309,8 +309,8 @@
                         `(gnu packages potluck
                               ,repo-dir
                               ,(uri-encode branch)
-                              ,(substring file 0
-                                          (- (string-length file)
+                              ,(substring (basename file) 0
+                                          (- (string-length (basename file))
                                              (string-length ".scm")))))
                       ;; Preserve copyright notices if possible.
                       (copy-header-comments port file)
diff --git a/guix/potluck/packages.scm b/guix/potluck/packages.scm
index 64c998a..ab92c72 100644
--- a/guix/potluck/packages.scm
+++ b/guix/potluck/packages.scm
@@ -507,7 +507,7 @@ potluck package will be validated with 
@code{validate-potluck-package}."
     (format port "(define-module ~a" lowered-module-name)
     (format port "~%  #:pure")
     ;; Because we're pure, we have to import these.
-    (format port "~%  #:use-module ((guile) #:select (list quote quasiquote 
unquote))")
+    (format port "~%  #:use-module ((guile) #:select (list quote 
define-public))")
     (when needs-runtime-lookup?
       (format port "~%  #:use-module ((gnu packages) #:select 
(specification->package))"))
     (format port "~%  #:use-module ((guix packages) #:select (package origin 
base32))")
@@ -521,27 +521,29 @@ potluck package will be validated with 
@code{validate-potluck-package}."
                  (format port "~%  #:use-module (~a #:select ~a)"
                          module-name syms)))
               (hash-map->list cons imports))
-    (format port ")~%")
+    (format port ")~%~%")
 
-    (format port "(package\n")
-    (format port "  (name ~s)\n" (potluck-package-name pkg))
-    (format port "  (version ~s)\n" (potluck-package-version pkg))
-    (format port "  (source\n")
+    (format port "(define-public ~s\n" (string->symbol
+                                        (potluck-package-name pkg)))
+    (format port "  (package\n")
+    (format port "    (name ~s)\n" (potluck-package-name pkg))
+    (format port "    (version ~s)\n" (potluck-package-version pkg))
+    (format port "    (source\n")
 
     (let ((source (potluck-package-source pkg)))
-      (format port "    (origin\n")
-      (format port "      (method git-fetch)\n")
-      (format port "      (uri (git-reference\n")
-      (format port "            (url ~s)\n" (potluck-source-git-uri source))
-      (format port "            (commit ~s)))\n"
+      (format port "      (origin\n")
+      (format port "        (method git-fetch)\n")
+      (format port "        (uri (git-reference\n")
+      (format port "              (url ~s)\n" (potluck-source-git-uri source))
+      (format port "              (commit ~s)))\n"
               (potluck-source-git-commit source))
       (when (potluck-source-snippet source)
         (pretty-print `(snippet ',(potluck-source-snippet source)) port
-                      #:per-line-prefix "      "))
-      (format port "      (sha256 (base32 ~s))))\n"
+                      #:per-line-prefix "        "))
+      (format port "        (sha256 (base32 ~s))))\n"
               (potluck-source-sha256 source)))
 
-    (format port "  (build-system ~s-build-system)\n"
+    (format port "    (build-system ~s-build-system)\n"
             (potluck-package-build-system pkg))
 
     (for-each
@@ -555,7 +557,7 @@ potluck package will be validated with 
@code{validate-potluck-package}."
                                 (or (hash-ref spec->binding spec)
                                     (error "internal error" spec)))
                               specs)))
-         port #:per-line-prefix "  ")))
+         port #:per-line-prefix "    ")))
      `((inputs . ,(potluck-package-inputs pkg))
        (native-inputs . ,(potluck-package-native-inputs pkg))
        (propagated-inputs . ,(potluck-package-propagated-inputs pkg))))
@@ -563,10 +565,10 @@ potluck package will be validated with 
@code{validate-potluck-package}."
     (match (potluck-package-arguments pkg)
       (() #t)
       (arguments
-       (pretty-print `(arguments ',arguments) port #:per-line-prefix "  ")))
+       (pretty-print `(arguments ',arguments) port #:per-line-prefix "    ")))
 
-    (format port "  (home-page ~s)\n" (potluck-package-home-page pkg))
-    (format port "  (synopsis ~s)\n" (potluck-package-synopsis pkg))
-    (format port "  (description ~s)\n" (potluck-package-description pkg))
-    (format port "  (license license:~s))\n" (potluck-package-license pkg))
+    (format port "    (home-page ~s)\n" (potluck-package-home-page pkg))
+    (format port "    (synopsis ~s)\n" (potluck-package-synopsis pkg))
+    (format port "    (description ~s)\n" (potluck-package-description pkg))
+    (format port "    (license license:~s)))\n" (potluck-package-license pkg))
     (force-output port)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]