Skip to content

Commit

Permalink
Fix nix build and add to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ymherklotz committed Jul 23, 2019
1 parent dee97df commit 30d2218
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 47 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ TAGS
*.log
*~
cabal.project.local
result

# Folders
.stack-work
Expand Down
26 changes: 1 addition & 25 deletions .travis.yml
@@ -1,25 +1 @@
sudo: false
language: minimal

# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.stack

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
- stack config set system-ghc --global true
- export PATH=/opt/ghc/8.6.4/bin:$PATH

addons:
apt:
sources:
- hvr-ghc
packages:
- ghc-8.6.4

script:
- stack --no-terminal --skip-ghc-check test --pedantic --fast
language: nix
17 changes: 17 additions & 0 deletions nix/tasty-hedgehog.nix
@@ -0,0 +1,17 @@
{ mkDerivation, base, hedgehog, stdenv, tagged, tasty
, tasty-expected-failure
}:
mkDerivation {
pname = "tasty-hedgehog";
version = "0.2.0.0";
sha256 = "5a107fc3094efc50663e4634331a296281318b38c9902969c2d2d215d754a182";
revision = "6";
editedCabalFile = "0d7s1474pvnyad6ilr5rvpama7s468ya9ns4ksbl0827z9vvga43";
libraryHaskellDepends = [ base hedgehog tagged tasty ];
testHaskellDepends = [
base hedgehog tasty tasty-expected-failure
];
homepage = "https://github.com/qfpl/tasty-hedgehog";
description = "Integration for tasty and hedgehog";
license = stdenv.lib.licenses.bsd3;
}
26 changes: 21 additions & 5 deletions release.nix
@@ -1,12 +1,28 @@
let
composeExtensionsList =
pkgs.lib.fold pkgs.lib.composeExtensions (_: _: {});
makeOverrides =
function: names: haskellPackagesNew: haskellPackagesOld:
let
toPackage = name: {
inherit name;
value = function haskellPackagesOld.${name};
};

in
builtins.listToAttrs (map toPackage names);
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {};
tomland = haskellPackagesNew.callPackage ./nix/tomland.nix {};
parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {};
};
overrides = composeExtensionsList [
(haskellPackagesNew: haskellPackagesOld: rec {
hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {};
tomland = haskellPackagesNew.callPackage ./nix/tomland.nix {};
parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {};
tasty-hedgehog = haskellPackagesNew.callPackage ./nix/tasty-hedgehog.nix {};
})
(makeOverrides pkgs.haskell.lib.dontCheck ["tomland"])
];
};
};
};
Expand Down
28 changes: 12 additions & 16 deletions src/VeriFuzz/Config.hs
Expand Up @@ -77,22 +77,18 @@ module VeriFuzz.Config
)
where

import Control.Applicative ( Alternative )
import Control.Lens hiding ( (.=) )
import Data.List.NonEmpty ( NonEmpty(..) )
import Data.Maybe ( fromMaybe )
import Data.Text ( Text
, pack
)
import qualified Data.Text.IO as T
import Data.Version ( showVersion )
import Control.Applicative (Alternative)
import Control.Lens hiding ((.=))
import Data.List.NonEmpty (NonEmpty (..))
import Data.Maybe (fromMaybe)
import Data.Text (Text, pack)
import qualified Data.Text.IO as T
import Data.Version (showVersion)
import Development.GitRev
import Hedgehog.Internal.Seed ( Seed )
import Paths_verifuzz ( version )
import Shelly ( toTextIgnore )
import Toml ( TomlCodec
, (.=)
)
import Hedgehog.Internal.Seed (Seed)
import Paths_verifuzz (version)
import Shelly (toTextIgnore)
import Toml (TomlCodec, (.=))
import qualified Toml
import VeriFuzz.Sim.Quartus
import VeriFuzz.Sim.Vivado
Expand Down Expand Up @@ -203,7 +199,7 @@ data ConfProperty = ConfProperty { _propSize :: {-# UNPACK #-} !Int
, _propMaxModules :: {-# UNPACK #-} !Int
, _propSampleMethod :: !Text
, _propSampleSize :: {-# UNPACK #-} !Int
, _propCombine :: {-# UNPACK #-} !Bool
, _propCombine :: !Bool
}
deriving (Eq, Show)

Expand Down
2 changes: 1 addition & 1 deletion verifuzz.cabal
Expand Up @@ -79,7 +79,7 @@ library
, parsec >=3.1 && <3.2
, transformers >=0.5 && <0.6
, transformers-base >=0.4.5 && <0.5
, tomland >=1.0 && <1.1
, tomland >=1.0 && <1.2
, prettyprinter >=1.2.0.1 && <1.3
, array >=0.5 && <0.6
, recursion-schemes >=5.0.2 && <5.2
Expand Down

0 comments on commit 30d2218

Please sign in to comment.