Refactor Idris packaging infrastructure

The main two changes are

1. Completely rewrite how with-packages works to remove use of envHooks
2. The package description is now an idris specific set rather than
    being a subset of the arguments to mkDerivation. This mirrors the
    way Haskell packages are treated.
This commit is contained in:
Matthew Pickering
2018-02-07 19:25:50 +00:00
parent 8d55538f97
commit 947e7d80b4
8 changed files with 90 additions and 103 deletions
@@ -1,4 +1,4 @@
# Build one of the packages that come with idris
# Build one of the packages that comes with idris
# name: The name of the package
# deps: The dependencies of the package
{ idris, build-idris-package, lib }: name: deps:
@@ -6,20 +6,16 @@ let
inherit (builtins.parseDrvName idris.name) version;
in
build-idris-package {
name = "${name}-${version}";
propagatedBuildInputs = deps;
inherit name version;
inherit (idris) src;
idrisDeps = deps;
postUnpack = ''
sourceRoot=$sourceRoot/libs/${name}
'';
postPatch = ''
sed -i ${name}.ipkg -e "/^opts/ s|-i \\.\\./|-i $IDRIS_LIBRARY_PATH/|g"
'';
meta = idris.meta // {
description = "${name} builtin Idris library";
};