Update nix-shell env and update tasty-quickcheck dep (#18)

* Add tasty-quickcheck to library deps

* Add shell hook to no-tests target and export it at toplevel

* cabal2nix . > default.nix

* PR feedback from @parnell (better shell hooks)
This commit is contained in:
intractable 2017-05-30 11:45:22 -05:00 committed by GitHub
parent 865b175845
commit d95052ebe6
3 changed files with 22 additions and 15 deletions

View file

@ -1,8 +1,8 @@
{ mkDerivation, async, base, bytestring, c2hs, clock, containers { mkDerivation, async, base, bytestring, c2hs, clock, containers
, grpc, managed, optparse-generic, pipes, proto3-suite, proto3-wire , grpc, managed, optparse-generic, pipes, proto3-suite, proto3-wire
, QuickCheck, random, safe, sorted-list, stdenv, stm , QuickCheck, safe, sorted-list, stdenv, stm, system-filepath
, system-filepath, tasty, tasty-hunit, tasty-quickcheck, text, time , tasty, tasty-hunit, tasty-quickcheck, text, time, transformers
, transformers, turtle, unix, vector , turtle, unix, vector
}: }:
mkDerivation { mkDerivation {
pname = "grpc-haskell"; pname = "grpc-haskell";
@ -12,21 +12,21 @@ mkDerivation {
isExecutable = true; isExecutable = true;
libraryHaskellDepends = [ libraryHaskellDepends = [
async base bytestring clock containers managed pipes proto3-suite async base bytestring clock containers managed pipes proto3-suite
proto3-wire safe sorted-list stm tasty tasty-hunit transformers proto3-wire safe sorted-list stm tasty tasty-hunit tasty-quickcheck
vector transformers vector
]; ];
librarySystemDepends = [ grpc ]; librarySystemDepends = [ grpc ];
libraryToolDepends = [ c2hs ]; libraryToolDepends = [ c2hs ];
executableHaskellDepends = [ executableHaskellDepends = [
async base bytestring containers optparse-generic proto3-suite async base bytestring containers optparse-generic proto3-suite
proto3-wire random system-filepath text transformers turtle vector proto3-wire system-filepath text transformers turtle
]; ];
testHaskellDepends = [ testHaskellDepends = [
async base bytestring clock containers managed pipes proto3-suite async base bytestring clock containers managed pipes proto3-suite
QuickCheck safe tasty tasty-hunit tasty-quickcheck text time QuickCheck safe tasty tasty-hunit tasty-quickcheck text time
transformers turtle unix transformers turtle unix
]; ];
homepage = "https://github.mv.awakenetworks.net/awakenetworks/gRPC-haskell"; homepage = "https://github.com/awakenetworks/gRPC-haskell";
description = "Haskell implementation of gRPC layered on shared C library"; description = "Haskell implementation of gRPC layered on shared C library";
license = stdenv.lib.licenses.asl20; license = stdenv.lib.licenses.asl20;
} }

View file

@ -37,6 +37,7 @@ library
, async ==2.1.* , async ==2.1.*
, tasty >= 0.11 && <0.12 , tasty >= 0.11 && <0.12
, tasty-hunit >= 0.9 && <0.10 , tasty-hunit >= 0.9 && <0.10
, tasty-quickcheck >= 0.8.4 && < 0.9
, safe ==0.3.* , safe ==0.3.*
, vector , vector
, sorted-list >=0.1.6.1 && <=0.3 , sorted-list >=0.1.6.1 && <=0.3
@ -248,7 +249,7 @@ test-suite test
, async , async
, tasty >= 0.11 && <0.12 , tasty >= 0.11 && <0.12
, tasty-hunit >= 0.9 && <0.10 , tasty-hunit >= 0.9 && <0.10
, tasty-quickcheck ==0.8.* , tasty-quickcheck >= 0.8.4 && < 0.9
, containers ==0.5.* , containers ==0.5.*
, managed >= 1.0.0 && < 1.1 , managed >= 1.0.0 && < 1.1
, pipes >=4.1 && <=4.4 , pipes >=4.1 && <=4.4

View file

@ -192,6 +192,11 @@ let
pkgs.lib.optionalString pkgs.stdenv.isDarwin '' pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH
''; '';
shellHook = (oldDerivation.shellHook or "") + ''
export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH
'';
}); });
grpc-haskell = grpc-haskell =
@ -257,7 +262,7 @@ let
--prefix DYLD_LIBRARY_PATH : ${grpc}/lib --prefix DYLD_LIBRARY_PATH : ${grpc}/lib
''; '';
shellHook = '' shellHook = (oldDerivation.shellHook or "") + ''
export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH=${grpc}/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH
# This lets us use our custom ghc and python environments in the shell. # This lets us use our custom ghc and python environments in the shell.
export PATH=${stack}/bin:${ghc}/bin:${python}/bin''${PATH:+:}$PATH export PATH=${stack}/bin:${ghc}/bin:${python}/bin''${PATH:+:}$PATH
@ -278,10 +283,11 @@ let
pkgs = import nixpkgs { inherit config; }; pkgs = import nixpkgs { inherit config; };
in in
{ grpc-haskell-linux = linuxPkgs.haskellPackages.grpc-haskell; { grpc-haskell-linux = linuxPkgs.haskellPackages.grpc-haskell;
grpc-haskell-darwin = darwinPkgs.haskellPackages.grpc-haskell; grpc-haskell-darwin = darwinPkgs.haskellPackages.grpc-haskell;
grpc-haskell = pkgs.haskellPackages.grpc-haskell; grpc-haskell = pkgs.haskellPackages.grpc-haskell;
grpc-linux = linuxPkgs.grpc; grpc-haskell-no-tests = pkgs.haskellPackages.grpc-haskell-no-tests;
grpc-darwin = darwinPkgs.grpc; grpc-linux = linuxPkgs.grpc;
grpc = pkgs.grpc; grpc-darwin = darwinPkgs.grpc;
grpc = pkgs.grpc;
} }