-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathnon_module_deps.bzl
57 lines (50 loc) · 1.39 KB
/
non_module_deps.bzl
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
load("@rules_nixpkgs_cc//:cc.bzl", "nixpkgs_cc_configure")
load(
"@rules_nixpkgs_core//:nixpkgs.bzl",
"nixpkgs_local_repository",
"nixpkgs_package",
)
def _non_module_deps_impl(_ctx):
nixpkgs_local_repository(
name = "nixpkgs",
nix_file = "//:nixpkgs.nix",
)
nixpkgs_cc_configure(
name = "nixpkgs_config_cc",
repository = "@nixpkgs",
register = False,
)
nixpkgs_package(
name = "nixpkgs_zlib",
attribute_path = "zlib",
repository = "@nixpkgs",
)
nixpkgs_package(
name = "zlib.dev",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")
filegroup(
name = "include",
srcs = glob(["include/*.h"]),
visibility = ["//visibility:public"],
)
cc_library(
name = "zlib",
srcs = ["@nixpkgs_zlib//:lib"],
hdrs = [":include"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
# This rule only bundles headers and a library and doesn't compile or link by itself.
# We set linkstatic = 1 to quiet to quiet the following warning:
#
# in linkstatic attribute of cc_library rule @zlib.dev//:zlib:
# setting 'linkstatic=1' is recommended if there are no object files.
#
linkstatic = 1,
)
""",
repository = "@nixpkgs",
)
non_module_deps = module_extension(
implementation = _non_module_deps_impl,
)