treewide: replace static mentions of repo name with dynamic ones

This does change the CONFIG_QEMU_FIRMWAREPATH to "/nonexistant", but
since we are using OVMF everywhere anyway this should behave the same.

Closes monogon-dev/monogon#343

Change-Id: I865e5ba5e62579c3ff1f31a25e46cbcb78dba688
Reviewed-on: https://review.monogon.dev/c/monogon/+/3450
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
Tested-by: Jenkins CI
diff --git a/third_party/swtpm/patches/0004-bazel-support-implement.patch b/third_party/swtpm/patches/0004-bazel-support-implement.patch
index ce69992..b37ea69 100644
--- a/third_party/swtpm/patches/0004-bazel-support-implement.patch
+++ b/third_party/swtpm/patches/0004-bazel-support-implement.patch
@@ -43,7 +43,13 @@
 index 0000000..acddc0e
 --- /dev/null
 +++ b/BUILD.bazel
-@@ -0,0 +1,94 @@
+@@ -0,0 +1,100 @@
++filegroup(
++    name = "all",
++    srcs = glob(["**"]),
++    visibility = ["//visibility:public"],
++)
++
 +cc_binary(
 +    name = "swtpm",
 +    deps = [
@@ -64,9 +70,9 @@
 +        "src/utils/swtpm_utils.c",
 +    ]),
 +    copts = [
-+        "-Iexternal/_main~_repo_rules~swtpm/include",
-+        "-Iexternal/_main~_repo_rules~swtpm/include/swtpm",
-+        "-Iexternal/_main~_repo_rules~swtpm/src/utils",
++        "-I{path}/include".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/include/swtpm".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/src/utils".format(path = package_relative_label(":all").workspace_root),
 +    ],
 +    visibility = [
 +        "//visibility:public",
@@ -88,9 +94,9 @@
 +        "src/utils/*.c",
 +    ], []),
 +    copts = [
-+        "-Iexternal/_main~_repo_rules~swtpm/include",
-+        "-Iexternal/_main~_repo_rules~swtpm/include/swtpm",
-+        "-Iexternal/_main~_repo_rules~swtpm/src/utils",
++        "-I{path}/include".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/include/swtpm".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/src/utils".format(path = package_relative_label(":all").workspace_root),
 +    ],
 +    visibility = [
 +        "//visibility:public",
@@ -112,9 +118,9 @@
 +        "src/utils/*.c",
 +    ], []),
 +    copts = [
-+        "-Iexternal/_main~_repo_rules~swtpm/include",
-+        "-Iexternal/_main~_repo_rules~swtpm/include/swtpm",
-+        "-Iexternal/_main~_repo_rules~swtpm/src/utils",
++        "-I{path}/include".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/include/swtpm".format(path = package_relative_label(":all").workspace_root),
++        "-I{path}/src/utils".format(path = package_relative_label(":all").workspace_root),
 +    ],
 +    visibility = [
 +        "//visibility:public",
@@ -132,7 +138,7 @@
 +        "include/*.h",
 +    ], []),
 +    copts = [
-+        "-Iexternal/_main~_repo_rules~swtpm/include",
++        "-I{path}/include".format(path = package_relative_label(":all").workspace_root),
 +    ],
 +    visibility = [
 +        "//visibility:public",