Skip to content

Commit 1e5acf6

Browse files
committed
php-master: Work around build failures on PHP 7.4 development versions
1 parent ce5896f commit 1e5acf6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pkgs/phps.nix

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,30 @@ let
5959
# phar extension’s build system expects hash or it will degrade.
6060
"--enable-hash"
6161
];
62+
63+
preConfigure =
64+
attrs.preConfigure
65+
+ prev.lib.optionalString (prev.lib.versionOlder args.version "7.4" || prev.lib.hasPrefix "7.4.0.pre" args.version) ''
66+
# Workaround “configure: error: Your system does not support systemd.”
67+
# caused by PHP build system expecting PKG_CONFIG variable to contain
68+
# an absolute path on PHP ≤ 7.4.
69+
# `generic.nix` works arounds this by patching the checks but only on PHP < 7.4
70+
# but this is also issue on PHP 7.4 development versions.
71+
# https://github.com/NixOS/nixpkgs/pull/90249
72+
for i in $(find . -type f -name "*.m4"); do
73+
substituteInPlace $i \
74+
--replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
75+
done
76+
''
77+
+ prev.lib.optionalString (prev.lib.hasPrefix "7.4.0.pre" args.version) ''
78+
# Workaround IFS='.' misinteracting with unquoted Nix store path
79+
# containing a period.
80+
# https://bugs.php.net/bug.php?id=78788
81+
# Introduced in 7.4.0RC1, fixed in 7.4.0RC6.
82+
# https://github.com/php/php-src/commit/afd52f9d9986d92dd0c63832a07ab1a16bf11d53
83+
# https://github.com/php/php-src/pull/4891
84+
substituteInPlace configure.ac --replace 'echo AC_PACKAGE_VERSION | $SED' 'echo AC_PACKAGE_VERSION | "''${SED}"'
85+
'';
6286
};
6387

6488
versionSpecificOverrides = args.phpAttrsOverrides or (attrs: { });

0 commit comments

Comments
 (0)