all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add emacs-mew.
@ 2017-01-24 17:01 Thomas Danckaert
  2017-01-24 20:08 ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-01-24 17:01 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: Text/X-Patch, Size: 2325 bytes --]

From 3759a0a4720165e0443bdb7522f6b4b7515aec6f Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.
---
 gnu/packages/mail.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 2318ae9..8991d4d 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,7 +379,34 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+  (name "emacs-mew")
+  (version "6.7")
+  (source
+    (origin
+      (method url-fetch)
+      (uri "http://mew.org/Release/mew-6.7.tar.gz")
+      (sha256
+       (base32
+        "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+  (inputs
+   `(("emacs" ,emacs-minimal)))
+  (propagated-inputs
+   `(("ruby-sqlite3" ,ruby-sqlite3) ; optionally uses an sqlite database of messages
+     ("ruby" ,ruby))) ; sets GEM_PATH so ruby-sqlite3 is found at runtime
+  (build-system gnu-build-system)
+  (arguments
+   `(#:phases
+     (modify-phases %standard-phases
+       (delete 'check)))) ; there are no tests
+  (home-page "http://www.mew.org")
+  (synopsis "Emacs e-mail client")
+  (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+  (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
-- 
2.7.4


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-01-24 17:01 [PATCH] gnu: Add emacs-mew Thomas Danckaert
@ 2017-01-24 20:08 ` Thomas Danckaert
  2017-01-25  9:29   ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-01-24 20:08 UTC (permalink / raw)
  To: guix-devel

From: Thomas Danckaert <thomas.danckaert@gmail.com>
Subject: [PATCH] gnu: Add emacs-mew.
Date: Tue, 24 Jan 2017 18:01:11 +0100 (CET)

> From 3759a0a4720165e0443bdb7522f6b4b7515aec6f Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Tue, 24 Jan 2017 09:41:42 +0100
> Subject: [PATCH] gnu: Add emacs-mew.
> 
> * gnu/packages/mail.scm (emacs-mew): New variable.

I've just discovered this patch doesn't add the package to emacs'
load-path, so please disregard for now. (and/or tell me how to fix
this :) )

Thomas

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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-01-24 20:08 ` Thomas Danckaert
@ 2017-01-25  9:29   ` Alex Kost
  2017-02-01  7:18     ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2017-01-25  9:29 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Thomas Danckaert (2017-01-24 21:08 +0100) wrote:

> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Subject: [PATCH] gnu: Add emacs-mew.
> Date: Tue, 24 Jan 2017 18:01:11 +0100 (CET)
>
>> From 3759a0a4720165e0443bdb7522f6b4b7515aec6f Mon Sep 17 00:00:00 2001
>> From: Thomas Danckaert <thomas.danckaert@gmail.com>
>> Date: Tue, 24 Jan 2017 09:41:42 +0100
>> Subject: [PATCH] gnu: Add emacs-mew.
>> 
>> * gnu/packages/mail.scm (emacs-mew): New variable.
>
> I've just discovered this patch doesn't add the package to emacs'
> load-path, so please disregard for now. (and/or tell me how to fix
> this :) )

This could happen if it adds itself to a sub-directory of
"/share/emacs/site-lisp".  In 'magit' package, for example, it is fixed
by using "lispdir" makeflag.  Since this package uses a full GNU Build
System, there should probably be "--with-lispdir" configure flag.

BTW, I can't apply this patch on the current master.

-- 
Alex

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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-01-25  9:29   ` Alex Kost
@ 2017-02-01  7:18     ` Thomas Danckaert
  2017-02-01  9:34       ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-02-01  7:18 UTC (permalink / raw)
  To: alezost; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 660 bytes --]

From: Alex Kost <alezost@gmail.com>
Subject: Re: [PATCH] gnu: Add emacs-mew.
Date: Wed, 25 Jan 2017 12:29:14 +0300

> This could happen if it adds itself to a sub-directory of
> "/share/emacs/site-lisp".  In 'magit' package, for example, it is 
> fixed
> by using "lispdir" makeflag.  Since this package uses a full GNU 
> Build
> System, there should probably be "--with-lispdir" configure flag.

Indeed, done!

> BTW, I can't apply this patch on the current master.

I had edited the patch file manually. Seems like this sometimes 
works, sometimes doesn't.

I've attached an updated patch, which also fixes some issues with 
paths to various icons.

Thomas

[-- Attachment #2: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: Text/X-Patch, Size: 2801 bytes --]

From 93118dba6e551fb66846a2b69a7bec560795ba71 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.
---
 gnu/packages/mail.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 2318ae9b6..d985419be 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,6 +379,40 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+  (name "emacs-mew")
+  (version "6.7")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "http://mew.org/Release/mew-" version ".tar.gz"))
+      (sha256
+       (base32
+        "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+  (inputs
+   `(("emacs" ,emacs-minimal)))
+  (propagated-inputs
+   `(("ruby-sqlite3" ,ruby-sqlite3) ; optionally uses an sqlite database of messages
+     ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
+  (build-system gnu-build-system)
+  (arguments
+   `(#:configure-flags (list
+                        (string-append "--with-elispdir=" (assoc-ref %outputs "out")
+                                       "/share/emacs/site-lisp/guix.d/mew"))
+     #:phases (modify-phases %standard-phases
+                (add-after 'configure 'patch-mew-icon-path ; ensure "Mew-icon.png" is found.
+                           (lambda _
+                             (substitute* "mew-key.el"
+                               (("\\(expand-file-name \"etc\" path\\)") "path")))))
+     #:tests? #f))
+  (home-page "http://www.mew.org")
+  (synopsis "Emacs e-mail client")
+  (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+  (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
-- 
2.11.0


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-01  7:18     ` Thomas Danckaert
@ 2017-02-01  9:34       ` Alex Kost
  2017-02-01 10:56         ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2017-02-01  9:34 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

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

Thomas Danckaert (2017-02-01 08:18 +0100) wrote:

>> This could happen if it adds itself to a sub-directory of
>> "/share/emacs/site-lisp".  In 'magit' package, for example, it is
>> fixed
>> by using "lispdir" makeflag.  Since this package uses a full GNU Build
>> System, there should probably be "--with-lispdir" configure flag.
>
> Indeed, done!
>
>> BTW, I can't apply this patch on the current master.
>
> I had edited the patch file manually. Seems like this sometimes works,
> sometimes doesn't.

Ouch, I think git-formatted patches are not intended to be edited
manually :-)

> I've attached an updated patch, which also fixes some issues with paths
> to various icons.

Thanks!  See the comments below.

> From 93118dba6e551fb66846a2b69a7bec560795ba71 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Tue, 24 Jan 2017 09:41:42 +0100
> Subject: [PATCH] gnu: Add emacs-mew.
>
> * gnu/packages/mail.scm (emacs-mew): New variable.
> ---
>  gnu/packages/mail.scm | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 2318ae9b6..d985419be 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -20,6 +20,7 @@
>  ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
>  ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
>  ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> +;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -79,6 +80,7 @@
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages gdb)
>    #:use-module (gnu packages man)
> +  #:use-module (gnu packages ruby)
>    #:use-module (gnu packages samba)
>    #:use-module (gnu packages screen)
>    #:use-module (gnu packages tls)
> @@ -377,6 +379,40 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
>  repository and Maildir/IMAP as LOCAL repository.")
>      (license gpl2+)))
>  
> +(define-public emacs-mew
> +  (package
> +  (name "emacs-mew")
> +  (version "6.7")
> +  (source
> +    (origin
> +      (method url-fetch)
> +      (uri (string-append "http://mew.org/Release/mew-" version ".tar.gz"))
> +      (sha256
> +       (base32
> +        "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
> +  (inputs
> +   `(("emacs" ,emacs-minimal)))
> +  (propagated-inputs
> +   `(("ruby-sqlite3" ,ruby-sqlite3) ; optionally uses an sqlite database of messages
> +     ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
> +  (build-system gnu-build-system)
> +  (arguments
> +   `(#:configure-flags (list
> +                        (string-append "--with-elispdir=" (assoc-ref %outputs "out")
> +                                       "/share/emacs/site-lisp/guix.d/mew"))
> +     #:phases (modify-phases %standard-phases
> +                (add-after 'configure 'patch-mew-icon-path ; ensure "Mew-icon.png" is found.
> +                           (lambda _
> +                             (substitute* "mew-key.el"
> +                               (("\\(expand-file-name \"etc\" path\\)") "path")))))

Hm, does it work for you?  I looked at "mew-key.el" but the code wasn't
patched, probably something with the regexp.  Anyway it is better to
patch 'mew-icon-directory' variable instead.

Also I see that by default it puts image files into
"share/emacs/site-lisp/mew/etc".  I don't think this is a good place, I
would rather move them to "share/mew" as most packages do with various
additional files.

> +     #:tests? #f))
> +  (home-page "http://www.mew.org")
> +  (synopsis "Emacs e-mail client")
> +  (description "Mew (Messaging in the Emacs World) is a user interface
> +for text messages, multimedia messages (MIME), news articles and
> +security functionality including PGP, S/MIME, SSH, and SSL.")
> +  (license bsd-3)))
> +
>  (define-public mu
>    (package
>      (name "mu")

Also it is good to generate "mew-autoloads.el" file, so that "M-x mew"
command will be available for users by default.  I'm attaching a
modified patch to address what I mentioned.  Could you test it to make
sure that mew works as expected with it?


[-- Attachment #2: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: text/x-patch, Size: 3593 bytes --]

From 2abd51a12aeb136ddb014ec8812601b52c6ca3eb Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.

Co-authored-by: Alex Kost <alezost@gmail.com>
---
 gnu/packages/mail.scm | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b17af40..69c2467 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,6 +379,55 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+    (name "emacs-mew")
+    (version "6.7")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://mew.org/Release/mew-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+    (inputs
+     `(("emacs" ,emacs-minimal)))
+    (propagated-inputs
+     `(("ruby-sqlite3" ,ruby-sqlite3) ; optional for the database of messages
+       ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
+    (build-system gnu-build-system)
+    (arguments
+     (let ((elisp-dir "/share/emacs/site-lisp/guix.d/mew")
+           (icon-dir  "/share/mew"))
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build utils)
+                    (guix build emacs-utils))
+         #:imported-modules (,@%gnu-build-system-modules
+                             (guix build emacs-utils))
+         #:configure-flags
+         (list (string-append "--with-elispdir=" %output ,elisp-dir)
+               (string-append "--with-etcdir=" %output ,icon-dir))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'configure 'patch-mew-icon-directory
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-substitute-variables "mew-key.el"
+                 ("mew-icon-directory"
+                  (string-append (assoc-ref outputs "out") ,icon-dir)))
+               #t))
+           (add-after 'install 'generate-autoloads
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-generate-autoloads
+                "mew" (string-append (assoc-ref outputs "out") ,elisp-dir))
+               #t)))
+         #:tests? #f)))
+    (home-page "http://www.mew.org")
+    (synopsis "Emacs e-mail client")
+    (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+    (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
-- 
2.10.2


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-01  9:34       ` Alex Kost
@ 2017-02-01 10:56         ` Thomas Danckaert
  2017-02-02  8:56           ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-02-01 10:56 UTC (permalink / raw)
  To: alezost; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 1674 bytes --]

From: Alex Kost <alezost@gmail.com>
Subject: Re: [PATCH] gnu: Add emacs-mew.
Date: Wed, 01 Feb 2017 12:34:34 +0300

>> +     #:phases (modify-phases %standard-phases
>> +                (add-after 'configure 'patch-mew-icon-path ; 
>> ensure "Mew-icon.png" is found.
>> +                           (lambda _
>> +                             (substitute* "mew-key.el"
>> +                               (("\\(expand-file-name \"etc\" 
>> path\\)") "path")))))
>
> Hm, does it work for you?  I looked at "mew-key.el" but the code
> wasn't patched, probably something with the regexp.  Anyway it is
> better to patch 'mew-icon-directory' variable instead.

Hi,

Ouch, I messed up my patch when rebasing.  I meant to also set
--with-etcdir=elispdir (see attached version).  The substitution does
work, but has no use without the updated --with-etcdir.

> Also I see that by default it puts image files into
> "share/emacs/site-lisp/mew/etc".  I don't think this is a good
> place, I would rather move them to "share/mew" as most packages do
> with various additional files.

Yes, that would be cleaner.  Is there also a clean way to add
share/mew to emacs' image-load-path?  The problem is that the package
needs various *.xpm icon's, which are opened with “find-image” (via
“tool-bar-add-item”), which looks on image-load-path, whereas
“Mew-icon.png” is looked up in mew-icon-directory.

My patch as originally intended (now attached) puts everything in
share/emacs/site-lisp/guix.d/mew, where find-image will find it, and
patches mew-key.el so it also looks in that directory.  Not clean, but
it works :-)

cheers,

Thomas

[-- Attachment #2: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: Text/X-Patch, Size: 2876 bytes --]

From 175d5b859c5615157db51ab79fa059e397a7f2b9 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.
---
 gnu/packages/mail.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 2318ae9b6..80a61a141 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,6 +379,42 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+  (name "emacs-mew")
+  (version "6.7")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "http://mew.org/Release/mew-" version ".tar.gz"))
+      (sha256
+       (base32
+        "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+  (inputs
+   `(("emacs" ,emacs-minimal)))
+  (propagated-inputs
+   `(("ruby-sqlite3" ,ruby-sqlite3) ; optionally uses an sqlite database of messages
+     ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
+  (build-system gnu-build-system)
+  (arguments
+   `(#:configure-flags
+     (let ((elispdir (string-append (assoc-ref %outputs "out")
+                     "/share/emacs/site-lisp/guix.d/mew")))
+       (list (string-append "--with-elispdir=" elispdir)
+             (string-append "--with-etcdir=" elispdir)))
+     #:phases (modify-phases %standard-phases
+                (add-after 'configure 'patch-mew-icon-path ; ensure "Mew-icon.png" is found.
+                           (lambda _
+                             (substitute* "mew-key.el"
+                               (("\\(expand-file-name \"etc\" path\\)") "path")))))
+     #:tests? #f))
+  (home-page "http://www.mew.org")
+  (synopsis "Emacs e-mail client")
+  (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+  (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
-- 
2.11.0


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-01 10:56         ` Thomas Danckaert
@ 2017-02-02  8:56           ` Alex Kost
  2017-02-02 18:41             ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2017-02-02  8:56 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Thomas Danckaert (2017-02-01 11:56 +0100) wrote:

>> Also I see that by default it puts image files into
>> "share/emacs/site-lisp/mew/etc".  I don't think this is a good
>> place, I would rather move them to "share/mew" as most packages do
>> with various additional files.
>
> Yes, that would be cleaner.  Is there also a clean way to add
> share/mew to emacs' image-load-path?  The problem is that the package
> needs various *.xpm icon's, which are opened with “find-image” (via
> “tool-bar-add-item”), which looks on image-load-path, whereas
> “Mew-icon.png” is looked up in mew-icon-directory.

OK, I see.  We can just patch "mew-key.el" file by putting the following
line there:

  (add-to-list 'image-load-path 'mew-icon-directory)

WDYT?

> My patch as originally intended (now attached) puts everything in
> share/emacs/site-lisp/guix.d/mew, where find-image will find it, and
> patches mew-key.el so it also looks in that directory.  Not clean, but
> it works :-)

I think it's rather messy having all elisp and image files in a single
directory, I would prefer to modify 'image-load-path', and to put these
images either in "share/mew" on in a sub-dir of the mew elisp dir.

> From 175d5b859c5615157db51ab79fa059e397a7f2b9 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Tue, 24 Jan 2017 09:41:42 +0100
> Subject: [PATCH] gnu: Add emacs-mew.
>
> * gnu/packages/mail.scm (emacs-mew): New variable.
> ---
>  gnu/packages/mail.scm | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 2318ae9b6..80a61a141 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -20,6 +20,7 @@
>  ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
>  ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
>  ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> +;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -79,6 +80,7 @@
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages gdb)
>    #:use-module (gnu packages man)
> +  #:use-module (gnu packages ruby)
>    #:use-module (gnu packages samba)
>    #:use-module (gnu packages screen)
>    #:use-module (gnu packages tls)
> @@ -377,6 +379,42 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
>  repository and Maildir/IMAP as LOCAL repository.")
>      (license gpl2+)))
>  
> +(define-public emacs-mew
> +  (package
> +  (name "emacs-mew")
> +  (version "6.7")
> +  (source
> +    (origin
> +      (method url-fetch)
> +      (uri (string-append "http://mew.org/Release/mew-" version ".tar.gz"))
> +      (sha256
> +       (base32
> +        "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
> +  (inputs
> +   `(("emacs" ,emacs-minimal)))
> +  (propagated-inputs
> +   `(("ruby-sqlite3" ,ruby-sqlite3) ; optionally uses an sqlite database of messages
> +     ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
> +  (build-system gnu-build-system)
> +  (arguments
> +   `(#:configure-flags
> +     (let ((elispdir (string-append (assoc-ref %outputs "out")
> +                     "/share/emacs/site-lisp/guix.d/mew")))
> +       (list (string-append "--with-elispdir=" elispdir)
> +             (string-append "--with-etcdir=" elispdir)))
> +     #:phases (modify-phases %standard-phases
> +                (add-after 'configure 'patch-mew-icon-path ; ensure "Mew-icon.png" is found.
> +                           (lambda _
> +                             (substitute* "mew-key.el"
> +                               (("\\(expand-file-name \"etc\" path\\)") "path")))))

I insist on patching 'mew-icon-directory' instead as I suggested.  Or
are there any problems with it?

Also you seem to overlook my comment about autoloads.  My version of
your patch (attached in my previous message) contains a phase to
generate "mew-autoloads.el".  This file is really needed to have "M-x
mew" command available by default.  Otherwise, a user has to put:

  (autoload 'mew "mew" nil t)

in his/her emacs config.

> +     #:tests? #f))
> +  (home-page "http://www.mew.org")
> +  (synopsis "Emacs e-mail client")
> +  (description "Mew (Messaging in the Emacs World) is a user interface
> +for text messages, multimedia messages (MIME), news articles and
> +security functionality including PGP, S/MIME, SSH, and SSL.")
> +  (license bsd-3)))
> +
>  (define-public mu
>    (package
>      (name "mu")

-- 
Alex

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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-02  8:56           ` Alex Kost
@ 2017-02-02 18:41             ` Thomas Danckaert
  2017-02-03  9:39               ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-02-02 18:41 UTC (permalink / raw)
  To: alezost; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 921 bytes --]

From: Alex Kost <alezost@gmail.com>
Subject: Re: [PATCH] gnu: Add emacs-mew.
Date: Thu, 02 Feb 2017 11:56:22 +0300

> OK, I see.  We can just patch "mew-key.el" file by putting the 
> following
> line there:
>
>   (add-to-list 'image-load-path 'mew-icon-directory)
>
> WDYT?

Yes, that would be fine!  I added a patch file, don't know if there's 
a more elegant way to achieve the same result?

> [...]
>
> Also you seem to overlook my comment about autoloads.  My version of
> your patch (attached in my previous message) contains a phase to
> generate "mew-autoloads.el".  This file is really needed to have 
> "M-x
> mew" command available by default.  Otherwise, a user has to put:
>
>   (autoload 'mew "mew" nil t)
>
> in his/her emacs config.

Yes, sorry, I just agreed and then forgot to comment on that part.  I 
didn't know about 'emacs-generate-autoloads and think it's great  :)

Thanks for your help!

Thomas

[-- Attachment #2: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: Text/X-Patch, Size: 5254 bytes --]

From 3179514335f61e29f93994f4dc0f59c30b59e876 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.
* gnu/packages/patches/mew-add-icons-to-load-path.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Co-authored-by: Alex Kost <alezost@gmail.com>
---
 gnu/local.mk                                       |  1 +
 gnu/packages/mail.scm                              | 52 ++++++++++++++++++++++
 .../patches/mew-add-icons-to-load-path.patch       | 14 ++++++
 3 files changed, 67 insertions(+)
 create mode 100644 gnu/packages/patches/mew-add-icons-to-load-path.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 59fc1a8..c9a5a3a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -744,6 +744,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/mcrypt-CVE-2012-4527.patch			\
   %D%/packages/patches/mesa-wayland-egl-symbols-check-mips.patch	\
   %D%/packages/patches/metabat-remove-compilation-date.patch	\
+  %D%/packages/patches/mew-add-icons-to-load-path.patch		\
   %D%/packages/patches/mhash-keygen-test-segfault.patch		\
   %D%/packages/patches/mingw-w64-5.0rc2-gcc-4.9.3.patch		\
   %D%/packages/patches/mpc123-initialize-ao.patch		\
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 2318ae9..c6aa820 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,6 +379,56 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+    (name "emacs-mew")
+    (version "6.7")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://mew.org/Release/mew-"
+                                  version ".tar.gz"))
+              (patches (search-patches "mew-add-icons-to-load-path.patch"))
+              (sha256
+               (base32
+                "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+    (inputs
+     `(("emacs" ,emacs-minimal)))
+    (propagated-inputs
+     `(("ruby-sqlite3" ,ruby-sqlite3) ; optional for the database of messages
+       ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
+    (build-system gnu-build-system)
+    (arguments
+     (let ((elisp-dir "/share/emacs/site-lisp/guix.d/mew")
+           (icon-dir  "/share/mew"))
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build utils)
+                    (guix build emacs-utils))
+         #:imported-modules (,@%gnu-build-system-modules
+                             (guix build emacs-utils))
+         #:configure-flags
+         (list (string-append "--with-elispdir=" %output ,elisp-dir)
+               (string-append "--with-etcdir=" %output ,icon-dir))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'configure 'patch-mew-icon-directory
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-substitute-variables "mew-key.el"
+                 ("mew-icon-directory"
+                  (string-append (assoc-ref outputs "out") ,icon-dir)))
+               #t))
+           (add-after 'install 'generate-autoloads
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-generate-autoloads
+                "mew" (string-append (assoc-ref outputs "out") ,elisp-dir))
+               #t)))
+         #:tests? #f)))
+    (home-page "http://www.mew.org")
+    (synopsis "Emacs e-mail client")
+    (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+    (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
diff --git a/gnu/packages/patches/mew-add-icons-to-load-path.patch b/gnu/packages/patches/mew-add-icons-to-load-path.patch
new file mode 100644
index 0000000..ba722ff
--- /dev/null
+++ b/gnu/packages/patches/mew-add-icons-to-load-path.patch
@@ -0,0 +1,14 @@
+Make sure the tool-bar icons are found on the load-path.
+
+diff --git a/mew-key.el b/mew-key.el
+index 4b753f6..6a27090 100644
+--- a/mew-key.el
++++ b/mew-key.el
+@@ -627,6 +627,7 @@
+ 	    (throw 'loop (expand-file-name "etc" path)))))))
+ 
+ (defvar mew-icon-directory (mew-which-mew-etc))
++(add-to-list 'load-path mew-icon-directory)
+ 
+ (defvar mew-icon-separate nil)
+ (defvar mew-icon-blank nil)
-- 
2.7.4


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-02 18:41             ` Thomas Danckaert
@ 2017-02-03  9:39               ` Alex Kost
  2017-02-03 12:22                 ` Thomas Danckaert
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2017-02-03  9:39 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Thomas Danckaert (2017-02-02 19:41 +0100) wrote:

> From: Alex Kost <alezost@gmail.com>
> Subject: Re: [PATCH] gnu: Add emacs-mew.
> Date: Thu, 02 Feb 2017 11:56:22 +0300
>
>> OK, I see.  We can just patch "mew-key.el" file by putting the
>> following
>> line there:
>>
>>   (add-to-list 'image-load-path 'mew-icon-directory)
>>
>> WDYT?
>
> Yes, that would be fine!

Great, but you did a different thing :-)  (see my comment below)

> I added a patch file, don't know if there's a
> more elegant way to achieve the same result?

Hm, we can modify 'image-load-path' during initializing
'mew-icon-directory' variable like this:

  (add-after 'configure 'patch-mew-icon-directory
    (lambda* (#:key outputs #:allow-other-keys)
      (emacs-substitute-sexps "mew-key.el"
        ("(def.* mew-icon-directory"
         `(progn
           (add-to-list 'image-load-path 'mew-icon-directory)
           ,(string-append (assoc-ref outputs "out") ,icon-dir))))
      #t))

This is probably not very clean, but at least it allows us to avoid
additional patch, WDYT?

Also we have to use 'emacs' input (it should be native-input btw, since
it is used only to byte-compile elisp code) instead of 'emacs-minimal':
emacs-minimal is compiled without X support, so it will fail to compile
"mew-key.el" (and all files that require it) as it uses image-load-path.

Oh, I just realized that's probably why you used 'load-path' instead of
'image-load-path', right?

>> [...]
>>
>> Also you seem to overlook my comment about autoloads.  My version of
>> your patch (attached in my previous message) contains a phase to
>> generate "mew-autoloads.el".  This file is really needed to have "M-x
>> mew" command available by default.  Otherwise, a user has to put:
>>
>>   (autoload 'mew "mew" nil t)
>>
>> in his/her emacs config.
>
> Yes, sorry, I just agreed and then forgot to comment on that part.  I
> didn't know about 'emacs-generate-autoloads and think it's great  :)
>
> Thanks for your help!

No problem, thanks for packaging it!  I hope we are close to finish,
could you test it with 'emacs' input and 'patch-mew-icon-directory'
phase I wrote above?

> From 3179514335f61e29f93994f4dc0f59c30b59e876 Mon Sep 17 00:00:00 2001
> From: Thomas Danckaert <thomas.danckaert@gmail.com>
> Date: Tue, 24 Jan 2017 09:41:42 +0100
> Subject: [PATCH] gnu: Add emacs-mew.
>
> * gnu/packages/mail.scm (emacs-mew): New variable.
> * gnu/packages/patches/mew-add-icons-to-load-path.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
>
> Co-authored-by: Alex Kost <alezost@gmail.com>
> ---
>  gnu/local.mk                                       |  1 +
>  gnu/packages/mail.scm                              | 52 ++++++++++++++++++++++
>  .../patches/mew-add-icons-to-load-path.patch       | 14 ++++++
>  3 files changed, 67 insertions(+)
>  create mode 100644 gnu/packages/patches/mew-add-icons-to-load-path.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 59fc1a8..c9a5a3a 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -744,6 +744,7 @@ dist_patch_DATA =						\
>    %D%/packages/patches/mcrypt-CVE-2012-4527.patch			\
>    %D%/packages/patches/mesa-wayland-egl-symbols-check-mips.patch	\
>    %D%/packages/patches/metabat-remove-compilation-date.patch	\
> +  %D%/packages/patches/mew-add-icons-to-load-path.patch		\
>    %D%/packages/patches/mhash-keygen-test-segfault.patch		\
>    %D%/packages/patches/mingw-w64-5.0rc2-gcc-4.9.3.patch		\
>    %D%/packages/patches/mpc123-initialize-ao.patch		\
> diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
> index 2318ae9..c6aa820 100644
> --- a/gnu/packages/mail.scm
> +++ b/gnu/packages/mail.scm
> @@ -20,6 +20,7 @@
>  ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
>  ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
>  ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> +;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -79,6 +80,7 @@
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages gdb)
>    #:use-module (gnu packages man)
> +  #:use-module (gnu packages ruby)
>    #:use-module (gnu packages samba)
>    #:use-module (gnu packages screen)
>    #:use-module (gnu packages tls)
> @@ -377,6 +379,56 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
>  repository and Maildir/IMAP as LOCAL repository.")
>      (license gpl2+)))
>  
> +(define-public emacs-mew
> +  (package
> +    (name "emacs-mew")
> +    (version "6.7")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "http://mew.org/Release/mew-"
> +                                  version ".tar.gz"))
> +              (patches (search-patches "mew-add-icons-to-load-path.patch"))
> +              (sha256
> +               (base32
> +                "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
> +    (inputs
> +     `(("emacs" ,emacs-minimal)))
> +    (propagated-inputs
> +     `(("ruby-sqlite3" ,ruby-sqlite3) ; optional for the database of messages
> +       ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
> +    (build-system gnu-build-system)
> +    (arguments
> +     (let ((elisp-dir "/share/emacs/site-lisp/guix.d/mew")
> +           (icon-dir  "/share/mew"))
> +       `(#:modules ((guix build gnu-build-system)
> +                    (guix build utils)
> +                    (guix build emacs-utils))
> +         #:imported-modules (,@%gnu-build-system-modules
> +                             (guix build emacs-utils))
> +         #:configure-flags
> +         (list (string-append "--with-elispdir=" %output ,elisp-dir)
> +               (string-append "--with-etcdir=" %output ,icon-dir))
> +         #:phases
> +         (modify-phases %standard-phases
> +           (add-after 'configure 'patch-mew-icon-directory
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (emacs-substitute-variables "mew-key.el"
> +                 ("mew-icon-directory"
> +                  (string-append (assoc-ref outputs "out") ,icon-dir)))
> +               #t))
> +           (add-after 'install 'generate-autoloads
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (emacs-generate-autoloads
> +                "mew" (string-append (assoc-ref outputs "out") ,elisp-dir))
> +               #t)))
> +         #:tests? #f)))
> +    (home-page "http://www.mew.org")
> +    (synopsis "Emacs e-mail client")
> +    (description "Mew (Messaging in the Emacs World) is a user interface
> +for text messages, multimedia messages (MIME), news articles and
> +security functionality including PGP, S/MIME, SSH, and SSL.")
> +    (license bsd-3)))
> +
>  (define-public mu
>    (package
>      (name "mu")
> diff --git a/gnu/packages/patches/mew-add-icons-to-load-path.patch b/gnu/packages/patches/mew-add-icons-to-load-path.patch
> new file mode 100644
> index 0000000..ba722ff
> --- /dev/null
> +++ b/gnu/packages/patches/mew-add-icons-to-load-path.patch
> @@ -0,0 +1,14 @@
> +Make sure the tool-bar icons are found on the load-path.
> +
> +diff --git a/mew-key.el b/mew-key.el
> +index 4b753f6..6a27090 100644
> +--- a/mew-key.el
> ++++ b/mew-key.el
> +@@ -627,6 +627,7 @@
> + 	    (throw 'loop (expand-file-name "etc" path)))))))
> + 
> + (defvar mew-icon-directory (mew-which-mew-etc))
> ++(add-to-list 'load-path mew-icon-directory)

This is not what I suggested: at first it should be 'image-load-path'
(not 'load-path').  Second, I think adding “'mew-icon-directory” symbol
(with a quote) is better than its value, since it allows users to change
'mew-icon-directory' value or to remove it from 'image-load-path' if
they want it for some reason, so my variant is:

  (add-to-list 'image-load-path 'mew-icon-directory)

> + 
> + (defvar mew-icon-separate nil)
> + (defvar mew-icon-blank nil)

-- 
Alex

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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-03  9:39               ` Alex Kost
@ 2017-02-03 12:22                 ` Thomas Danckaert
  2017-02-03 19:54                   ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Danckaert @ 2017-02-03 12:22 UTC (permalink / raw)
  To: alezost; +Cc: guix-devel

[-- Attachment #1: Type: Text/Plain, Size: 747 bytes --]

From: Alex Kost <alezost@gmail.com>
Subject: Re: [PATCH] gnu: Add emacs-mew.
Date: Fri, 03 Feb 2017 12:39:05 +0300

> Oh, I just realized that's probably why you used 'load-path' 
> instead of
> 'image-load-path', right?

load-path, shmoad-path ;-) I was just confused (even more so because 
load-path is part of image-load-path).

> [...]
> No problem, thanks for packaging it!  I hope we are close to finish,
> could you test it with 'emacs' input and 'patch-mew-icon-directory'
> phase I wrote above?

Yes, that works, and it's nice to avoid the patch file. I've attached 
a (final?) updated patch.

I tried to do something similar with emacs-substitute-variables, but 
of course that embedded all my elisp code as a string...

thanks,

Thomas

[-- Attachment #2: 0001-gnu-Add-emacs-mew.patch --]
[-- Type: Text/X-Patch, Size: 3699 bytes --]

From 868c56166ce62b9572b95a9ca7a20feee970666d Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert@gmail.com>
Date: Tue, 24 Jan 2017 09:41:42 +0100
Subject: [PATCH] gnu: Add emacs-mew.

* gnu/packages/mail.scm (emacs-mew): New variable.

Co-authored-by: Alex Kost <alezost@gmail.com>
---
 gnu/packages/mail.scm | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 2318ae9..4a73484 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -79,6 +80,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gdb)
   #:use-module (gnu packages man)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages samba)
   #:use-module (gnu packages screen)
   #:use-module (gnu packages tls)
@@ -377,6 +379,57 @@ can read the same mailbox from multiple computers.  It supports IMAP as REMOTE
 repository and Maildir/IMAP as LOCAL repository.")
     (license gpl2+)))
 
+(define-public emacs-mew
+  (package
+    (name "emacs-mew")
+    (version "6.7")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://mew.org/Release/mew-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "03fzky2kz73vgx4cbps2psbbnrgqgkk5q7jwfldisymkzr9iz03y"))))
+    (native-inputs
+     `(("emacs" ,emacs)))
+    (propagated-inputs
+     `(("ruby-sqlite3" ,ruby-sqlite3) ; optional for the database of messages
+       ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at runtime
+    (build-system gnu-build-system)
+    (arguments
+     (let ((elisp-dir "/share/emacs/site-lisp/guix.d/mew")
+           (icon-dir  "/share/mew"))
+       `(#:modules ((guix build gnu-build-system)
+                    (guix build utils)
+                    (guix build emacs-utils))
+         #:imported-modules (,@%gnu-build-system-modules
+                             (guix build emacs-utils))
+         #:configure-flags
+         (list (string-append "--with-elispdir=" %output ,elisp-dir)
+               (string-append "--with-etcdir=" %output ,icon-dir))
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'configure 'patch-mew-icon-directory
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-substitute-sexps "mew-key.el"
+                 ("(def.* mew-icon-directory"
+                  `(progn
+                    (add-to-list 'image-load-path 'mew-icon-directory)
+                    ,(string-append (assoc-ref outputs "out") ,icon-dir))))
+               #t))
+           (add-after 'install 'generate-autoloads
+             (lambda* (#:key outputs #:allow-other-keys)
+               (emacs-generate-autoloads
+                "mew" (string-append (assoc-ref outputs "out") ,elisp-dir))
+               #t)))
+         #:tests? #f)))
+    (home-page "http://www.mew.org")
+    (synopsis "Emacs e-mail client")
+    (description "Mew (Messaging in the Emacs World) is a user interface
+for text messages, multimedia messages (MIME), news articles and
+security functionality including PGP, S/MIME, SSH, and SSL.")
+    (license bsd-3)))
+
 (define-public mu
   (package
     (name "mu")
-- 
2.7.4


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

* Re: [PATCH] gnu: Add emacs-mew.
  2017-02-03 12:22                 ` Thomas Danckaert
@ 2017-02-03 19:54                   ` Alex Kost
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Kost @ 2017-02-03 19:54 UTC (permalink / raw)
  To: Thomas Danckaert; +Cc: guix-devel

Thomas Danckaert (2017-02-03 13:22 +0100) wrote:

>> Oh, I just realized that's probably why you used 'load-path' instead
>> of
>> 'image-load-path', right?
>
> load-path, shmoad-path ;-) I was just confused (even more so because
> load-path is part of image-load-path).

He-he :-)

>> [...]
>> No problem, thanks for packaging it!  I hope we are close to finish,
>> could you test it with 'emacs' input and 'patch-mew-icon-directory'
>> phase I wrote above?
>
> Yes, that works, and it's nice to avoid the patch file. I've attached a
> (final?) updated patch.

Applied as 3e9750c, thanks!

-- 
Alex

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

end of thread, other threads:[~2017-02-03 19:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24 17:01 [PATCH] gnu: Add emacs-mew Thomas Danckaert
2017-01-24 20:08 ` Thomas Danckaert
2017-01-25  9:29   ` Alex Kost
2017-02-01  7:18     ` Thomas Danckaert
2017-02-01  9:34       ` Alex Kost
2017-02-01 10:56         ` Thomas Danckaert
2017-02-02  8:56           ` Alex Kost
2017-02-02 18:41             ` Thomas Danckaert
2017-02-03  9:39               ` Alex Kost
2017-02-03 12:22                 ` Thomas Danckaert
2017-02-03 19:54                   ` Alex Kost

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.