added community/ninja

This commit is contained in:
Kevin Mihelich 2021-10-02 22:16:47 +00:00
parent 32c45b56b3
commit 6605bef507

61
community/ninja/PKGBUILD Normal file
View file

@ -0,0 +1,61 @@
# Maintainer: Anatol Pomozov <anatol.pomozov@gmail.com>
# Contributor: Filip Brcic <brcha@gna.org>
# Contributor: Mika Fischer <mika.fischer@zoopnet.de>
# Contributor: Gergely Imreh <imrehgATgmailDOTcom>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - add environment variable override to ninja job guess routine
# https://www.linuxfromscratch.org/lfs/view/development/chapter08/ninja.html
pkgname=ninja
pkgver=1.10.2
pkgrel=1.1
pkgdesc='Small build system with a focus on speed'
arch=(x86_64)
url='https://ninja-build.org/'
license=(Apache)
depends=(gcc-libs)
makedepends=(python re2c emacs-nox)
source=($pkgname-$pkgver.zip::https://github.com/martine/ninja/archive/v$pkgver.zip)
sha1sums=('8415866400a85a1ced2140e52c5db714baec7444')
prepare() {
cd ninja-$pkgver
sed -i '/int Guess/a \
int j = 0;\
char* jobs = getenv( "ALARM_NINJA_JOBS" );\
if ( jobs != NULL ) j = atoi( jobs );\
if ( j > 0 ) return j;\
' src/ninja.cc
}
build() {
cd ninja-$pkgver
python configure.py --bootstrap
emacs -Q --batch -f batch-byte-compile misc/ninja-mode.el
}
check() {
cd ninja-$pkgver
python ./configure.py
./ninja ninja_test
./ninja_test
}
package() {
cd ninja-$pkgver
install -m755 -D ninja "$pkgdir/usr/bin/ninja"
install -m644 -D doc/manual.asciidoc "$pkgdir/usr/share/doc/ninja/manual.asciidoc"
install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
install -m644 -D misc/ninja-mode.el "$pkgdir/usr/share/emacs/site-lisp/ninja-mode.el"
install -m644 -D misc/ninja-mode.elc "$pkgdir/usr/share/emacs/site-lisp/ninja-mode.elc"
install -m644 -D misc/ninja.vim "$pkgdir/usr/share/vim/vimfiles/syntax/ninja.vim"
install -m644 -D misc/bash-completion "$pkgdir/usr/share/bash-completion/completions/ninja"
install -m644 -D misc/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_ninja"
}