From 0f90c9dbc1a42430883ab31853ba25e9d9ec26a5 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 27 Nov 2015 13:17:17 -0500 Subject: [PATCH] idris-modules: documentation --- .../idris-modules/build-builtin-package.nix | 11 ++++++++-- .../idris-modules/build-idris-package.nix | 8 ++++++-- pkgs/development/idris-modules/default.nix | 7 ++++++- .../idris-modules/with-packages.nix | 6 ++++-- pkgs/development/idris-modules/wl-pprint.nix | 20 +++++++++++++++++-- pkgs/top-level/all-packages.nix | 4 +++- 6 files changed, 46 insertions(+), 10 deletions(-) diff --git a/pkgs/development/idris-modules/build-builtin-package.nix b/pkgs/development/idris-modules/build-builtin-package.nix index 7445e95e27c0..95641a8f9fa1 100644 --- a/pkgs/development/idris-modules/build-builtin-package.nix +++ b/pkgs/development/idris-modules/build-builtin-package.nix @@ -1,4 +1,7 @@ -{ idris, build-idris-package }: name: deps: build-idris-package (args: { +# Build one of the packages that come with idris +# name: The name of the package +# deps: The dependencies of the package +{ idris, build-idris-package, lib }: name: deps: build-idris-package { inherit name; propagatedBuildInputs = deps; @@ -9,4 +12,8 @@ mv $sourceRoot/libs/${name} $IDRIS_LIBRARY_PATH sourceRoot=$IDRIS_LIBRARY_PATH/${name} ''; -}) + + meta = idris.meta // { + description = "${name} builtin Idris library"; + }; +} diff --git a/pkgs/development/idris-modules/build-idris-package.nix b/pkgs/development/idris-modules/build-idris-package.nix index d3686b2a293d..a00f5e74b845 100644 --- a/pkgs/development/idris-modules/build-idris-package.nix +++ b/pkgs/development/idris-modules/build-idris-package.nix @@ -1,4 +1,8 @@ -{ stdenv, idris, gmp }: argf: let args = { +# Build an idris package +# +# args: Additional arguments to pass to mkDerivation. Generally should include at least +# name and src. +{ stdenv, idris, gmp }: args: stdenv.mkDerivation ({ preHook = '' mkdir idris-libs export IDRIS_LIBRARY_PATH=$PWD/idris-libs @@ -33,4 +37,4 @@ ''; buildInputs = [ gmp ]; -}; in stdenv.mkDerivation (args // (argf args)) +} // args) diff --git a/pkgs/development/idris-modules/default.nix b/pkgs/development/idris-modules/default.nix index da879fa6cf4a..95ab68c5f42b 100644 --- a/pkgs/development/idris-modules/default.nix +++ b/pkgs/development/idris-modules/default.nix @@ -28,9 +28,14 @@ files = builtins.filter (n: n != "default") (pkgs.lib.mapAttrsToList (name: type: let m = builtins.match "(.*)\.nix" name; in if m == null then "default" else builtins.head m) (builtins.readDir ./.)); - in (builtins.listToAttrs (map (name: { inherit name; value = callPackage (./. + "/${name}.nix") {}; }) files)) // { + in (builtins.listToAttrs (map (name: { + inherit name; + + value = callPackage (./. + "/${name}.nix") {}; + }) files)) // { inherit idris callPackage; + # A list of all of the libraries that come with idris builtins = pkgs.lib.mapAttrsToList (name: value: value) builtins_; } // builtins_; in fix' (extends overrides idrisPackages) diff --git a/pkgs/development/idris-modules/with-packages.nix b/pkgs/development/idris-modules/with-packages.nix index f8abe09fe877..edcd20c10978 100644 --- a/pkgs/development/idris-modules/with-packages.nix +++ b/pkgs/development/idris-modules/with-packages.nix @@ -1,7 +1,9 @@ -{ stdenv, idris }: buildInputs: stdenv.mkDerivation { +# Build a version of idris with a set of packages visible +# packages: The packages visible to idris +{ stdenv, idris }: packages: stdenv.mkDerivation { inherit (idris) name; - inherit buildInputs; + buildInputs = packages; preHook = '' mkdir -p $out/lib/${idris.name} diff --git a/pkgs/development/idris-modules/wl-pprint.nix b/pkgs/development/idris-modules/wl-pprint.nix index dfde08fceab2..2bf5ef79253c 100644 --- a/pkgs/development/idris-modules/wl-pprint.nix +++ b/pkgs/development/idris-modules/wl-pprint.nix @@ -1,4 +1,10 @@ -{ build-idris-package, fetchgit, prelude, base }: build-idris-package (args : { +{ build-idris-package +, fetchgit +, prelude +, base +, lib +, idris +}: build-idris-package { name = "wl-pprint"; src = fetchgit { @@ -8,4 +14,14 @@ }; propagatedBuildInputs = [ prelude base ]; -}) + + meta = { + description = "Wadler-Leijen pretty-printing library"; + + homepage = https://github.com/shayan-najd/wl-pprint; + + license = lib.licenses.bsd2; + + inherit (idris.meta) platforms; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f482a74881c3..1f647c712f2b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4121,7 +4121,9 @@ let icedtea_web = icedtea8_web; - idrisPackages = callPackage ../development/idris-modules { inherit (haskellPackages) idris; }; + idrisPackages = callPackage ../development/idris-modules { + inherit (haskellPackages) idris; + }; ikarus = callPackage ../development/compilers/ikarus { };