3
0
Fork 0
forked from mirrors/nixpkgs

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:
Marc Weber 2010-01-06 17:04:38 +00:00
parent 4220742818
commit 900a1c22a4
4 changed files with 87 additions and 36 deletions

View 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;
};
}

View 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
''

View file

@ -106,13 +106,6 @@ composableDerivation {} ( fixed : {
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 = {
@ -130,14 +123,13 @@ composableDerivation {} ( fixed : {
soapSupport = getConfig ["php" "soap"] true;
zlibSupport = getConfig ["php" "zlib"] true;
opensslSupport = getConfig ["php" "openssl"] true;
xdebugSupport = getConfig ["php" "xdebug"] false;
mbstringSupport = getConfig ["php" "mbstring"] true;
gdSupport = getConfig ["php" "gd"] true;
};
# only -O1
configurePhase = ''
iniFile=$out/etc/$name.ini
iniFile=$out/etc/php-recommended.ini
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
echo configurePhase end
@ -147,32 +139,6 @@ composableDerivation {} ( fixed : {
installPhase = ''
unset installPhase; installPhase;
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 {

View file

@ -2339,13 +2339,21 @@ let
if stdenv.isDarwin then null else unixODBC;
};
php = import ../development/interpreters/php_configurable {
php = makeOverridable (import ../development/interpreters/php_configurable) {
inherit
stdenv fetchurl lib composableDerivation autoconf automake
flex bison apacheHttpd mysql libxml2 # gettext
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) {
inherit cairo fontconfig freetype libjpeg libpng openssl
perl mesa zlib which;