From c54c7d52761a2cc688d0e46685a3d90ea44ad267 Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 2 May 2013 19:09:18 +0000 Subject: [PATCH] Initial import of ninja, a simple build system with a focus on speed. ok dcoppa, sthen --- devel/ninja/Makefile | 37 ++++++++++ devel/ninja/distinfo | 2 + .../patches/patch-src_subprocess-posix_cc | 70 +++++++++++++++++++ devel/ninja/pkg/DESCR | 1 + devel/ninja/pkg/PLIST | 2 + 5 files changed, 112 insertions(+) create mode 100644 devel/ninja/Makefile create mode 100644 devel/ninja/distinfo create mode 100644 devel/ninja/patches/patch-src_subprocess-posix_cc create mode 100644 devel/ninja/pkg/DESCR create mode 100644 devel/ninja/pkg/PLIST diff --git a/devel/ninja/Makefile b/devel/ninja/Makefile new file mode 100644 index 00000000000..12a4331f924 --- /dev/null +++ b/devel/ninja/Makefile @@ -0,0 +1,37 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2013/05/02 19:09:18 matthew Exp $ + +COMMENT = a small build system with a focus on speed +V = 1.2.0 +DISTNAME = ninja-${V} +CATEGORIES = devel +HOMEPAGE = http://martine.github.io/ninja/ +MAINTAINER = Matthew Dempsky + +# Apache License v2.0 +PERMIT_PACKAGE_CDROM = Yes + +# c>=68.1 needed for ppoll +WANTLIB = c>=68.1 m stdc++ + +MASTER_SITES = https://github.com/martine/ninja/archive/v${V}.tar.gz?bleh=/ + +MODULES = lang/python + +MODPY_ADJ_FILES = bootstrap.py \ + configure.py \ + src/browse.py + +# Not strictly required, but will be used if available. Included as a build +# dependency to ensure consistent builds. +BUILD_DEPENDS = devel/re2c + +MAKE_ENV = CXX="${CXX}" + +do-build: + @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ + ${MODPY_BIN} ./bootstrap.py --verbose + +do-install: + ${INSTALL_PROGRAM} ${WRKBUILD}/ninja ${PREFIX}/bin + +.include diff --git a/devel/ninja/distinfo b/devel/ninja/distinfo new file mode 100644 index 00000000000..0ca2f2cae8d --- /dev/null +++ b/devel/ninja/distinfo @@ -0,0 +1,2 @@ +SHA256 (ninja-1.2.0.tar.gz) = gToeZQ9Q7W6X01O7zjMTSNOet/2tT7pT5Kmb59qTnnI= +SIZE (ninja-1.2.0.tar.gz) = 136233 diff --git a/devel/ninja/patches/patch-src_subprocess-posix_cc b/devel/ninja/patches/patch-src_subprocess-posix_cc new file mode 100644 index 00000000000..85ca80d9946 --- /dev/null +++ b/devel/ninja/patches/patch-src_subprocess-posix_cc @@ -0,0 +1,70 @@ +$OpenBSD: patch-src_subprocess-posix_cc,v 1.1.1.1 2013/05/02 19:09:18 matthew Exp $ +--- src/subprocess-posix.cc.orig Fri Apr 5 09:36:12 2013 ++++ src/subprocess-posix.cc Thu May 2 12:01:23 2013 +@@ -25,13 +25,6 @@ + #include + #include + +-// Older versions of glibc (like 2.4) won't find this in . glibc +-// 2.4 keeps it in , though attempting to include that +-// will redefine the pollfd structure. +-#ifndef POLLRDHUP +-#define POLLRDHUP 0x2000 +-#endif +- + #include "util.h" + + Subprocess::Subprocess() : fd_(-1), pid_(-1) { +@@ -49,12 +42,12 @@ bool Subprocess::Start(SubprocessSet* set, const strin + if (pipe(output_pipe) < 0) + Fatal("pipe: %s", strerror(errno)); + fd_ = output_pipe[0]; +-#if !defined(linux) +- // On linux we use ppoll in DoWork(); elsewhere we use pselect and so must +- // avoid overly-large FDs. ++#if !defined(linux) && !defined(__OpenBSD__) ++ // On Linux and OpenBSD, we use ppoll in DoWork(); elsewhere we use pselect ++ // and so must avoid overly-large FDs. + if (fd_ >= static_cast(FD_SETSIZE)) + Fatal("pipe: %s", strerror(EMFILE)); +-#endif // !linux ++#endif // !linux && !__OpenBSD__ + SetCloseOnExec(fd_); + + pid_ = fork(); +@@ -189,7 +182,7 @@ Subprocess *SubprocessSet::Add(const string& command) + return subprocess; + } + +-#ifdef linux ++#if defined(linux) || defined(__OpenBSD__) + bool SubprocessSet::DoWork() { + vector fds; + nfds_t nfds = 0; +@@ -199,7 +192,7 @@ bool SubprocessSet::DoWork() { + int fd = (*i)->fd_; + if (fd < 0) + continue; +- pollfd pfd = { fd, POLLIN | POLLPRI | POLLRDHUP, 0 }; ++ pollfd pfd = { fd, POLLIN | POLLPRI, 0 }; + fds.push_back(pfd); + ++nfds; + } +@@ -236,7 +229,7 @@ bool SubprocessSet::DoWork() { + return false; + } + +-#else // linux ++#else // linux || __OpenBSD__ + bool SubprocessSet::DoWork() { + fd_set set; + int nfds = 0; +@@ -279,7 +272,7 @@ bool SubprocessSet::DoWork() { + + return false; + } +-#endif // linux ++#endif // linux || __OpenBSD__ + + Subprocess* SubprocessSet::NextFinished() { + if (finished_.empty()) diff --git a/devel/ninja/pkg/DESCR b/devel/ninja/pkg/DESCR new file mode 100644 index 00000000000..6fb62d63c0e --- /dev/null +++ b/devel/ninja/pkg/DESCR @@ -0,0 +1 @@ +Ninja is a small build system with a focus on speed. diff --git a/devel/ninja/pkg/PLIST b/devel/ninja/pkg/PLIST new file mode 100644 index 00000000000..b62b8dd74b4 --- /dev/null +++ b/devel/ninja/pkg/PLIST @@ -0,0 +1,2 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2013/05/02 19:09:18 matthew Exp $ +@bin bin/ninja