Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Feb 2011 17:14:25 +0100
From:      Grzegorz Blach <magik@roorback.net>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/154603: new port: devel/ninja - a small build system similar to make
Message-ID:  <4D556061.6080603@roorback.net>
In-Reply-To: <201102090010.p190ABgw042819@freefall.freebsd.org>
References:  <201102090010.p190ABgw042819@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------050501030008010101080306
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Forgotten attachment

--------------050501030008010101080306
Content-Type: text/plain;
 name="ninja.shar.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="ninja.shar.txt"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	devel/ninja
#	devel/ninja/pkg-descr
#	devel/ninja/files
#	devel/ninja/files/patch-build.ninja
#	devel/ninja/files/patch-src-ninja.cc
#	devel/ninja/Makefile
#	devel/ninja/distinfo
#
echo c - devel/ninja
mkdir -p devel/ninja > /dev/null 2>&1
echo x - devel/ninja/pkg-descr
sed 's/^X//' >devel/ninja/pkg-descr << '510a61658044b6a64cd5b5553e11f0ad'
XNinja is yet another build system. It takes as input the interdependencies
Xof files (typically source code and output executables) and orchestrates
Xbuilding them, quickly.
X
XNinja joins a sea of other build systems. Its distinguishing goal is to be
Xfast. It is born from my work on the Chromium browser project, which has
Xover 30,000 source files and whose other build systems (including one built
Xfrom custom non-recursive Makefiles) can take ten seconds to start building
Xafter changing one file. Ninja is under a second.
X
XWWW: https://github.com/martine/ninja
510a61658044b6a64cd5b5553e11f0ad
echo c - devel/ninja/files
mkdir -p devel/ninja/files > /dev/null 2>&1
echo x - devel/ninja/files/patch-build.ninja
sed 's/^X//' >devel/ninja/files/patch-build.ninja << '01e1d7c668d097f67fd7e701790ead03'
X--- build.ninja.orig	2011-02-10 19:29:29.000000000 +0100
X+++ build.ninja	2011-02-10 19:29:33.000000000 +0100
X@@ -24,7 +24,7 @@
X   description = CC $out
X 
X rule ar
X-  command = ar crsT $out $in
X+  command = ar crs $out $in
X   description = AR $out
X 
X rule link
01e1d7c668d097f67fd7e701790ead03
echo x - devel/ninja/files/patch-src-ninja.cc
sed 's/^X//' >devel/ninja/files/patch-src-ninja.cc << '5e7698b3317f87584cb7ef199b09e282'
X--- src/ninja.orig	2011-02-10 17:21:11.000000000 +0200
X+++ src/ninja.cc	2011-02-10 17:21:43.000000000 +0200
X@@ -20,6 +20,9 @@
X #include <stdio.h>
X #include <string.h>
X #include <sys/stat.h>
X+#if defined(__APPLE__) || defined(__FreeBSD__)
X+#include <sys/sysctl.h>
X+#endif
X #include <sys/types.h>
X 
X #include "build.h"
X@@ -64,6 +67,7 @@ void usage(const BuildConfig& config) {
X int GuessParallelism() {
X   int processors = 0;
X 
X+#if defined(linux)
X   const char kProcessorPrefix[] = "processor\t";
X   char buf[16 << 10];
X   FILE* f = fopen("/proc/cpuinfo", "r");
X@@ -74,6 +78,12 @@ int GuessParallelism() {
X       ++processors;
X   }
X   fclose(f);
X+#elif defined(__APPLE__) || defined(__FreeBSD__)
X+  size_t procSize = sizeof(processors);
X+  int name[] = {CTL_HW, HW_NCPU};
X+  if (sysctl(name, sizeof(name) / sizeof(int), &processors, &procSize, NULL, 0))
X+    return 2;
X+#endif
X 
X   switch (processors) {
X   case 0:
5e7698b3317f87584cb7ef199b09e282
echo x - devel/ninja/Makefile
sed 's/^X//' >devel/ninja/Makefile << 'a4d06ad0c75a4dd311db1c69e561998c'
X# New ports collection makefile for:	ninja
X# Date created:				08 February 2011
X# Whom:					Grzegorz Blach <magik@roorback.net>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	ninja
XPORTVERSION=	20110208
XCATEGORIES=	devel
XMASTER_SITES=	http://files.roorback.net/src/
X
XMAINTAINER=	magik@roorback.net
XCOMMENT=	Ninja is a small build system closest in spirit to Make
X
XLIB_DEPENDS=	execinfo.1:${PORTSDIR}/devel/libexecinfo
X
XLICENSE=	ASL
XCONFLICTS=	irc/ninja-[0-9]*
X
XPLIST_FILES=	bin/ninja
XPORTDOCS=	COPYING HACKING README manual.asciidoc todo
X
Xpost-patch:
X	@${REINPLACE_CMD} \
X	    -e 's|/bin/bash|/bin/sh|' \
X	    -e 's|conf_cflags = -O2|conf_cflags = ${CXXFLAGS} -I${LOCALBASE}/include|' \
X	    -e 's|conf_ldflags = -s|conf_ldflags = -s -L${LOCALBASE}/lib -lexecinfo|' \
X	    -e 's|g++|g++ -I${LOCALBASE}/include -L${LOCALBASE}/lib -lexecinfo|' \
X	    ${WRKSRC}/bootstrap.sh
X
Xdo-build:
X	@(cd ${WRKSRC}; ./bootstrap.sh)
X
Xdo-install:
X	@${INSTALL} -m 755 ${WRKSRC}/ninja ${PREFIX}/bin
X.if !defined(NOPORTDOCS)
X	@${MKDIR} ${DOCSDIR}
X	@(cd ${WRKSRC}; ${INSTALL} -m 644 ${PORTDOCS} ${DOCSDIR})
X.endif
X
X.include <bsd.port.mk>
a4d06ad0c75a4dd311db1c69e561998c
echo x - devel/ninja/distinfo
sed 's/^X//' >devel/ninja/distinfo << '301aa92f68e218809c48ef64b6b4b3ea'
XSHA256 (ninja-20110208.tar.gz) = 0b4ce3a9b9755479b7e34e7da6a7dfbf6e49df0a38e0553bda1e2565cbba8b99
XSIZE (ninja-20110208.tar.gz) = 46644
301aa92f68e218809c48ef64b6b4b3ea
exit


--------------050501030008010101080306--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D556061.6080603>