mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-01-19 14:40:52 +00:00
build script: extent .pc file update with additional processor
This commit is contained in:
parent
5ed71bf57a
commit
eea854fe3e
1 changed files with 8 additions and 3 deletions
11
build.py
11
build.py
|
@ -156,14 +156,19 @@ class Target(BaseTarget):
|
|||
f.writelines(patched_content)
|
||||
|
||||
@staticmethod
|
||||
def update_prefix_shell_script(path: str):
|
||||
def update_prefix_shell_script(path: str, processor: typing.Callable = None):
|
||||
prefix = 'prefix='
|
||||
|
||||
def update_prefix(line: str) -> str:
|
||||
if line.startswith(prefix):
|
||||
return prefix + r'"$(cd "${0%/*}/.."; pwd)"' + os.linesep
|
||||
patched_line = prefix + r'"$(cd "${0%/*}/.."; pwd)"' + os.linesep
|
||||
else:
|
||||
patched_line = line
|
||||
|
||||
return line
|
||||
if processor:
|
||||
patched_line = processor(patched_line)
|
||||
|
||||
return patched_line
|
||||
|
||||
Target.update_text_file(path, update_prefix)
|
||||
|
||||
|
|
Loading…
Reference in a new issue