moving xdebug into its own package. This means you have to specify an additional php.ini file to make php debugger work for command line php.
svn path=/nixpkgs/trunk/; revision=19266
This commit is contained in:
parent
4220742818
commit
900a1c22a4
34
pkgs/development/interpreters/php-xdebug/default.nix
Normal file
34
pkgs/development/interpreters/php-xdebug/default.nix
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
args: with args;
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "php-xdebug";
|
||||||
|
|
||||||
|
src = args.fetchurl {
|
||||||
|
url = "http://xdebug.org/files/xdebug-2.0.5.tgz";
|
||||||
|
sha256 = "1cmq7c36gj8n41mfq1wba5rij8j77yqhydpcsbcysk1zchg68f26";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [php autoconf automake];
|
||||||
|
|
||||||
|
configurePhase = ''
|
||||||
|
phpize
|
||||||
|
./configure --prefix=$out
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
make && make test
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
ensureDir $out/lib/xdebug
|
||||||
|
cp modules/xdebug.so $out/lib
|
||||||
|
cp LICENSE $out/lib/xdebug
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "php debugger and profiler extension";
|
||||||
|
homepage = http://xdebug.org/;
|
||||||
|
license = "xdebug"; # based on PHP-3
|
||||||
|
maintainers = [args.lib.maintainers.marcweber];
|
||||||
|
platforms = args.lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
43
pkgs/development/interpreters/php/ini-bulider.nix
Normal file
43
pkgs/development/interpreters/php/ini-bulider.nix
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{runCommand, php, appendLines ? "", prefixPhpRecommended ? true} :
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
NixOS: see apache-httpd/default.nix's phpIni option
|
||||||
|
|
||||||
|
to enable Xdebug append these lines:
|
||||||
|
''
|
||||||
|
zend_extension="${pkgs.phpXdebug}/lib/xdebug.so"
|
||||||
|
zend_extension_ts="${pkgs.phpXdebug}/lib/xdebug.so"
|
||||||
|
zend_extension_debug="${pkgs.phpXdebug}/lib/xdebug.so"
|
||||||
|
xdebug.remote_enable=true
|
||||||
|
xdebug.remote_host=127.0.0.1
|
||||||
|
xdebug.remote_port=9000
|
||||||
|
xdebug.remote_handler=dbgp
|
||||||
|
xdebug.profiler_enable=0
|
||||||
|
xdebug.profiler_output_dir="/tmp/xdebug"
|
||||||
|
xdebug.remote_mode=req
|
||||||
|
''
|
||||||
|
|
||||||
|
to make php's mail() function work add
|
||||||
|
''
|
||||||
|
; Needed for PHP's mail() function.
|
||||||
|
sendmail_path = sendmail -t -i
|
||||||
|
''
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
runCommand "php.ini"
|
||||||
|
{
|
||||||
|
inherit php appendLines prefixPhpRecommended;
|
||||||
|
}
|
||||||
|
''
|
||||||
|
[ -z "$prefixPhpRecommended" ] || {
|
||||||
|
{
|
||||||
|
echo "# PHP RECOMMENDED INI START"
|
||||||
|
cat $php/etc/php-recommended.ini
|
||||||
|
echo "# PHP RECOMMENDED INI END"
|
||||||
|
} >> $out
|
||||||
|
}
|
||||||
|
echo "$appendLines" >> $out
|
||||||
|
''
|
@ -106,13 +106,6 @@ composableDerivation {} ( fixed : {
|
|||||||
license = "based on the PHP license - as is";
|
license = "based on the PHP license - as is";
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
xdebug = {
|
|
||||||
buildInputs = [ automake autoconf ];
|
|
||||||
xdebug_src = args.fetchurl {
|
|
||||||
url = "http://xdebug.org/files/xdebug-2.0.5.tgz";
|
|
||||||
sha256 = "1cmq7c36gj8n41mfq1wba5rij8j77yqhydpcsbcysk1zchg68f26";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cfg = {
|
cfg = {
|
||||||
@ -130,14 +123,13 @@ composableDerivation {} ( fixed : {
|
|||||||
soapSupport = getConfig ["php" "soap"] true;
|
soapSupport = getConfig ["php" "soap"] true;
|
||||||
zlibSupport = getConfig ["php" "zlib"] true;
|
zlibSupport = getConfig ["php" "zlib"] true;
|
||||||
opensslSupport = getConfig ["php" "openssl"] true;
|
opensslSupport = getConfig ["php" "openssl"] true;
|
||||||
xdebugSupport = getConfig ["php" "xdebug"] false;
|
|
||||||
mbstringSupport = getConfig ["php" "mbstring"] true;
|
mbstringSupport = getConfig ["php" "mbstring"] true;
|
||||||
gdSupport = getConfig ["php" "gd"] true;
|
gdSupport = getConfig ["php" "gd"] true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# only -O1
|
# only -O1
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
iniFile=$out/etc/$name.ini
|
iniFile=$out/etc/php-recommended.ini
|
||||||
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
|
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
|
||||||
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
|
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
|
||||||
echo configurePhase end
|
echo configurePhase end
|
||||||
@ -147,32 +139,6 @@ composableDerivation {} ( fixed : {
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
unset installPhase; installPhase;
|
unset installPhase; installPhase;
|
||||||
cp php.ini-recommended $iniFile
|
cp php.ini-recommended $iniFile
|
||||||
|
|
||||||
# Now Let's build xdebug if flag has been given
|
|
||||||
# TODO I think there are better paths than the given below
|
|
||||||
if [ -n "$xdebug_src" ]; then
|
|
||||||
PATH=$PATH:$out/bin
|
|
||||||
tar xfz $xdebug_src;
|
|
||||||
cd xdebug*
|
|
||||||
phpize
|
|
||||||
./configure --prefix=$out
|
|
||||||
make
|
|
||||||
ensureDir $out/lib; cp modules/xdebug.so $out/lib
|
|
||||||
cat >> $out/etc/php.ini << EOF
|
|
||||||
zend_extension="$out/lib/xdebug.so"
|
|
||||||
zend_extension_ts="$out/lib/xdebug.so"
|
|
||||||
zend_extension_debug="$out/lib/xdebug.so"
|
|
||||||
xdebug.remote_enable=true
|
|
||||||
xdebug.remote_host=127.0.0.1
|
|
||||||
xdebug.remote_port=9000
|
|
||||||
xdebug.remote_handler=dbgp
|
|
||||||
xdebug.profiler_enable=0
|
|
||||||
xdebug.profiler_output_dir="/tmp/xdebug"
|
|
||||||
xdebug.remote_mode=req
|
|
||||||
max_execution_time = 300
|
|
||||||
date.timezone = UTC
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
src = args.fetchurl {
|
src = args.fetchurl {
|
||||||
|
@ -2339,13 +2339,21 @@ let
|
|||||||
if stdenv.isDarwin then null else unixODBC;
|
if stdenv.isDarwin then null else unixODBC;
|
||||||
};
|
};
|
||||||
|
|
||||||
php = import ../development/interpreters/php_configurable {
|
php = makeOverridable (import ../development/interpreters/php_configurable) {
|
||||||
inherit
|
inherit
|
||||||
stdenv fetchurl lib composableDerivation autoconf automake
|
stdenv fetchurl lib composableDerivation autoconf automake
|
||||||
flex bison apacheHttpd mysql libxml2 # gettext
|
flex bison apacheHttpd mysql libxml2 # gettext
|
||||||
zlib curl gd postgresql openssl pkgconfig sqlite getConfig;
|
zlib curl gd postgresql openssl pkgconfig sqlite getConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
phpXdebug = import ../development/interpreters/php-xdebug {
|
||||||
|
inherit stdenv fetchurl php autoconf automake;
|
||||||
|
};
|
||||||
|
|
||||||
|
phpIniBuilder = makeOverridable (import ../development/interpreters/php/ini-bulider.nix) {
|
||||||
|
inherit php runCommand;
|
||||||
|
};
|
||||||
|
|
||||||
pltScheme = builderDefsPackage (import ../development/interpreters/plt-scheme) {
|
pltScheme = builderDefsPackage (import ../development/interpreters/plt-scheme) {
|
||||||
inherit cairo fontconfig freetype libjpeg libpng openssl
|
inherit cairo fontconfig freetype libjpeg libpng openssl
|
||||||
perl mesa zlib which;
|
perl mesa zlib which;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user