From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] gnu: Add emacs-mew. Date: Fri, 03 Feb 2017 12:39:05 +0300 Message-ID: <871svfk406.fsf@gmail.com> References: <87k29ai79x.fsf@gmail.com> <20170201.115644.1899018789878865874.post@thomasdanckaert.be> <87vastt1hl.fsf@gmail.com> <20170202.194107.439776871711114152.post@thomasdanckaert.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZaKl-0003mc-PV for guix-devel@gnu.org; Fri, 03 Feb 2017 04:39:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZaKh-0003vB-Ml for guix-devel@gnu.org; Fri, 03 Feb 2017 04:39:11 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cZaKh-0003uy-7v for guix-devel@gnu.org; Fri, 03 Feb 2017 04:39:07 -0500 Received: by mail-lf0-x244.google.com with SMTP id h65so1031848lfi.3 for ; Fri, 03 Feb 2017 01:39:06 -0800 (PST) In-Reply-To: <20170202.194107.439776871711114152.post@thomasdanckaert.be> (Thomas Danckaert's message of "Thu, 02 Feb 2017 19:41:07 +0100 (CET)") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Thomas Danckaert Cc: guix-devel@gnu.org Thomas Danckaert (2017-02-02 19:41 +0100) wrote: > From: Alex Kost > 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 > 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 > --- > 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 =3D \ > %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 =C2=A9 2016 Arun Isaac > ;;; Copyright =C2=A9 2016 John Darrington > ;;; Copyright =C2=A9 2016 Marius Bakke > +;;; Copyright =C2=A9 2017 Thomas Danckaert > ;;; > ;;; 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+))) >=20=20 > +(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 mes= sages > + ("ruby" ,ruby))) ; to set GEM_PATH so ruby-sqlite3 is found at ru= ntime > + (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=3D" %output ,elisp-dir) > + (string-append "--with-etcdir=3D" %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-di= r)) > + #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))))))) > +=20 > + (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 =E2=80=9C'mew-icon-directory=E2= =80=9D 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) > +=20 > + (defvar mew-icon-separate nil) > + (defvar mew-icon-blank nil) --=20 Alex