From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3oqP-0005jG-VD for guix-patches@gnu.org; Sun, 15 Oct 2017 15:45:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3oqM-0004lj-Sh for guix-patches@gnu.org; Sun, 15 Oct 2017 15:45:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:33288) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3oqM-0004lb-PT for guix-patches@gnu.org; Sun, 15 Oct 2017 15:45:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e3oqM-0001FW-Iv for guix-patches@gnu.org; Sun, 15 Oct 2017 15:45:02 -0400 Subject: [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20171013054542.2032-1-mail@cbaines.net> <87shemybat.fsf@gnu.org> <20171015200517.253789a0@cbaines.net> Date: Sun, 15 Oct 2017 21:44:29 +0200 In-Reply-To: <20171015200517.253789a0@cbaines.net> (Christopher Baines's message of "Sun, 15 Oct 2017 20:05:17 +0100") Message-ID: <877evwurfm.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 28805@debbugs.gnu.org Hi! Christopher Baines skribis: > On Fri, 13 Oct 2017 23:42:34 +0200 > ludo@gnu.org (Ludovic Court=C3=A8s) wrote: [...] >> I=E2=80=99m sorry to ask ;-), but would it be an option to have a separa= te >> =E2=80=98emacs-contrib=E2=80=99 package instead? That way people could = install >> emacs-org, and optionally emacs-contrib on top of it. > > No problem, I had a similar thought when I was first figuring out what > this contrib thing was. > > I've attached my attempt at making an emacs-org-contrib package. Which > binds it to the emacs-org package, propagates emacs-org, as well as > deleting all the files included within the emacs-org package. [...] > From 2c5b66bf198ae77047e7c3d4e5631b10e90981eb Mon Sep 17 00:00:00 2001 > From: Christopher Baines > Date: Wed, 11 Oct 2017 14:46:47 +0100 > Subject: [PATCH] gnu: Add emacs-org-contrib. > > * gnu/packages/emacs.scm (emacs-org-contrib): New variable. > --- > gnu/packages/emacs.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 43 insertions(+) > > diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm > index 7661855a8..7a97a5471 100644 > --- a/gnu/packages/emacs.scm > +++ b/gnu/packages/emacs.scm > @@ -4099,6 +4099,49 @@ also is an authoring system with unique support fo= r literate programming and > reproducible research.") > (license license:gpl3+))) >=20=20 > +(define-public emacs-org-contrib > + (package > + (inherit emacs-org) > + (name "emacs-org-contrib") > + (source (origin > + (method url-fetch) > + (uri (string-append "http://orgmode.org/elpa/org-plus-cont= rib-" > + (package-version emacs-org) ".tar")) > + (sha256 > + (base32 > + "1ya4kah8kg13ka3gpsw8hn6y8358843g986p1bgw5w77n9bgbwsl"))= )) > + (arguments > + `(#:phases > + (modify-phases %standard-phases > + (add-after 'install 'delete-org-files > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (use-modules (ice-9 ftw)) Please use #:modules instead of this inner =E2=80=98use-modules=E2=80=99 fo= rm (it has wacky semantic and could be deprecated in the future.) > + (let ((out (assoc-ref outputs "out"))) > + (for-each > + (lambda (file) > + (if (and (not (string-prefix? "." file)) > + (file-exists? file)) > + (delete-file > + (string-append > + out > + "/share/emacs/site-lisp/guix.d/org-contrib-" > + ,(package-version emacs-org) > + "/" > + file)))) > + (scandir > + (string-append > + (assoc-ref inputs "emacs-org") > + "/share/emacs/site-lisp/guix.d/org-" > + ,(package-version emacs-org)))))))))) For clarity, what about first buildign up the list of files to delete, and then actually deleting them? (let* (=E2=80=A6 (org+contrib (map basename (find-files out))) (org (map basename (find-files org))) (duplicates (lset-intersection string=3D? org+contrib org))) (with-directory-excursion (string-append out =E2=80=A6) (for-each delete-file duplicates)) #t) WDYT? Thanks, Ludo=E2=80=99.