Merge pull request #271678 from shyim/frankenphp-darwin-support
frankenphp: add darwin support
This commit is contained in:
commit
17a63a0abc
2 changed files with 24 additions and 5 deletions
|
@ -5,6 +5,8 @@
|
||||||
, php
|
, php
|
||||||
, testers
|
, testers
|
||||||
, frankenphp
|
, frankenphp
|
||||||
|
, darwin
|
||||||
|
, pkg-config
|
||||||
, runCommand
|
, runCommand
|
||||||
, writeText
|
, writeText
|
||||||
}:
|
}:
|
||||||
|
@ -13,6 +15,9 @@ let
|
||||||
phpEmbedWithZts = php.override {
|
phpEmbedWithZts = php.override {
|
||||||
embedSupport = true;
|
embedSupport = true;
|
||||||
ztsSupport = true;
|
ztsSupport = true;
|
||||||
|
staticSupport = stdenv.isDarwin;
|
||||||
|
zendSignalsSupport = false;
|
||||||
|
zendMaxExecutionTimersSupport = stdenv.isLinux;
|
||||||
};
|
};
|
||||||
phpUnwrapped = phpEmbedWithZts.unwrapped;
|
phpUnwrapped = phpEmbedWithZts.unwrapped;
|
||||||
phpConfig = "${phpUnwrapped.dev}/bin/php-config";
|
phpConfig = "${phpUnwrapped.dev}/bin/php-config";
|
||||||
|
@ -36,6 +41,7 @@ in buildGoModule rec {
|
||||||
vendorHash = "sha256-Lgj/pFtSQIgjrycajJ1zNY3ytvArmuk0E3IjsAzsNdM=";
|
vendorHash = "sha256-Lgj/pFtSQIgjrycajJ1zNY3ytvArmuk0E3IjsAzsNdM=";
|
||||||
|
|
||||||
buildInputs = [ phpUnwrapped ] ++ phpUnwrapped.buildInputs;
|
buildInputs = [ phpUnwrapped ] ++ phpUnwrapped.buildInputs;
|
||||||
|
nativeBuildInputs = lib.optionals stdenv.isDarwin [ pkg-config darwin.cctools darwin.autoSignDarwinBinariesHook ];
|
||||||
|
|
||||||
subPackages = [ "frankenphp" ];
|
subPackages = [ "frankenphp" ];
|
||||||
|
|
||||||
|
@ -52,7 +58,15 @@ in buildGoModule rec {
|
||||||
export CGO_CFLAGS="$(${phpConfig} --includes)"
|
export CGO_CFLAGS="$(${phpConfig} --includes)"
|
||||||
export CGO_LDFLAGS="-DFRANKENPHP_VERSION=${version} \
|
export CGO_LDFLAGS="-DFRANKENPHP_VERSION=${version} \
|
||||||
$(${phpConfig} --ldflags) \
|
$(${phpConfig} --ldflags) \
|
||||||
-Wl,--start-group $(${phpConfig} --libs) -Wl,--end-group"
|
$(${phpConfig} --libs)"
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
# replace hard-code homebrew path
|
||||||
|
substituteInPlace ../frankenphp.go \
|
||||||
|
--replace "-L/opt/homebrew/opt/libiconv/lib" "-L${darwin.libiconv}/lib"
|
||||||
|
|
||||||
|
# remove when https://github.com/dunglas/frankenphp/pull/331 is merged and released
|
||||||
|
substituteInPlace ../frankenphp.go \
|
||||||
|
--replace "darwin pkg-config: libxml-2.0 sqlite3" "darwin pkg-config: libxml-2.0"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
@ -82,7 +96,7 @@ in buildGoModule rec {
|
||||||
homepage = "https://github.com/dunglas/frankenphp";
|
homepage = "https://github.com/dunglas/frankenphp";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
mainProgram = "frankenphp";
|
mainProgram = "frankenphp";
|
||||||
maintainers = with maintainers; [ gaelreyrol ];
|
maintainers = with maintainers; [ gaelreyrol shyim ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,10 @@ let
|
||||||
, argon2Support ? true
|
, argon2Support ? true
|
||||||
, cgotoSupport ? false
|
, cgotoSupport ? false
|
||||||
, embedSupport ? false
|
, embedSupport ? false
|
||||||
|
, staticSupport ? false
|
||||||
, ipv6Support ? true
|
, ipv6Support ? true
|
||||||
|
, zendSignalsSupport ? true
|
||||||
|
, zendMaxExecutionTimersSupport ? false
|
||||||
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
|
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
|
||||||
, valgrindSupport ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
|
, valgrindSupport ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind
|
||||||
, ztsSupport ? apxs2Support
|
, ztsSupport ? apxs2Support
|
||||||
|
@ -236,7 +239,6 @@ let
|
||||||
# PCRE
|
# PCRE
|
||||||
++ [ "--with-external-pcre=${pcre2.dev}" ]
|
++ [ "--with-external-pcre=${pcre2.dev}" ]
|
||||||
|
|
||||||
|
|
||||||
# Enable sapis
|
# Enable sapis
|
||||||
++ lib.optional (!cgiSupport) "--disable-cgi"
|
++ lib.optional (!cgiSupport) "--disable-cgi"
|
||||||
++ lib.optional (!cliSupport) "--disable-cli"
|
++ lib.optional (!cliSupport) "--disable-cli"
|
||||||
|
@ -250,11 +252,14 @@ let
|
||||||
++ lib.optional apxs2Support "--with-apxs2=${apacheHttpd.dev}/bin/apxs"
|
++ lib.optional apxs2Support "--with-apxs2=${apacheHttpd.dev}/bin/apxs"
|
||||||
++ lib.optional argon2Support "--with-password-argon2=${libargon2}"
|
++ lib.optional argon2Support "--with-password-argon2=${libargon2}"
|
||||||
++ lib.optional cgotoSupport "--enable-re2c-cgoto"
|
++ lib.optional cgotoSupport "--enable-re2c-cgoto"
|
||||||
++ lib.optional embedSupport "--enable-embed"
|
++ lib.optional embedSupport "--enable-embed${lib.optionalString staticSupport "=static"}"
|
||||||
++ lib.optional (!ipv6Support) "--disable-ipv6"
|
++ lib.optional (!ipv6Support) "--disable-ipv6"
|
||||||
++ lib.optional systemdSupport "--with-fpm-systemd"
|
++ lib.optional systemdSupport "--with-fpm-systemd"
|
||||||
++ lib.optional valgrindSupport "--with-valgrind=${valgrind.dev}"
|
++ lib.optional valgrindSupport "--with-valgrind=${valgrind.dev}"
|
||||||
++ lib.optional ztsSupport "--enable-zts"
|
++ lib.optional ztsSupport "--enable-zts"
|
||||||
|
++ lib.optional staticSupport "--enable-static"
|
||||||
|
++ lib.optional (!zendSignalsSupport) ["--disable-zend-signals"]
|
||||||
|
++ lib.optional zendMaxExecutionTimersSupport "--enable-zend-max-execution-timers"
|
||||||
|
|
||||||
|
|
||||||
# Sendmail
|
# Sendmail
|
||||||
|
|
Loading…
Reference in a new issue