Browse Source

Build using stack and LTS Haskell 4.2

tags/v0.2.2.0
Peter J. Jones 3 years ago
parent
commit
33e9e0945c
7 changed files with 28 additions and 68 deletions
  1. 2
    4
      .gitignore
  2. 1
    1
      LICENSE
  3. 10
    0
      build/nixpkgs.nix
  4. 12
    0
      build/stack.yaml
  5. 3
    3
      byline.cabal
  6. 0
    47
      default.nix
  7. 0
    13
      shell.nix

+ 2
- 4
.gitignore View File

@@ -1,4 +1,2 @@
/.cabal-sandbox
/cabal.sandbox.config
/dist
/.deps.mk
/.stack-work
/build/.stack-work

+ 1
- 1
LICENSE View File

@@ -1,4 +1,4 @@
Copyright (c) 2015, Peter J. Jones <pjones@devalot.com>
Copyright (c) 2015,2016, Peter J. Jones <pjones@devalot.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without

+ 10
- 0
build/nixpkgs.nix View File

@@ -0,0 +1,10 @@
with (import <nixpkgs> {});

stdenv.mkDerivation {
name = "byline";

buildInputs = [
haskell.packages.lts-4_2.ghc
ncurses
];
}

+ 12
- 0
build/stack.yaml View File

@@ -0,0 +1,12 @@
flags:
byline:
maintainer: true
build-examples: true

packages:
- ../

extra-deps:
- terminfo-hs-0.2.1

resolver: lts-4.2

+ 3
- 3
byline.cabal View File

@@ -8,12 +8,12 @@ license: BSD2
license-file: LICENSE
author: Peter Jones <pjones@devalot.com>
maintainer: Peter Jones <pjones@devalot.com>
copyright: Copyright: (c) 2015 Peter J. Jones
copyright: Copyright: (c) 2015,2016 Peter J. Jones
category: System, User Interfaces
build-type: Simple
stability: experimental
tested-with: GHC == 7.8.4, GHC == 7.10.1
cabal-version: >=1.10
tested-with: GHC == 7.8.4, GHC == 7.10.3
cabal-version: >=1.18
description:
Byline simplifies writing interactive terminal applications by
building upon @ansi-terminal@ and @haskeline@. This makes it

+ 0
- 47
default.nix View File

@@ -1,47 +0,0 @@
{ stdenv, haskellPackages }:

let
env = haskellPackages.ghcWithPackages (p: with p; [
# Tools:
cabal-install
hlint

# Libraries:
ansi-terminal
base
colour
exceptions
haskeline
mtl
terminfo-hs
text
transformers
]);

in stdenv.mkDerivation rec {
name = "byline";
src = ./src;

buildInputs = [ env ];

buildPhase = ''
( HOME="$(mktemp -d)" # For cabal-install.
if [ ! -d .cabal-sandbox ]; then
cabal sandbox init
fi

cabal configure -fmaintainer -fbuild-examples
cabal build || exit 1
) && hlint src
'';

installPhase = ''
'';

shellHook = ''
export NIX_GHC="${env}/bin/ghc"
export NIX_GHCPKG="${env}/bin/ghc-pkg"
export NIX_GHC_DOCDIR="${env}/share/doc/ghc/html"
export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir )
'';
}

+ 0
- 13
shell.nix View File

@@ -1,13 +0,0 @@
{ pkgs ? (import <nixpkgs> {})
, ghc ? "7.8.4" # Allow overriding the GHC version.

# Logic to pick the correct version of haskellPackages:
, haskellPackages ? if ghc == "7.8.4"
then pkgs.haskell.packages.ghc784
else pkgs.haskell.packages.ghc7101
}:

(import ./default.nix) {
stdenv = pkgs.stdenv;
haskellPackages = haskellPackages;
}

Loading…
Cancel
Save