summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/folly/package.py
blob: e3999e40bcd05dc0937d2b10d7328ec29d2110fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


from spack.package import *


class Folly(CMakePackage):
    """Folly (acronymed loosely after Facebook Open Source Library) is a
    library of C++11 components designed with practicality and efficiency
    in mind.

    Folly contains a variety of core library components used extensively at
    Facebook. In particular, it's often a dependency of Facebook's other open
    source C++ efforts and place where those projects can share code.
    """

    homepage = "https://github.com/facebook/folly"
    url = "https://github.com/facebook/folly/releases/download/v2021.05.24.00/folly-v2021.05.24.00.tar.gz"

    license("MIT")

    version(
        "2021.05.24.00", sha256="9d308adefe4670637f5c7d96309b3b394ac3fa129bc954f5dfbdd8b741c02aad"
    )

    # CMakePackage Dependency
    depends_on("pkgconfig", type="build")

    # folly requires gcc 5+ and a version of boost compiled with >= C++14
    variant(
        "cxxstd",
        default="14",
        values=("14", "17"),
        multi=False,
        description="Use the specified C++ standard when building.",
    )
    depends_on(
        "boost+context+container+exception+filesystem+program_options"
        "+regex+serialization+system+thread cxxstd=14",
        when="cxxstd=14",
    )
    depends_on(
        "boost+context+container+exception+filesystem+program_options"
        "+regex+serialization+system+thread cxxstd=17",
        when="cxxstd=17",
    )

    # required dependencies
    depends_on("gflags")
    depends_on("glog")
    depends_on("double-conversion")
    depends_on("libevent")
    depends_on("fmt")

    # optional dependencies
    variant("libdwarf", default=False, description="Optional Dependency")
    variant("elfutils", default=False, description="Optional Dependency")
    variant("libunwind", default=False, description="Optional Dependency")
    depends_on("libdwarf", when="+libdwarf")
    depends_on("elfutils", when="+elfutils")
    depends_on("libunwind", when="+libunwind")

    configure_directory = "folly"