diff --git a/pkgs/build-support/agda/default.nix b/pkgs/build-support/agda/default.nix index 99cc1259023a..5df02fbd5c17 100644 --- a/pkgs/build-support/agda/default.nix +++ b/pkgs/build-support/agda/default.nix @@ -49,6 +49,7 @@ let , meta , buildInputs ? [] , everythingFile ? "./Everything.agda" + , includePaths ? [] , libraryName ? pname , libraryFile ? "${libraryName}.agda-lib" , buildPhase ? null @@ -57,6 +58,7 @@ let , ... }: let agdaWithArgs = withPackages (builtins.filter (p: p ? isAgdaDerivation) buildInputs); + includePathArgs = concatMapStrings (path: "-i" + path + " ") (includePaths ++ [(dirOf everythingFile)]); in { inherit libraryName libraryFile; @@ -67,7 +69,7 @@ let buildPhase = if buildPhase != null then buildPhase else '' runHook preBuild - agda -i ${dirOf everythingFile} ${everythingFile} + agda ${includePathArgs} ${everythingFile} runHook postBuild ''; diff --git a/pkgs/development/libraries/agda/agdarsec/default.nix b/pkgs/development/libraries/agda/agdarsec/default.nix new file mode 100644 index 000000000000..ccdf65f96570 --- /dev/null +++ b/pkgs/development/libraries/agda/agdarsec/default.nix @@ -0,0 +1,28 @@ +{ lib, mkDerivation, fetchFromGitHub +, standard-library }: + +mkDerivation rec { + pname = "agdarsec"; + version = "0.4.1"; + + src = fetchFromGitHub { + owner = "gallais"; + repo = "agdarsec"; + rev = "v${version}"; + sha256 = "02fqkycvicw6m2xsz8p01aq8n3gj2d2gyx8sgj15l46f8434fy0x"; + }; + + everythingFile = "./index.agda"; + + includePaths = [ "src" "examples" ]; + + buildInputs = [ standard-library ]; + + meta = with lib; { + homepage = "https://gallais.github.io/agdarsec/"; + description = "Total Parser Combinators in Agda"; + license = licenses.gpl3; + platforms = platforms.unix; + maintainers = with maintainers; [ turion ]; + }; +} diff --git a/pkgs/top-level/agda-packages.nix b/pkgs/top-level/agda-packages.nix index 7434134d28f2..e38819cfcb02 100644 --- a/pkgs/top-level/agda-packages.nix +++ b/pkgs/top-level/agda-packages.nix @@ -31,5 +31,7 @@ let ../development/libraries/agda/functional-linear-algebra { }; generic = callPackage ../development/libraries/agda/generic { }; + + agdarsec = callPackage ../development/libraries/agda/agdarsec { }; }; in mkAgdaPackages Agda