From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 27 21:00:08 2019 Received: (at submit) by debbugs.gnu.org; 28 Dec 2019 02:00:08 +0000 Received: from localhost ([127.0.0.1]:57913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1il1Ob-0004Uy-97 for submit@debbugs.gnu.org; Fri, 27 Dec 2019 21:00:07 -0500 Received: from lists.gnu.org ([209.51.188.17]:48638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1il1OU-0004Um-Qu for submit@debbugs.gnu.org; Fri, 27 Dec 2019 20:59:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43867) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1il1OS-0007Bq-0v for guix-patches@gnu.org; Fri, 27 Dec 2019 20:59:54 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1il1OP-00085u-2d for guix-patches@gnu.org; Fri, 27 Dec 2019 20:59:51 -0500 Received: from zancanaro.com.au ([45.76.117.151]:51566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1il1OO-0007we-AM for guix-patches@gnu.org; Fri, 27 Dec 2019 20:59:49 -0500 Received: by zancanaro.com.au (Postfix, from userid 116) id 1DA6B20930; Sat, 28 Dec 2019 01:59:43 +0000 (UTC) Received: from jolteon (210-1-202-160-cpe.spintel.net.au [210.1.202.160]) by zancanaro.com.au (Postfix) with ESMTPSA id 3D5202092A for ; Sat, 28 Dec 2019 01:59:41 +0000 (UTC) User-agent: mu4e 1.2.0; emacs 26.3 From: Carlo Zancanaro To: guix-patches@gnu.org Subject: [PATCH] import: Add importer for MELPA packages. Date: Sat, 28 Dec 2019 12:59:40 +1100 Message-ID: <87v9q1jjlf.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 45.76.117.151 X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain; format=flowed Hey Guix! I have for a while wanted to write an importer for MELPA packages that reads from the MELPA recipe and constructs a Guix package. This is primarily because the ELPA importer uses source tarballs, which we can't rely on for MELPA because they remove old tarballs and upload new ones whenever they rebuild the package. So, here is my importer! Probably the most controversial decision here is to always import the current head that MELPA would build. This means that when you run "guix import melpa" it gives you a package definition that should correspond to what MELPA currently has. This may not correspond to a release of the package, so we cannot easily give it a version, and thus I put the current date into the version string. I imagine it would be possible to combine this importer with the current ELPA one in some way, to use all the metadata provided by the ELPA importer, but then generate an origin based on the MELPA recipe, but that seemed more daunting to me than writing a new importer. Carlo --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-import-Add-importer-for-MELPA-packages.patch Content-Transfer-Encoding: quoted-printable >From 2ad1f71d72d72ca742005c4244e9a997411473f0 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sat, 28 Dec 2019 12:34:33 +1100 Subject: [PATCH] import: Add importer for MELPA packages. * guix/import/melpa.scm: New file. * guix/scripts/import/melpa.scm: New file. * guix/scripts/import.scm (importers): Add melpa importer. * doc/guix.texi: Add melpa importer to table. * Makefile.am (MODULES): Add files. --- Makefile.am | 2 + doc/guix.texi | 10 ++ guix/import/melpa.scm | 216 ++++++++++++++++++++++++++++++++++ guix/scripts/import.scm | 2 +- guix/scripts/import/melpa.scm | 99 ++++++++++++++++ 5 files changed, 328 insertions(+), 1 deletion(-) create mode 100644 guix/import/melpa.scm create mode 100644 guix/scripts/import/melpa.scm diff --git a/Makefile.am b/Makefile.am index 6106250b37..0fdd829f3e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -217,6 +217,7 @@ MODULES =3D \ guix/import/cran.scm \ guix/import/crate.scm \ guix/import/elpa.scm \ + guix/import/melpa.scm \ guix/import/gem.scm \ guix/import/github.scm \ guix/import/gnome.scm \ @@ -262,6 +263,7 @@ MODULES =3D \ guix/scripts/import/crate.scm \ guix/scripts/import/cran.scm \ guix/scripts/import/elpa.scm \ + guix/scripts/import/melpa.scm \ guix/scripts/import/gem.scm \ guix/scripts/import/gnu.scm \ guix/scripts/import/hackage.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index efc59c1aaf..9e75e619ff 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9215,6 +9215,16 @@ and generate package expressions for all those packa= ges that are not yet in Guix. @end table =20 +@item melpa +@cindex melpa +Import a package recipe from @uref{https://melpa.org/packages, MELPA}. +Unlike the ELPA importer, above, the MELPA importer does not use source +archives, but builds its package from the upstream source. + +@example +guix import melpa org-mime +@end example + @item crate @cindex crate Import metadata from the crates.io Rust package repository diff --git a/guix/import/melpa.scm b/guix/import/melpa.scm new file mode 100644 index 0000000000..cd22018589 --- /dev/null +++ b/guix/import/melpa.scm @@ -0,0 +1,216 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2015 Federico Beffa +;;; Copyright =C2=A9 2015, 2016, 2017, 2018 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2019 Carlo Zancanaro +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix import melpa) + #:use-module (gcrypt hash) + #:use-module (guix base32) + #:use-module (guix git) + #:use-module (guix http-client) + #:use-module (guix import utils) + #:use-module (guix serialization) + #:use-module (guix store) + #:use-module (ice-9 control) + #:use-module (ice-9 ftw) + #:use-module (ice-9 match) + #:use-module (ice-9 rdelim) + #:use-module (ice-9 regex) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-26) + #:use-module (web uri) + #:export (melpa->guix-package)) + +(define emacs-standard-library? + (let ((libs '("emacs" "cl-lib"))) + (lambda (lib) + "Return true if LIB is part of Emacs itself. The check is not +exhaustive and only attempts to recognize a subset of packages which in the +past were distributed separately from Emacs." + (member lib libs)))) + +(define* (download-git-repository url ref) + (with-store store + (latest-repository-commit store url #:ref ref))) + +(define (package-name->recipe-url package-name) + (string-append "https://raw.githubusercontent.com/melpa/melpa/master/rec= ipes/" + package-name)) + +(define (package-name->recipe package-name) + (define (data->recipe data) + (match data + (() '()) + ((key value . tail) + (cons (cons key value) (data->recipe tail))))) + + (let* ((port (http-fetch/cached (string->uri (package-name->recipe-url p= ackage-name)) + #:ttl (* 6 3600))) + (previous-keyword-mode (match (member 'keywords (read-options)) + ((_ value . _) value))) + (data (begin + (read-set! keywords 'prefix) + (read port)))) + (read-set! keywords previous-keyword-mode) + (close-port port) + (data->recipe (cons #:name data)))) + +(define (github-repo->url repo) + (string-append "https://github.com/" repo ".git")) + +(define (gitlab-repo->url repo) + (string-append "https://gitlab.com/" repo ".git")) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=3D? (basename file) ".git")) + (else + #f))) + +(define (emacs-requires->inputs requires) + (define (require-symbol->input-string require) + (let ((require-string (symbol->string (if (pair? require) + (car require) + require)))) + (if (emacs-standard-library? require-string) + #f + (string-append "emacs-" require-string)))) + + (package-names->package-inputs + (filter identity (map require-symbol->input-string requires)))) + +;; This is a regular expression that will extract the package requirements +;; from a line of elisp. See "(elisp) Library Headers" for more details a= bout +;; this header. +(define package-depends-regexp + (make-regexp "\\s*;+\\s**package-requires:(.*)" regexp/icase)) + +(define (find-package-inputs directory) + (define (for-each-line f file) + (call-with-input-file file + (lambda (port) + (let loop () + (let ((line (read-line port 'concat))) + (unless (eof-object? line) + (f line) + (loop))))))) + + (emacs-requires->inputs + (call/ec (lambda (return) + (for-each + (lambda (filename) + (for-each-line + (lambda (line) + (let ((match-data (regexp-exec package-depends-regexp = line))) + (when match-data + (return (with-input-from-string (match:substring m= atch-data 1) + read))))) + (string-append directory "/" filename))) + (scandir directory (cut string-suffix-ci? ".el" <>))) + (return '()))))) + + +(define (git-repository->package recipe url) + (define ref + (cond + ((assoc-ref recipe #:branch) + =3D> (lambda (branch) (cons 'branch branch))) + ((assoc-ref recipe #:commit) + =3D> (lambda (commit) (cons 'commit commit))) + (else + '(branch . "master")))) + + (define (maybe-inputs input-type inputs) + (if (null? inputs) + (list) + (list (list input-type (list 'quasiquote inputs))))) + + (define (maybe-arguments files) + (define (glob->regexp glob) + (string-append + "^" + (regexp-substitute/global #f "\\*\\*?" glob + 'pre + (lambda (m) + (if (string=3D (match:substring m 0) "*= *") + ".*" + "[^/]+")) + 'post) + "$")) + + (if files + `((arguments '(#:include ',(map glob->regexp (remove pair? files)) + #:exclude ',(map glob->regexp (apply append + (map (match-la= mbda + ((#:exc= lude . values) + values) + (_ '())) + files))))= )) + '())) + + (let-values (((directory commit) (download-git-repository url ref))) + (let ((inputs (find-package-inputs directory))) + `(package + (name ,(string-append "emacs-" (symbol->string (assoc-ref recipe = #:name)))) + (version , (strftime "%Y%m%d" (gmtime (current-time)))) + (source (origin + (method git-fetch) + (uri (git-reference + (url ,url) + (commit ,commit))) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash directory (negate vcs-file?) #t)))))) + (build-system emacs-build-system) + ,@(maybe-inputs 'propagated-inputs + (find-package-inputs directory)) + ,@(maybe-arguments (assoc-ref recipe #:files)) + (home-page #f) + (description #f) + (synopsis #f) + (license #f))))) + +(define (melpa->guix-package package-name) + "Construct a Guix package based on the MELPA recipe for PACKAGE-NAME." + (let ((recipe (package-name->recipe package-name))) + (match (assoc-ref recipe #:fetcher) + ('github (git-repository->package recipe + (github-repo->url (assoc-ref recip= e #:repo)))) + ('gitlab (git-repository->package recipe + (gitlab-repo->url (assoc-ref recip= e #:repo)))) + ('git (git-repository->package recipe + (assoc-ref recipe #:url))) + (_ (leave (G_ "Only github, gitlab, and git repositories are current= ly supported")))))) diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index c6cc93fad8..1c5fc68776 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -76,7 +76,7 @@ rather than \\n." ;;; =20 (define importers '("gnu" "nix" "pypi" "cpan" "hackage" "stackage" "elpa" = "gem" - "cran" "crate" "texlive" "json" "opam")) + "cran" "crate" "texlive" "json" "opam" "melpa")) =20 (define (resolve-importer name) (let ((module (resolve-interface diff --git a/guix/scripts/import/melpa.scm b/guix/scripts/import/melpa.scm new file mode 100644 index 0000000000..5e298b87b2 --- /dev/null +++ b/guix/scripts/import/melpa.scm @@ -0,0 +1,99 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2015 Federico Beffa +;;; Copyright =C2=A9 2018 Oleg Pykhalov +;;; Copyright =C2=A9 2019 Carlo Zancanaro +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix scripts import melpa) + #:use-module (guix ui) + #:use-module (guix utils) + #:use-module (guix scripts) + #:use-module (guix import melpa) + #:use-module (guix import utils) + #:use-module (guix scripts import) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-11) + #:use-module (srfi srfi-37) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:export (guix-import-melpa)) + + +;;; +;;; Command-line options. +;;; + +(define %default-options + '((repo . gnu))) + +(define (show-help) + (display (G_ "Usage: guix import melpa PACKAGE-NAME +Import the latest package named PACKAGE-NAME from the MELPA repository rec= ipes.\n")) + (display (G_ " + -h, --help display this help and exit")) + (display (G_ " + -V, --version display version information and exit")) + (newline) + (show-bug-report-information)) + +(define %options + ;; Specification of the command-line options. + (cons* (option '(#\h "help") #f #f + (lambda args + (show-help) + (exit 0))) + (option '(#\V "version") #f #f + (lambda args + (show-version-and-exit "guix import melpa"))) + (option '(#\r "recursive") #f #f + (lambda (opt name arg result) + (alist-cons 'recursive #t result))) + %standard-import-options)) + + +;;; +;;; Entry point. +;;; + +(define (guix-import-melpa . args) + (define (parse-options) + ;; Return the alist of option values. + (args-fold* args %options + (lambda (opt name arg result) + (leave (G_ "~A: unrecognized option~%") name)) + (lambda (arg result) + (alist-cons 'argument arg result)) + %default-options)) + + (let* ((opts (parse-options)) + (args (filter-map (match-lambda + (('argument . value) + value) + (_ #f)) + (reverse opts)))) + (match args + ((package-name) + (let ((sexp (melpa->guix-package package-name))) + (unless sexp + (leave (G_ "failed to download package '~a'~%") package-name)) + sexp)) + (() + (leave (G_ "too few arguments~%"))) + ((many ...) + (leave (G_ "too many arguments~%")))))) + +;;; melpa.scm ends here --=20 2.24.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 07 14:39:00 2020 Received: (at 38769) by debbugs.gnu.org; 7 Jan 2020 19:39:00 +0000 Received: from localhost ([127.0.0.1]:49399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iougu-0003WK-7n for submit@debbugs.gnu.org; Tue, 07 Jan 2020 14:39:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iougs-0003W7-EW for 38769@debbugs.gnu.org; Tue, 07 Jan 2020 14:38:59 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iougn-0003tv-9n; Tue, 07 Jan 2020 14:38:53 -0500 Received: from [2605:6000:1a0d:4c95::3d] (port=50916 helo=oryx) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iougm-0000JC-Km; Tue, 07 Jan 2020 14:38:52 -0500 From: Brett Gilio To: Carlo Zancanaro Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. References: <87v9q1jjlf.fsf@zancanaro.id.au> Date: Tue, 07 Jan 2020 13:39:02 -0600 In-Reply-To: <87v9q1jjlf.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Sat, 28 Dec 2019 12:59:40 +1100") Message-ID: <87r20bqco9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Carlo Zancanaro writes: > Hey Guix! > > I have for a while wanted to write an importer for MELPA packages that > reads from the MELPA recipe and constructs a Guix package. This is > primarily because the ELPA importer uses source tarballs, which we > can't rely on for MELPA because they remove old tarballs and upload > new ones whenever they rebuild the package. > > So, here is my importer! > > Probably the most controversial decision here is to always import the > current head that MELPA would build. This means that when you run > "guix import melpa" it gives you a package definition that should > correspond to what MELPA currently has. This may not correspond to a > release of the package, so we cannot easily give it a version, and > thus I put the current date into the version string. > > I imagine it would be possible to combine this importer with the > current ELPA one in some way, to use all the metadata provided by the > ELPA importer, but then generate an origin based on the MELPA recipe, > but that seemed more daunting to me than writing a new importer. > > Carlo > > Hi Carlo! Thanks for your contribution. I have not yet had a chance to look at it, but I agree that we /should/ combine this with the ELPA importer in its current tradition: `guix import elpa -a melpa`. That seems preferable to me, as it would avoid the need to deprecate a command flag in our UX. What do you think? -- Brett M. Gilio GNU Guix, Contributor | GNU Project, Webmaster [DFC0 C7F7 9EE6 0CA7 AE55 5E19 6722 43C4 A03F 0EEE] From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 17 22:55:02 2020 Received: (at 38769) by debbugs.gnu.org; 18 Mar 2020 02:55:02 +0000 Received: from localhost ([127.0.0.1]:39715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEOrF-0003zB-JE for submit@debbugs.gnu.org; Tue, 17 Mar 2020 22:55:02 -0400 Received: from zancanaro.com.au ([45.76.117.151]:48156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jEOrD-0003yv-HC for 38769@debbugs.gnu.org; Tue, 17 Mar 2020 22:55:00 -0400 Received: by zancanaro.com.au (Postfix, from userid 116) id 4FD2D2D664; Wed, 18 Mar 2020 02:54:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on vultr X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_FILL_THIS_FORM_SHORT,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from jolteon (210-1-202-160-cpe.spintel.net.au [210.1.202.160]) by zancanaro.com.au (Postfix) with ESMTPSA id 51A622D573; Wed, 18 Mar 2020 02:54:55 +0000 (UTC) References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> User-agent: mu4e 1.2.0; emacs 26.3 From: Carlo Zancanaro To: Brett Gilio Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. In-reply-to: <87r20bqco9.fsf@gnu.org> Date: Wed, 18 Mar 2020 13:54:52 +1100 Message-ID: <874kum9xtv.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; format=flowed Hey Brett! It's been a while, but I've finally found time to revisit this patch. On Wed, Jan 08 2020, Brett Gilio wrote: > ... we /should/ combine this with the ELPA importer in its > current tradition: `guix import elpa -a melpa`. That seems > preferable to me, as it would avoid the need to deprecate a > command flag in our UX. I've done this. Carlo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-import-elpa-Fetch-MELPA-packages-with-a-stable-git-r.patch >From eee82d9668410c3b71884082fa770417f6b53921 Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Wed, 18 Mar 2020 13:38:50 +1100 Subject: [PATCH] import: elpa: Fetch MELPA packages with a stable git-reference. * guix/import/elpa.scm (default-files-spec): New variable. (download-git-repository, package-name->melpa-recipe, file-hash, vcs-file?, git-repository->origin, melpa-recipe->origin, melpa-recipe->maybe-arguments): New procedures. (elpa-package->sexp): Add optional repo argument, and use it to determine whether to attempt to construct a source using the MELPA recipe. (elpa->guix-package): Pass repo to elpa-package->sexp. --- guix/import/elpa.scm | 189 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 166 insertions(+), 23 deletions(-) diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 2d4487dba0..2483b57385 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -21,6 +21,7 @@ (define-module (guix import elpa) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) + #:use-module (ice-9 regex) #:use-module (web uri) #:use-module (srfi srfi-1) #:use-module (srfi srfi-9) @@ -30,6 +31,8 @@ #:use-module ((guix download) #:select (download-to-store)) #:use-module (guix import utils) #:use-module (guix http-client) + #:use-module (guix git) + #:use-module ((guix serialization) #:select (write-file)) #:use-module (guix store) #:use-module (guix ui) #:use-module (gcrypt hash) @@ -195,10 +198,143 @@ include VERSION." url))) (_ #f)))) -(define* (elpa-package->sexp pkg #:optional license) +(define* (download-git-repository url ref) + "Fetch the given REF from the Git repository at URL." + (with-store store + (latest-repository-commit store url #:ref ref))) + +(define (package-name->melpa-recipe package-name) + "Fetch the MELPA recipe for PACKAGE-NAME, represented as an alist from +keywords to values." + (define recipe-url + (string-append "https://raw.githubusercontent.com/melpa/melpa/master/recipes/" + package-name)) + + (define (data->recipe data) + (match data + (() '()) + ((key value . tail) + (cons (cons key value) (data->recipe tail))))) + + (let* ((port (http-fetch/cached (string->uri recipe-url) + #:ttl (* 6 3600))) + (data (read port))) + (close-port port) + (data->recipe (cons ':name data)))) + +;; XXX adapted from (guix scripts hash) +(define (file-hash file select? recursive?) + ;; Compute the hash of FILE. + (if recursive? + (let-values (((port get-hash) (open-sha256-port))) + (write-file file port #:select? select?) + (force-output port) + (get-hash)) + (call-with-input-file file port-sha256))) + +;; XXX taken from (guix scripts hash) +(define (vcs-file? file stat) + (case (stat:type stat) + ((directory) + (member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS"))) + ((regular) + ;; Git sub-modules have a '.git' file that is a regular text file. + (string=? (basename file) ".git")) + (else + #f))) + +(define (git-repository->origin recipe url) + "Fetch origin details from the Git repository at URL for the provided MELPA +RECIPE." + (define ref + (cond + ((assoc-ref recipe #:branch) + => (lambda (branch) (cons 'branch branch))) + ((assoc-ref recipe #:commit) + => (lambda (commit) (cons 'commit commit))) + (else + '(branch . "master")))) + + (let-values (((directory commit) (download-git-repository url ref))) + `(origin + (method git-fetch) + (uri (git-reference + (url ,url) + (commit ,commit))) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (file-hash directory (negate vcs-file?) #t))))))) + +(define* (melpa-recipe->origin recipe) + "Fetch origin details from the MELPA recipe and associated repository for +the package named PACKAGE-NAME." + (define (github-repo->url repo) + (string-append "https://github.com/" repo ".git")) + (define (gitlab-repo->url repo) + (string-append "https://gitlab.com/" repo ".git")) + + (match (assq-ref recipe ':fetcher) + ('github (git-repository->origin recipe (github-repo->url (assq-ref recipe ':repo)))) + ('gitlab (git-repository->origin recipe (gitlab-repo->url (assq-ref recipe ':repo)))) + ('git (git-repository->origin recipe (assq-ref recipe ':url))) + (#f #f) ; if we're not using melpa then this stops us printing a warning + (_ (warning (G_ "Unsupported MELPA fetcher: ~a, falling back to unstable MELPA source.~%") + (assq-ref recipe ':fetcher)) + #f))) + +(define default-files-spec + ;; This contains more than just the things contained in %default-include and + ;; %default-exclude, presumably because this includes source files (*.in, + ;; *.texi, etc.) which have already been processed for releases. + ;; + ;; Taken from: + ;; https://github.com/melpa/melpa/blob/e8dc709d0ab2b4a68c59315f42858bcb86095f11/package-build/package-build.el#L580-L585 + '("*.el" "*.el.in" "dir" + "*.info" "*.texi" "*.texinfo" + "doc/dir" "doc/*.info" "doc/*.texi" "doc/*.texinfo" + (:exclude ".dir-locals.el" "test.el" "tests.el" "*-test.el" "*-tests.el"))) + +(define* (melpa-recipe->maybe-arguments melpa-recipe) + "Extract arguments for the build system from MELPA-RECIPE." + (define (glob->regexp glob) + (string-append + "^" + (regexp-substitute/global #f "\\*\\*?" glob + 'pre + (lambda (m) + (if (string= (match:substring m 0) "**") + ".*" + "[^/]+")) + 'post) + "$")) + + (let ((files (assq-ref melpa-recipe ':files))) + (if files + (let* ((with-default (apply append (map (lambda (entry) + (if (eq? ':defaults entry) + default-files-spec + (list entry))) + files))) + (inclusions (remove pair? with-default)) + (exclusions (apply append (map (match-lambda + ((':exclude . values) + values) + (_ '())) + with-default)))) + `((arguments '(#:include ',(map glob->regexp inclusions) + #:exclude ',(map glob->regexp exclusions))))) + '()))) + +(define* (elpa-package->sexp pkg #:optional license repo) "Return the `package' S-expression for the Emacs package PKG, a record of type ''." + (define melpa-recipe + (if (eq? repo 'melpa) + (package-name->melpa-recipe (elpa-package-name pkg)) + #f)) + (define name (elpa-package-name pkg)) (define version (elpa-package-version pkg)) @@ -223,27 +359,34 @@ type ''." (list (list input-type (list 'quasiquote inputs)))))) - (let ((tarball (with-store store - (download-to-store store source-url)))) - (values - `(package - (name ,(elpa-name->package-name name)) - (version ,version) - (source (origin - (method url-fetch) - (uri (string-append ,@(factorize-uri source-url version))) - (sha256 - (base32 - ,(if tarball - (bytevector->nix-base32-string (file-sha256 tarball)) - "failed to download package"))))) - (build-system emacs-build-system) - ,@(maybe-inputs 'propagated-inputs dependencies) - (home-page ,(elpa-package-home-page pkg)) - (synopsis ,(elpa-package-synopsis pkg)) - (description ,(elpa-package-description pkg)) - (license ,license)) - dependencies-names))) + (define melpa-source + (melpa-recipe->origin melpa-recipe)) + + (values + `(package + (name ,(elpa-name->package-name name)) + (version ,version) + (source ,(or melpa-source + (let ((tarball (with-store store + (download-to-store store source-url)))) + `(origin + (method url-fetch) + (uri (string-append ,@(factorize-uri source-url version))) + (sha256 + (base32 + ,(if tarball + (bytevector->nix-base32-string (file-sha256 tarball)) + "failed to download package"))))))) + (build-system emacs-build-system) + ,@(maybe-inputs 'propagated-inputs dependencies) + ,@(if melpa-source + (melpa-recipe->maybe-arguments melpa-recipe) + '()) + (home-page ,(elpa-package-home-page pkg)) + (synopsis ,(elpa-package-synopsis pkg)) + (description ,(elpa-package-description pkg)) + (license ,license)) + dependencies-names)) (define* (elpa->guix-package name #:optional (repo 'gnu)) "Fetch the package NAME from REPO and produce a Guix package S-expression." @@ -253,7 +396,7 @@ type ''." ;; ELPA is known to contain only GPLv3+ code. Other repos may contain ;; code under other license but there's no license metadata. (let ((license (and (memq repo '(gnu gnu/http)) 'license:gpl3+))) - (elpa-package->sexp package license))))) + (elpa-package->sexp package license repo))))) ;;; -- 2.25.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 30 10:26:12 2020 Received: (at 38769) by debbugs.gnu.org; 30 May 2020 14:26:12 +0000 Received: from localhost ([127.0.0.1]:58848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf2RA-0003Ca-Ca for submit@debbugs.gnu.org; Sat, 30 May 2020 10:26:12 -0400 Received: from zancanaro.com.au ([45.76.117.151]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jf2R8-0003CQ-7s for 38769@debbugs.gnu.org; Sat, 30 May 2020 10:26:11 -0400 Received: by zancanaro.com.au (Postfix, from userid 116) id 16B162F6C3; Sat, 30 May 2020 14:26:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on vultr X-Spam-Level: X-Spam-Status: No, score=-1.9 required=4.0 tests=ALL_TRUSTED,BAYES_00, MISSING_HEADERS autolearn=no autolearn_force=no version=3.4.2 Received: from jolteon (210-1-202-160-cpe.spintel.net.au [210.1.202.160]) by zancanaro.com.au (Postfix) with ESMTPSA id AE1FB2F6C1 for <38769@debbugs.gnu.org>; Sat, 30 May 2020 14:26:07 +0000 (UTC) References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> <874kum9xtv.fsf@zancanaro.id.au> User-agent: mu4e 1.4.6; emacs 26.3 From: Carlo Zancanaro Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. In-reply-to: <874kum9xtv.fsf@zancanaro.id.au> Date: Sun, 31 May 2020 00:26:06 +1000 Message-ID: <87367hxzwh.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I just saw a message on guix-patches that reminded me that this was still sitting around. Can anyone help me out getting this change into Guix so Emacs packages are easier to import correctly? Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 MISSING_HEADERS Missing To: header -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) I just saw a message on guix-patches that reminded me that this was still sitting around. Can anyone help me out getting this change into Guix so Emacs packages are easier to import correctly? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 24 21:49:32 2020 Received: (at 38769) by debbugs.gnu.org; 25 Jul 2020 01:49:32 +0000 Received: from localhost ([127.0.0.1]:49026 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz9Jc-0007tM-5f for submit@debbugs.gnu.org; Fri, 24 Jul 2020 21:49:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jz9Ja-0007t2-Cc for 38769@debbugs.gnu.org; Fri, 24 Jul 2020 21:49:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37150) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jz9JV-0002iM-1w; Fri, 24 Jul 2020 21:49:25 -0400 Received: from [2605:6000:1a0d:48fb::e9] (port=60958 helo=lenovo-t430) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jz9JU-00049r-IK; Fri, 24 Jul 2020 21:49:24 -0400 From: Brett Gilio To: Carlo Zancanaro Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> <874kum9xtv.fsf@zancanaro.id.au> <87367hxzwh.fsf@zancanaro.id.au> Date: Fri, 24 Jul 2020 20:49:35 -0500 In-Reply-To: <87367hxzwh.fsf@zancanaro.id.au> (Carlo Zancanaro's message of "Sun, 31 May 2020 00:26:06 +1000") Message-ID: <87mu3o4b4g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Carlo Zancanaro writes: > I just saw a message on guix-patches that reminded me that this was > still sitting around. Can anyone help me out getting this change into > Guix so Emacs packages are easier to import correctly? Hey Carlo, Sorry nobody got back to you on this! I am just recently coming off of a haitus from contributing. I have a few things still on my backlog, but I have marked this bug for review ASAP! If somebody else can get to it faster than me, great! If not, I will surely look it over soon! Brett Gilio From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 05:32:33 2020 Received: (at 38769) by debbugs.gnu.org; 18 Dec 2020 10:32:33 +0000 Received: from localhost ([127.0.0.1]:37778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqD3p-0007AU-43 for submit@debbugs.gnu.org; Fri, 18 Dec 2020 05:32:33 -0500 Received: from mira.cbaines.net ([212.71.252.8]:54336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqD3Y-0007A5-5W for 38769@debbugs.gnu.org; Fri, 18 Dec 2020 05:32:31 -0500 Received: from localhost (188.30.130.172.threembb.co.uk [188.30.130.172]) by mira.cbaines.net (Postfix) with ESMTPSA id 15FB427BC05; Fri, 18 Dec 2020 10:32:15 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d37895ba; Fri, 18 Dec 2020 10:32:12 +0000 (UTC) References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> <874kum9xtv.fsf@zancanaro.id.au> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines To: Carlo Zancanaro Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. In-reply-to: <874kum9xtv.fsf@zancanaro.id.au> Date: Fri, 18 Dec 2020 10:32:09 +0000 Message-ID: <87a6ub2ymu.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org, Brett Gilio X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Carlo Zancanaro writes: > Hey Brett! > > It's been a while, but I've finally found time to revisit this > patch. > > On Wed, Jan 08 2020, Brett Gilio wrote: >> ... we /should/ combine this with the ELPA importer in its >> current tradition: `guix import elpa -a melpa`. That seems >> preferable to me, as it would avoid the need to deprecate a >> command flag in our UX. > > I've done this. I've had a go at trying this out, I tried importing ack from elpa and a from melpa, and it seemed to work OK. The packages built at least, and the outputs look reasonable. Looking at the code, elpa-package->sexp is a little awkward, the code would probably be clearer if the (or ...) bits in the package sexp were moved out in to functions that deal with generating that part of the package. It seems to work though, so I'm happy to push this. Is this patch still relevant? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/chSlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XdPiA//fHvV/A3MrQYIUuoQFee4vT6RfocLTcrV rW3wxSDHQ8JaEtOc5l4kWrTe8od4+j2Pe+Z/K5I52aRBu8SurbC34dnCIwhbIABv WD551bSjE3G3eXiy1wGb9nAkLMl7KtDi5umEpCwq/SK+1lWOonKQM0I9bTNKwNUq IG7yXYA9ou7utfdoAo2cqY5CRf1sIryjzfKoYYcdtYYTXQGSJwhNC0SbHW955nMu YRWUgkTgdxcDIfCagDWKjkC7PyKq/SUeWmDK/VRzzgpecKdWHDjWfFLFVR+gmgpR /WWOluZdzRhV0HRgfoxeq1odYv5s0eLx8ui/04YJJ588gZ+6+ZyiECcVJUy2abhy bx9ysS1I/U3z45v8vX6D1m9K6HI5Cvmg2AE/XhtnoUoCK8Cb+HxSZRYaNJlfOo13 5swwmUw5cAZhvm0TBUS5q/OOeVcMhXjBgc5s/JaTZ3Bs2TrgRBDFMKAvcS6/49cw Pz2B5EqOInX0JvOvQWRLOuARRDJxD4PS7Ymzq25xZrJ9J+C+fWQwcQ0zLQvaweBr ybDJ6Hzlc2QAP1LBRV4cLdifPAEYVlbjUe0ntC6T9sYNca1ivU/nm0pcORLjg1xC ReX0QUzUbxqoH2Sf4vsZtdCzN6X4iMKldC/fCCWWD2yFsdA6miraDQiFfnVmaAbi +3VY51hRPNc= =9SjF -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 06:16:20 2020 Received: (at 38769) by debbugs.gnu.org; 18 Dec 2020 11:16:20 +0000 Received: from localhost ([127.0.0.1]:37840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqDkC-0008Fz-6v for submit@debbugs.gnu.org; Fri, 18 Dec 2020 06:16:20 -0500 Received: from zancanaro.com.au ([45.76.117.151]:54698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqDk9-0008Fo-CY for 38769@debbugs.gnu.org; Fri, 18 Dec 2020 06:16:19 -0500 Received: by zancanaro.com.au (Postfix, from userid 116) id 7865C32F59; Fri, 18 Dec 2020 11:16:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on vultr X-Spam-Level: X-Spam-Status: No, score=-2.9 required=4.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from jolteon (unknown [27.96.215.68]) by zancanaro.com.au (Postfix) with ESMTPSA id 13C2932F56; Fri, 18 Dec 2020 11:16:15 +0000 (UTC) References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> <874kum9xtv.fsf@zancanaro.id.au> <87a6ub2ymu.fsf@cbaines.net> User-agent: mu4e 1.4.13; emacs 27.1 From: Carlo Zancanaro To: Christopher Baines Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. In-reply-to: <87a6ub2ymu.fsf@cbaines.net> Date: Fri, 18 Dec 2020 22:16:13 +1100 Message-ID: <87zh2b2wle.fsf@zancanaro.id.au> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 38769 Cc: 38769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Chris! On Fri, Dec 18 2020, Christopher Baines wrote: > Looking at the code, elpa-package->sexp is a little awkward, the > code would probably be clearer if the (or ...) bits in the > package sexp were moved out in to functions that deal with > generating that part of the package. I agree with you. The "quasiquote, unquote, quasiquote, unquote" is a bit awkward, but I don't think it's unreasonable. I'm not that interested in revising the patch right now, but feel free to extract that logic before merging if you think it's necessary. > It seems to work though, so I'm happy to push this. Is this > patch still relevant? Yep, as far as I know this is still relevant. Carlo From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 18 07:40:32 2020 Received: (at 38769-done) by debbugs.gnu.org; 18 Dec 2020 12:40:32 +0000 Received: from localhost ([127.0.0.1]:38032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqF3f-00049F-Sd for submit@debbugs.gnu.org; Fri, 18 Dec 2020 07:40:32 -0500 Received: from mira.cbaines.net ([212.71.252.8]:32802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kqF3d-000496-UP for 38769-done@debbugs.gnu.org; Fri, 18 Dec 2020 07:40:30 -0500 Received: from localhost (188.30.130.172.threembb.co.uk [188.30.130.172]) by mira.cbaines.net (Postfix) with ESMTPSA id EBB3827BC05; Fri, 18 Dec 2020 12:40:28 +0000 (GMT) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 703b457b; Fri, 18 Dec 2020 12:40:26 +0000 (UTC) References: <87v9q1jjlf.fsf@zancanaro.id.au> <87r20bqco9.fsf@gnu.org> <874kum9xtv.fsf@zancanaro.id.au> <87a6ub2ymu.fsf@cbaines.net> <87zh2b2wle.fsf@zancanaro.id.au> User-agent: mu4e 1.4.13; emacs 27.1 From: Christopher Baines To: Carlo Zancanaro Subject: Re: [bug#38769] [PATCH] import: Add importer for MELPA packages. In-reply-to: <87zh2b2wle.fsf@zancanaro.id.au> Date: Fri, 18 Dec 2020 12:40:26 +0000 Message-ID: <87sg831e4l.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 38769-done Cc: 38769-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Carlo Zancanaro writes: > Hi Chris! > > On Fri, Dec 18 2020, Christopher Baines wrote: >> Looking at the code, elpa-package->sexp is a little awkward, the >> code would probably be clearer if the (or ...) bits in the >> package sexp were moved out in to functions that deal with >> generating that part of the package. > > I agree with you. The "quasiquote, unquote, quasiquote, unquote" is a > bit awkward, but I don't think it's unreasonable. I'm not that > interested in revising the patch right now, but feel free to extract > that logic before merging if you think it's necessary. > >> It seems to work though, so I'm happy to push this. Is this patch >> still relevant? > > Yep, as far as I know this is still relevant. Cool, I've gone ahead and pushed this as b129b43475442b1da43d8209914fee215f98aa29. Hopefully it'll be helpful. Thanks, Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/cozpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xf3iBAAuJFHvjtuqSDn7TzonW9sAnWpKXlnmX9L KDTM9/SSx3uVN7RG++sPBVFV9OH7zajMg+v1bIzdndysWtTKhkVphgyM1nxB2Gh7 E+IZ6uD2IvYYqdYtRHBboEzQaBnuYjF5Mfo9OT0leTfIIhAtGJuVlH7xg/348Xh3 vfxYHDdOYDUf4Ee93ABqxMtFkzWsI/NpwZ+7+7/Oas5Jkt4tVXq+ZcFsw+SpLay1 kfu89Lns6/9Pf+Z8dRVX8Ry0WcAfKq4hZ44ROF3XvPkC0MMfcPZf0J2OPXozSVZK iBSREpS+OT8i2Yp4C5DRPFAt+q7oStHsw2Ke+zj6trpGGLos0OakxBP6+S5MeqyU dLlcpl5aHOwiFnxfKocNhF+HY70Sxdh2dJQQ2R7sbRscfAb5I2nXHsuvTdq53jAj 2+D6NPO0aGQmw3A57EjSgxkX3hdcwsti8PAye+VLW8eyDBNB6tF+yLOjceTAcF7V gfp6JnAkx5gI0Sq6PU/D+cuXCnmbWGJGwziANOsJHo2C5Wf/DusZy7NUpbS07jAJ Vvi7ow0erkGZ5aqnp9F255ZLORlBa9F7m2gHd3EQmLhQ+4L+ADZlvfS4UQ+cMYUT NiZNEE+tyf+LbZK6dKqwyt+VGQc/CuuMr76CdWS74aYy5rMyMTaPmdc95XT1ehiD SwmMgdZ+M2g= =l+Cg -----END PGP SIGNATURE----- --=-=-=-- From unknown Tue Aug 19 05:11:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 16 Jan 2021 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator