zfs-replicate: patch path to lz4 binary

This commit is contained in:
Gaetan Lepage
2025-01-02 15:35:19 +01:00
parent d70411a127
commit c86bb0aba1
+10
View File
@@ -2,6 +2,7 @@
lib,
python3Packages,
fetchFromGitHub,
lz4,
}:
python3Packages.buildPythonApplication rec {
@@ -16,6 +17,15 @@ python3Packages.buildPythonApplication rec {
hash = "sha256-VajMSoFZ4SQXpuF1Lo6S9IhxvspCfUwpNw5zg16uA3M=";
};
# For compression to work, both local and remote systems must have lz4 installed.
# This hard codes the path to the lz4 when running it on the local system.
postPatch = ''
substituteInPlace zfs/replicate/compress/command.py \
--replace-fail \
'("/usr/bin/env - lz4 | ", "/usr/bin/env - lz4 -d | ")' \
'("${lib.getExe lz4} | ", "/usr/bin/env - lz4 -d | ")'
'';
build-system = with python3Packages; [
poetry-core
];