Commit e4441c49 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Use carton for dependency management

parent 3498bc87
......@@ -4,5 +4,6 @@ env:
- EMACS=emacs-snapshot
- sh vagrant/
- make deps
- make EMACS=${EMACS} test
\ No newline at end of file
- make EMACS=${EMACS} CARTON=/opt/carton/bin/carton test
\ No newline at end of file
(source "melpa" "")
(package "flycheck" "0.6.1" "Flymake done right
Flycheck provides on-the-fly syntax checker with
- major-mode based checkers,
- simple declarative checker definitions,
- built-in checkers for many languages,
- standard error navigation,
- easy customization,
- and a clean, concise and understandable implementation.")
(depends-on "s" "1.3.1")
(depends-on "dash" "1.0.3")
;; Various modes for use in the unit tests
(depends-on "coffee-mode")
(depends-on "haml-mode")
(depends-on "js2-mode")
(depends-on "js3-mode")
(depends-on "lua-mode")
(depends-on "cperl-mode")
(depends-on "php-mode")
(depends-on "php+-mode")
(depends-on "sass-mode"))
EMACS = emacs
CARTON = carton
VAGRANT = vagrant
OBJECTS = flycheck.elc
.PHONY: deps
deps :
$(CARTON) install
$(CARTON) update
.PHONY: build
build : $(OBJECTS)
build : deps $(OBJECTS)
.PHONY: test
test : build
@$(EMACS) --no-site-file --no-site-lisp --batch $(EMACSFLAGS) \
-l dependencies.el -l tests/testsuite.el \
-f ert-run-tests-batch-and-exit
$(CARTON) exec $(EMACS) --no-site-file --no-site-lisp --batch \
-l tests/testsuite.el -f ert-run-tests-batch-and-exit
.PHONY: virtual-test
virtual-test :
$(VAGRANT) ssh -c "make -C /vagrant EMACS=$(EMACS) clean test"
$(VAGRANT) ssh -c "make -C /vagrant CARTON=/opt/carton/bin/carton EMACS=$(EMACS) clean test"
.PHONY: clean
clean :
......@@ -24,5 +30,6 @@ clean :
rm -rf elpa # Clean packages installed for development
%.elc : %.el
$(EMACS) --no-site-file --no-site-lisp --batch $(EMACSFLAGS) \
-l dependencies.el -f batch-byte-compile $<
$(CARTON) exec $(EMACS) --no-site-file --no-site-lisp --batch \
-f batch-byte-compile $<
;;; dependencies.el --- Install and load development dependencies
;; Copyright (c) 2013 Sebastian Wiesner <>
;; Author: Sebastian Wiesner <>
;; URL:
;; This file is not part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <>.
;;; Code:
(defconst source-dir (file-name-directory load-file-name)
"The source directory.")
;; Enable installation of dependencies
(require 'package)
(add-to-list 'package-archives
'("melpa" . "") t)
;; Install packages into the source directory (not into ~/.emacs.d!)
(setq package-user-dir (expand-file-name "elpa") source-dir)
;; Initialize the package system and fetch the archive contents
(unless package-archive-contents
(defun package-need (package)
"Require PACKAGE to be installed."
(unless (package-installed-p package)
(package-install package)))
(package-need 'dash)
(package-need 's)
(require 'dash)
(require 's)
;;; dependencies.el ends here
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'coffee-mode)
(require 'coffee-mode)
(ert-deftest checker-coffeelint-throwing-strings ()
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'haml-mode)
(require 'haml-mode)
(ert-deftest checker-haml-inconsistent-indentation ()
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'js2-mode)
(require 'js2-mode)
(package-need 'js3-mode)
(require 'js3-mode)
(ert-deftest checker-javascript-jshint-missing-semicolon ()
......@@ -31,8 +31,7 @@
;; HACK: Use system-wide installation in Vagrant and on Travis. The MELPA
;; package of lua-mode causes tests to hang in these environments
(load "/usr/share/emacs/site-lisp/lua-mode/lua-mode.el")
(package-need 'lua-mode))
(require 'lua-mode)
(require 'lua-mode))
(ert-deftest checker-lua-missing-quote ()
"Test a syntax error with Lua."
......@@ -26,7 +26,6 @@
(require 'dash)
(require 'flycheck)
(package-need 'cperl-mode)
(require 'cperl-mode)
(ert-deftest checker-perl-unused-variable ()
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'php-mode)
(require 'php-mode)
(package-need 'php+-mode)
(require 'php+-mode)
(ert-deftest checker-php-missing-quote ()
......@@ -25,9 +25,7 @@
(require 'ert)
(require 'flycheck)
(package-need 'php-mode)
(require 'php-mode)
(package-need 'php+-mode)
(require 'php+-mode)
(ert-deftest checker-php-phpcs-uppercase-keyqord ()
......@@ -25,7 +25,6 @@
(require 'ert)
(require 'flycheck)
(package-need 'sass-mode)
(require 'sass-mode)
(ert-deftest checker-sass-inconsistent-indentation ()
......@@ -53,7 +53,7 @@ export DEBIAN_FRONTEND='noninteractive'
# Install basic packages
apt make python-software-properties
apt git make python-software-properties
# Bring in the necessary PPAs
ppa ppa:cassou/emacs
......@@ -92,3 +92,10 @@ npm coffee-script coffeelint \
gem haml \
# Install carton for Emacs dependency management
rm -rf /tmp/carton
git clone /tmp/carton
mkdir -p /opt/
rm -rf /opt/carton
sudo mv /tmp/carton /opt/carton
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment