patch with perl

This commit is contained in:
Gregor Lohaus
2026-05-28 22:09:45 +02:00
parent ee127fd006
commit 6e4ddbf9df

View File

@@ -44,8 +44,13 @@
# Gluon Substrate hardcodes /usr/bin/pkg-config. Keep the # Gluon Substrate hardcodes /usr/bin/pkg-config. Keep the
# replacement string the same byte length to avoid rewriting # replacement string the same byte length to avoid rewriting
# the Java class constant pool structure. # the Java class constant pool structure.
substituteInPlace com/gluonhq/substrate/util/linux/LinuxLinkerFlags.class \ perl -0pi -e 's|/usr/bin/pkg-config|/tmp/nix/pkg-config|g' \
--replace-fail "/usr/bin/pkg-config" "/tmp/nix/pkg-config" com/gluonhq/substrate/util/linux/LinuxLinkerFlags.class
if grep -a -q "/usr/bin/pkg-config" com/gluonhq/substrate/util/linux/LinuxLinkerFlags.class; then
echo "Failed to patch hardcoded pkg-config path in Substrate" >&2
exit 1
fi
zip -qr "$out" . zip -qr "$out" .
''; '';