Skip to content

Commit

Permalink
Only patch if file exists
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Nov 7, 2023
1 parent ac98472 commit 6ee1754
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions relenv/build/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
The linux build process.
"""
import pathlib
import tempfile
from .common import *
from ..common import arches, LINUX
Expand Down Expand Up @@ -341,14 +342,18 @@ def build_python(env, dirs, logfp):
]
)

with tempfile.NamedTemporaryFile(
node="w", suffix="_patch", delete_on_close=False
) as patch_file:
patch_file.write(PATCH)
patch_file.close()
runcmd(
["patch", "-p0", "-i", patch_file.name], env=env, stderr=logfp, stdout=logfp
)
if pathlib.Path("setup.py").exists():
with tempfile.NamedTemporaryFile(
node="w", suffix="_patch", delete_on_close=False
) as patch_file:
patch_file.write(PATCH)
patch_file.close()
runcmd(
["patch", "-p0", "-i", patch_file.name],
env=env,
stderr=logfp,
stdout=logfp,
)

env["PKG_CONFIG_PATH"] = f"{dirs.prefix}/lib/pkgconfig"
env["OPENSSL_CFLAGS"] = f"-I{dirs.prefix}/include -Wno-coverage-mismatch"
Expand Down

0 comments on commit 6ee1754

Please sign in to comment.