[152202] trunk/dports/devel

sean at macports.org sean at macports.org
Wed Aug 31 13:59:44 PDT 2016


Revision: 152202
          https://trac.macports.org/changeset/152202
Author:   sean at macports.org
Date:     2016-08-31 13:59:44 -0700 (Wed, 31 Aug 2016)
Log Message:
-----------
folly: add new port

Added Paths:
-----------
    trunk/dports/devel/folly/
    trunk/dports/devel/folly/Portfile
    trunk/dports/devel/folly/files/
    trunk/dports/devel/folly/files/patch-alloc.diff
    trunk/dports/devel/folly/files/patch-malloc.diff
    trunk/dports/devel/folly/files/patch-reference.diff

Added: trunk/dports/devel/folly/Portfile
===================================================================
--- trunk/dports/devel/folly/Portfile	                        (rev 0)
+++ trunk/dports/devel/folly/Portfile	2016-08-31 20:59:44 UTC (rev 152202)
@@ -0,0 +1,48 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim: fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+PortGroup           cxx11 1.0
+
+github.setup        facebook folly 2016.08.22.00 v
+categories          devel
+platforms           darwin
+license             Apache-2
+
+maintainers         sean openmaintainer
+
+description         An open-source C++ library developed and used at Facebook.
+long_description    ${description}
+
+checksums           rmd160  eae22943df01420f1e524a8d288b4d43ff1d3542 \
+                    sha256  fad4cc85dc7d20c62672ec438b38e852e6e58119d519a1607c678e71edef47eb
+
+use_autoreconf      yes
+
+worksrcdir          ${worksrcdir}/folly
+
+# can remove after next version is released
+patch.pre_args      -p2
+patchfiles-append   patch-alloc.diff \
+                    patch-malloc.diff \
+                    patch-reference.diff
+
+# needed for ax_boost and friends
+depends_build-append \
+                    port:autoconf-archive \
+                    port:pkgconfig
+
+depends_lib-append  port:boost \
+                    port:python27 \
+                    port:gflags \
+                    port:google-glog \
+                    port:double-conversion \
+                    port:libevent \
+                    port:snappy \
+                    port:lz4 \
+                    port:lzma \
+                    port:xz \
+                    port:openssl \
+                    port:zlib \
+                    port:zstd

Added: trunk/dports/devel/folly/files/patch-alloc.diff
===================================================================
--- trunk/dports/devel/folly/files/patch-alloc.diff	                        (rev 0)
+++ trunk/dports/devel/folly/files/patch-alloc.diff	2016-08-31 20:59:44 UTC (rev 152202)
@@ -0,0 +1,55 @@
+From 2a0c9d069374e5953625ae45aaa9ccbece7a7f5d Mon Sep 17 00:00:00 2001
+From: Christopher Dykes <cdykes at fb.com>
+Date: Mon, 22 Aug 2016 09:52:34 -0700
+Subject: [PATCH] More fixup of the build on Mac for HHVM
+
+Summary: `std::__throw_bad_alloc()` is defined in `<new>` on OSX, so bring back the `#ifdef` guards that were there previously.
+
+Reviewed By: markw65
+
+Differential Revision: D3749714
+
+fbshipit-source-id: 0338a4cece928fce0b9d33d41c17cfa99a319abe
+---
+ folly/portability/BitsFunctexcept.cpp | 2 ++
+ folly/portability/BitsFunctexcept.h   | 4 ++++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/folly/portability/BitsFunctexcept.cpp b/folly/portability/BitsFunctexcept.cpp
+index 55b9561..1a72b69 100644
+--- a/folly/portability/BitsFunctexcept.cpp
++++ b/folly/portability/BitsFunctexcept.cpp
+@@ -33,9 +33,11 @@ void __throw_out_of_range(const char* msg) {
+   throw std::out_of_range(msg);
+ }
+ 
++#ifdef _MSC_VER
+ void __throw_bad_alloc() {
+   throw std::bad_alloc();
+ }
++#endif
+ 
+ FOLLY_NAMESPACE_STD_END
+ #endif
+diff --git a/folly/portability/BitsFunctexcept.h b/folly/portability/BitsFunctexcept.h
+index 80b2cb2..098d1e7 100644
+--- a/folly/portability/BitsFunctexcept.h
++++ b/folly/portability/BitsFunctexcept.h
+@@ -21,13 +21,17 @@
+ #if FOLLY_HAVE_BITS_FUNCTEXCEPT_H
+ #include <bits/functexcept.h>
+ #else
++#include <new> // Some platforms define __throw_bad_alloc() here.
+ #include <folly/Portability.h>
+ FOLLY_NAMESPACE_STD_BEGIN
+ 
+ [[noreturn]] void __throw_length_error(const char* msg);
+ [[noreturn]] void __throw_logic_error(const char* msg);
+ [[noreturn]] void __throw_out_of_range(const char* msg);
++
++#ifdef _MSC_VER
+ [[noreturn]] void __throw_bad_alloc();
++#endif
+ 
+ FOLLY_NAMESPACE_STD_END
+ #endif

Added: trunk/dports/devel/folly/files/patch-malloc.diff
===================================================================
--- trunk/dports/devel/folly/files/patch-malloc.diff	                        (rev 0)
+++ trunk/dports/devel/folly/files/patch-malloc.diff	2016-08-31 20:59:44 UTC (rev 152202)
@@ -0,0 +1,59 @@
+From 89166c82417a52f99dd373f510dd5119574dbf33 Mon Sep 17 00:00:00 2001
+From: Giuseppe Ottaviano <ott at fb.com>
+Date: Tue, 23 Aug 2016 10:14:40 -0700
+Subject: [PATCH] Make Malloc.h self-contained again
+
+Summary: D3743475 adds to `Malloc.h` a dependency on another folly header, which breaks it when used in stand-alone mode. This diff moves the include to the right `#ifdef` section.
+
+Reviewed By: Gownta
+
+Differential Revision: D3757819
+
+fbshipit-source-id: 71664ca6a3a47b6e4449a4ef603fedf052c5df3b
+---
+ folly/Malloc.h | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/folly/Malloc.h b/folly/Malloc.h
+index 64fd393..fec188f 100644
+--- a/folly/Malloc.h
++++ b/folly/Malloc.h
+@@ -20,8 +20,6 @@
+ #pragma once
+ #define FOLLY_MALLOC_H_
+ 
+-#include <folly/portability/BitsFunctexcept.h>
+-
+ /**
+  * Define various MALLOCX_* macros normally provided by jemalloc.  We define
+  * them so that we don't have to include jemalloc.h, in case the program is
+@@ -42,6 +40,7 @@
+ #if defined(_GLIBCXX_USE_FB) && !defined(_LIBSTDCXX_FBSTRING)
+ 
+ #include <folly/detail/Malloc.h>
++#include <folly/portability/BitsFunctexcept.h>
+ 
+ #include <string>
+ 
+@@ -87,13 +86,19 @@ extern "C" int mallctlbymib(const size_t*, size_t, void*, size_t*, void*,
+                             size_t)
+ __attribute__((__weak__));
+ 
++#include <bits/functexcept.h>
++
+ #define FOLLY_HAVE_MALLOC_H 1
+-#else
++
++#else // !defined(_LIBSTDCXX_FBSTRING)
++
+ #include <folly/detail/Malloc.h> /* nolint */
++#include <folly/portability/BitsFunctexcept.h> /* nolint */
++
+ #endif
+ 
+ // for malloc_usable_size
+-// NOTE: FreeBSD 9 doesn't have malloc.h.  It's defitions
++// NOTE: FreeBSD 9 doesn't have malloc.h.  Its definitions
+ // are found in stdlib.h.
+ #if FOLLY_HAVE_MALLOC_H
+ #include <malloc.h>

Added: trunk/dports/devel/folly/files/patch-reference.diff
===================================================================
--- trunk/dports/devel/folly/files/patch-reference.diff	                        (rev 0)
+++ trunk/dports/devel/folly/files/patch-reference.diff	2016-08-31 20:59:44 UTC (rev 152202)
@@ -0,0 +1,31 @@
+From b646787c313a85935a894d6fb50e60e30d9f3b33 Mon Sep 17 00:00:00 2001
+From: Christopher Dykes <cdykes at fb.com>
+Date: Mon, 22 Aug 2016 15:55:49 -0700
+Subject: [PATCH] Fixup a reference to detail/FunctionalExcept.cpp
+
+Summary: I missed this reference when I moved it to the portability folder. It is already being compiled at its new location.
+
+Reviewed By: yfeldblum
+
+Differential Revision: D3754227
+
+fbshipit-source-id: 357b0c26ddbcefdc7640f6a334150abba90ed711
+---
+ folly/Makefile.am | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/folly/Makefile.am b/folly/Makefile.am
+index 5df00b8..a51285f 100644
+--- a/folly/Makefile.am
++++ b/folly/Makefile.am
+@@ -497,10 +497,6 @@ if !HAVE_WEAK_SYMBOLS
+ libfollybase_la_SOURCES += detail/MallocImpl.cpp
+ endif
+ 
+-if !HAVE_BITS_FUNCTEXCEPT_H
+-libfollybase_la_SOURCES += detail/FunctionalExcept.cpp
+-endif
+-
+ if HAVE_BOOST_CONTEXT
+ nobase_follyinclude_HEADERS += \
+ 	fibers/AddTasks.h \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160831/71adc196/attachment-0001.html>


More information about the macports-changes mailing list