agda: Don't be too picky about `everythingFile`

The `-path` test of `find` does string comparison, not path comparison.
Hence, the format of `everythingFile` needed to be very specific. Now,
it can be denormalized (e.g. it can contain `/./`) and an error is
emitted if the everything file or its interface file can't be removed.

ibbem b9343ad4 16426544

+7 -4
+2 -1
pkgs/build-support/agda/default.nix
··· 75 buildPhase = if buildPhase != null then buildPhase else '' 76 runHook preBuild 77 agda ${includePathArgs} ${everythingFile} 78 runHook postBuild 79 ''; 80 81 installPhase = if installPhase != null then installPhase else '' 82 runHook preInstall 83 mkdir -p $out 84 - find -not \( -path ${everythingFile} -or -path ${lib.interfaceFile Agda.version everythingFile} \) -and \( ${concatMapStringsSep " -or " (p: "-name '*.${p}'") (extensions ++ extraExtensions)} \) -exec cp -p --parents -t "$out" {} + 85 runHook postInstall 86 ''; 87
··· 75 buildPhase = if buildPhase != null then buildPhase else '' 76 runHook preBuild 77 agda ${includePathArgs} ${everythingFile} 78 + rm ${everythingFile} ${lib.interfaceFile Agda.version everythingFile} 79 runHook postBuild 80 ''; 81 82 installPhase = if installPhase != null then installPhase else '' 83 runHook preInstall 84 mkdir -p $out 85 + find \( ${concatMapStringsSep " -or " (p: "-name '*.${p}'") (extensions ++ extraExtensions)} \) -exec cp -p --parents -t "$out" {} + 86 runHook postInstall 87 ''; 88
+5 -3
pkgs/build-support/agda/lib.nix
··· 2 { 3 /* Returns the Agda interface file to a given Agda file. 4 * 5 * Examples: 6 - * interfaceFile pkgs.agda.version "./Everything.agda" == "./_build/2.6.4.3/agda/Everything.agdai" 7 - * interfaceFile pkgs.agda.version "./src/Everything.lagda.tex" == "./_build/2.6.4.3/agda/src/Everything.agdai" 8 */ 9 - interfaceFile = agdaVersion: agdaFile: "./_build/" + agdaVersion + "/agda/" + lib.head (builtins.match ''./(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile) + "agdai"; 10 11 /* Takes an arbitrary derivation and says whether it is an agda library package 12 * that is not marked as broken.
··· 2 { 3 /* Returns the Agda interface file to a given Agda file. 4 * 5 + * The resulting path may not be normalized. 6 + * 7 * Examples: 8 + * interfaceFile pkgs.agda.version "./Everything.agda" == "_build/2.6.4.3/agda/./Everything.agdai" 9 + * interfaceFile pkgs.agda.version "src/Everything.lagda.tex" == "_build/2.6.4.3/agda/src/Everything.agdai" 10 */ 11 + interfaceFile = agdaVersion: agdaFile: "_build/" + agdaVersion + "/agda/" + lib.head (builtins.match ''(.*\.)l?agda(\.(md|org|rst|tex|typ))?'' agdaFile) + "agdai"; 12 13 /* Takes an arbitrary derivation and says whether it is an agda library package 14 * that is not marked as broken.