about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/flutter/artifacts/prepare-artifacts.nix
blob: def75e280da77f10bba6ba558e43aefe2af171ef (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 ({ ... }: { })
)