summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/Makefile1
-rw-r--r--devel/ninja/Makefile42
-rw-r--r--devel/ninja/distinfo2
-rw-r--r--devel/ninja/files/patch-build.ninja11
-rw-r--r--devel/ninja/files/patch-src-ninja.cc33
-rw-r--r--devel/ninja/pkg-descr11
6 files changed, 100 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 03be03e39d92..475c440395b4 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1052,6 +1052,7 @@
SUBDIR += newt
SUBDIR += ngpt
SUBDIR += nini
+ SUBDIR += ninja
SUBDIR += noweb
SUBDIR += nspr
SUBDIR += oaf
diff --git a/devel/ninja/Makefile b/devel/ninja/Makefile
new file mode 100644
index 000000000000..6fccf2c512df
--- /dev/null
+++ b/devel/ninja/Makefile
@@ -0,0 +1,42 @@
+# New ports collection makefile for: ninja
+# Date created: 08 February 2011
+# Whom: Grzegorz Blach <magik@roorback.net>
+#
+# $FreeBSD$
+#
+
+PORTNAME= ninja
+PORTVERSION= 20110208
+CATEGORIES= devel
+MASTER_SITES= http://files.roorback.net/src/
+
+MAINTAINER= magik@roorback.net
+COMMENT= Ninja is a small build system closest in spirit to Make
+
+LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
+
+LICENSE= ASL
+CONFLICTS= irc/ninja-[0-9]*
+
+PLIST_FILES= bin/ninja
+PORTDOCS= COPYING HACKING README manual.asciidoc todo
+
+post-patch:
+ @${REINPLACE_CMD} \
+ -e 's|/bin/bash|/bin/sh|' \
+ -e 's|conf_cflags = -O2|conf_cflags = ${CXXFLAGS} -I${LOCALBASE}/include|' \
+ -e 's|conf_ldflags = -s|conf_ldflags = -s -L${LOCALBASE}/lib -lexecinfo|' \
+ -e 's|g++|g++ -I${LOCALBASE}/include -L${LOCALBASE}/lib -lexecinfo|' \
+ ${WRKSRC}/bootstrap.sh
+
+do-build:
+ @(cd ${WRKSRC}; ./bootstrap.sh)
+
+do-install:
+ @${INSTALL} -m 755 ${WRKSRC}/ninja ${PREFIX}/bin
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ @(cd ${WRKSRC}; ${INSTALL} -m 644 ${PORTDOCS} ${DOCSDIR})
+.endif
+
+.include <bsd.port.mk>
diff --git a/devel/ninja/distinfo b/devel/ninja/distinfo
new file mode 100644
index 000000000000..96fa705c1214
--- /dev/null
+++ b/devel/ninja/distinfo
@@ -0,0 +1,2 @@
+SHA256 (ninja-20110208.tar.gz) = 0b4ce3a9b9755479b7e34e7da6a7dfbf6e49df0a38e0553bda1e2565cbba8b99
+SIZE (ninja-20110208.tar.gz) = 46644
diff --git a/devel/ninja/files/patch-build.ninja b/devel/ninja/files/patch-build.ninja
new file mode 100644
index 000000000000..4a5a0b485544
--- /dev/null
+++ b/devel/ninja/files/patch-build.ninja
@@ -0,0 +1,11 @@
+--- build.ninja.orig 2011-02-10 19:29:29.000000000 +0100
++++ build.ninja 2011-02-10 19:29:33.000000000 +0100
+@@ -24,7 +24,7 @@
+ description = CC $out
+
+ rule ar
+- command = ar crsT $out $in
++ command = ar crs $out $in
+ description = AR $out
+
+ rule link
diff --git a/devel/ninja/files/patch-src-ninja.cc b/devel/ninja/files/patch-src-ninja.cc
new file mode 100644
index 000000000000..1e6d680429ea
--- /dev/null
+++ b/devel/ninja/files/patch-src-ninja.cc
@@ -0,0 +1,33 @@
+--- src/ninja.orig 2011-02-10 17:21:11.000000000 +0200
++++ src/ninja.cc 2011-02-10 17:21:43.000000000 +0200
+@@ -20,6 +20,9 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sys/stat.h>
++#if defined(__APPLE__) || defined(__FreeBSD__)
++#include <sys/sysctl.h>
++#endif
+ #include <sys/types.h>
+
+ #include "build.h"
+@@ -64,6 +67,7 @@ void usage(const BuildConfig& config) {
+ int GuessParallelism() {
+ int processors = 0;
+
++#if defined(linux)
+ const char kProcessorPrefix[] = "processor\t";
+ char buf[16 << 10];
+ FILE* f = fopen("/proc/cpuinfo", "r");
+@@ -74,6 +78,12 @@ int GuessParallelism() {
+ ++processors;
+ }
+ fclose(f);
++#elif defined(__APPLE__) || defined(__FreeBSD__)
++ size_t procSize = sizeof(processors);
++ int name[] = {CTL_HW, HW_NCPU};
++ if (sysctl(name, sizeof(name) / sizeof(int), &processors, &procSize, NULL, 0))
++ return 2;
++#endif
+
+ switch (processors) {
+ case 0:
diff --git a/devel/ninja/pkg-descr b/devel/ninja/pkg-descr
new file mode 100644
index 000000000000..63724b70b8ae
--- /dev/null
+++ b/devel/ninja/pkg-descr
@@ -0,0 +1,11 @@
+Ninja is yet another build system. It takes as input the interdependencies
+of files (typically source code and output executables) and orchestrates
+building them, quickly.
+
+Ninja joins a sea of other build systems. Its distinguishing goal is to be
+fast. It is born from my work on the Chromium browser project, which has
+over 30,000 source files and whose other build systems (including one built
+from custom non-recursive Makefiles) can take ten seconds to start building
+after changing one file. Ninja is under a second.
+
+WWW: https://github.com/martine/ninja