diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-12-09 16:07:21 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-12-13 01:48:11 +0700 |
commit | 230d2da7d15866c0d961deb1a94c0f883db8c5ef (patch) | |
tree | af925dc118ce6d45bdbe3aab466c672322d0a325 /system/mongodb/mongodb.SlackBuild | |
parent | 1aa1106c44f54ec7c1a2d0c9cb0347dff8f4037d (diff) |
system/mongodb: Lower GCC version and support multiple job
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/mongodb/mongodb.SlackBuild')
-rw-r--r-- | system/mongodb/mongodb.SlackBuild | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/system/mongodb/mongodb.SlackBuild b/system/mongodb/mongodb.SlackBuild index d242ce9ec48e7..76548ba6ece90 100644 --- a/system/mongodb/mongodb.SlackBuild +++ b/system/mongodb/mongodb.SlackBuild @@ -28,10 +28,9 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM="mongodb" VERSION=${VERSION:-7.0.4} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -MAKEJOBS=${MAKEJOBS:-1} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -101,6 +100,9 @@ find -L . \ # thanks gentoo, also for these patches for i in $CWD/patches/* ; do patch -p1 < $i ; done +sed -i "s|GCC 11.3|GCC 11.2|g" SConstruct +sed -i "s|__GNUC_MINOR__ < 3|__GNUC_MINOR__ < 2|g" SConstruct + scons_opts=( --disable-warnings-as-errors --use-system-boost @@ -115,12 +117,20 @@ scons_opts=( --ssl ) +# Thanks to Lockywolf +# scons can use multiple jobs. For convenience, read MAKEFLAGS from the environment, if set +JOBS="$( echo $MAKEFLAGS | sed 's,.*-j *\([0-9][0-9]*\)*.*,\1,' )" +# or if no MAKEFLAGS, use the number of cores minus 1 +JOBS="${JOBS:-$(( $( nproc ) - 1 ))}" +# or 1, if we really have one core +[ "$JOBS" = "0" ] && JOBS=1 + if [ "$ARCH" = "x86_64" ]; then PREFIX=${PKG}/usr CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" LDFLAGS="-L /lib$LIBDIRSUFFIX -L/usr/lib$LIBDIRSUFFIX" \ - ./buildscripts/scons.py "${scons_opts[@]}" --jobs="$MAKEJOBS" install-core + ./buildscripts/scons.py "${scons_opts[@]}" --force-jobs --jobs="$JOBS" install-core else PREFIX=${PKG}/usr CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" LDFLAGS="-L /lib$LIBDIRSUFFIX -L/usr/lib$LIBDIRSUFFIX" \ - ./buildscripts/scons.py "${scons_opts[@]}" --jobs="$MAKEJOBS" --wiredtiger=off install-core + ./buildscripts/scons.py "${scons_opts[@]}" --force-jobs --jobs="$JOBS" --wiredtiger=off install-core fi # manual install @@ -137,6 +147,7 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r mkdir -p ${PKG}/usr/doc/${PRGNAM}-${VERSION} cp distsrc/* ${PKG}/usr/doc/${PRGNAM}-${VERSION} +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/etc/{logrotate,rc}.d cat $CWD/files/mongodb.conf > $PKG/etc/mongodb.conf.new |