PKGBUILDs/extra/ninja/PKGBUILD

65 lines
2.1 KiB
Bash
Raw Normal View History

2021-10-02 22:16:47 +00:00
# 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
2024-04-28 22:19:06 +00:00
pkgver=1.12.0
pkgrel=2
2021-10-02 22:16:47 +00:00
pkgdesc='Small build system with a focus on speed'
arch=(x86_64)
url='https://ninja-build.org/'
2024-04-27 15:42:42 +00:00
license=(Apache-2.0)
2021-10-02 22:16:47 +00:00
depends=(gcc-libs)
2024-04-28 22:19:06 +00:00
makedepends=(cmake python re2c emacs-nox)
checkdepends=(gtest)
2024-04-27 15:42:42 +00:00
source=($pkgname-$pkgver.zip::https://github.com/ninja-build/ninja/archive/v$pkgver.zip)
2024-04-28 22:19:06 +00:00
sha1sums=('53e759ea6ed7895d71ce9f60915b37b20327da55')
sha256sums=('47411d1c95a91f416efc6f1bfb22477047c7a91951711af6123ab68ab11d6fcf')
2021-10-02 22:16:47 +00:00
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
2024-04-28 22:19:06 +00:00
cmake -Bbuild-cmake
cmake --build build-cmake
2021-10-02 22:16:47 +00:00
emacs -Q --batch -f batch-byte-compile misc/ninja-mode.el
}
check() {
cd ninja-$pkgver
2024-04-28 22:19:06 +00:00
./build-cmake/ninja_test
2021-10-02 22:16:47 +00:00
}
package() {
cd ninja-$pkgver
2023-05-03 19:16:18 +00:00
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
2024-04-28 22:19:06 +00:00
install -m755 -D build-cmake/ninja "$pkgdir/usr/bin/ninja"
2021-10-02 22:16:47 +00:00
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"
2023-05-03 19:16:18 +00:00
install -m644 -D misc/ninja_syntax.py "$pkgdir/$site_packages/ninja_syntax.py"
2021-10-02 22:16:47 +00:00
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"
}