From a84464761f5304059c37a5d09003d82ddf2b1992 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 17 Sep 2017 09:48:31 +0200 Subject: [PATCH] ninja: add haiku minimum hrev for spawn.h * restore 1.6.0 recipe for older hrevs. * note Haikuporter is unable to pick the old one automatically. --- dev-util/ninja/ninja-1.6.0.recipe | 45 +++++++ dev-util/ninja/ninja-1.8.2.recipe | 5 +- dev-util/ninja/patches/ninja-1.6.0.patchset | 125 ++++++++++++++++++++ 3 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 dev-util/ninja/ninja-1.6.0.recipe create mode 100644 dev-util/ninja/patches/ninja-1.6.0.patchset diff --git a/dev-util/ninja/ninja-1.6.0.recipe b/dev-util/ninja/ninja-1.6.0.recipe new file mode 100644 index 000000000..eec7fa999 --- /dev/null +++ b/dev-util/ninja/ninja-1.6.0.recipe @@ -0,0 +1,45 @@ +SUMMARY="A small build system similar to make" +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. +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, KDE, Blender, etc." +HOMEPAGE="http://martine.github.io/ninja/" +COPYRIGHT="2014 Google Inc." +LICENSE="Apache v2" +REVISION="1" +SOURCE_URI="https://github.com/martine/ninja/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="b43e88fb068fe4d92a3dfd9eb4d19755dae5c33415db2e9b7b61b4659009cde7" +PATCHES="ninja-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="?x86" + +PROVIDES=" + ninja$secondaryArchSuffix = $portVersion + cmd:ninja = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + haiku_devel + cmd:python2 + cmd:g++$secondaryArchSuffix + cmd:gcc$secondaryArchSuffix + cmd:as$secondaryArchSuffix + " + +BUILD() +{ + python2 ./configure.py --bootstrap +} + +INSTALL() +{ + mkdir -p $prefix/bin + cp ninja $prefix/bin +} diff --git a/dev-util/ninja/ninja-1.8.2.recipe b/dev-util/ninja/ninja-1.8.2.recipe index 304fe133e..cd20a2fe2 100644 --- a/dev-util/ninja/ninja-1.8.2.recipe +++ b/dev-util/ninja/ninja-1.8.2.recipe @@ -24,8 +24,11 @@ PROVIDES=" REQUIRES=" haiku$secondaryArchSuffix " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel >= r1~alpha4_pm_hrev51418-1 + " BUILD_PREREQUIRES=" - haiku${secondaryArchSuffix}_devel haiku_devel cmd:python2 cmd:g++$secondaryArchSuffix diff --git a/dev-util/ninja/patches/ninja-1.6.0.patchset b/dev-util/ninja/patches/ninja-1.6.0.patchset new file mode 100644 index 000000000..bca43fdf5 --- /dev/null +++ b/dev-util/ninja/patches/ninja-1.6.0.patchset @@ -0,0 +1,125 @@ +From d7d59de2f79e0ce06043f56c29d0202569b88e62 Mon Sep 17 00:00:00 2001 +From: Augustin Cavalier +Date: Tue, 15 Jul 2014 10:39:30 -0400 +Subject: Add minimal Haiku support; based on Adrien's patch. + + +diff --git a/configure.py b/configure.py +index 2eacbfe..97919db 100755 +--- a/configure.py ++++ b/configure.py +@@ -55,13 +55,15 @@ class Platform(object): + self._platform = 'msvc' + elif self._platform.startswith('bitrig'): + self._platform = 'bitrig' ++ elif self._platform.startswith('haiku'): ++ self._platform = 'haiku' + elif self._platform.startswith('netbsd'): + self._platform = 'netbsd' + + @staticmethod + def known_platforms(): + return ['linux', 'darwin', 'freebsd', 'openbsd', 'solaris', 'sunos5', +- 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd'] ++ 'mingw', 'msvc', 'gnukfreebsd', 'bitrig', 'netbsd', 'haiku'] + + def platform(self): + return self._platform +@@ -88,6 +90,9 @@ class Platform(object): + def is_solaris(self): + return self._platform == 'solaris' + ++ def is_haiku(self): ++ return self._platform == 'is_haiku' ++ + def uses_usr_local(self): + return self._platform in ('freebsd', 'openbsd', 'bitrig') + +@@ -427,11 +432,7 @@ if platform.supports_ninja_browse(): + + n.comment('the depfile parser and ninja lexers are generated using re2c.') + def has_re2c(): +- try: +- proc = subprocess.Popen(['re2c', '-V'], stdout=subprocess.PIPE) +- return int(proc.communicate()[0], 10) >= 1103 +- except OSError: +- return False ++ return False + if has_re2c(): + n.rule('re2c', + command='re2c -b -i --no-generation-date -o $out $in', +diff --git a/src/util.cc b/src/util.cc +index aa47f2f..3308025 100644 +--- a/src/util.cc ++++ b/src/util.cc +@@ -507,7 +507,7 @@ int GetProcessorCount() { + #endif + } + +-#if defined(_WIN32) || defined(__CYGWIN__) ++#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__) + static double CalculateProcessorLoad(uint64_t idle_ticks, uint64_t total_ticks) + { + static uint64_t previous_idle_ticks = 0; +-- +2.11.0 + + +From 364a8621f81fdab928ea41791463ed66787b7e4f Mon Sep 17 00:00:00 2001 +From: Michael Lotz +Date: Sat, 19 Dec 2015 23:30:47 +0000 +Subject: Add include of sys/select.h to get FD_* definitions. + +Apparently these are pulled in by one of the already present headers +on other platforms. A cursory look at the POSIX specs did not reveal +a requirement to expose these types with the given headers though. + +diff --git a/src/subprocess-posix.cc b/src/subprocess-posix.cc +index f3baec2..6b27d7e 100644 +--- a/src/subprocess-posix.cc ++++ b/src/subprocess-posix.cc +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + #include "util.h" +-- +2.11.0 + + +From 5ec9e60993a9c93634371aa06fcae454fa364ce6 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 16 Apr 2017 13:39:04 +0200 +Subject: GetLoadAvg to be implemented for Haiku + + +diff --git a/src/util.cc b/src/util.cc +index 3308025..bc9739c 100644 +--- a/src/util.cc ++++ b/src/util.cc +@@ -507,7 +507,7 @@ int GetProcessorCount() { + #endif + } + +-#if defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__) ++#if defined(_WIN32) || defined(__CYGWIN__) + static double CalculateProcessorLoad(uint64_t idle_ticks, uint64_t total_ticks) + { + static uint64_t previous_idle_ticks = 0; +@@ -573,6 +573,10 @@ double GetLoadAverage() { + + return posix_compatible_load; + } ++#elif defined(__HAIKU__) ++double GetLoadAverage() { ++ return -0.0f; ++} + #else + double GetLoadAverage() { + double loadavg[3] = { 0.0f, 0.0f, 0.0f }; +-- +2.11.0 +