treewide: dynamically generate copyright line
A copyright line with hardcoded year was shown in various places of the
UI. Instead, take the year from the commit date.
Change-Id: I424d6c5b3aff34fe4479c37f30f9ea280b7eb4af
Reviewed-on: https://review.monogon.dev/c/monogon/+/4168
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/metropolis/node/core/minit/BUILD.bazel b/metropolis/node/core/minit/BUILD.bazel
index 70419d5..bff1f69 100644
--- a/metropolis/node/core/minit/BUILD.bazel
+++ b/metropolis/node/core/minit/BUILD.bazel
@@ -1,9 +1,19 @@
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_binary")
+expand_template(
+ name = "stamp",
+ out = "stamp.h",
+ stamp = 1,
+ stamp_substitutions = {"copyright": "{{STABLE_MONOGON_copyright}}"},
+ template = ["#define COPYRIGHT_LINE \"copyright\""],
+)
+
cc_binary(
name = "minit",
srcs = [
"main.c",
+ ":stamp",
],
visibility = [
"//metropolis/node:__pkg__",