1 # Build recipe for ninja.
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=http://github.com/ninja-build/ninja/archive/v${version}/$tarname
33 A small build system with a focus on speed.
35 Ninja is a small build system with a focus on speed. It differs from
36 other build systems in two major respects: it is designed to have its
37 input files generated by a higher-level build system, and it is
38 designed to run builds as fast as possible.
41 homepage=http://ninja-build.org
42 license="Apache License v2.0"
44 # Source documentation
45 docs="COPYING HACKING.md doc/manual.asciidoc"
46 docsdir="${docdir}/${program}-${version}"
50 unpack "${tardir}/$tarname"
54 patch -Np1 -i "${worktree}/patches/ninja/fix-musl.patch"
56 # Set sane permissions
57 chmod -R u+w,go-w,a+rX-s .
59 python3 configure.py --bootstrap
63 #./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
65 mkdir -p "${destdir}/usr/bin"
66 cp -p ninja "${destdir}/usr/bin/"
67 chmod 755 "${destdir}/usr/bin/ninja"
69 strip --strip-unneeded "${destdir}/usr/bin/ninja"
73 mkdir -p "${destdir}/usr/share/bash-completion/completions/ninja" \
74 "${destdir}/usr/share/zsh/site-functions/_ninja"
76 cp -p misc/bash-completion \
77 "${destdir}/usr/share/bash-completion/completions/ninja"
79 cp -p misc/zsh-completion \
80 "${destdir}/usr/share/zsh/site-functions/_ninja"
82 pylib=$( python3 -c 'import sysconfig; print(sysconfig.get_path("platlib"))' )
83 mkdir -p "${destdir}/${pylib}"
84 cp -p misc/ninja_syntax.py "${destdir}/${pylib}"
87 "${destdir}/usr/share/bash-completion/completions/ninja/bash-completion" \
88 "${destdir}/usr/share/zsh/site-functions/_ninja/zsh-completion" \
89 "${destdir}/${pylib}/ninja_syntax.py"
94 mkdir -p "${destdir}${docsdir}"
95 cp -p $docs "${destdir}${docsdir}"