]> git.notmuchmail.org Git - notmuch/commitdiff
build/emacs: add target to create elpa package
authorDavid Bremner <david@tethera.net>
Sat, 19 Nov 2016 17:44:29 +0000 (13:44 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 26 Nov 2016 11:57:58 +0000 (07:57 -0400)
This package can be created without emacs, but will only be usable in
versions of emacs supporting package.el

Makefile.global
emacs/Makefile.local

index 444e6bb42f624ac000c348ab41473aa0f677d17b..d8f335af6c15b96f14853c55583b957320bba7cb 100644 (file)
@@ -23,6 +23,8 @@ ifeq ($(IS_GIT),yes)
 VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
 # drop the ~g$sha1 part
 ELPA_VERSION:=$(word 1,$(subst ~, ,$(VERSION)))
+# convert git version to package.el friendly form
+ELPA_VERSION:=$(subst +,snapshot,$(ELPA_VERSION))
 
 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
index 90a57cca74ed40e1f56d0b962531a6048b5c64cb..f1636177915e5170e8f89e2389d9fc5a06b83d3c 100644 (file)
@@ -24,6 +24,8 @@ emacs_sources := \
        $(dir)/notmuch-company.el \
        $(dir)/notmuch-draft.el
 
+elpa_sources := ${emacs_sources} $(dir)/notmuch-pkg.el
+
 $(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp
 $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl
        @sed -e 's/%AG%/Generated file (from $(<F)) -- do not edit!/' \
@@ -73,6 +75,14 @@ ifeq ($(HAVE_EMACS),1)
        $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
 endif
 
+elpa: $(ELPA_FILE)
+
+notmuch-emacs-%.tar: ${elpa_sources}
+       mkdir -p .elpa-build/notmuch-${ELPA_VERSION}
+       cp ${elpa_sources} .elpa-build/notmuch-${ELPA_VERSION}
+       tar -C .elpa-build -cf $@ notmuch-${ELPA_VERSION}
+       rm -r .elpa-build
+
 ifeq ($(WITH_EMACS),1)
 ifeq ($(HAVE_EMACS),1)
 all: $(emacs_bytecode)