Merge pull request #324503 from ncfavier/agda-mk-library-file

build-support/agda: expose mkLibraryFile
This commit is contained in:
Naïm Favier 2024-07-11 00:44:48 +02:00 committed by GitHub
commit 0764f58ca3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -19,14 +19,17 @@ let
optionalString
;
mkLibraryFile = pkgs: let
pkgs' = if isList pkgs then pkgs else pkgs self;
in writeText "libraries" ''
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
'';
withPackages' = {
pkgs,
ghc ? ghcWithPackages (p: with p; [ ieee754 ])
}: let
pkgs' = if isList pkgs then pkgs else pkgs self;
library-file = writeText "libraries" ''
${(concatMapStringsSep "\n" (p: "${p}/${p.libraryFile}") pkgs')}
'';
library-file = mkLibraryFile pkgs;
pname = "agdaWithPackages";
version = Agda.version;
in runCommand "${pname}-${version}" {
@ -118,5 +121,5 @@ in
{
mkDerivation = args: stdenv.mkDerivation (args // defaults args);
inherit withPackages withPackages';
inherit mkLibraryFile withPackages withPackages';
}

View File

@ -7,9 +7,9 @@ let
inherit (callPackage ../build-support/agda {
inherit Agda self;
inherit (pkgs.haskellPackages) ghcWithPackages;
}) withPackages mkDerivation;
}) withPackages mkLibraryFile mkDerivation;
in {
inherit mkDerivation;
inherit mkLibraryFile mkDerivation;
lib = lib.extend (final: prev: import ../build-support/agda/lib.nix { lib = prev; });