mirror of
https://github.com/clearlinux/autospec.git
synced 2026-06-16 02:45:56 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b858a2a990 | |||
| 43d564b0b7 |
@@ -68,6 +68,7 @@ class Config(object):
|
||||
|
||||
def __init__(self, download_path):
|
||||
"""Initialize Default configuration settings."""
|
||||
self.cargo_vendors = ""
|
||||
self.content = None # hack to avoid circular init dependency
|
||||
self.extra_configure = ""
|
||||
self.extra_configure32 = ""
|
||||
@@ -448,6 +449,8 @@ class Config(object):
|
||||
|
||||
# default lto to true for new things
|
||||
config_f['autospec']['use_lto'] = 'true'
|
||||
# default autoupdate to true for new things
|
||||
config_f['autospec']['autoupdate'] = 'true'
|
||||
|
||||
# renamed options need special care
|
||||
skip_path = os.path.join(self.download_path, "skip_test_suite")
|
||||
@@ -989,6 +992,11 @@ class Config(object):
|
||||
if not license.add_license(word, self.license_translations, self.license_blacklist):
|
||||
print_warning("{}: blacklisted license {} ignored.".format(self.content.name + ".license", word))
|
||||
|
||||
# cargo_vendors is the output of 'cargo vendor' and should be read as is
|
||||
content = self.read_file(os.path.join(self.download_path, "cargo_vendors"), track=True)
|
||||
if content:
|
||||
self.cargo_vendors = "".join(content)
|
||||
|
||||
if self.config_opts['use_clang']:
|
||||
self.config_opts['funroll-loops'] = False
|
||||
requirements.add_buildreq("llvm")
|
||||
|
||||
@@ -509,14 +509,11 @@ class Specfile(object):
|
||||
self.apply_patches()
|
||||
|
||||
# setup cargo.toml vendoring if needed
|
||||
if self.config.config_opts['cargo_vendor']:
|
||||
if self.config.cargo_vendors:
|
||||
if self.config.subdir:
|
||||
self._write_strip("pushd " + self.config.subdir)
|
||||
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""")
|
||||
self._write_strip(f"echo '{self.config.cargo_vendors}' >> .cargo/config.toml")
|
||||
if self.config.subdir:
|
||||
self._write_strip("popd")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user