Skip to content

Commit

Permalink
Get test deps with rules_nixpkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
googleson78 committed Aug 15, 2022
1 parent 0204ca2 commit 1340c40
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,9 @@ stack_snapshot(
},
)

new_local_repository(
name = "system-libs",
# pkg-config --variable=libdir x11
path = "/usr/local/lib",
build_file_content = """
cc_library(
name = "phonenumbers",
srcs = ["libphonenumber.so"],
visibility = ["//visibility:public"],
)
""",
)

stack_snapshot(
name = "stackage-phone-numbers",
extra_deps = {"phone-numbers": ["@system-libs//:phonenumbers"]},
extra_deps = {"phone-numbers": ["@libphonenumber//:lib", "@protobuf//:lib"]},
local_snapshot = "//:stackage_snapshot.yaml",
packages = ["phone-numbers"]
)
Expand Down Expand Up @@ -438,6 +425,36 @@ filegroup(
repository = "@nixpkgs_default",
)

nixpkgs_package(
name = "libphonenumber",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "lib",
srcs = glob(["lib/*.so*",]),
hdrs = [":include"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
""",
repository = "@nixpkgs_default",
)

nixpkgs_package(
name = "protobuf",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "lib",
srcs = glob(["lib/*.so*",]),
hdrs = [":include"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
""",
repository = "@nixpkgs_default",
)

http_archive(
name = "zlib.hs",
build_file_content = """
Expand Down

0 comments on commit 1340c40

Please sign in to comment.