Skip to content

Commit 202605d

Browse files
committed
fix(php72): fix builds on php<=7.2 for darwin
1 parent 7e53d72 commit 202605d

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

pkgs/php/7.3.nix

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ let
1313
url = "https://github.com/NixOS/nixpkgs/raw/42e9a2ccfab2a96d28c3c164a6cf41fb6f769de5/pkgs/development/interpreters/php/php73-darwin-isfinite.patch";
1414
sha256 = "V0mLLmXa2qJyxIVW/7nEml6cXZTBbr42kkJiij9KPyk=";
1515
})
16-
# Handle macos versions that don't start with 10.* in libtool.
17-
# https://github.com/php/php-src/commit/d016434ad33284dfaceb8d233351d34356566d7d
18-
(prev.pkgs.fetchpatch2 {
19-
url = "https://github.com/php/php-src/commit/d016434ad33284dfaceb8d233351d34356566d7d.patch";
20-
sha256 = "sha256-x0vEcoXNFeQi3re1TrK/Np9AH5dy3wf95xM08xCyGE0=";
21-
includes = [
22-
"build/libtool.m4"
23-
];
24-
})
2516
];
2617
};
2718
in

pkgs/phps.nix

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ let
3333
url = "https://bugs.php.net/patch-display.php?bug_id=76826&patch=bug76826.poc.0.patch&revision=1538723399&download=1";
3434
sha256 = "aW+MW9Kb8N/yBO7MdqZMZzgMSF7b+IMLulJKgKPWrUA=";
3535
})
36+
]
37+
++ prev.lib.optionals (prev.lib.versionOlder args.version "7.4" && prev.stdenv.isDarwin) [
38+
# Handle macos versions that don't start with 10.* in libtool.
39+
# https://github.com/php/php-src/commit/d016434ad33284dfaceb8d233351d34356566d7d
40+
(prev.pkgs.fetchpatch2 {
41+
url = "https://github.com/php/php-src/commit/d016434ad33284dfaceb8d233351d34356566d7d.patch";
42+
sha256 = "sha256-x0vEcoXNFeQi3re1TrK/Np9AH5dy3wf95xM08xCyGE0=";
43+
includes = [
44+
"build/libtool.m4"
45+
];
46+
})
3647
];
3748

3849
configureFlags =
@@ -43,9 +54,14 @@ let
4354

4455
"--enable-libxml"
4556
"--with-libxml-dir=${prev.libxml2.dev}"
57+
(
58+
if prev.lib.versionAtLeast args.version "7.3"
59+
then "--with-pcre-regex=${prev.pcre2.dev}"
60+
else "--with-pcre-regex=${prev.pcre.dev}"
61+
)
4662
]
47-
++ prev.lib.optionals (prev.lib.versionAtLeast args.version "7.3") [
48-
"--with-pcre-regex=${prev.pcre2.dev}"
63+
++ prev.lib.optionals (prev.lib.versionOlder args.version "7.3") [
64+
"PCRE_LIBDIR=${prev.pcre}"
4965
];
5066

5167
buildInputs =

0 commit comments

Comments
 (0)