File: copy.bara.sky

package info (click to toggle)
monado 25.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,708 kB
  • sloc: cpp: 175,132; ansic: 141,570; python: 2,913; java: 753; xml: 735; sh: 403; javascript: 255; makefile: 58
file content (240 lines) | stat: -rw-r--r-- 7,746 bytes parent folder | download
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# Copyright 2022-2025, Collabora, Ltd.
#
# SPDX-License-Identifier: BSL-1.0
"""Configuration for "copybara" <https://github.com/google/copybara> to update vendored source."""

gitlab_url = "git@ssh.gitlab.freedesktop.org:rpavlik/monado.git"
author = "Rylie Pavlik <rylie.pavlik@collabora.com>"

# Helpful flag when working on these workflows:
# --git-destination-non-fast-forward

# update-stb: Update STB libraries
core.workflow(
    name="update-stb",
    custom_rev_id="STB_REV_ID",
    origin=git.github_origin(
        url="https://github.com/nothings/stb.git",
        ref="master",
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-stb",
    ),
    destination_files=glob(["src/external/stb/*.h"]),
    origin_files=glob(["stb_image_write.h"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.replace_message("external/stb: Update stb libraries from upstream"),
        core.move("", "src/external/stb/"),
    ],
)


# Custom transformation that writes the COMMIT file in the nanopb directory
def write_nanopb_commit(ctx):
    return ctx.write_path(
        ctx.new_path("src/external/nanopb/COMMIT.txt"),
        core.format("%s\n", [ctx.find_label("GIT_DESCRIBE_CHANGE_VERSION")]),
    )


# update-nanopb: Update NanoPB library
# WARNING: May also require update of the generated .pb.h and .pb.c files,
# not currently done by this code!
core.workflow(
    name="update-nanopb",
    custom_rev_id="NANOPB_REV_ID",
    origin=git.github_origin(
        url="https://github.com/nanopb/nanopb.git",
        # ref = "master",
        describe_version=True,
        version_selector=core.latest_version(
            format="refs/tags/nanopb-${n0}.${n1}.${n2}",
            regex_groups={
                "n0": "[0-9]+",
                "n1": "[0-9]+",
                "n2": "[0-9]+",
            },
        ),
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-nanopb",
    ),
    destination_files=glob(
        ["src/external/nanopb/*.{h,c,txt}"],
        exclude=["src/external/nanopb/monado_metrics.pb.{c,h}"],
    ),
    origin_files=glob(["*.{h,c,txt}"], exclude=["CMakeLists.txt", "requirements.txt"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "external/nanopb: Update nanopb from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("", "src/external/nanopb/"),
        # core.format()
        write_nanopb_commit,
    ],
)

# update-cjson: Update cJSON library
core.workflow(
    name="update-cjson",
    custom_rev_id="CJSON_REV_ID",
    origin=git.github_origin(
        url="https://github.com/DaveGamble/cJSON.git",
        # ref = "master",
        describe_version=True,
        version_selector=core.latest_version(
            format="refs/tags/v${n0}.${n1}.${n2}",
            regex_groups={
                "n0": "[0-9]+",
                "n1": "[0-9]+",
                "n2": "[0-9]+",
            },
        ),
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-cjson",
    ),
    destination_files=glob(["src/external/cjson/cjson/*"]),
    origin_files=glob(["cJSON.{h,c}", "{CHANGELOG,CONTRIBUTORS}.md", "LICENSE"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "external/cjson: Update cJSON from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("", "src/external/cjson/cjson/"),
    ],
)

# update-catch2: Update Catch2 library (amalgamated version)
core.workflow(
    name="update-catch2",
    custom_rev_id="CATCH2_REV_ID",
    origin=git.github_origin(
        url="https://github.com/catchorg/Catch2.git",
        describe_version=True,
        version_selector=core.latest_version(
            format="refs/tags/v${n0}.${n1}.${n2}",
            regex_groups={
                "n0": "3",
                "n1": "[0-9]+",
                "n2": "[0-9]+",
            },
        ),
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-catch2",
    ),
    destination_files=glob(["src/external/Catch2/*"]),
    origin_files=glob(["extras/catch_amalgamated.*", "LICENSE.txt"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "external/Catch2: Update Catch2 from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("extras/", "src/external/Catch2/"),
        core.move("LICENSE.txt", "src/external/Catch2/LICENSE.txt"),
    ],
)

# update-renderdoc: Update RenderDoc API
core.workflow(
    name="update-renderdoc",
    custom_rev_id="RENDERDOC_REV_ID",
    origin=git.github_origin(
        url="https://github.com/baldurk/renderdoc.git",
        ref="v1.x",
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-renderdoc",
    ),
    destination_files=glob(["src/external/renderdoc_api/*.h"]),
    origin_files=glob(["renderdoc/api/app/*.h"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "external/renderdoc_api: Update RenderDoc API from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("renderdoc/api/app/", "src/external/renderdoc_api/"),
    ],
)

# update-jnipp: Update jnipp library (used on Android)
core.workflow(
    name="update-jnipp",
    custom_rev_id="JNIPP_REV_ID",
    origin=git.github_origin(
        url="https://github.com/mitchdowd/jnipp.git",
        describe_version=True,
        ref="master",
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-jnipp",
    ),
    destination_files=glob(["src/external/jnipp/**"]),
    origin_files=glob(["**"], exclude=[".*", ".*/**", "*.sln"]),
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "Update jnipp from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("", "src/external/jnipp/"),
    ],
)


# update-openxr: Update OpenXR headers
core.workflow(
    name="update-openxr",
    custom_rev_id="OPENXR_REV_ID",
    origin=git.github_origin(
        url="https://github.com/KhronosGroup/OpenXR-SDK.git",
        ref="main",
        describe_version=True,
        # version_selector=core.latest_version(
        #     format="refs/tags/release-${n0}.${n1}.${n2}",
        #     regex_groups={
        #         "n0": "1",
        #         "n1": "[0-9]+",
        #         "n2": "[0-9]+",
        #     },
        # ),
    ),
    destination=git.destination(
        url=gitlab_url,
        fetch="main",
        push="update-openxr",
    ),
    destination_files=glob(
        ["src/external/openxr_includes/openxr/openxr*.h"],
        exclude=["src/external/openxr_includes/openxr/openxr_extension_helpers.h"],
    ),
    origin_files=glob(["include/openxr/*.h"]),
    mode="SQUASH",
    authoring=authoring.pass_thru(author),
    transformations=[
        metadata.expose_label("GIT_DESCRIBE_CHANGE_VERSION"),
        metadata.replace_message(
            "external/openxr_includes: Update OpenXR headers from upstream ${GIT_DESCRIBE_CHANGE_VERSION}"
        ),
        core.move("include/openxr/", "src/external/openxr_includes/openxr/"),
    ],
)