{ stdenv, fetch-bower, git }: name: version: target: outputHash: stdenv.mkDerivation {
  name = "${name}-${version}";
  realBuilder = "${fetch-bower}/bin/fetch-bower";
  args = [ name version target ];
  outputHashMode = "recursive";
  outputHashAlgo = "sha256";
  inherit outputHash;
  PATH = "${git}/bin";
}

{ stdenv, fetch-bower, git }: name: version: target: outputHash: stdenv.mkDerivation {
  name = "${name}-${version}";
  buildCommand = ''
    out=$PWD/out fetch-bower ${name} ${version} ${target}
    cp -R out $out
  '';
  outputHashMode = "recursive";
  outputHashAlgo = "sha256";
  inherit outputHash;
  buildInputs = [git fetch-bower];
}

Make fetchBower a bit more like a normal mkDerivation, which is easier to test. Also, in some cases, the result of fetchBower is different depending on the value of $out. For now, it seems that it works best if using a local output directory before copying to $out.
Make fetchBower a bit more like a normal mkDerivation, which is easier to test.
Also, in some cases, the result of fetchBower is different depending on the
value of $out. For now, it seems that it works best if using a local output
directory before copying to $out.

(cherry picked from commit aa4c6b027163abe0891f9ad438899f9679298a64)
