about summary refs log tree commit diff
path: root/pkgs/development/php-packages/phive/default.nix
blob: f5670cdfcf23da5541f0b8e2df9bdc575c03cbdc (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
27
28
29
30
31
32
{ mkDerivation, fetchurl, makeWrapper, lib, php }:

mkDerivation rec {
  pname = "phive";
  version = "0.15.2";

  src = fetchurl {
    url = "https://github.com/phar-io/phive/releases/download/${version}/phive-${version}.phar";
    sha256 = "K7B2dT7F1nL14vlql6D+fo6ewkpDnu0A/SnvlCx5Bfk=";
  };

  dontUnpack = true;

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    install -D $src $out/libexec/phive/phive.phar
    makeWrapper ${php}/bin/php $out/bin/phive \
      --add-flags "$out/libexec/phive/phive.phar"
    runHook postInstall
  '';

  meta = with lib; {
    changelog = "https://github.com/phar-io/phive/releases/tag/${version}";
    description = "The Phar Installation and Verification Environment (PHIVE)";
    homepage = "https://github.com/phar-io/phive";
    license = licenses.bsd3;
    maintainers = with maintainers; teams.php.members;
  };
}