Commit 39e696e9 authored by Christopher League's avatar Christopher League

Less flaky nix build

Don't rely on cabal2nix at build time.
parent 7c5cf499
Pipeline #544 passed with stage
in 1 minute and 26 seconds
{ mkDerivation, aeson, base, blaze-markup, bytestring
, case-insensitive, classy-prelude, classy-prelude-yesod
, containers, data-default, directory, exceptions, fast-logger
, file-embed, foreign-store, gitrev, gogol, gogol-apps-calendar
, hjsmin, hpack, hspec, http-client-tls, http-conduit, http-types
, lens, monad-control, monad-logger, shakespeare, sorted-list
, stdenv, template-haskell, text, time, transformers, tz
, unordered-containers, vector, wai, wai-extra, wai-logger, warp
, yaml, yesod, yesod-core, yesod-form, yesod-static, yesod-test
}:
mkDerivation {
pname = "bookme";
version = "0.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin http-client-tls http-conduit http-types
lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static
];
libraryToolDepends = [ hpack ];
executableHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin http-client-tls http-conduit http-types
lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static
];
testHaskellDepends = [
aeson base blaze-markup bytestring case-insensitive classy-prelude
classy-prelude-yesod containers data-default directory exceptions
fast-logger file-embed foreign-store gitrev gogol
gogol-apps-calendar hjsmin hspec http-client-tls http-conduit
http-types lens monad-control monad-logger shakespeare sorted-list
template-haskell text time transformers tz unordered-containers
vector wai wai-extra wai-logger warp yaml yesod yesod-core
yesod-form yesod-static yesod-test
];
preConfigure = "hpack";
license = stdenv.lib.licenses.unfree;
hydraPlatforms = stdenv.lib.platforms.none;
}
......@@ -2,40 +2,88 @@
}:
with nixpkgs;
let
stackageVersion = "lts-1110";
# This requires the nixpkgs-stackage overlay.
hpkgs = nixpkgs.pkgs.haskell.packages.stackage.lts-1110;
hlib = nixpkgs.pkgs.haskell.lib;
stackageSrc = pkgs.fetchgit {
url = "https://github.com/typeable/nixpkgs-stackage.git";
rev = "7c94ec65e12850e7dd5282e83a6da91f88cb8857";
sha256 = "1ihsbgb9agg1f5q7mk3ycja6njbrg1dqlxniav47kyr9cm5ng0kn";
};
gogolSrc = pkgs.fetchgit {
# The gogol package is not part of stackage LTS, and it's a bit
# tricky to build. Best results so far are with LTS specified above
# and the gogol revision specified here.
gogol-src = pkgs.fetchgit {
url = "https://github.com/brendanhay/gogol.git";
rev = "344c9f781560e1ed8395b17e370ba1b085f2edc2";
sha256 = "0f48mh7f2ifk3b7rjwgn9cwmi6845xv9zvs07khycbk70959pk1n";
};
stackageOverlay = import stackageSrc;
nixpkgs' = import pkgs.path { overlays = [stackageOverlay]; };
haskell = nixpkgs'.pkgs.haskell;
gogol-core =
{ mkDerivation, aeson, attoparsec, base, bifunctors, bytestring
, case-insensitive, conduit, dlist, exceptions, hashable
, http-api-data, http-client, http-media, http-types, lens
, resourcet, scientific, servant, stdenv, tasty, text, time
, unordered-containers
}:
mkDerivation {
pname = "gogol-core";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd core";
libraryHaskellDepends = [
aeson attoparsec base bifunctors bytestring case-insensitive
conduit dlist exceptions hashable http-api-data http-client
http-media http-types lens resourcet scientific servant text time
unordered-containers
];
testHaskellDepends = [ base tasty ];
homepage = "https://github.com/brendanhay/gogol";
description = "Core data types and functionality for Gogol libraries";
license = "unknown";
};
mkNix = name: loc: pkgs.runCommand name {} ''
${pkgs.cabal2nix}/bin/cabal2nix ${loc} >$out
'';
gogol =
{ mkDerivation, aeson, base, bytestring, case-insensitive, conduit
, conduit-extra, cryptonite, directory, exceptions, filepath
, gogol-core, http-client, http-conduit, http-media, http-types
, lens, memory, mime-types, mtl, resourcet, stdenv, text, time
, transformers, unliftio-core, unordered-containers, x509
, x509-store
}:
mkDerivation {
pname = "gogol";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd gogol";
libraryHaskellDepends = [
aeson base bytestring case-insensitive conduit conduit-extra
cryptonite directory exceptions filepath gogol-core http-client
http-conduit http-media http-types lens memory mime-types mtl
resourcet text time transformers unliftio-core unordered-containers
x509 x509-store
];
homepage = "https://github.com/brendanhay/gogol";
description = "Comprehensive Google Services SDK";
license = "unknown";
};
gogolCoreNix = mkNix "gogol-core.nix" "${gogolSrc}/core";
gogolNix = mkNix "gogol.nix" "${gogolSrc}/gogol";
gogolCalNix = mkNix "gogol-cal.nix" "${gogolSrc}/gogol-apps-calendar";
bookmeNix = mkNix "bookme.nix" ./.;
gogol-cal =
{ mkDerivation, base, gogol-core, stdenv }:
mkDerivation {
pname = "gogol-apps-calendar";
version = "0.3.0";
src = gogol-src;
preCompileBuildDriver = "cd gogol-apps-calendar";
libraryHaskellDepends = [ base gogol-core ];
homepage = "https://github.com/brendanhay/gogol";
description = "Google Calendar SDK";
license = "unknown";
};
hpkgs = haskell.packages.stackage.${stackageVersion}.override {
hpkgs' = hpkgs.override {
overrides = self: super: {
gogol-core = self.callPackage gogolCoreNix {};
gogol = self.callPackage gogolNix {};
gogol-apps-calendar = self.callPackage gogolCalNix {};
alex = haskell.lib.dontCheck super.alex;
bookme = self.callPackage bookmeNix {};
alex = hlib.dontCheck super.alex;
bookme = self.callPackage (import ./bookme.nix) {};
gogol-core = self.callPackage gogol-core {};
gogol = self.callPackage gogol {};
gogol-apps-calendar = self.callPackage gogol-cal {};
# mkDerivation = args: super.mkDerivation (args // {
# enableLibraryProfiling = false;
# doHoogle = false;
......@@ -44,4 +92,4 @@ let
};
};
in
haskell.lib.justStaticExecutables hpkgs.bookme
hlib.justStaticExecutables hpkgs'.bookme
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment