lfs-scripts/scripts/chapter8/8.52-ninja.sh
2023-01-12 14:37:49 +05:30

31 lines
614 B
Bash

#!/bin/bash
cd /sources
tar xf ninja-1.11.0.tar.gz
cd ninja-1.11.0
export NINJAJOBS=4
sed -i '/int Guess/a \
int j = 0;\
char* jobs = getenv( "NINJAJOBS" );\
if ( jobs != NULL ) j = atoi( jobs );\
if ( j > 0 ) return j;\
' src/ninja.cc
python3 configure.py --bootstrap
if [ $? -ne 0 ]
then
exit 1
fi
./ninja ninja_test
./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
install -vm755 ninja /usr/bin/
install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja
install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja
cd /sources
rm -rf ninja-1.11.0