Unverified Commit 8d17fb2b authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #273378 from shyim/frankenphp-extension-support

frankenphp: fix php extensions loading
parents 3fc9b986 6cf771c1
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
, frankenphp
, darwin
, pkg-config
, makeBinaryWrapper
, runCommand
, writeText
}:
@@ -41,7 +42,7 @@ in buildGoModule rec {
  vendorHash = "sha256-Lgj/pFtSQIgjrycajJ1zNY3ytvArmuk0E3IjsAzsNdM=";

  buildInputs = [ phpUnwrapped ] ++ phpUnwrapped.buildInputs;
  nativeBuildInputs = lib.optionals stdenv.isDarwin [ pkg-config darwin.cctools darwin.autoSignDarwinBinariesHook ];
  nativeBuildInputs = [ makeBinaryWrapper ] ++ lib.optionals stdenv.isDarwin [ pkg-config darwin.cctools darwin.autoSignDarwinBinariesHook ];

  subPackages = [ "frankenphp" ];

@@ -63,10 +64,13 @@ in buildGoModule rec {
    # 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"
  preFixup = ''
    mkdir -p $out/lib
    ln -s "${phpEmbedWithZts}/lib/php.ini" "$out/lib/php.ini"

    wrapProgram $out/bin/frankenphp --set-default PHP_INI_SCAN_DIR $out/lib
  '';

  doCheck = false;
+1 −0
Original line number Diff line number Diff line
@@ -476,6 +476,7 @@ lib.makeScope pkgs.newScope (self: with self; {
            lib.optional
              (!stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind)
              valgrind.dev;
          configureFlags = lib.optional php.ztsSupport "--disable-opcache-jit";
          zendExtension = true;
          postPatch = lib.optionalString stdenv.isDarwin ''
            # Tests are flaky on darwin