Skip to content

Commit

Permalink
callCabal2nix works
Browse files Browse the repository at this point in the history
  • Loading branch information
monacoremo authored and Remo committed Apr 25, 2020
1 parent e07f6f9 commit 027ea0e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 173 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let

# Static derivation for the PostgREST executable.
drvStatic =
import nix/static.nix {
import nix/static {
inherit pkgs name src;
# Currently only works with GHC 8.6.5.
compiler = "ghc865";
Expand Down
2 changes: 1 addition & 1 deletion nix/nixpkgs-version.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pinned version of Nixpkgs, generated with nixpkgs-upgrade.
{
date = "2020-04-19";
date = "2020-04-23";
rev = "10100a97c8964e82b30f180fda41ade8e6f69e41";
tarballHash = "011f36kr3c1ria7rag7px26bh73d1b0xpqadd149bysf4hg17rln";
}
164 changes: 0 additions & 164 deletions nix/postgrest.nix

This file was deleted.

27 changes: 27 additions & 0 deletions nix/static/Cabal.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ mkDerivation, array, base, base-compat, base-orphans, binary
, bytestring, containers, deepseq, Diff, directory, filepath
, integer-logarithms, mtl, optparse-applicative, parsec, pretty
, process, QuickCheck, stdenv, stm, tagged, tar, tasty
, tasty-golden, tasty-hunit, tasty-quickcheck, temporary, text
, time, transformers, tree-diff, unix
}:
mkDerivation {
pname = "Cabal";
version = "3.0.0.0";
sha256 = "5143ec26d740c1a508c93a8860e64407e7546c29b9817db20ff1595c1968d287";
setupHaskellDepends = [ mtl parsec ];
libraryHaskellDepends = [
array base binary bytestring containers deepseq directory filepath
mtl parsec pretty process text time transformers unix
];
testHaskellDepends = [
array base base-compat base-orphans binary bytestring containers
deepseq Diff directory filepath integer-logarithms
optparse-applicative pretty process QuickCheck stm tagged tar tasty
tasty-golden tasty-hunit tasty-quickcheck temporary text tree-diff
];
doCheck = false;
homepage = "http://www.haskell.org/cabal/";
description = "A framework for packaging Haskell software";
license = stdenv.lib.licenses.bsd3;
}
13 changes: 6 additions & 7 deletions nix/static.nix → nix/static/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,17 @@ let
final: prev:
{
# Add our source package.
"${name}" =
#prev.callPackage ./postgrest.nix { inherit name src; };
prev.callCabal2nix name src {};
"${name}" = prev.callCabal2nix name src {};

Cabal = prev.Cabal_3_2_0_0;
# cabal2nix depends on Cabal 3.0.*, while our pinned version of Nixpkgs
# only provides 2.4 or 3.2. So we pinned 3.0.0.0 in ./Cabal.nix
cabal2nix =
prev.cabal2nix.overrideScope
(self: super: { Cabal = self.callPackage ./Cabal.nix {}; });

# The tests for the packages below took a long time on static
# builds, so we disable them for now - to be investigated.
happy = self.haskell.lib.dontCheck prev.happy;
text-short = self.haskell.lib.dontCheck prev.text-short;
jose = self.haskell.lib.dontCheck prev.jose;
tls = self.haskell.lib.dontCheck prev.tls;
};
in
# Override the set of Haskell packages at
Expand Down

0 comments on commit 027ea0e

Please sign in to comment.