[notmuch] [PATCH] notmuch: improve installation of emacs mode
authorJeffrey C. Ollie <jeff@ocjtech.us>
Thu, 19 Nov 2009 13:12:48 +0000 (07:12 +1800)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:37 +0000 (09:35 -0800)
a0/f496c5d37fcbd3b3a6059928f02ce22523fd66 [new file with mode: 0644]

diff --git a/a0/f496c5d37fcbd3b3a6059928f02ce22523fd66 b/a0/f496c5d37fcbd3b3a6059928f02ce22523fd66
new file mode 100644 (file)
index 0000000..5e6c122
--- /dev/null
@@ -0,0 +1,127 @@
+Return-Path: <jeff@ocjtech.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 30B90431FBC\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 05:13:12 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 3S3mZmet+ORs for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Nov 2009 05:13:11 -0800 (PST)\r
+Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com\r
+       [209.85.210.204])\r
+       by olra.theworths.org (Postfix) with ESMTP id 364C4431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 05:13:11 -0800 (PST)\r
+Received: by yxe42 with SMTP id 42so2273393yxe.22\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Nov 2009 05:13:10 -0800 (PST)\r
+Received: by 10.150.246.3 with SMTP id t3mr34648ybh.256.1258636389821;\r
+       Thu, 19 Nov 2009 05:13:09 -0800 (PST)\r
+Received: from lt26923.campus.dmacc.edu ([69.57.47.215])\r
+       by mx.google.com with ESMTPS id 14sm281818gxk.2.2009.11.19.05.13.08\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Thu, 19 Nov 2009 05:13:08 -0800 (PST)\r
+Received: from localhost ([127.0.0.1] helo=localhost.localdomain)\r
+       by lt26923.campus.dmacc.edu with esmtps (TLSv1:AES256-SHA:256)\r
+       (Exim 4.69) (envelope-from <jeff@ocjtech.us>)\r
+       id 1NB6ot-000220-4D; Thu, 19 Nov 2009 07:13:07 -0600\r
+From: "Jeffrey C. Ollie" <jeff@ocjtech.us>\r
+To: Not Much Mail <notmuch@notmuchmail.org>\r
+Date: Thu, 19 Nov 2009 07:12:48 -0600\r
+Message-Id: <1258636368-7778-1-git-send-email-jeff@ocjtech.us>\r
+X-Mailer: git-send-email 1.6.5.2\r
+In-Reply-To: <1258628956-sup-8884@cannonball>\r
+References: <1258628956-sup-8884@cannonball>\r
+Subject: [notmuch] [PATCH] notmuch: improve installation of emacs mode\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 19 Nov 2009 13:13:12 -0000\r
+\r
+1) Add a separate install target to install emacs mode.\r
+\r
+2) Don't hardcode the installation directory, instead use emacs'\r
+   pkg-config module.\r
+\r
+3) Install a byte compiled version of the emacs mode.\r
+\r
+4) Install the emacs mode in emacs' site-start directory so that it\r
+   gets loaded automatically.\r
+\r
+Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>\r
+---\r
+ Makefile       |    6 ++++++\r
+ Makefile.local |   13 ++++++++++---\r
+ 2 files changed, 16 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/Makefile b/Makefile\r
+index 023b2ec..17fa4a2 100644\r
+--- a/Makefile\r
++++ b/Makefile\r
+@@ -7,6 +7,9 @@ CFLAGS=-O2\r
+ extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)\r
+ extra_cxxflags := $(shell xapian-config --cxxflags)\r
\r
++emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)\r
++emacs_startdir := $(shell pkg-config emacs --variable sitestartdir)\r
++\r
+ # Now smash together user's values with our extra values\r
+ override CFLAGS += $(WARN_FLAGS) $(extra_cflags)\r
+ override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)\r
+@@ -28,6 +31,9 @@ include Makefile.config\r
+ %.o: %.c\r
+       $(CC) -c $(CFLAGS) $< -o $@\r
\r
++%.elc: %.el\r
++      emacs -batch -f batch-byte-compile $<\r
++\r
+ .deps/%.d: %.c\r
+       @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \\r
+       $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \\r
+diff --git a/Makefile.local b/Makefile.local\r
+index 6bc01a5..e4a27e5 100644\r
+--- a/Makefile.local\r
++++ b/Makefile.local\r
+@@ -1,4 +1,4 @@\r
+-all: notmuch notmuch.1.gz\r
++all: notmuch notmuch.1.gz notmuch.elc\r
\r
+ notmuch_client_srcs =         \\r
+       notmuch.c               \\r
+@@ -25,15 +25,22 @@ notmuch.1.gz: notmuch.1\r
\r
+ install: all notmuch.1.gz\r
+       for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \\r
+-              $(DESTDIR)/$(prefix)/share/emacs/site-lisp/ $(DESTDIR)/etc/bash_completion.d/ ; \\r
++              $(DESTDIR)/etc/bash_completion.d/ ; \\r
+       do \\r
+               install -d $$d ; \\r
+       done ;\r
+       install notmuch $(DESTDIR)$(prefix)/bin/\r
+       install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/\r
+-      install -m0644 notmuch.el $(DESTDIR)$(prefix)/share/emacs/site-lisp/\r
+       install notmuch-completion.bash \\r
+               $(DESTDIR)/etc/bash_completion.d/notmuch\r
\r
++install-emacs: install notmuch.elc\r
++      for d in $(DESTDIR)/$(emacs_startdir) ; \\r
++      do \\r
++              install -d $$d ; \\r
++      done ;\r
++      install -m0644 notmuch.el $(DESTDIR)$(emacs_startdir)\r
++      install -m0644 notmuch.elc $(DESTDIR)$(emacs_startdir)\r
++\r
+ SRCS  := $(SRCS) $(notmuch_client_srcs)\r
+ CLEAN := $(CLEAN) notmuch $(notmuch_client_modules)\r
+-- \r
+1.6.5.2\r
+\r