mirror of
https://github.com/bensuperpc/dockcross.git
synced 2025-01-22 14:15:44 +01:00
common: Introduce "install-ninja.sh"
This commit is contained in:
parent
191d773e01
commit
8077008a10
@ -17,16 +17,15 @@ RUN \
|
||||
fi; \
|
||||
rm /dockcross/install-openssl.sh /dockcross/install-cmake.sh
|
||||
|
||||
RUN git clone "https://github.com/ninja-build/ninja.git" && \
|
||||
cd ninja && \
|
||||
git checkout v1.7.1 && \
|
||||
([ -e /opt/python/cp35-cp35m/bin/python ] && /opt/python/cp35-cp35m/bin/python ./configure.py --bootstrap) || python ./configure.py --bootstrap && \
|
||||
./ninja && \
|
||||
cp ./ninja /usr/bin/ && \
|
||||
cd .. && rm -rf ninja
|
||||
COPY imagefiles/cmake.sh /usr/local/bin/cmake
|
||||
COPY imagefiles/ccmake.sh /usr/local/bin/ccmake
|
||||
|
||||
COPY imagefiles/install-ninja.sh /dockcross/
|
||||
RUN \
|
||||
/dockcross/install-ninja.sh \
|
||||
-python $([ -e /opt/python/cp35-cp35m/bin/python ] && echo "/opt/python/cp35-cp35m/bin/python" || echo "python") && \
|
||||
rm /dockcross/install-ninja.sh
|
||||
|
||||
RUN echo "root:root" | chpasswd
|
||||
WORKDIR /work
|
||||
ENTRYPOINT ["/dockcross/entrypoint.sh"]
|
||||
|
43
imagefiles/install-ninja.sh
Executable file
43
imagefiles/install-ninja.sh
Executable file
@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Configure, build and install ninja
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# install-ninja.sh [-python /path/to/bin/python]
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
PYTHON=python
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-python)
|
||||
PYTHON=$2
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Usage: Usage: ${0##*/} [-python /path/to/bin/python]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# Download
|
||||
REV=v1.7.1
|
||||
wget https://github.com/ninja-build/ninja/archive/$REV.tar.gz -O ninja.tar.gz
|
||||
mkdir ninja
|
||||
tar -xzvf ./ninja.tar.gz --strip-components=1 -C ./ninja
|
||||
|
||||
# Configure, build and install
|
||||
pushd ./ninja
|
||||
echo "Configuring ninja using [$PYTHON]"
|
||||
$PYTHON ./configure.py --bootstrap && ./ninja
|
||||
cp ./ninja /usr/bin/
|
||||
popd
|
||||
|
||||
# Clean
|
||||
rm -rf ./ninja*
|
||||
|
Loading…
x
Reference in New Issue
Block a user