branch: elpa/nix-mode
commit 95ef285e7455bb88bf81d36057aa6649dc8cd995
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>
Update .nix script
Makes it easier to do things in travis.
---
.gitignore | 3 +++
.travis.yml | 24 +++++++++++++-----------
Makefile | 42 +++++++++++++++++++++++++++---------------
default.nix | 20 ++++++++++++++++++++
nix-mode.nix | 3 ---
5 files changed, 63 insertions(+), 29 deletions(-)
diff --git a/.gitignore b/.gitignore
index 66a97ac24c..bfc379fa2f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,3 +11,6 @@ result
*.html
*.texi
*.info
+*.tex
+*.pdf
+auto/
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index b8a997a295..712ed64879 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,14 +1,16 @@
-language: emacs-lisp
-env:
- - EVM_EMACS=emacs-24.5-travis
- - EVM_EMACS=emacs-git-snapshot-travis
+language: nix
-before_install:
- - git clone https://github.com/rejeep/evm.git $HOME/.evm
- - export PATH=$HOME/.evm/bin:$PATH
+script:
+ - nix-build
- - evm config path /tmp
- - evm install $EVM_EMACS --use --skip
+matrix:
+ include:
+ - os: linux
+ dist: trusty
+ - os: linux
+ dist: trusty
+ - os: osx
-script:
- - make test
+cache:
+ directories:
+ - /nix/store
diff --git a/Makefile b/Makefile
index 52991ac33f..4e1d93f6bc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,4 @@
-emacs ?= emacs
-
-.PHONY: test clean
+.PHONY: test clean install run
ELS = nix.el nix-company.el nix-drv-mode.el nix-format.el \
nix-instantiate.el nix-mode.el nix-mode-mmm.el \
@@ -8,18 +6,34 @@ ELS = nix.el nix-company.el nix-drv-mode.el nix-format.el \
nix-shell.el nix-store.el
ELCS = $(ELS:.el=.elc)
-DOCS = nix-mode.info nix-mode.html nix-mode.pdf
+DOCS = nix-mode.info nix-mode.html # nix-mode.pdf
+
+DESTDIR =
+PREFIX = /usr
-all: $(ELCS) $(DOCS) test
+all: $(ELCS) $(DOCS)
test:
- emacs -Q -batch -l nix-mode.el \
+ emacs -batch -L . \
-l tests/nix-mode-tests.el \
-l tests/nix-font-lock-tests.el \
-f ert-run-tests-batch-and-exit
+install: $(ELCS) $(DOCS)
+ mkdir -p $(DESTDIR)$(PREFIX)/share/emacs/site-lisp/nix-mode/
+ cp $(ELCS) $(DESTDIR)$(PREFIX)/share/emacs/site-lisp/nix-mode/
+
+ mkdir -p $(DESTDIR)$(PREFIX)/share/doc/nix-mode/
+ cp $(DOCS) $(DESTDIR)$(PREFIX)/share/doc/nix-mode/
+
+clean:
+ rm -f $(ELCS) $(DOCS)
+
+run:
+ emacs -l nix-mode.el
+
%.elc: %.el
- emacs -Q -batch -L . --eval "(progn\
+ emacs -batch -L . --eval "(progn\
(when (file-exists-p \"$@\")\
(delete-file \"$@\"))\
(fset 'message* (symbol-function 'message))\
@@ -29,10 +43,9 @@ test:
-f batch-byte-compile $<
%.texi: %.org
- emacs --batch -Q \
- -l ox-extra -l org-man -l ox-texinfo.el $< \
+ emacs --batch \
+ -l ox-extra -l org-man -l ox-texinfo $< \
-f org-texinfo-export-to-texinfo
- @echo >> $@
%.info: %.texi
makeinfo --no-split $< -o $@
@@ -40,8 +53,7 @@ test:
%.html: %.texi
makeinfo --html --no-split $<
-%.pdf: %.texi
- texi2pdf --clean $< > /dev/null
-
-clean:
- rm *.elc
+%.pdf: %.org
+ emacs --batch \
+ -l ox-extra -l ox-latex $< \
+ -f org-latex-export-to-pdf
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000000..01cf1347a0
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,20 @@
+{ pkgs ? import <nixpkgs> {}}:
+let
+ inherit (pkgs) emacsWithPackages stdenvNoCC texinfo;
+ emacs = emacsWithPackages (epkgs: with epkgs; [
+ org-plus-contrib
+ company
+ json-mode
+ mmm-mode
+ ]);
+in stdenvNoCC.mkDerivation {
+ name = "nix-mode";
+ src = ./.;
+ nativeBuildInputs = [ emacs texinfo ];
+ makeFlags = [ "PREFIX=$(out)" ];
+ shellHook = ''
+ echo Run make run to get vanilla emacs with nix-mode loaded.
+ '';
+ doCheck = true;
+ checkTarget = "test";
+}
diff --git a/nix-mode.nix b/nix-mode.nix
deleted file mode 100644
index d0f56c6d0c..0000000000
--- a/nix-mode.nix
+++ /dev/null
@@ -1,3 +0,0 @@
-with import <nixpkgs> {};
-
-emacsWithPackages (epkgs: [ epkgs.nix-mode ])