nixpkgs/pkgs/development/tools/misc/drush/default.nix
Florian Klink f37a71a737 drush: 6.1.0 -> 8.4.10
Drush 6.x is unsupported, and not compatible with any PHP version we
ship in nixpkgs.

Drush 8.x still supports Drupal 6, 7 and 8.

I switched to using the released .phar, instead of trying to nixify the
composer dependencies.
2022-01-19 19:13:36 +01:00

32 lines
957 B
Nix

{ lib, stdenv, fetchurl, fetchFromGitHub, php, which, makeWrapper, bash, coreutils, ncurses }:
stdenv.mkDerivation rec {
pname = "drush";
version = "8.4.10";
src = fetchurl {
url = "https://github.com/drush-ops/drush/releases/download/${version}/drush.phar";
sha256 = "sha256-yXSoTDFLsjDiYkRfrIxv2WTVdHzgxZRvtn3Pht5XF4k=";
};
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;
};
}