WIP for ninja.

* Fails to build, the python bootstrap tools seems to be generating
some build rules twice.
 * Not enough experience with Python to solve this, so leaving the
package as broken.
This commit is contained in:
Adrien Destugues
2013-10-03 10:10:30 +02:00
parent 2a68df0986
commit c2a04a95c9
2 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
SUMMARY="A small build system similar to make."
HOMEPAGE="http://martine.github.io/ninja/"
LICENSE="Apache v2"
COPYRIGHT="2011 Google Inc."
SRC_URI="git://github.com/martine/ninja.git#v1.4.0"
REVISION="1"
ARCHITECTURES="!x86_gcc2 !x86"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
ninja$secondaryArchSuffix = $portVersion
cmd:ninja = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:python
cmd:g++$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:as$secondaryArchSuffix
"
PATCHES="ninja-1.4.0.patchset"
BUILD()
{
python ./bootstrap.py
}
INSTALL()
{
cp ninja $binDir
}
DESCRIPTION="
Ninja is a small build system with a focus on speed. It differs from other
build systems in two major respects: it is designed to have its input files
generated by a higher-level build system, and it is designed to run builds
as fast as possible.
Why yet another build system?
Where other build systems are high-level languages Ninja aims to be an
assembler.
Ninja build files are human-readable but not especially convenient to write
by hand. (See the generated build file used to build Ninja itself.) These
constrained build files allow Ninja to evaluate incremental builds quickly.
For the Chrome browser on Linux (the motivating project behind Ninja),
Ninja is under a second for a no-op build where the equivalent Makefiles
took over ten seconds.
Ninja's low-level approach makes it perfect for embedding into more
featureful build systems. Via gyp it can build Chrome and v8 and node.js
etc.; via CMake it can build LLVM and KDE and Blender etc.
"

View File

@@ -0,0 +1,51 @@
From 2fa2d0ca09ffb589f08dc11330f91364228f0bdd Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 3 Oct 2013 10:06:13 +0200
Subject: Add minimal Haiku support
diff --git a/platform_helper.py b/platform_helper.py
index b7447a1..bf7a99e 100644
--- a/platform_helper.py
+++ b/platform_helper.py
@@ -19,7 +19,7 @@ import sys
def platforms():
return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5',
- 'mingw', 'msvc', 'gnukfreebsd8', 'bitrig']
+ 'mingw', 'msvc', 'gnukfreebsd8', 'bitrig', 'haiku']
class Platform( object ):
def __init__( self, platform):
@@ -43,6 +43,8 @@ class Platform( object ):
self._platform = 'msvc'
elif self._platform.startswith('bitrig'):
self._platform = 'bitrig'
+ elif self._platform.startswith('haiku'):
+ self._platform = 'haiku'
def platform(self):
return self._platform
@@ -73,3 +75,6 @@ class Platform( object ):
def is_bitrig(self):
return self._platform == 'bitrig'
+
+ def is_haiku(self):
+ return self._platform == 'haiku'
diff --git a/src/util.cc b/src/util.cc
index 6ba3c6c..7142d13 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -310,7 +310,7 @@ int GetProcessorCount() {
#endif
}
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
double GetLoadAverage() {
// TODO(nicolas.despres@gmail.com): Find a way to implement it on Windows.
// Remember to also update Usage() when this is fixed.
--
1.8.3.4