-
Notifications
You must be signed in to change notification settings - Fork 1
/
dependencies.bzl
103 lines (90 loc) · 3.23 KB
/
dependencies.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
# Load all external repositories - these are split up for readability
load("@rules_third_party//libraries:enet.bzl", "enet")
load("@rules_third_party//libraries:osg.bzl", "osg")
load("@rules_third_party//libraries:tiff.bzl", "tiff")
load("@rules_third_party//libraries:zlib.bzl", "zlib")
load("@rules_third_party//libraries:png.bzl", "png")
load("@rules_third_party//libraries:freetype.bzl", "freetype")
load("@rules_third_party//libraries:allegro.bzl", "allegro")
load("@rules_third_party//libraries:curl.bzl", "curl")
#load("@rules_third_party//libraries:sdl2_image.bzl", "sdl2_image")
#load("@rules_third_party//libraries:sdl2_image_prebuilt.bzl", "sdl2_image_prebuilt")
# load("@rules_third_party//:sdl2.bzl", "sdl2")
load("@rules_third_party//libraries:mygui.bzl", "mygui")
load("@rules_third_party//libraries:bullet.bzl", "bullet")
load("@rules_third_party//libraries:physfs.bzl", "physfs")
load("@rules_third_party//libraries:xml2.bzl", "xml2")
load("@rules_third_party//libraries:iconv.bzl", "iconv")
load("@rules_third_party//libraries:lzma.bzl", "lzma")
load("@rules_third_party//applications:doxygen.bzl", "doxygen")
load("@rules_third_party//applications:graphviz.bzl", "graphviz")
load("@rules_third_party//libraries:harfbuzz.bzl", "harfbuzz")
load("@rules_third_party//libraries:irrlicht.bzl", "irrlicht")
load("@rules_third_party//libraries:jpeg.bzl", "jpeg")
load("@rules_third_party//libraries:bzip2.bzl", "bzip2")
load("@rules_third_party//libraries:python3.bzl", "python3")
load("@rules_third_party//libraries:lua.bzl", "lua")
def dependencies():
rules_foreign_cc_dependencies()
rules_pkg_dependencies()
zlib()
png()
tiff()
jpeg()
enet()
iconv()
bzip2()
freetype()
lzma()
irrlicht()
graphviz()
harfbuzz()
allegro()
curl()
doxygen()
#sdl2_image()
# sdl2()
mygui()
bullet()
xml2()
# sdl2_image_prebuilt()
bullet()
osg()
python3()
physfs()
lua()
def generate_dependencies(target, dependencies, name):
for index, dependency in enumerate(dependencies):
rule_name = dependency.replace(".", "_")
native.genrule(
name = rule_name,
srcs = [
target
],
cmd = "\n".join([
"LOCATIONS=\"$(locations %s)\"" % target,
"IFS=' ' read -ra LOCATIONS <<< $$LOCATIONS",
# Search for our copy target
"TARGET_BASENAME=$$(basename \"$@\")",
"for LOCATION in $${LOCATIONS[@]}; do",
"LOCATION_BASENAME=$$(basename $$LOCATION)",
"if [ \"$$LOCATION_BASENAME\" == \"$$TARGET_BASENAME\" ]; then",
"cp $$LOCATION \"$@\"",
"exit 0",
"fi",
"done",
"echo !!! COULD NOT FIND $@",
"echo SEARCH LIST: ",
"echo $${LOCATIONS[@]}",
"exit 1"
]),
outs = [
dependency
]
)
native.filegroup(
name = name,
srcs = dependencies
)