diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/agda/default.nix | 8 | ||||
-rw-r--r-- | pkgs/build-support/agda/lib.nix | 8 |
2 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/build-support/agda/default.nix b/pkgs/build-support/agda/default.nix index 893383a759aec..681d1ea681bb4 100644 --- a/pkgs/build-support/agda/default.nix +++ b/pkgs/build-support/agda/default.nix @@ -31,10 +31,9 @@ let mkdir -p $out/bin makeWrapper ${Agda}/bin/agda $out/bin/agda \ --add-flags "--with-compiler=${ghc}/bin/ghc" \ - --add-flags "--library-file=${library-file}" \ - --add-flags "--local-interfaces" + --add-flags "--library-file=${library-file}" ln -s ${Agda}/bin/agda-mode $out/bin/agda-mode - ''; # Local interfaces has been added for now: See https://github.com/agda/agda/issues/4526 + ''; withPackages = arg: if builtins.isAttrs arg then withPackages' arg else withPackages' { pkgs = arg; }; @@ -76,13 +75,14 @@ let buildPhase = if buildPhase != null then buildPhase else '' runHook preBuild agda ${includePathArgs} ${everythingFile} + rm ${everythingFile} ${lib.interfaceFile Agda.version everythingFile} runHook postBuild ''; installPhase = if installPhase != null then installPhase else '' runHook preInstall mkdir -p $out - find -not \( -path ${everythingFile} -or -path ${lib.interfaceFile everythingFile} \) -and \( ${concatMapStringsSep " -or " (p: "-name '*.${p}'") (extensions ++ extraExtensions)} \) -exec cp -p --parents -t "$out" {} + + find \( ${concatMapStringsSep " -or " (p: "-name '*.${p}'") (extensions ++ extraExtensions)} \) -exec cp -p --parents -t "$out" {} + runHook postInstall ''; diff --git a/pkgs/build-support/agda/lib.nix b/pkgs/build-support/agda/lib.nix index e6e391b2ceddf..63fa6ccddba6b 100644 --- a/pkgs/build-support/agda/lib.nix +++ b/pkgs/build-support/agda/lib.nix @@ -2,11 +2,13 @@ { /* Returns the Agda interface file to a given Agda file. * + * The resulting path may not be normalized. + * * Examples: - * interfaceFile "Everything.agda" == "Everything.agdai" - * interfaceFile "src/Everything.lagda.tex" == "src/Everything.agdai" + * interfaceFile pkgs.agda.version "./Everything.agda" == "_build/2.6.4.3/agda/./Everything.agdai" + * interfaceFile pkgs.agda.version "src/Everything.lagda.tex" == "_build/2.6.4.3/agda/src/Everything.agdai" */ - interfaceFile = agdaFile: lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile) + "agdai"; + interfaceFile = agdaVersion: agdaFile: "_build/" + agdaVersion + "/agda/" + lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile) + "agdai"; /* Takes an arbitrary derivation and says whether it is an agda library package * that is not marked as broken. |