Merge pull request #324503 from ncfavier/agda-mk-library-file
build-support/agda: expose mkLibraryFile
This commit is contained in:
commit
0764f58ca3
@ -19,14 +19,17 @@ let
|
|||||||
optionalString
|
optionalString
|
||||||
;
|
;
|
||||||
|
|
||||||
|
mkLibraryFile = pkgs: let
|
||||||
|
pkgs' = if isList pkgs then pkgs else pkgs self;
|
||||||
|
in writeText "libraries" ''
|
||||||
|
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
|
||||||
|
'';
|
||||||
|
|
||||||
withPackages' = {
|
withPackages' = {
|
||||||
pkgs,
|
pkgs,
|
||||||
ghc ? ghcWithPackages (p: with p; [ ieee754 ])
|
ghc ? ghcWithPackages (p: with p; [ ieee754 ])
|
||||||
}: let
|
}: let
|
||||||
pkgs' = if isList pkgs then pkgs else pkgs self;
|
library-file = mkLibraryFile pkgs;
|
||||||
library-file = writeText "libraries" ''
|
|
||||||
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
|
|
||||||
'';
|
|
||||||
pname = "agdaWithPackages";
|
pname = "agdaWithPackages";
|
||||||
version = Agda.version;
|
version = Agda.version;
|
||||||
in runCommand "${pname}-${version}" {
|
in runCommand "${pname}-${version}" {
|
||||||
@ -118,5 +121,5 @@ in
|
|||||||
{
|
{
|
||||||
mkDerivation = args: stdenv.mkDerivation (args // defaults args);
|
mkDerivation = args: stdenv.mkDerivation (args // defaults args);
|
||||||
|
|
||||||
inherit withPackages withPackages';
|
inherit mkLibraryFile withPackages withPackages';
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,9 @@ let
|
|||||||
inherit (callPackage ../build-support/agda {
|
inherit (callPackage ../build-support/agda {
|
||||||
inherit Agda self;
|
inherit Agda self;
|
||||||
inherit (pkgs.haskellPackages) ghcWithPackages;
|
inherit (pkgs.haskellPackages) ghcWithPackages;
|
||||||
}) withPackages mkDerivation;
|
}) withPackages mkLibraryFile mkDerivation;
|
||||||
in {
|
in {
|
||||||
inherit mkDerivation;
|
inherit mkLibraryFile mkDerivation;
|
||||||
|
|
||||||
lib = lib.extend (final: prev: import ../build-support/agda/lib.nix { lib = prev; });
|
lib = lib.extend (final: prev: import ../build-support/agda/lib.nix { lib = prev; });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user