From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: [PATCH] Elpa importer improvements Date: Wed, 14 Dec 2016 13:04:45 +1100 Message-ID: <8760mn5kqq.fsf@zancanaro.id.au> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGyxx-0001kZ-4e for guix-devel@gnu.org; Tue, 13 Dec 2016 21:06:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGyxt-0000Ah-6w for guix-devel@gnu.org; Tue, 13 Dec 2016 21:06:45 -0500 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGyxt-00006H-0u for guix-devel@gnu.org; Tue, 13 Dec 2016 21:06:41 -0500 Received: by mail-pg0-f41.google.com with SMTP id x23so2228995pgx.1 for ; Tue, 13 Dec 2016 18:06:18 -0800 (PST) Received: from charizard (14-200-183-160.static.tpgi.com.au. [14.200.183.160]) by smtp.gmail.com with ESMTPSA id t25sm83149848pgo.9.2016.12.13.18.05.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 13 Dec 2016 18:05:15 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Guix-devel --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed 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. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-import-elpa-Fix-call-with-downloaded-file.patch Content-Transfer-Encoding: quoted-printable From=200e561aee91b5d389d72906d059ddf486a322f20a Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro 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. =2D-- 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 =2D-- 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." =2D (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))))) =20 (define (is-elpa-package? name elpa-pkg-spec) "Return true if the string NAME corresponds to the name of the package =2D-=20 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-import-elpa-Import-dependencies-as-propagated-inputs.patch Content-Transfer-Encoding: quoted-printable From=2088f23b9c369841837a83225b52e19f4c029906ab Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro 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. =2D-- 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 =2D-- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -228,7 +228,7 @@ type ''." (bytevector->nix-base32-string (file-sha256 tarbal= l)) "failed to download package"))))) (build-system emacs-build-system) =2D ,@(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)) =2D-=20 2.11.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJYUKi9AAoJEMBVJci7YG0rrCUH+QGvSVFhBR2riI60hpx+aLRE Fis7dkDMY2F05uAWc+c7Mrkd4YSkrEDM8Nu7RvI+pSBqcugOo4IYIvcK/VB5hl0g 8F5nSQJCtdpxBENfvRMpGYOoTQ8ozfkdxN3nmofi8AFKId7sTuM4uhVyBBYFyVci lk12J6S60PwLUkk1RKazWk+e9XOJJ1ldmCH+en6Le7a28jAxOvTBK0R/20AIqznq DyXgBiWVUzslcUbMXPuqldeMLC13ZKf5Yg1lhkFGeAetoxbYZJalv/L5NRWn6+lb u94FyaGFmWGUPeKoJHky2exUHDeJXdqWONyF6HDVltqkHSKE8mzKU/hJZUSdOcg= =zOwh -----END PGP SIGNATURE----- --==-=-=--