2020-11-06 11:47:11 +03:00
|
|
|
# Functions that are expected run on the native (non-cross) system.
|
|
|
|
|
2020-10-27 15:55:49 +03:00
|
|
|
{ lib, recurseIntoAttrs, haskell-nix, callPackage }:
|
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
rec {
|
|
|
|
bootFakeShip = callPackage ./boot-fake-ship.nix { };
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
testFakeShip = callPackage ./test-fake-ship.nix { inherit bootFakeShip; };
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
fetchGitHubLFS = callPackage ./fetch-github-lfs.nix { };
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
makeReleaseTarball = callPackage ./make-release-tarball.nix { };
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
collectHaskellComponents = project:
|
2020-10-27 15:55:49 +03:00
|
|
|
let
|
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
# These functions pull out from the Haskell project either all the
|
2020-10-27 15:55:49 +03:00
|
|
|
# components of a particular type, or all the checks.
|
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
pkgs = haskell-nix.haskellLib.selectProjectPackages project;
|
|
|
|
|
|
|
|
collectChecks = _:
|
|
|
|
recurseIntoAttrs (builtins.mapAttrs (_: p: p.checks) pkgs);
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
collectComponents = type:
|
|
|
|
haskell-nix.haskellLib.collectComponents' type pkgs;
|
2020-10-27 15:55:49 +03:00
|
|
|
|
2020-11-11 10:48:53 +03:00
|
|
|
# Recompute the Haskell package set sliced by component type
|
|
|
|
in builtins.mapAttrs (type: f: f type) {
|
2020-10-27 15:55:49 +03:00
|
|
|
# These names must match the subcomponent: components.<name>.<...>
|
|
|
|
"library" = collectComponents;
|
|
|
|
"tests" = collectComponents;
|
|
|
|
"benchmarks" = collectComponents;
|
|
|
|
"exes" = collectComponents;
|
|
|
|
"checks" = collectChecks;
|
2020-11-11 10:48:53 +03:00
|
|
|
};
|
2020-10-27 15:55:49 +03:00
|
|
|
}
|