33 lines
853 B
Bash
33 lines
853 B
Bash
# Set the package we're building.
|
|
package="ninja-1.12.1"
|
|
extension=".tar.gz"
|
|
|
|
# Decompress the source.
|
|
echo "Unpacking ${package}${extension} ..."
|
|
tar xvf ${package}${extension}
|
|
|
|
# Enter the unpacked sources.
|
|
echo "Entering ${package} directory ..."
|
|
cd ${package}
|
|
|
|
# LFS commands.
|
|
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
|
|
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
|
|
|
|
# Exit sources directory.
|
|
echo "Exiting ${package} directory ..."
|
|
cd ..
|
|
|
|
# Remove the directory of source files.
|
|
echo "Removing ${package} directory ..."
|
|
rm -rf ${package}
|