build-idris-package: includePreludeBase -> noPrelude, noBase

Resembles idris --noprelude and --nobasepkgs arguments
This commit is contained in:
Silvan Mosberger 2018-07-03 21:19:28 +02:00
parent ef0073410d
commit 5f620d0e22
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7
2 changed files with 9 additions and 5 deletions

View File

@ -10,7 +10,8 @@ build-idris-package {
inherit name version;
inherit (idris) src;
includePreludeBase = false;
noPrelude = true;
noBase = true;
idrisDeps = deps;

View File

@ -1,15 +1,18 @@
# Build an idris package
{ stdenv, lib, idrisPackages, gmp }:
{ idrisDeps ? []
, includePreludeBase ? true
, noPrelude ? false
, noBase ? false
, name
, version
, extraBuildInputs ? []
, ...
}@attrs:
let
idrisDeps' = idrisDeps ++ lib.optionals includePreludeBase (with idrisPackages; [ prelude base ]);
idris-with-packages = idrisPackages.with-packages idrisDeps';
allIdrisDeps = idrisDeps
++ lib.optional (!noPrelude) idrisPackages.prelude
++ lib.optional (!noBase) idrisPackages.base;
idris-with-packages = idrisPackages.with-packages allIdrisDeps;
newAttrs = builtins.removeAttrs attrs [ "idrisDeps" "extraBuildInputs" "name" "version" ] // {
meta = attrs.meta // {
platforms = attrs.meta.platforms or idrisPackages.idris.meta.platforms;
@ -20,7 +23,7 @@ stdenv.mkDerivation ({
name = "${name}-${version}";
buildInputs = [ idris-with-packages gmp ] ++ extraBuildInputs;
propagatedBuildInputs = idrisDeps';
propagatedBuildInputs = allIdrisDeps;
# Some packages use the style
# opts = -i ../../path/to/package