Permalink
Browse files

build system updates

  • Loading branch information...
ekmett committed Jan 26, 2013
1 parent cc7f9b3 commit f48832c0989da8ff906125ce1b30697d7d5ad293
Showing with 37 additions and 28 deletions.
  1. +1 −3 .travis.yml
  2. +13 −13 linear.cabal
  3. +23 −12 travis/cabal-apt-install
View
@@ -4,9 +4,7 @@ before_install:
# - mkdir -p ~/.cabal && cp travis/config ~/.cabal/config && cabal update
# Try installing some of the build-deps with apt-get for speed.
- - travis/cabal-apt-install --only-dependencies --force-reinstall $mode
-
- - sudo apt-get -q -y install hlint || cabal install hlint
+ - travis/cabal-apt-install $mode
install:
- cabal configure $mode
View
@@ -30,14 +30,14 @@ source-repository head
library
build-depends:
- base >= 4.5 && < 5,
- containers >= 0.4 && < 0.5,
- distributive >= 0.2.2,
- hashable >= 1.1 && < 1.3,
- semigroups >= 0.9,
- semigroupoids >= 3,
- transformers >= 0.2 && < 0.4,
- unordered-containers >= 0.2.3
+ base >= 4.5 && < 5,
+ containers >= 0.4 && < 0.5,
+ distributive >= 0.2.2 && < 1,
+ hashable >= 1.1 && < 1.3,
+ semigroups >= 0.9 && < 1,
+ semigroupoids >= 3 && < 4,
+ transformers >= 0.2 && < 0.4,
+ unordered-containers >= 0.2.3 && < 0.3
exposed-modules:
Linear
@@ -60,16 +60,16 @@ library
-- Verify the results of the examples
test-suite doctests
- type: exitcode-stdio-1.0
- main-is: doctests.hs
+ type: exitcode-stdio-1.0
+ main-is: doctests.hs
+ ghc-options: -Wall -Werror -threaded
+ hs-source-dirs: tests
build-depends:
base,
directory >= 1.0 && < 1.2,
doctest >= 0.8 && < 0.10,
filepath >= 1.3 && < 1.4,
- lens >= 3.7,
+ lens >= 3.8.4,
simple-reflect >= 0.3.1
- ghc-options: -Wall -Werror -threaded
- hs-source-dirs: tests
View
@@ -1,16 +1,27 @@
-#!/bin/sh
+#! /bin/bash
set -eu
-sudo apt-get -q update
-sudo apt-get -q -y install dctrl-tools
+APT="sudo apt-get -q -y"
+CABAL_INSTALL_DEPS="cabal install --only-dependencies --force-reinstall"
-# Try installing some of the build-deps with apt-get for speed.
-eval "$(
- printf '%s' "grep-aptavail -n -sPackage '(' -FFALSE -X FALSE ')'"
- 2>/dev/null cabal install "$@" --dry-run -v | \
- sed -nre "s/^([^ ]+)-[0-9.]+ \(.*$/ -o '(' -FPackage -X libghc-\1-dev ')'/p" | \
- xargs -d'\n'
-)" | sort -u | xargs -d'\n' sudo apt-get -q -y install -- libghc-quickcheck2-dev
+$APT update
+$APT install dctrl-tools
+
+# Find potential system packages to satisfy cabal dependencies
+deps()
+{
+ local M='^\([^ ]\+\)-[0-9.]\+ (.*$'
+ local G=' -o ( -FPackage -X libghc-\L\1\E-dev )'
+ local E="$($CABAL_INSTALL_DEPS "$@" --dry-run -v 2> /dev/null \
+ | sed -ne "s/$M/$G/p" | sort -u)"
+ grep-aptavail -n -sPackage \( -FNone -X None \) $E | sort -u
+}
+
+$APT install $(deps "$@") libghc-quickcheck2-dev # QuickCheck is special
+$CABAL_INSTALL_DEPS "$@" # Install the rest via Hackage
+
+if ! $APT install hlint ; then
+ $APT install $(deps hlint)
+ cabal install hlint
+fi
-# Install whatever is still needed with cabal.
-cabal install "$@"

0 comments on commit f48832c

Please sign in to comment.