phpPackages: build packages with pname

This commit is contained in:
Izorkin 2019-04-20 17:09:05 +03:00
parent 94e1807eeb
commit f40f2323fa
2 changed files with 75 additions and 47 deletions

View file

@ -1,18 +1,19 @@
{ stdenv, php, autoreconfHook, fetchurl }: { stdenv, php, autoreconfHook, fetchurl }:
{ name { pname
, version
, buildInputs ? [] , buildInputs ? []
, nativeBuildInputs ? [] , nativeBuildInputs ? []
, makeFlags ? [] , makeFlags ? []
, src ? fetchurl { , src ? fetchurl {
url = "http://pecl.php.net/get/${name}.tgz"; url = "http://pecl.php.net/get/${pname}-${version}.tgz";
inherit (args) sha256; inherit (args) sha256;
} }
, ... , ...
}@args: }@args:
stdenv.mkDerivation (args // { stdenv.mkDerivation (args // {
name = "php-${name}"; name = "php-${pname}-${version}";
inherit src; inherit src;

View file

@ -9,9 +9,12 @@ let
isPhp73 = pkgs.lib.versionAtLeast php.version "7.3"; isPhp73 = pkgs.lib.versionAtLeast php.version "7.3";
apcu = buildPecl { apcu = buildPecl rec {
name = "apcu-5.1.17"; version = "5.1.17";
pname = "apcu";
sha256 = "14y7alvj5q17q1b544bxidavkn6i40cjbq2nv1m0k70ai5vv84bb"; sha256 = "14y7alvj5q17q1b544bxidavkn6i40cjbq2nv1m0k70ai5vv84bb";
buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ]; buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
doCheck = true; doCheck = true;
checkTarget = "test"; checkTarget = "test";
@ -20,21 +23,25 @@ let
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
}; };
apcu_bc = buildPecl { apcu_bc = buildPecl rec {
name = "apcu_bc-1.0.5"; version = "1.0.5";
pname = "apcu_bc";
sha256 = "0ma00syhk2ps9k9p02jz7rii6x3i2p986il23703zz5npd6y9n20"; sha256 = "0ma00syhk2ps9k9p02jz7rii6x3i2p986il23703zz5npd6y9n20";
buildInputs = [ apcu (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ]; buildInputs = [ apcu (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
}; };
ast = buildPecl { ast = buildPecl rec {
name = "ast-1.0.0"; version = "1.0.0";
pname = "ast";
sha256 = "0abccvwif1pih222lbj2z4cf9ibciz48xj35lfixyry163vabkck"; sha256 = "0abccvwif1pih222lbj2z4cf9ibciz48xj35lfixyry163vabkck";
}; };
box = pkgs.stdenv.mkDerivation rec { box = pkgs.stdenv.mkDerivation rec {
name = "box-${version}";
version = "2.7.5"; version = "2.7.5";
pname = "box";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/box-project/box2/releases/download/${version}/box-${version}.phar"; url = "https://github.com/box-project/box2/releases/download/${version}/box-${version}.phar";
@ -60,8 +67,8 @@ let
}; };
composer = pkgs.stdenv.mkDerivation rec { composer = pkgs.stdenv.mkDerivation rec {
pname = "composer";
version = "1.8.4"; version = "1.8.4";
pname = "composer";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://getcomposer.org/download/${version}/composer.phar"; url = "https://getcomposer.org/download/${version}/composer.phar";
@ -89,8 +96,8 @@ let
}; };
couchbase = buildPecl rec { couchbase = buildPecl rec {
name = "couchbase-${version}";
version = "2.6.0"; version = "2.6.0";
pname = "couchbase";
buildInputs = [ pkgs.libcouchbase pkgs.zlib igbinary pcs ]; buildInputs = [ pkgs.libcouchbase pkgs.zlib igbinary pcs ];
@ -129,35 +136,38 @@ let
]; ];
}; };
igbinary = buildPecl { igbinary = buildPecl rec {
name = "igbinary-2.0.8"; version = "2.0.8";
pname = "igbinary";
configureFlags = [ "--enable-igbinary" ];
makeFlags = [ "phpincludedir=$(dev)/include" ];
outputs = [ "out" "dev" ];
sha256 = "105nyn703k9p9c7wwy6npq7xd9mczmmlhyn0gn2v2wz0f88spjxs"; sha256 = "105nyn703k9p9c7wwy6npq7xd9mczmmlhyn0gn2v2wz0f88spjxs";
configureFlags = [ "--enable-igbinary" ];
makeFlags = [ "phpincludedir=$(dev)/include" ];
outputs = [ "out" "dev" ];
}; };
imagick = buildPecl { imagick = buildPecl rec {
name = "imagick-3.4.3"; version = "3.4.3";
pname = "imagick";
sha256 = "0z2nc92xfc5axa9f2dy95rmsd2c81q8cs1pm4anh0a50x9g5ng0z"; sha256 = "0z2nc92xfc5axa9f2dy95rmsd2c81q8cs1pm4anh0a50x9g5ng0z";
configureFlags = [ "--with-imagick=${pkgs.imagemagick.dev}" ]; configureFlags = [ "--with-imagick=${pkgs.imagemagick.dev}" ];
nativeBuildInputs = [ pkgs.pkgconfig ]; nativeBuildInputs = [ pkgs.pkgconfig ];
buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ]; buildInputs = [ (if isPhp73 then pkgs.pcre2 else pkgs.pcre) ];
}; };
mailparse = assert !isPhp73; buildPecl { mailparse = assert !isPhp73; buildPecl rec {
name = "mailparse-3.0.2"; version = "3.0.2";
pname = "mailparse";
sha256 = "0fw447ralqihsjnn0fm2hkaj8343cvb90v0d1wfclgz49256y6nq"; sha256 = "0fw447ralqihsjnn0fm2hkaj8343cvb90v0d1wfclgz49256y6nq";
}; };
memcached = buildPecl rec { memcached = buildPecl rec {
version = "3.1.3"; version = "3.1.3";
name = "memcached-${version}"; pname = "memcached";
src = fetchgit { src = fetchgit {
url = "https://github.com/php-memcached-dev/php-memcached"; url = "https://github.com/php-memcached-dev/php-memcached";
@ -175,27 +185,34 @@ let
}; };
oci8 = buildPecl rec { oci8 = buildPecl rec {
name = "oci8-2.1.8"; version = "2.1.8";
pname = "oci8";
sha256 = "1bp6fss2f2qmd5bdk7x22j8vx5qivrdhz4x7csf29vjgj6gvchxy"; sha256 = "1bp6fss2f2qmd5bdk7x22j8vx5qivrdhz4x7csf29vjgj6gvchxy";
buildInputs = [ pkgs.re2c pkgs.oracle-instantclient ]; buildInputs = [ pkgs.re2c pkgs.oracle-instantclient ];
configureFlags = [ "--with-oci8=shared,instantclient,${pkgs.oracle-instantclient}/lib" ]; configureFlags = [ "--with-oci8=shared,instantclient,${pkgs.oracle-instantclient}/lib" ];
}; };
pcs = buildPecl rec { pcs = buildPecl rec {
name = "pcs-1.3.3"; version = "1.3.3";
pname = "pcs";
sha256 = "0d4p1gpl8gkzdiv860qzxfz250ryf0wmjgyc8qcaaqgkdyh5jy5p"; sha256 = "0d4p1gpl8gkzdiv860qzxfz250ryf0wmjgyc8qcaaqgkdyh5jy5p";
}; };
pdo_sqlsrv = buildPecl rec { pdo_sqlsrv = buildPecl rec {
name = "pdo_sqlsrv-5.6.1"; version = "5.6.1";
pname = "pdo_sqlsrv";
sha256 = "02ill1iqffa5fha9iz4y91823scml24ikfk8pn90jyycfwv07x6a"; sha256 = "02ill1iqffa5fha9iz4y91823scml24ikfk8pn90jyycfwv07x6a";
buildInputs = [ pkgs.unixODBC ]; buildInputs = [ pkgs.unixODBC ];
}; };
php-cs-fixer = pkgs.stdenv.mkDerivation rec { php-cs-fixer = pkgs.stdenv.mkDerivation rec {
name = "php-cs-fixer-${version}";
version = "2.14.0"; version = "2.14.0";
pname = "php-cs-fixer";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar"; url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
@ -221,8 +238,8 @@ let
}; };
php-parallel-lint = pkgs.stdenv.mkDerivation rec { php-parallel-lint = pkgs.stdenv.mkDerivation rec {
name = "php-parallel-lint-${version}";
version = "1.0.0"; version = "1.0.0";
pname = "php-parallel-lint";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "JakubOnderka"; owner = "JakubOnderka";
@ -254,8 +271,8 @@ let
}; };
php_excel = buildPecl rec { php_excel = buildPecl rec {
name = "php_excel-${version}";
version = "1.0.2"; version = "1.0.2";
pname = "php_excel";
phpVersion = "php7"; phpVersion = "php7";
buildInputs = [ pkgs.libxl ]; buildInputs = [ pkgs.libxl ];
@ -269,8 +286,8 @@ let
}; };
phpcbf = pkgs.stdenv.mkDerivation rec { phpcbf = pkgs.stdenv.mkDerivation rec {
pname = "phpcbf";
version = "3.4.1"; version = "3.4.1";
pname = "phpcbf";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcbf.phar"; url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcbf.phar";
@ -296,8 +313,8 @@ let
}; };
phpcs = pkgs.stdenv.mkDerivation rec { phpcs = pkgs.stdenv.mkDerivation rec {
pname = "phpcs";
version = "3.4.1"; version = "3.4.1";
pname = "phpcs";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar"; url = "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${version}/phpcs.phar";
@ -323,8 +340,8 @@ let
}; };
phpstan = pkgs.stdenv.mkDerivation rec { phpstan = pkgs.stdenv.mkDerivation rec {
pname = "phpstan";
version = "0.11.5"; version = "0.11.5";
pname = "phpstan";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar"; url = "https://github.com/phpstan/phpstan/releases/download/${version}/phpstan.phar";
@ -357,8 +374,8 @@ let
}; };
psysh = pkgs.stdenv.mkDerivation rec { psysh = pkgs.stdenv.mkDerivation rec {
name = "psysh-${version}";
version = "0.9.8"; version = "0.9.8";
pname = "psysh";
src = pkgs.fetchurl { src = pkgs.fetchurl {
url = "https://github.com/bobthecow/psysh/releases/download/v${version}/psysh-v${version}.tar.gz"; url = "https://github.com/bobthecow/psysh/releases/download/v${version}/psysh-v${version}.tar.gz";
@ -382,26 +399,34 @@ let
}; };
}; };
pthreads = assert (pkgs.config.php.zts or false); buildPecl { pthreads = assert (pkgs.config.php.zts or false); buildPecl rec {
name = "pthreads-3.1.5"; version = "3.1.5";
pname = "pthreads";
sha256 = "1ziap0py3zrc7qj9lw4nzq6wx1viyj8v9y1babchizzan014x6p5"; sha256 = "1ziap0py3zrc7qj9lw4nzq6wx1viyj8v9y1babchizzan014x6p5";
meta.broken = true; meta.broken = true;
}; };
redis = buildPecl { redis = buildPecl rec {
name = "redis-4.2.0"; version = "4.2.0";
pname = "redis";
sha256 = "105k2rfz97svrqzdhd0a0668mn71c8v0j7hks95832fsvn5dhmbn"; sha256 = "105k2rfz97svrqzdhd0a0668mn71c8v0j7hks95832fsvn5dhmbn";
}; };
sqlsrv = buildPecl rec { sqlsrv = buildPecl rec {
name = "sqlsrv-5.6.1"; version = "5.6.1";
pname = "sqlsrv";
sha256 = "0ial621zxn9zvjh7k1h755sm2lc9aafc389yxksqcxcmm7kqmd0a"; sha256 = "0ial621zxn9zvjh7k1h755sm2lc9aafc389yxksqcxcmm7kqmd0a";
buildInputs = [ pkgs.unixODBC ]; buildInputs = [ pkgs.unixODBC ];
}; };
v8 = buildPecl rec { v8 = buildPecl rec {
version = "0.2.2"; version = "0.2.2";
name = "v8-${version}"; pname = "v8";
sha256 = "103nys7zkpi1hifqp9miyl0m1mn07xqshw3sapyz365nb35g5q71"; sha256 = "103nys7zkpi1hifqp9miyl0m1mn07xqshw3sapyz365nb35g5q71";
@ -411,7 +436,7 @@ let
v8js = assert !isPhp73; buildPecl rec { v8js = assert !isPhp73; buildPecl rec {
version = "2.1.0"; version = "2.1.0";
name = "v8js-${version}"; pname = "v8js";
sha256 = "0g63dyhhicngbgqg34wl91nm3556vzdgkq19gy52gvmqj47rj6rg"; sha256 = "0g63dyhhicngbgqg34wl91nm3556vzdgkq19gy52gvmqj47rj6rg";
@ -421,7 +446,7 @@ let
xdebug = buildPecl rec { xdebug = buildPecl rec {
version = "2.7.1"; version = "2.7.1";
name = "xdebug-${version}"; pname = "xdebug";
sha256 = "1hr4gy87a3gp682ggwp831xk1fxasil9wan8cxv23q3m752x3sdp"; sha256 = "1hr4gy87a3gp682ggwp831xk1fxasil9wan8cxv23q3m752x3sdp";
@ -429,8 +454,9 @@ let
checkTarget = "test"; checkTarget = "test";
}; };
yaml = buildPecl { yaml = buildPecl rec {
name = "yaml-2.0.4"; version = "2.0.4";
pname = "yaml";
sha256 = "1036zhc5yskdfymyk8jhwc34kvkvsn5kaf50336153v4dqwb11lp"; sha256 = "1036zhc5yskdfymyk8jhwc34kvkvsn5kaf50336153v4dqwb11lp";
@ -441,8 +467,9 @@ let
nativeBuildInputs = [ pkgs.pkgconfig ]; nativeBuildInputs = [ pkgs.pkgconfig ];
}; };
zmq = assert !isPhp73; buildPecl { zmq = assert !isPhp73; buildPecl rec {
name = "zmq-1.1.3"; version = "1.1.3";
pname = "zmq";
sha256 = "1kj487vllqj9720vlhfsmv32hs2dy2agp6176mav6ldx31c3g4n4"; sha256 = "1kj487vllqj9720vlhfsmv32hs2dy2agp6176mav6ldx31c3g4n4";