Unverified Commit b508b879 authored by Jonas Chevalier's avatar Jonas Chevalier Committed by GitHub
Browse files

trivial-builders: add missing passthru argument (#320973)

parents 68e9d15e d04d2858
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ rec {
    , destination ? ""
    , checkPhase ? ""
    , meta ? { }
    , passthru ? { }
    , allowSubstitutes ? false
    , preferLocalBuild ? true
    , derivationArgs ? { }
@@ -105,7 +106,8 @@ rec {
          {
            mainProgram = lib.head matches;
          } // meta // derivationArgs.meta or {};
      } // removeAttrs derivationArgs [ "passAsFile" "meta" ])
        passthru = passthru // derivationArgs.passthru or {};
      } // removeAttrs derivationArgs [ "passAsFile" "meta" "passthru" ])
      ''
        target=$out${lib.escapeShellArg destination}
        mkdir -p "$(dirname "$target")"
@@ -220,6 +222,12 @@ rec {
         Type: AttrSet
       */
      meta ? { },
      /*
         `stdenv.mkDerivation`'s `passthru` argument.

         Type: AttrSet
       */
      passthru ? { },
      /*
         The `checkPhase` to run. Defaults to `shellcheck` on supported
         platforms and `bash -n`.
@@ -263,7 +271,7 @@ rec {
      derivationArgs ? { },
    }:
    writeTextFile {
      inherit name meta derivationArgs;
      inherit name meta passthru derivationArgs;
      executable = true;
      destination = "/bin/${name}";
      allowSubstitutes = true;
@@ -366,9 +374,10 @@ rec {
    , destination ? ""   # relative path appended to $out eg "/bin/foo"
    , checkPhase ? ""    # syntax checks, e.g. for scripts
    , meta ? { }
    , passthru ? { }
    }:
    runCommandLocal name
      { inherit files executable checkPhase meta destination; }
      { inherit files executable checkPhase meta passthru destination; }
      ''
        file=$out$destination
        mkdir -p "$(dirname "$file")"