You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
937 B
43 lines
937 B
{pkgs ? import <nixpkgs> {
|
|
inherit system;
|
|
},
|
|
system ? builtins.currentSystem,
|
|
noDev ? false,
|
|
stdExts ? [],
|
|
zendExts ? []
|
|
}:
|
|
|
|
let
|
|
|
|
stdenv = pkgs.stdenv;
|
|
|
|
stdExtConcat = builtins.concatStringsSep " " stdExts;
|
|
zendExtConcat = builtins.concatStringsSep " " zendExts;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
phpExtScript = ''
|
|
#!/usr/bin/env bash
|
|
echo '; This file has been auto-generated by php-exts/default.nix'
|
|
for d in ${zendExtConcat} ; do
|
|
for f in $d/lib/php/extensions/*.so ; do
|
|
echo "zend_extension=$f"
|
|
done
|
|
done
|
|
|
|
for d in ${stdExtConcat} ; do
|
|
for f in $d/lib/php/extensions/*.so ; do
|
|
echo "extension=$f"
|
|
done
|
|
done
|
|
'';
|
|
|
|
name = "php-exts";
|
|
buildInputs = zendExts ++ stdExts;
|
|
buildCommand = ''
|
|
mkdir -p $out/bin
|
|
echo "$phpExtScript" > $out/bin/php-exts
|
|
chmod +x $out/bin/php-exts
|
|
'';
|
|
|
|
}
|