summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorRobbert van der Helm2021-01-03 18:18:17 +0100
committerRobbert van der Helm2021-01-03 18:55:04 +0100
commit7b069b0f445df9022193e18e6bd7e0984e45fd28 (patch)
treed065b1917ffe6d88a36424458dd943f7d114f64c /PKGBUILD
parent3a52270b6338e3eac4f7895ed2dba3735bf502ee (diff)
downloadaur-7b069b0f445df9022193e18e6bd7e0984e45fd28.tar.gz
Limit the number of jobs to 3 in low RAM envs
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD16
1 files changed, 12 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 42c5fd96becd..5010176def51 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=yabridge-git
_pkgname=yabridge
-pkgver=2.2.1.r492.g18bfc5c
+pkgver=2.2.1.r508.g71eadff
pkgrel=1
pkgdesc="Yet Another VST bridge, run Windows VST2 plugins under Linux"
arch=('x86_64')
@@ -51,9 +51,17 @@ build() {
-Dwith-bitbridge=true \
build
- # If the build is taking up too much RAM, then add `-j<num_jobs>` to control
- # the number of targets being built simultaneously
- ninja -C build
+ # The unity build takes can take up to 2 GB of RAM per target, so if the
+ # system does not have enough RAM to build everything at once we'll limit the
+ # number of concurrent jobs to 3.
+ total_memory=$(free --gibi --si | awk '/^Mem:/ { print $2 }')
+ if [ "$total_memory" -le 8 ]; then
+ echo -e "\n$total_memory gigabytes of RAM detected, limiting the number of build jobs to 3\n"
+
+ ninja -C build -j3
+ else
+ ninja -C build
+ fi
}
package() {