aedi: add configurable temp directory

use it as $TMPDIR via state's environment variables
This commit is contained in:
alexey.lysiuk 2022-08-16 12:25:55 +03:00
parent 041094274f
commit bcec0999de
2 changed files with 8 additions and 0 deletions

View file

@ -51,6 +51,12 @@ class Builder(object):
state.platform = self._platforms[0] state.platform = self._platforms[0]
if arguments.temp_path:
state.temp_path = Path(arguments.temp_path).absolute()
state.environment['TMPDIR'] = str(state.temp_path) + os.sep
os.makedirs(state.temp_path, exist_ok=True)
if arguments.source_path: if arguments.source_path:
state.source_path = Path(arguments.source_path).absolute() state.source_path = Path(arguments.source_path).absolute()
@ -315,6 +321,7 @@ class Builder(object):
help='path to store downloaded and checked out source code') help='path to store downloaded and checked out source code')
group.add_argument('--build-path', metavar='path', help='target build path') group.add_argument('--build-path', metavar='path', help='target build path')
group.add_argument('--output-path', metavar='path', help='output path for main targets') group.add_argument('--output-path', metavar='path', help='output path for main targets')
group.add_argument('--temp-path', metavar='path', help='path to temporary files directory')
group.add_argument('--sdk-path-x64', metavar='path', help='path to macOS SDK for x86_64') group.add_argument('--sdk-path-x64', metavar='path', help='path to macOS SDK for x86_64')
group.add_argument('--sdk-path-arm', metavar='path', help='path to macOS SDK for ARM64') group.add_argument('--sdk-path-arm', metavar='path', help='path to macOS SDK for ARM64')
group.add_argument('--os-version-x64', metavar='version', help='macOS deployment version for x86_64') group.add_argument('--os-version-x64', metavar='version', help='macOS deployment version for x86_64')

View file

@ -40,6 +40,7 @@ class BuildState:
self.lib_path = self.prefix_path / 'lib' self.lib_path = self.prefix_path / 'lib'
self.patch_path = self.root_path / 'patch' self.patch_path = self.root_path / 'patch'
self.source_path = self.root_path / 'source' self.source_path = self.root_path / 'source'
self.temp_path = self.root_path / 'temp'
self.source = Path() self.source = Path()
self.external_source = True self.external_source = True