Skip to content

Commit 77517c4

Browse files
committed
travis -> nix
1 parent b70c1d2 commit 77517c4

File tree

3 files changed

+15
-107
lines changed

3 files changed

+15
-107
lines changed

.travis.yml

Lines changed: 12 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,20 @@
11
language: bash
22

3+
sudo: required
4+
35
matrix:
46
include:
5-
- env: GHCVER=head EMACSVER=head CABALVER=head
6-
addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
7-
- env: GHCVER=7.10.2 EMACSVER=head CABALVER=1.22
8-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
9-
- env: GHCVER=7.10.2 EMACSVER=24 CABALVER=1.22
10-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
11-
- env: GHCVER=7.8.4 EMACSVER=head CABALVER=1.20
12-
addons: {apt: {packages: [cabal-install-1.20,ghc-7.8.4,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
13-
- env: GHCVER=7.8.4 EMACSVER=24 CABALVER=1.20
14-
addons: {apt: {packages: [cabal-install-1.20,ghc-7.8.4,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
15-
- env: GHCVER=7.6.3 EMACSVER=24 CABALVER=1.20
16-
addons: {apt: {packages: [cabal-install-1.20,ghc-7.6.3,happy-1.19.5,ocaml], sources: [hvr-ghc]}}
17-
18-
allow_failures:
19-
- env: GHCVER=head EMACSVER=head CABALVER=head
20-
- env: GHCVER=7.10.2 EMACSVER=head CABALVER=1.22
21-
- env: GHCVER=7.8.4 EMACSVER=head CABALVER=1.20
22-
23-
cache:
24-
directories:
25-
- z3
26-
- liquid
27-
- emacs-24
28-
- haskell-utils
29-
30-
before_install:
31-
-
32-
- echo ╔═══════════════════════════════════════════════════════════════════════════╗
33-
- echo ║ WARNING! Tests are not run with emacs23 because of --batch bugs. ║
34-
- echo ║ It should work with emacs23, to test it call it without --batch. ║
35-
- echo ║ This is unfortunately not supported on travis-ci. ║
36-
- echo ║ $ emacs -Q -l test/haskell-emacs-test.el ║
37-
- echo ╚═══════════════════════════════════════════════════════════════════════════╝
38-
-
7+
- env: NIXCHAN=15.09
8+
- env: NIXCHAN=16.03
9+
- env: NIXCHAN=unstable
3910

4011
install:
41-
- export PREFIX=/home/travis/build/knupfer/haskell-emacs
42-
- export HAPPYVER=1.19.5
43-
- export PATH=$PREFIX/liquid/liquidhaskell/.cabal-sandbox/bin:$PREFIX/z3/build:$PREFIX/haskell-utils/.cabal-sandbox/bin:$PREFIX/emacs-$EMACSVER/src:/opt/happy/$HAPPYVER/bin:/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
44-
-
45-
- |
46-
if [ ! -e $PREFIX/emacs-$EMACSVER/src/emacs ]; then
47-
if [ $EMACSVER = "head" ]; then
48-
git clone --depth=1 https://github.com/emacs-mirror/emacs $PREFIX/emacs-head
49-
else
50-
git clone --depth=1 --branch=emacs-$EMACSVER https://github.com/emacs-mirror/emacs $PREFIX/emacs-$EMACSVER
51-
fi
52-
53-
cd $PREFIX/emacs-$EMACSVER
54-
./autogen.sh
55-
./configure --without-makeinfo --with-xpm=no --with-gif=no
56-
make
57-
fi
58-
-
59-
- cabal update
60-
- |
61-
if [ $GHCVER = "7.6.3" ] || [ $GHCVER = "7.8.4" ]; then
62-
cabal install atto-lisp
63-
else
64-
cabal install --allow-newer=deepseq,blaze-builder atto-lisp
65-
fi
66-
- cabal install haskell-src-exts parallel utf8-string mtl
67-
-
68-
- |
69-
if [ ! -e $PREFIX/haskell-utils/.cabal-sandbox/bin/hlint ]; then
70-
mkdir -p $PREFIX/haskell-utils
71-
cd $PREFIX/haskell-utils
72-
cabal sandbox init
73-
cabal install hlint stylish-haskell
74-
fi
75-
-
76-
- |
77-
if [ $GHCVER = "7.10.2" ] && [ ! -e $PREFIX/z3/build/z3 ]; then
78-
git clone https://github.com/z3prover/z3 $PREFIX/z3
79-
cd $PREFIX/z3
80-
python scripts/mk_make.py
81-
cd build
82-
make
83-
fi
84-
-
85-
- |
86-
if [ $GHCVER = "7.10.2" ] && [ ! -e $PREFIX/liquid/liquidhaskell/.cabal-sandbox/bin/liquid ]; then
87-
mkdir -p $PREFIX/liquid
88-
cd $PREFIX/liquid
89-
git clone https://github.com/ucsd-progsys/liquid-fixpoint
90-
git clone https://github.com/ucsd-progsys/liquidhaskell
91-
cd liquidhaskell
92-
cabal sandbox init
93-
cabal sandbox add-source ../liquid-fixpoint/
94-
cabal install
95-
fi
96-
-
97-
- cd $PREFIX
98-
-
99-
- which emacs
100-
- emacs --version
101-
- happy --version
102-
- hlint --version
103-
- stylish-haskell --version
104-
- ghc --version
105-
- cabal --version
106-
- if [ $GHCVER = "7.10.2" ]; then liquid --version; fi
107-
- if [ $GHCVER = "7.10.2" ]; then z3 --version; fi
12+
- curl https://nixos.org/nix/install | sh
13+
- source /home/travis/.nix-profile/etc/profile.d/nix.sh
14+
- nix-channel --add https://nixos.org/channels/nixos-$NIXCHAN nixpkgs
15+
- nix-channel --update
10816

10917
script:
110-
- ghc -O2 -Wall --make HaskellEmacs.hs
111-
- if [ $GHCVER = "7.10.2" ]; then liquid --totality HaskellEmacs.hs; fi
112-
- hlint HaskellEmacs.hs
113-
- diff -s HaskellEmacs.hs <(stylish-haskell HaskellEmacs.hs)
114-
- emacs --batch -Q -l test/haskell-emacs-test.el
18+
- nix-shell -Q --pure -p haskellPackages.hlint --command "hlint HaskellEmacs.hs"
19+
- nix-shell -Q --pure -p haskellPackages.stylish-haskell --command "diff -s HaskellEmacs.hs <(stylish-haskell HaskellEmacs.hs)"
20+
- nix-shell -Q -p emacs --command "emacs --batch -Q -l test/haskell-emacs-test.el"

haskell-emacs.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ name: HaskellEmacs
344344
version: 0.0.0
345345
build-type: Simple
346346
cabal-version: >=1.10
347+
license: GPL-2
347348
executable HaskellEmacs
348349
main-is: HaskellEmacs.hs
349350
default-language: Haskell2010
350-
license: GPL-2
351351
ghc-options: -O2 -threaded -rtsopts -with-rtsopts=-N
352352
build-depends: base
353353
, atto-lisp

test/haskell-emacs-test.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
;;; Code:
1212

13+
(setq debug-on-error t)
14+
1315
(let ((load-dir (file-name-directory load-file-name)))
1416
(add-to-list 'load-path load-dir)
1517
(add-to-list 'load-path (progn (string-match ".*haskell-emacs/" load-dir)

0 commit comments

Comments
 (0)