about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/flutter/artifacts/prepare-artifacts.nix
blob: 9309c64298285023240a00ac30c2608ad54943d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ lib
, stdenv
, callPackage
, autoPatchelfHook
, src
}:

(stdenv.mkDerivation {
  inherit (src) name;
  inherit src;

  nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook;

  installPhase = ''
    runHook preInstall

    mkdir -p "$out/bin"
    cp -r . "$out/bin/cache"

    runHook postInstall
  '';
}).overrideAttrs (
  if builtins.pathExists ./overrides/${src.flutterPlatform}.nix
  then callPackage ./overrides/${src.flutterPlatform}.nix { }
  else ({ ... }: { })
)