Skip to content

Commit c261e73

Browse files
authored
Merge pull request #156 from anuejn/macos-arm-builder
add support for using builder.py under macos-arm
2 parents 0f02935 + 55f2c31 commit c261e73

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ ARM64 based Linux devices using 64bit CPU as in Raspberry Pi 4,5 and 400 (with 6
149149

150150
## Contributing
151151

152-
To be able to build OSS CAD Suite yourself, you need to install `docker` (please note this only works on x64 platforms) and `python 3.6` or higher, with the `click` library.
152+
To be able to build OSS CAD Suite yourself, you need to install `docker` (please note this only works on x64 platforms or under rosetta on macos-arm) and `python 3.6` or higher, with the `click` library.
153153

154154

155155
After that just running ```./builder.py``` should work fine.

src/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ def executeBuild(target, arch, prefix, build_dir, output_dir, nproc, pack_source
419419
'-v', '{}:/work'.format(cwd),
420420
'-w', os.path.join('/work', os.path.relpath(build_dir, os.getcwd())),
421421
]
422+
423+
if not scriptfile.name.startswith("/tmp"):
424+
params += ['-v', f'{scriptfile.name}:{scriptfile.name}']
425+
if platform.system() == "Darwin" and platform.processor() == "arm":
426+
params += ['--platform', 'linux/amd64']
427+
422428
for i, j in env.items():
423429
if i.endswith('_DIR'):
424430
params += ['-e', '{}={}'.format(i, os.path.join('/work', os.path.relpath(j, os.getcwd())))]

0 commit comments

Comments
 (0)