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.
21 # Define a category for the output of the package name
24 tarname=${program}-${version}.tar.gz
27 fetch=http://github.com/ninja-build/ninja/archive/v${version}/$tarname
30 A small build system with a focus on speed.
32 Ninja is a small build system with a focus on speed. It differs from
33 other build systems in two major respects: it is designed to have its
34 input files generated by a higher-level build system, and it is
35 designed to run builds as fast as possible.
38 homepage=http://ninja-build.org
39 license="Apache License v2.0"
41 # Source documentation
42 docs="COPYING HACKING.md doc/manual.asciidoc"
43 docsdir="${docdir}/${program}-${version}"
49 unpack "${tardir}/$tarname"
53 patch -Np1 -i "${worktree}/patches/ninja/fix-musl.patch"
55 # Set sane permissions
56 chmod -R u+w,go-w,a+rX-s .
58 python3 configure.py --bootstrap
62 #./ninja_test --gtest_filter=-SubprocessTest.SetWithLots
64 mkdir -p "${destdir}/usr/bin"
65 cp -p ninja "${destdir}/usr/bin/"
66 chmod 755 "${destdir}/usr/bin/ninja"
68 strip --strip-unneeded "${destdir}/usr/bin/ninja"
72 mkdir -p "${destdir}/usr/share/bash-completion/completions/ninja" \
73 "${destdir}/usr/share/zsh/site-functions/_ninja"
75 cp -p misc/bash-completion \
76 "${destdir}/usr/share/bash-completion/completions/ninja"
78 cp -p misc/zsh-completion \
79 "${destdir}/usr/share/zsh/site-functions/_ninja"
81 pylib=$( python3 -c 'import sysconfig; print(sysconfig.get_path("platlib"))' )
82 mkdir -p "${destdir}/${pylib}"
83 cp -p misc/ninja_syntax.py "${destdir}/${pylib}"
86 "${destdir}/usr/share/bash-completion/completions/ninja/bash-completion" \
87 "${destdir}/usr/share/zsh/site-functions/_ninja/zsh-completion" \
88 "${destdir}/${pylib}/ninja_syntax.py"
93 mkdir -p "${destdir}${docsdir}"
94 cp -p $docs "${destdir}${docsdir}"