Add support for handling Makefiles using cargo

In cases where cargo_vendoring is used for a Makefile, add the cargo
config.toml snippet for vendoring usage.

Signed-off-by: William Douglas <william.douglas@intel.com>
This commit is contained in:
William Douglas
2023-03-27 09:59:34 -07:00
committed by William Douglas
parent dbfbd6e3f1
commit 3b88151806
+6
View File
@@ -381,6 +381,12 @@ class Specfile(object):
def write_make_line(self, build32=False):
"""Write make line to spec file."""
if self.config.config_opts['cargo_vendor']:
self._write_strip("mkdir -p .cargo")
self._write_strip("echo '[source.crates-io]' >> .cargo/config.toml")
self._write_strip("""echo 'replace-with = "vendored-sources"' >> .cargo/config.toml""")
self._write_strip("echo '[source.vendored-sources]' >> .cargo/config.toml")
self._write_strip("""echo 'directory = "vendor"' >> .cargo/config.toml""")
if self.config.make_prepend:
self._write_strip("## make_prepend content")
for line in self.config.make_prepend: