ports/devel/electron4/files/patch-build_toolchain_get__concurrent__links.py
Luca Pizzamiglio 2f40d531c4 devel/electron4: Add electron 4.2.2
Finally, after a long wait, an electron port for FreeBSD lands in the
portstree.

A huge thanks to everyone contributed to this huge effort and to the
maintainer that is willing to take the burden of the maintainership!
2019-05-28 09:12:02 +00:00

17 lines
705 B
Python

--- build/toolchain/get_concurrent_links.py.orig 2019-03-15 06:25:28 UTC
+++ build/toolchain/get_concurrent_links.py
@@ -46,6 +46,14 @@ def _GetTotalMemoryInBytes():
return int(subprocess.check_output(['sysctl', '-n', 'hw.memsize']))
except Exception:
return 0
+ elif sys.platform.startswith('freebsd'):
+ try:
+ avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.physmem']))
+ # With -fuse-lld it doesn't take a lot of ram, feel free to change that
+ # 1 * ... to needed amount
+ return max(1, avail_bytes / (1 * (2 ** 30))) # total / 4GB
+ except Exception:
+ return 1
# TODO(scottmg): Implement this for other platforms.
return 0