From 6e4ddbf9dff10ef795d1355c9e541dc9703b07d1 Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Thu, 28 May 2026 22:09:45 +0200 Subject: [PATCH] patch with perl --- flake.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index aad7cca..c2ff428 100644 --- a/flake.nix +++ b/flake.nix @@ -44,8 +44,13 @@ # Gluon Substrate hardcodes /usr/bin/pkg-config. Keep the # replacement string the same byte length to avoid rewriting # the Java class constant pool structure. - substituteInPlace com/gluonhq/substrate/util/linux/LinuxLinkerFlags.class \ - --replace-fail "/usr/bin/pkg-config" "/tmp/nix/pkg-config" + perl -0pi -e 's|/usr/bin/pkg-config|/tmp/nix/pkg-config|g' \ + 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" . '';