all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Guix-devel <guix-devel@gnu.org>
Subject: [PATCH] Elpa importer improvements
Date: Wed, 14 Dec 2016 13:04:45 +1100	[thread overview]
Message-ID: <8760mn5kqq.fsf@zancanaro.id.au> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 402 bytes --]

I was trying to import some elpa packages recently and found some 
issues, so here are some patches to fix them.

1. call-with-downloaded-file had behaviour different to how it was 
documented to behave. This was primarily a problem when trying to 
import packages with no description (eg. color-theme-solarized on 
melpa).

2. Package dependencies need to be propagated so that emacs can 
find them.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-import-elpa-Fix-call-with-downloaded-file.patch --]
[-- Type: text/x-diff, Size: 1201 bytes --]

From 0e561aee91b5d389d72906d059ddf486a322f20a Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Wed, 14 Dec 2016 12:31:12 +1100
Subject: [PATCH 1/2] import: elpa: Fix call-with-downloaded-file

* guix/import/elpa.scm (call-with-downloaded-file): Make function behaviour
match documentation string.
---
 guix/import/elpa.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 320a09e8c..5f8b7a9e5 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -89,7 +89,13 @@ NAMES (strings)."
   "Fetch URL, store the content in a temporary file and call PROC with that
 file.  Returns the value returned by PROC.  On error call ERROR-THUNK and
 return its value or leave if it's false."
-  (proc (http-fetch/cached (string->uri url))))
+  (catch #t
+    (lambda ()
+      (proc (http-fetch/cached (string->uri url))))
+    (lambda (key . args)
+      (if error-thunk
+          (error-thunk)
+          (apply throw key args)))))
 
 (define (is-elpa-package? name elpa-pkg-spec)
   "Return true if the string NAME corresponds to the name of the package
-- 
2.11.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-import-elpa-Import-dependencies-as-propagated-inputs.patch --]
[-- Type: text/x-diff, Size: 1063 bytes --]

From 88f23b9c369841837a83225b52e19f4c029906ab Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <carlo@zancanaro.id.au>
Date: Wed, 14 Dec 2016 12:34:15 +1100
Subject: [PATCH 2/2] import: elpa: Import dependencies as propagated-inputs

* guix/import/elpa.scm (elpa-package->sexp): Import dependencies as
propagated-inputs.
---
 guix/import/elpa.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 5f8b7a9e5..897ce6a69 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -228,7 +228,7 @@ type '<elpa-package>'."
                         (bytevector->nix-base32-string (file-sha256 tarball))
                         "failed to download package")))))
        (build-system emacs-build-system)
-       ,@(maybe-inputs 'inputs dependencies)
+       ,@(maybe-inputs 'propagated-inputs dependencies)
        (home-page ,(elpa-package-home-page pkg))
        (synopsis ,(elpa-package-synopsis pkg))
        (description ,(elpa-package-description pkg))
-- 
2.11.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

             reply	other threads:[~2016-12-14  2:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14  2:04 Carlo Zancanaro [this message]
2016-12-23  1:57 ` [PATCH] Elpa importer improvements Carlo Zancanaro
2016-12-27  8:54 ` Alex Kost
2016-12-27 10:20   ` Carlo Zancanaro
2016-12-29 17:16   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760mn5kqq.fsf@zancanaro.id.au \
    --to=carlo@zancanaro.id.au \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.