From 1266884f58ad1433714a9b956597b43105c5f3d1 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 31 May 2021 11:42:12 +0300 Subject: [PATCH] aedi: force common variables in .pc files exec_prefix, includedir, libdir should no longer contain full paths --- aedi/target/base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aedi/target/base.py b/aedi/target/base.py index 5ecbb1d3..ebb1c8c2 100644 --- a/aedi/target/base.py +++ b/aedi/target/base.py @@ -159,6 +159,9 @@ class BuildTarget(Target): @staticmethod def update_pc_file(path: str, processor: typing.Callable = None): prefix = 'prefix=' + exec_prefix = 'exec_prefix=' + includedir = 'includedir=' + libdir = 'libdir=' def pc_proc(line: str) -> str: patched_line = line @@ -166,6 +169,12 @@ class BuildTarget(Target): if line.startswith(prefix): # Clear prefix variable patched_line = prefix + os.linesep + elif line.startswith(exec_prefix): + patched_line = exec_prefix + '${prefix}\n' + elif line.startswith(includedir): + patched_line = includedir + '${prefix}/include\n' + elif line.startswith(libdir): + patched_line = libdir + '${exec_prefix}/lib\n' if processor: patched_line = processor(path, patched_line)