unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
@ 2017-10-13  5:45 Christopher Baines
  2017-10-13 21:42 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2017-10-13  5:45 UTC (permalink / raw)
  To: 28805

* gnu/packages/emacs.scm (emacs-org-plus-contrib): New variable.
---
 gnu/packages/emacs.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index b29436154..de2b89370 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -4005,6 +4005,30 @@ also is an authoring system with unique support for literate programming and
 reproducible research.")
     (license license:gpl3+)))
 
+(define-public emacs-org-plus-contrib
+  (package
+    (name "emacs-org-plus-contrib")
+    (version "20170917")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://orgmode.org/elpa/org-plus-contrib-"
+                                  version ".tar"))
+              (sha256
+               (base32
+                "1ya4kah8kg13ka3gpsw8hn6y8358843g986p1bgw5w77n9bgbwsl"))))
+    (build-system emacs-build-system)
+    (home-page "http://orgmode.org/")
+    (synopsis "Outline-based notes management and organizer (with contrib files)")
+    (description "Org is an Emacs mode for keeping notes, maintaining TODO
+lists, and project planning with a fast and effective plain-text system.  It
+also is an authoring system with unique support for literate programming and
+reproducible research.
+
+This package includes all the functionality of the @code{emacs-org} package,
+plus all files that you would find in @file{contrib/} from the git
+repository.")
+    (license license:gpl3+)))
+
 (define-public emacs-flx
   (package
     (name "emacs-flx")
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-13  5:45 [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib Christopher Baines
@ 2017-10-13 21:42 ` Ludovic Courtès
  2017-10-15 19:05   ` Christopher Baines
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-10-13 21:42 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 28805

Christopher Baines <mail@cbaines.net> skribis:

> * gnu/packages/emacs.scm (emacs-org-plus-contrib): New variable.

[...]

> +This package includes all the functionality of the @code{emacs-org} package,
> +plus all files that you would find in @file{contrib/} from the git
> +repository.")

I’m sorry to ask ;-), but would it be an option to have a separate
‘emacs-contrib’ package instead?  That way people could install
emacs-org, and optionally emacs-contrib on top of it.

If not, this package if perfectly fine.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-13 21:42 ` Ludovic Courtès
@ 2017-10-15 19:05   ` Christopher Baines
  2017-10-15 19:44     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2017-10-15 19:05 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28805


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

On Fri, 13 Oct 2017 23:42:34 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Christopher Baines <mail@cbaines.net> skribis:
> 
> > * gnu/packages/emacs.scm (emacs-org-plus-contrib): New variable.  
> 
> [...]
> 
> > +This package includes all the functionality of the @code{emacs-org} package,
> > +plus all files that you would find in @file{contrib/} from the git
> > +repository.")  
> 
> I’m sorry to ask ;-), but would it be an option to have a separate
> ‘emacs-contrib’ 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.

Thanks for taking a look,

Chris

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-emacs-org-contrib.patch --]
[-- Type: text/x-patch, Size: 2586 bytes --]

From 2c5b66bf198ae77047e7c3d4e5631b10e90981eb Mon Sep 17 00:00:00 2001
From: Christopher Baines <mail@cbaines.net>
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 for literate programming and
 reproducible research.")
     (license license:gpl3+)))
 
+(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-contrib-"
+                                  (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))
+             (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))))))))))
+    (propagated-inputs
+     `(("emacs-org" ,emacs-org)))
+    (synopsis "Contributed packages to Org-mode")
+    (description "Org is an Emacs mode for keeping notes, maintaining TODO
+lists, and project planning with a fast and effective plain-text system.
+
+This package includes additional files that you would find in @file{contrib/}
+from the git repository.")))
+
 (define-public emacs-flx
   (package
     (name "emacs-flx")
-- 
2.14.2


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-15 19:05   ` Christopher Baines
@ 2017-10-15 19:44     ` Ludovic Courtès
  2017-10-15 20:11       ` Christopher Baines
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-10-15 19:44 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 28805

Hi!

Christopher Baines <mail@cbaines.net> skribis:

> On Fri, 13 Oct 2017 23:42:34 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:

[...]

>> I’m sorry to ask ;-), but would it be an option to have a separate
>> ‘emacs-contrib’ 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 <mail@cbaines.net>
> 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 for literate programming and
>  reproducible research.")
>      (license license:gpl3+)))
>  
> +(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-contrib-"
> +                                  (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 ‘use-modules’ form (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* (…
         (org+contrib (map basename (find-files out)))
         (org         (map basename (find-files org)))
         (duplicates  (lset-intersection string=? org+contrib org)))
    (with-directory-excursion (string-append out …)
      (for-each delete-file duplicates))
    #t)

WDYT?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-15 19:44     ` Ludovic Courtès
@ 2017-10-15 20:11       ` Christopher Baines
  2017-10-16  7:27         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher Baines @ 2017-10-15 20:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28805


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

On Sun, 15 Oct 2017 21:44:29 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> > +(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-contrib-"
> > +                                  (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 ‘use-modules’ form (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* (…
>          (org+contrib (map basename (find-files out)))
>          (org         (map basename (find-files org)))
>          (duplicates  (lset-intersection string=? org+contrib org)))
>     (with-directory-excursion (string-append out …)
>       (for-each delete-file duplicates))
>     #t)
> 
> WDYT?

That is nice :) I've attached an updated patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-emacs-org-contrib.patch --]
[-- Type: text/x-patch, Size: 2739 bytes --]

From 43ad9a4e6db6f4f94d2b2f63cbd9b729f5d4e607 Mon Sep 17 00:00:00 2001
From: Christopher Baines <mail@cbaines.net>
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..6e9c2a19d 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -4099,6 +4099,49 @@ also is an authoring system with unique support for literate programming and
 reproducible research.")
     (license license:gpl3+)))
 
+(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-contrib-"
+                                  (package-version emacs-org) ".tar"))
+              (sha256
+               (base32
+                "1ya4kah8kg13ka3gpsw8hn6y8358843g986p1bgw5w77n9bgbwsl"))))
+    (arguments
+     `(#:modules ((guix build emacs-build-system)
+                  (guix build utils)
+                  (guix build emacs-utils)
+                  (ice-9 ftw)
+                  (srfi srfi-1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'delete-org-files
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (org (assoc-ref inputs "emacs-org"))
+                    (contrib-files
+                     (map basename (find-files out)))
+                    (org+contrib-files
+                     (map basename (find-files org)))
+                    (duplicates (lset-intersection
+                                 string=? contrib-files org+contrib-files)))
+               (with-directory-excursion
+                   (string-append
+                    out "/share/emacs/site-lisp/guix.d/org-contrib-"
+                    ,(package-version emacs-org))
+                 (for-each delete-file duplicates))))))))
+    (propagated-inputs
+     `(("emacs-org" ,emacs-org)))
+    (synopsis "Contributed packages to Org-mode")
+    (description "Org is an Emacs mode for keeping notes, maintaining TODO
+lists, and project planning with a fast and effective plain-text system.
+
+This package is equivilent to org-plus-contrib, but only includes additional
+files that you would find in @file{contrib/} from the git repository.")))
+
 (define-public emacs-flx
   (package
     (name "emacs-flx")
-- 
2.14.2


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-15 20:11       ` Christopher Baines
@ 2017-10-16  7:27         ` Ludovic Courtès
  2017-10-16  7:40           ` bug#28805: " Christopher Baines
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-10-16  7:27 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 28805

Hi!

Christopher Baines <mail@cbaines.net> skribis:

> From 43ad9a4e6db6f4f94d2b2f63cbd9b729f5d4e607 Mon Sep 17 00:00:00 2001
> From: Christopher Baines <mail@cbaines.net>
> 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.

[...]

> +       (modify-phases %standard-phases
> +         (add-after 'install 'delete-org-files
> +           (lambda* (#:key inputs outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (org (assoc-ref inputs "emacs-org"))
> +                    (contrib-files
> +                     (map basename (find-files out)))
> +                    (org+contrib-files
> +                     (map basename (find-files org)))
> +                    (duplicates (lset-intersection
> +                                 string=? contrib-files org+contrib-files)))
> +               (with-directory-excursion
> +                   (string-append
> +                    out "/share/emacs/site-lisp/guix.d/org-contrib-"
> +                    ,(package-version emacs-org))
> +                 (for-each delete-file duplicates))))))))

Awesome.  Just return #t and we’re done.  :-)

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#28805: [PATCH] gnu: Add emacs-org-plus-contrib.
  2017-10-16  7:27         ` Ludovic Courtès
@ 2017-10-16  7:40           ` Christopher Baines
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Baines @ 2017-10-16  7:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28805-done

[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]

On Mon, 16 Oct 2017 09:27:57 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Hi!
> 
> Christopher Baines <mail@cbaines.net> skribis:
> 
> > From 43ad9a4e6db6f4f94d2b2f63cbd9b729f5d4e607 Mon Sep 17 00:00:00 2001
> > From: Christopher Baines <mail@cbaines.net>
> > 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.  
> 
> [...]
> 
> > +       (modify-phases %standard-phases
> > +         (add-after 'install 'delete-org-files
> > +           (lambda* (#:key inputs outputs #:allow-other-keys)
> > +             (let* ((out (assoc-ref outputs "out"))
> > +                    (org (assoc-ref inputs "emacs-org"))
> > +                    (contrib-files
> > +                     (map basename (find-files out)))
> > +                    (org+contrib-files
> > +                     (map basename (find-files org)))
> > +                    (duplicates (lset-intersection
> > +                                 string=? contrib-files org+contrib-files)))
> > +               (with-directory-excursion
> > +                   (string-append
> > +                    out "/share/emacs/site-lisp/guix.d/org-contrib-"
> > +                    ,(package-version emacs-org))
> > +                 (for-each delete-file duplicates))))))))  
> 
> Awesome.  Just return #t and we’re done.  :-)
> 
> Thank you!

Great, I've now added #t, and pushed this. Thanks for reviewing :)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-16  7:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-13  5:45 [bug#28805] [PATCH] gnu: Add emacs-org-plus-contrib Christopher Baines
2017-10-13 21:42 ` Ludovic Courtès
2017-10-15 19:05   ` Christopher Baines
2017-10-15 19:44     ` Ludovic Courtès
2017-10-15 20:11       ` Christopher Baines
2017-10-16  7:27         ` Ludovic Courtès
2017-10-16  7:40           ` bug#28805: " Christopher Baines

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).