Skip to content

Commit

Permalink
Migrate third party packages to new helpers
Browse files Browse the repository at this point in the history
Summary: See D63653719 for full context.

Reviewed By: bigfootjon

Differential Revision: D63653729

fbshipit-source-id: 96c6b42ce38da541cd462ea48f334da17f8370de
  • Loading branch information
ckwalsh authored and facebook-github-bot committed Oct 1, 2024
1 parent 22d17a7 commit ea782ec
Show file tree
Hide file tree
Showing 29 changed files with 235 additions and 263 deletions.
8 changes: 6 additions & 2 deletions shim/third-party/binutils/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

oncall("open_source")

third_party_library(
system_library(
name = "iberty",
packages = {
"//os:linux-fedora": ["binutils-devel"],
"//os:linux-ubuntu": ["libiberty-dev"],
},
)
43 changes: 22 additions & 21 deletions shim/third-party/boost/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,28 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party/boost:boost.bzl", "boost_header_only", "boost_libs")
load("@//third-party/boost:boost.bzl", "boost_libs")

oncall("open_source")

boost_libs([
"container",
"context",
"filesystem",
"program_options",
"random",
"regex",
"thread",
])

boost_header_only([
"algorithm",
"interprocess",
"lexical_cast",
"multi_index",
"preprocessor",
"range",
"sort",
"variant",
])
boost_libs(
header_only = [
"algorithm",
"interprocess",
"lexical_cast",
"multi_index",
"preprocessor",
"range",
"sort",
"variant",
],
libraries = [
"container",
"context",
"filesystem",
"program_options",
"random",
"regex",
"thread",
],
)
54 changes: 27 additions & 27 deletions shim/third-party/boost/boost.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

def boost_libs(xs):
third_party_library(
HOMEBREW_BREW = "boost"

def boost_libs(libraries, header_only):
system_library(
name = "boost",
repo_package_names = {
"fedora": "boost-devel",
"homebrew": "boost",
"ubuntu": "libboost-all-dev",
packages = {
"//os:linux-fedora": ["boost-devel"],
"//os:linux-ubuntu": ["libboost-all-dev"],
"//os:macos-homebrew": ["boost"],
},
)
for x in xs:
third_party_library(
name = "boost_{}".format(x),
repo_package_names = {
"fedora": "boost-devel",
"homebrew": "boost",
"ubuntu": "libboost-all-dev",
},
linker_flags = ["-lboost_{}".format(x)],
)

def boost_header_only(xs):
for x in xs:
third_party_library(
name = "boost_{}".format(x),
repo_package_names = {
"fedora": "boost-devel",
"homebrew": "boost",
"ubuntu": "libboost-all-dev",
},
)
for library in libraries:
boost_library(library, False)

for library in header_only:
boost_library(library, True)

def boost_library(library: str, header_only: bool):
linker_flags = [] if header_only else ["-lboost_{}".format(library)]

system_library(
name = "boost_{}".format(library),
packages = {
"//os:linux-fedora": ["boost-devel"],
"//os:linux-ubuntu": ["libboost-{}-dev".format(library)],
"//os:macos-homebrew": ["boost"],
},
linker_flags = [] if header_only else ["-lboost_{}".format(library)],
)
24 changes: 11 additions & 13 deletions shim/third-party/brotli/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
PACKAGES = {
"//os:linux-fedora": ["brotli-devel"],
"//os:linux-ubuntu": ["libbrotli-dev"],
"//os:macos-homebrew": ["brotli"],
}

pkgconfig_system_library(
name = "brotli_decode",
packages = PACKAGES,
pkgconfig_name = "libbrotlidec",
repo_package_names = {
"fedora": "brotli-devel",
"homebrew": "brotli",
"ubuntu": "libbrotli-dev",
},
)

third_party_library(
pkgconfig_system_library(
name = "brotli_encode",
packages = PACKAGES,
pkgconfig_name = "libbrotlienc",
repo_package_names = {
"fedora": "brotli-devel",
"homebrew": "brotli",
"ubuntu": "libbrotli-dev",
},
)
12 changes: 6 additions & 6 deletions shim/third-party/double_conversion/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

oncall("open_source")

third_party_library(
system_library(
name = "double_conversion",
linker_flags = ["-ldouble-conversion"],
repo_package_names = {
"fedora": "double-conversion-devel",
"homebrew": "double-conversion",
"ubuntu": "libdouble-conversion-dev",
packages = {
"//os:linux-fedora": ["double-conversion-devel"],
"//os:linux-ubuntu": ["libdouble-conversion-dev"],
"//os:macos-homebrew": ["double-conversion"],
},
)
12 changes: 6 additions & 6 deletions shim/third-party/fast_float/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

oncall("open_source")

third_party_library(
system_library(
name = "fast_float",
repo_package_names = {
"fedora": "fast_float-devel",
"homebrew": "fast_float",
"ubuntu": "libfast-float-dev",
packages = {
"//os:linux-fedora": ["fast_float-devel"],
"//os:linux-ubuntu": ["libfast-float-dev"],
"//os:macos-homebrew": ["fast_float"],
},
)
13 changes: 6 additions & 7 deletions shim/third-party/fmt/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
pkgconfig_system_library(
name = "fmt",
pkgconfig_name = "fmt",
repo_package_names = {
"fedora": "fmt-devel",
"homebrew": "fmt",
"ubuntu": "libfmt-dev",
packages = {
"//os:linux-fedora": ["fmt-devel"],
"//os:linux-ubuntu": ["libfmt-dev"],
"//os:macos-homebrew": ["fmt"],
},
)
13 changes: 6 additions & 7 deletions shim/third-party/gflags/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
pkgconfig_system_library(
name = "gflags",
pkgconfig_name = "gflags",
repo_package_names = {
"fedora": "gflags-devel",
"homebrew": "gflags",
"ubuntu": "libgflags-dev",
packages = {
"//os:linux-fedora": ["gflags-devel"],
"//os:linux-ubuntu": ["libgflags-dev"],
"//os:macos-homebrew": ["gflags"],
},
)
18 changes: 9 additions & 9 deletions shim/third-party/glog/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
pkgconfig_system_library(
name = "glog",
pkgconfig_name = "libglog",
repo_package_names = {
"fedora": "glog-devel",
"homebrew": "glog",
"ubuntu": "libgoogle-glog-dev",
packages = {
"//os:linux-fedora": ["glog-devel"],
"//os:linux-ubuntu": ["libgoogle-glog-dev"],
"//os:macos-homebrew": ["glog"],
},
deps = [
"shim//third-party/gflags:gflags",
pkgconfig_name = "libglog",
exported_deps = [
"//third-party/gflags:gflags",
],
)
24 changes: 11 additions & 13 deletions shim/third-party/googletest/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,25 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
pkgconfig_system_library(
name = "gtest",
pkgconfig_name = "gtest",
repo_package_names = {
"fedora": "gtest-devel",
"homebrew": "googletest",
"ubuntu": "libgtest-dev",
packages = {
"//os:linux-fedora": ["gtest-devel"],
"//os:linux-ubuntu": ["libgtest-dev"],
"//os:macos-homebrew": ["googletest"],
},
)

third_party_library(
pkgconfig_system_library(
name = "gmock",
pkgconfig_name = "gmock",
repo_package_names = {
"fedora": "gmock-devel",
"homebrew": "googletest",
"ubuntu": "libgmock-dev",
packages = {
"//os:linux-fedora": ["gmock-devel"],
"//os:linux-ubuntu": ["libgmock-dev"],
"//os:macos-homebrew": ["googletest"],
},
)

Expand Down
14 changes: 7 additions & 7 deletions shim/third-party/jemalloc/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "pkgconfig_system_library")

oncall("open_source")

third_party_library(
pkgconfig_system_library(
name = "headers",
pkgconfig_name = "jemalloc",
repo_package_names = {
"fedora": "jemalloc-devel",
"homebrew": "jemalloc",
"ubuntu": "libjemalloc-dev",
packages = {
"//os:linux-fedora": ["jemalloc-devel"],
"//os:linux-ubuntu": ["libjemalloc-dev"],
"//os:macos-homebrew": ["jemalloc"],
},
pkgconfig_name = "jemalloc",
)
8 changes: 4 additions & 4 deletions shim/third-party/jvm/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

oncall("open_source")

third_party_library(
system_library(
name = "jvm",
repo_package_names = {
"homebrew": "openjdk",
packages = {
"//os:macos-homebrew": ["openjdk"],
},
)
12 changes: 6 additions & 6 deletions shim/third-party/libaio/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@shim//third-party:third_party.bzl", "third_party_library")
load("@//third-party:defs.bzl", "system_library")

oncall("open_source")

third_party_library(
system_library(
name = "aio",
linker_flags = ["-laio"],
repo_package_names = {
"fedora": "libaio-devel",
"homebrew": "libaio",
"ubuntu": "libaio-dev",
packages = {
"//os:linux-fedora": ["libaio-devel"],
"//os:linux-ubuntu": ["libaio-dev"],
"//os:macos-homebrew": ["libaio"],
},
)
Loading

0 comments on commit ea782ec

Please sign in to comment.