about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/drush/default.nix
blob: bd1c7110996316b519e151480b159d5cbabce423 (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
{ lib, stdenv, fetchurl, fetchFromGitHub, php, which, makeWrapper, bash, coreutils, ncurses }:

stdenv.mkDerivation rec {
  pname = "drush";
  version = "8.4.12";

  src = fetchurl {
    url = "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar";
    sha256 = "sha256-YtD9lD621LJJAM/ieL4KWvY4o4Uqo3+FWgjGYGdQQaw=";
  };

  dontUnpack = true;

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir -p $out/bin
    install -D $src $out/libexec/drush/drush.phar
    makeWrapper ${php}/bin/php $out/bin/drush \
      --add-flags "$out/libexec/drush/drush.phar" \
      --prefix PATH : "${lib.makeBinPath [ which php bash coreutils ncurses ]}"
  '';

  meta = with lib; {
    description = "Command-line shell and Unix scripting interface for Drupal";
    homepage = "https://github.com/drush-ops/drush";
    license = licenses.gpl2;
    maintainers = with maintainers; [ lovek323 ];
    platforms = platforms.all;
  };
}