third_party/urcu: init at 0.14.0

Adds userspace-rcu aka urcu, a userspace RCU library. Generated files
needed to be patched in and have been stripped of any unnecessary
definitions to make review easier and keep the patch small.

This is used by modern versions of xfsprogs, so we need to add it.

Change-Id: I280d313a9365fc642ca6c1cfd1d997094c0a0f98
Reviewed-on: https://review.monogon.dev/c/monogon/+/3345
Tested-by: Jenkins CI
Reviewed-by: Jan Schär <jan@monogon.tech>
diff --git a/third_party/urcu/external.bzl b/third_party/urcu/external.bzl
new file mode 100644
index 0000000..df78388
--- /dev/null
+++ b/third_party/urcu/external.bzl
@@ -0,0 +1,16 @@
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+def urcu_external(name, version):
+    sums = {
+        "0.14.0": "sha256-QvtRKaP//lpLeQ3+HqOnNMae4JX++/ZJMmJpu6lMJi0=",
+    }
+
+    http_archive(
+        name = name,
+        integrity = sums[version],
+        strip_prefix = "userspace-rcu-" + version,
+        build_file = "@//third_party/urcu:urcu.bzl",
+        patch_args = ["-p1"],
+        patches = ["//third_party/urcu/patches:generated-files.patch"],
+        urls = ["https://github.com/urcu/userspace-rcu/archive/refs/tags/v%s.tar.gz" % version],
+    )