summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/README.template.md55
-rw-r--r--etc/defaults/CC/TARGETS3
-rw-r--r--etc/defaults/CC/auto/TARGETS1
-rw-r--r--etc/defaults/CC/foreign/TARGETS7
-rw-r--r--etc/defaults/CC/proto/TARGETS14
-rw-r--r--etc/defaults/CC/test/TARGETS1
-rw-r--r--etc/defaults/patch/TARGETS3
-rw-r--r--etc/defaults/shell/test/TARGETS1
-rwxr-xr-xetc/generate-doc.sh78
-rwxr-xr-xetc/generate-repos.sh25
-rw-r--r--etc/imports/gtest.TARGETS6
-rw-r--r--etc/imports/libcurl.TARGETS6
-rw-r--r--etc/imports/libs.TARGETS10
-rw-r--r--etc/imports/libz.TARGETS6
-rw-r--r--etc/imports/rules.TARGETS1
-rwxr-xr-xetc/json-format.py72
-rw-r--r--etc/repos.json484
-rw-r--r--etc/repos.template.json71
18 files changed, 844 insertions, 0 deletions
diff --git a/etc/README.template.md b/etc/README.template.md
new file mode 100644
index 0000000..517fc0a
--- /dev/null
+++ b/etc/README.template.md
@@ -0,0 +1,55 @@
+# C/C++ rules for the `just` build system
+
+A collection of rules for building C/C++ libraries and binaries.
+
+## How to use this Repository
+
+There are two ways to import this repository. You can generate your
+`repos.json` from a template (`repos.template.json`) by importing
+the `rules-cc` repository with the tool `just-import-git`
+
+~~~sh
+$ just-import-git -C repos.template.json --as rules-cc -b master https://github.com/just-buildsystem/rules-cc > repos.json
+~~~
+
+Importing this way will also pull in `protoc` and `grpc_cpp_plugin`
+as a dependency for generating bindings for proto dependencies, if
+this feature is used.
+
+Alternatively, the `rules-cc` repository can be added manually to
+your `repos.json`.
+
+~~~jsonc
+...
+ , "rules-cc":
+ { "repository":
+ { "type": "git"
+ , "branch": "master"
+ , "commit": "2ea50063460a3e11dfcbb71651540c0d61fddc1a"
+ , "repository": "https://github.com/just-buildsystem/rules-cc"
+ , "subdir": "rules"
+ }
+ }
+...
+~~~
+
+Importing this way, `protoc` and `grpc_cpp_plugin` will be taken
+from the host system. To change the binary names or to bring your
+own proto toolchain, add a corresponding `target_root` layer (and
+provide the needed binding, if your target files refer to other
+repositories containing the toolchain).
+
+## Consume and being consumed by CMake Libraries
+
+For interoperability with CMake projects, see
+
+- [consume CMake libraries](./doc/consume-cmake-libraries.md)
+- [being consumed by CMake](./doc/being-consumed-by-cmake.md)
+
+## Rule Documentation
+
+In this documentation, the standard configuration variables
+`"AR"`, `"CC"`, `"CXX"`, `"CFLAGS"`, `"CXXFLAGS"`,`"LDFLAGS"`,
+`"ADD_CFLAGS"`, `"ADD_CXXFLAGS"`, `"ADD_LDFLAGS"`, `"ENV"`,
+`"BUILD_POSITION_INDEPENDENT"` are ommitted.
+
diff --git a/etc/defaults/CC/TARGETS b/etc/defaults/CC/TARGETS
new file mode 100644
index 0000000..6e095cc
--- /dev/null
+++ b/etc/defaults/CC/TARGETS
@@ -0,0 +1,3 @@
+{ "defaults":
+ {"type": ["CC", "defaults"], "base": [["@", "base", "CC", "defaults"]]}
+}
diff --git a/etc/defaults/CC/auto/TARGETS b/etc/defaults/CC/auto/TARGETS
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/etc/defaults/CC/auto/TARGETS
@@ -0,0 +1 @@
+{}
diff --git a/etc/defaults/CC/foreign/TARGETS b/etc/defaults/CC/foreign/TARGETS
new file mode 100644
index 0000000..5fbb6a9
--- /dev/null
+++ b/etc/defaults/CC/foreign/TARGETS
@@ -0,0 +1,7 @@
+{ "defaults":
+ { "type": ["CC/foreign", "defaults"]
+ , "MAKE": ["make"]
+ , "CMAKE": ["cmake"]
+ , "PATH": ["/bin", "/usr/bin"]
+ }
+}
diff --git a/etc/defaults/CC/proto/TARGETS b/etc/defaults/CC/proto/TARGETS
new file mode 100644
index 0000000..95ae1b0
--- /dev/null
+++ b/etc/defaults/CC/proto/TARGETS
@@ -0,0 +1,14 @@
+{ "defaults":
+ { "type": ["CC/proto", "defaults"]
+ , "PROTOC": ["bin/protoc"]
+ , "deps": [["@", "protoc", "", "libprotobuf"]]
+ , "toolchain": [["@", "protoc", "", "toolchain"]]
+ }
+, "service defaults":
+ { "type": ["CC/proto", "defaults"]
+ , "base": ["defaults"]
+ , "GRPC_PLUGIN": ["grpc_cpp_plugin"]
+ , "deps": [["@", "grpc", "", "grpc++"]]
+ , "toolchain": [["@", "grpc", "", "grpc_cpp_plugin"]]
+ }
+}
diff --git a/etc/defaults/CC/test/TARGETS b/etc/defaults/CC/test/TARGETS
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/etc/defaults/CC/test/TARGETS
@@ -0,0 +1 @@
+{}
diff --git a/etc/defaults/patch/TARGETS b/etc/defaults/patch/TARGETS
new file mode 100644
index 0000000..16a4670
--- /dev/null
+++ b/etc/defaults/patch/TARGETS
@@ -0,0 +1,3 @@
+{ "defaults":
+ {"type": ["patch", "defaults"], "base": [["@", "base", "patch", "defaults"]]}
+}
diff --git a/etc/defaults/shell/test/TARGETS b/etc/defaults/shell/test/TARGETS
new file mode 100644
index 0000000..0967ef4
--- /dev/null
+++ b/etc/defaults/shell/test/TARGETS
@@ -0,0 +1 @@
+{}
diff --git a/etc/generate-doc.sh b/etc/generate-doc.sh
new file mode 100755
index 0000000..6153883
--- /dev/null
+++ b/etc/generate-doc.sh
@@ -0,0 +1,78 @@
+#!/bin/sh
+# Copyright 2022 Huawei Cloud Computing Technology Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eu
+
+readonly ROOT=$(readlink -f $(dirname $0)/..)
+
+: ${OUTFILE:=README.md}
+
+doc2md() {
+ local MAIN="$1"
+ local MODULE="$2"
+ local RULE="$3"
+
+ local RULE_DOC="$(just-mr --main "$MAIN" describe --rule --json "$MODULE" "$RULE")"
+ local DOC="$(echo "$RULE_DOC" | jq -r '.doc')"
+ local FIELD_DOC="$(echo "$RULE_DOC" | jq -r '.field_doc')"
+ local CONFIG_DOC="$(echo "$RULE_DOC" | jq -r '.config_doc | delpaths([["AR"], ["CC"], ["CXX"], ["CFLAGS"], ["CXXFLAGS"],["LDFLAGS"], ["ADD_CFLAGS"], ["ADD_CXXFLAGS"], ["ADD_LDFLAGS"], ["ENV"], ["BUILD_POSITION_INDEPENDENT"]])')"
+
+ echo "### Rule \`[\"$MODULE\", \"$RULE\"]\`"
+ echo
+ echo "$DOC" \
+ | jq -r '[.[] as $v | if ($v == "") then "\n\n" else $v end] | join(" ")' \
+ | sed 's/\("[^"]*"\|\[[^]]*\]\|{[^}]*}\)/`\1`/g'
+ echo
+ echo "| Field | Description |"
+ echo "| ----- | ----------- |"
+ echo "$FIELD_DOC" \
+ | jq -r 'keys_unsorted[] as $k | "| \"\($k)\" | \(.[$k] | join(" ")) |"' \
+ | sed 's/\("[^"]*"\|\[[^]]*\]\|{[^}]*}\)/`\1`/g'
+ echo
+ if [ "$(echo "$CONFIG_DOC" | jq -r 'length')" -gt 0 ]
+ then
+ echo "| Config variable | Description |"
+ echo "| --------------- | ----------- |"
+ echo "$CONFIG_DOC" \
+ | jq -r 'keys_unsorted[] as $k | "| \"\($k)\" | \(.[$k] | join(" ")) |"' \
+ | sed 's/\("[^"]*"\|\[[^]]*\]\|{[^}]*}\)/`\1`/g'
+ echo
+ fi
+}
+
+rm -f "$OUTFILE"
+( cat "$ROOT/etc/README.template.md"
+ doc2md rules CC defaults
+ doc2md rules CC/proto defaults
+ doc2md rules CC/foreign defaults
+ doc2md rules patch defaults
+ doc2md rules CC binary
+ doc2md rules CC library
+ doc2md rules CC/prebuilt library
+ doc2md rules CC/pkgconfig system_library
+ doc2md rules CC install-with-deps
+ doc2md rules CC/test test
+ doc2md rules shell/test script
+ doc2md rules CC/foreign/cmake library
+ doc2md rules CC/foreign/cmake data
+ doc2md rules CC/foreign/make library
+ doc2md rules CC/foreign/make data
+ doc2md rules CC/foreign/shell data
+ doc2md rules proto library
+ doc2md rules data staged
+ doc2md rules patch file
+ doc2md rules CC/auto config
+ doc2md rules CC/auto config_file
+) >> "$OUTFILE"
diff --git a/etc/generate-repos.sh b/etc/generate-repos.sh
new file mode 100755
index 0000000..c49a188
--- /dev/null
+++ b/etc/generate-repos.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Copyright 2022 Huawei Cloud Computing Technology Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -eu
+
+readonly ROOT=$(readlink -f $(dirname $0)/..)
+
+: ${BRANCH:=v1.2.0}
+: ${OUTFILE:=${ROOT}/etc/repos.json}
+
+just-import-git --as just -C ${ROOT}/etc/repos.template.json \
+ -b ${BRANCH} https://github.com/just-buildsystem/justbuild \
+ | ${ROOT}/etc/json-format.py > ${OUTFILE}
diff --git a/etc/imports/gtest.TARGETS b/etc/imports/gtest.TARGETS
new file mode 100644
index 0000000..a9b2217
--- /dev/null
+++ b/etc/imports/gtest.TARGETS
@@ -0,0 +1,6 @@
+{ "tree":
+ { "type": "install"
+ , "dirs": [[["TREE", null, "."], "googletest"]]
+ , "tainted": ["test"]
+ }
+}
diff --git a/etc/imports/libcurl.TARGETS b/etc/imports/libcurl.TARGETS
new file mode 100644
index 0000000..f33a101
--- /dev/null
+++ b/etc/imports/libcurl.TARGETS
@@ -0,0 +1,6 @@
+{ "tree":
+ { "type": "install"
+ , "dirs": [[["TREE", null, "."], "libcurl"]]
+ , "tainted": ["test"]
+ }
+}
diff --git a/etc/imports/libs.TARGETS b/etc/imports/libs.TARGETS
new file mode 100644
index 0000000..57adf74
--- /dev/null
+++ b/etc/imports/libs.TARGETS
@@ -0,0 +1,10 @@
+{ "tree":
+ { "type": "tree"
+ , "deps":
+ [ ["@", "gtest", "", "tree"]
+ , ["@", "libz", "", "tree"]
+ , ["@", "libcurl", "", "tree"]
+ ]
+ , "tainted": ["test"]
+ }
+}
diff --git a/etc/imports/libz.TARGETS b/etc/imports/libz.TARGETS
new file mode 100644
index 0000000..5b5ef8f
--- /dev/null
+++ b/etc/imports/libz.TARGETS
@@ -0,0 +1,6 @@
+{ "tree":
+ { "type": "install"
+ , "dirs": [[["TREE", null, "."], "libz"]]
+ , "tainted": ["test"]
+ }
+}
diff --git a/etc/imports/rules.TARGETS b/etc/imports/rules.TARGETS
new file mode 100644
index 0000000..73e1ff5
--- /dev/null
+++ b/etc/imports/rules.TARGETS
@@ -0,0 +1 @@
+{"tree": {"type": "install", "dirs": [[["TREE", null, "."], "rules"]], "tainted": ["test"]}}
diff --git a/etc/json-format.py b/etc/json-format.py
new file mode 100755
index 0000000..058d098
--- /dev/null
+++ b/etc/json-format.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2021-2022 Klaus Aehlig. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import json
+import sys
+
+def is_simple(entry):
+ if isinstance(entry, list):
+ return len(entry) == 0
+ if isinstance(entry, dict):
+ return len(entry) == 0
+ return True
+
+def is_short(entry, indent):
+ return len(json.dumps(entry)) + indent < 80
+
+def hdumps(entry, *, _current_indent=0):
+ if is_short(entry, _current_indent):
+ return json.dumps(entry)
+ if isinstance(entry, list) and entry:
+ result = "[ " + hdumps(entry[0], _current_indent=_current_indent+2)
+ for x in entry[1:]:
+ result += "\n" + " " * _current_indent + ", "
+ result += hdumps(x, _current_indent=_current_indent+2)
+ result += "\n" + " " * _current_indent + "]"
+ return result
+ if isinstance(entry, dict) and entry:
+ result = "{ "
+ is_first = True
+ for k in entry.keys():
+ if not is_first:
+ result += "\n" + " " * _current_indent + ", "
+ result += json.dumps(k) + ":"
+ if is_simple(entry[k]):
+ result += " " + json.dumps(entry[k])
+ elif is_short(entry[k], _current_indent + len(json.dumps(k)) + 4):
+ result += " " + json.dumps(entry[k])
+ else:
+ result += "\n" + " " * _current_indent + " "
+ result += hdumps(entry[k], _current_indent=_current_indent+2)
+ is_first = False
+ result += "\n" + " " * _current_indent + "}"
+ return result
+ return json.dumps(entry)
+
+if __name__ == "__main__":
+ data = json.load(sys.stdin)
+ print(hdumps(data))
diff --git a/etc/repos.json b/etc/repos.json
new file mode 100644
index 0000000..ca623dd
--- /dev/null
+++ b/etc/repos.json
@@ -0,0 +1,484 @@
+{ "main": "rules with bundled tools"
+, "repositories":
+ { "rules": {"repository": {"type": "file", "path": "rules"}}
+ , "rules with bundled tools":
+ { "repository": "rules"
+ , "target_root": "defaults"
+ , "rule_root": "rules"
+ , "bindings":
+ { "base": "just/rules"
+ , "protoc": "just/protobuf"
+ , "grpc": "just/com_github_grpc_grpc"
+ }
+ }
+ , "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
+ , "tests":
+ { "repository": {"type": "file", "path": "tests"}
+ , "bindings":
+ { "test-just": "just"
+ , "test-rules": "test-rules"
+ , "test-libs": "test-libs"
+ }
+ }
+ , "imports": {"repository": {"type": "file", "path": "etc/imports"}}
+ , "test-rules":
+ { "repository": {"type": "file", "path": "rules"}
+ , "target_root": "imports"
+ , "target_file_name": "rules.TARGETS"
+ }
+ , "test-libs":
+ { "repository": "imports"
+ , "target_file_name": "libs.TARGETS"
+ , "bindings": {"gtest": "gtest", "libz": "libz", "libcurl": "libcurl"}
+ }
+ , "gtest":
+ { "repository":
+ { "type": "archive"
+ , "fetch": "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz"
+ , "content": "cbd19f97df3ab86b174520cd850d238617c156e0"
+ , "sha256": "ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363"
+ , "subdir": "googletest-1.13.0"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "gtest.TARGETS"
+ }
+ , "libz":
+ { "repository":
+ { "type": "archive"
+ , "content": "d115fc690fa59d3be51b3442158876536140b6c2"
+ , "fetch": "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz"
+ , "sha256": "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
+ , "sha512": "99f0e843f52290e6950cc328820c0f322a4d934a504f66c7caa76bd0cc17ece4bf0546424fc95135de85a2656fed5115abb835fd8d8a390d60ffaf946c8887ad"
+ , "subdir": "zlib-1.2.13"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "libz.TARGETS"
+ }
+ , "libcurl":
+ { "repository":
+ { "type": "archive"
+ , "content": "540b4de2edfa015b894ad86d51b33a55f451ac99"
+ , "fetch": "https://github.com/curl/curl/releases/download/curl-8_0_1/curl-8.0.1.tar.gz"
+ , "sha256": "5fd29000a4089934f121eff456101f0a5d09e2a3e89da1d714adf06c4be887cb"
+ , "sha512": "87d945e65176613c6296f8b130bd6c5355e3ca3c62ee4010edd481950cad9760482fd3be8a84e51501c118c29ebc284b8f87c49b06f9d248e9da5819fda38f8f"
+ , "subdir": "curl-8.0.1"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "libcurl.TARGETS"
+ , "bindings": {"libz": "libz"}
+ }
+ , "just":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ }
+ , "bindings":
+ { "rules": "just/rules-just"
+ , "gsl": "just/com_github_microsoft_gsl"
+ , "cli11": "just/cli11"
+ , "json": "just/json"
+ , "fmt": "just/fmt"
+ , "ssl": "just/ssl"
+ , "grpc": "just/com_github_grpc_grpc"
+ , "googleapis": "just/google_apis"
+ , "bazel_remote_apis": "just/bazel_remote_apis"
+ , "libgit2": "just/com_github_libgit2_libgit2"
+ , "protoc": "just/protobuf"
+ , "libcurl": "just/com_github_curl_curl"
+ , "libarchive": "just/com_github_libarchive_libarchive"
+ }
+ }
+ , "just/bazel_remote_apis":
+ { "repository":
+ { "type": "archive"
+ , "content": "da6d7d589ccd1924ba9840a4e329e438dfa27f86"
+ , "fetch": "https://github.com/bazelbuild/remote-apis/archive/e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0.tar.gz"
+ , "sha256": "7421abd5352ccf927c2050453a4dbfa1f7b1c7170ec3e8702b6fe2d39b8805fe"
+ , "sha512": "3042690ee4b17a27db92ca867b4225c25f3f16344dce5fe86695d72ddda531e1593a5f0f70a291283451ce1e9f606c2285d222df3787815cd8f4054e1113bc9d"
+ , "subdir": "remote-apis-e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.bazel_remote_apis"
+ , "bindings": {"rules": "just/rules", "google_apis": "just/google_apis"}
+ }
+ , "just/bzip2":
+ { "repository":
+ { "type": "archive"
+ , "content": "f9d91f2012aedeedcfd3bd918124ca11f0160373"
+ , "fetch": "https://github.com/libarchive/bzip2/archive/refs/tags/bzip2-1.0.8.tar.gz"
+ , "sha256": "db106b740252669664fd8f3a1c69fe7f689d5cd4b132f82ba82b9afba27627df"
+ , "sha512": "596d1b304f1f2d64b020d04845db10a2330c7f614a9fd0b5344afff65877d2141b3fcaa43d9e2dbc2f6a7929a1dab07df54d3d4bd69678b53906472958c7b80c"
+ , "subdir": "bzip2-bzip2-1.0.8"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.bzip2"
+ , "bindings": {"rules": "just/rules-bzip2"}
+ }
+ , "just/cli11":
+ { "repository":
+ { "type": "archive"
+ , "content": "f2eee8c3fe04347bbb65cbb555c83d4c8d6a7034"
+ , "fetch": "https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.3.2.tar.gz"
+ , "sha256": "aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22"
+ , "sha512": "f48b289d52034c47b90db58c035a123b464bed488cf31bcdbe10a692214a5c05e62b99d6fb7c4b065f42df862ecf3813f11dd533b3697939d761e99d2b89c2ec"
+ , "subdir": "CLI11-2.3.2/"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.cli11"
+ , "bindings": {"rules": "just/rules"}
+ }
+ , "just/com_github_cares_cares":
+ { "repository":
+ { "type": "archive"
+ , "content": "4237a53f7a5dc1cfb4d04a6b6374f8674c32e271"
+ , "fetch": "https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz"
+ , "sha256": "321700399b72ed0e037d0074c629e7741f6b2ec2dda92956abe3e9671d3e268e"
+ , "sha512": "466a94efda626e815a6ef7a890637056339f883d549ea6055e289fd8cd2391130e5682c905c0fb3bd7e955af7f6deb793562c170eb0ee066a4a62085a82ba470"
+ , "subdir": "c-ares-1.19.1"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.cares"
+ , "bindings": {"rules": "just/rules", "grpc": "just/com_github_grpc_grpc"}
+ }
+ , "just/com_github_curl_curl":
+ { "repository":
+ { "type": "archive"
+ , "content": "23e33f9883e014ced35cc09f66b6b79a0b24e18d"
+ , "fetch": "https://github.com/curl/curl/releases/download/curl-8_2_1/curl-8.2.1.tar.gz"
+ , "sha256": "f98bdb06c0f52bdd19e63c4a77b5eb19b243bcbbd0f5b002b9f3cba7295a3a42"
+ , "sha512": "d0a906f4dff4c485e6dae930d9a7530147f4c0a0cbb46a83cb9be9d7bd6b9c320386c8be5bcdd3749f2d468b0daf39d06e8c581bab1fa792fd26da409a575cbd"
+ , "subdir": "curl-8.2.1"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.curl"
+ , "bindings":
+ { "rules": "just/rules-curl"
+ , "zlib": "just/zlib"
+ , "ssl": "just/ssl"
+ , "cares": "just/com_github_cares_cares"
+ }
+ }
+ , "just/com_github_grpc_grpc":
+ { "repository":
+ { "type": "archive"
+ , "content": "eb5007bb7fb6575db8c1467090719d3262a05868"
+ , "fetch": "https://github.com/grpc/grpc/archive/refs/tags/v1.56.2.tar.gz"
+ , "sha256": "931f07db9d48cff6a6007c1033ba6d691fe655bea2765444bc1ad974dfc840aa"
+ , "sha512": "bb4be3b8a128566581b7ea69d1faa6d08a28624656c2f4afdd8bb8fa804e362b7d8f2bb6c52789081b48f299ddffe18e1795c8dce9b9bc304a5e6d3a4274b11e"
+ , "subdir": "grpc-1.56.2"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.grpc"
+ , "rule_file_name": "RULES.grpc"
+ , "bindings":
+ { "rules": "just/rules-grpc"
+ , "protobuf": "just/protobuf"
+ , "ssl": "just/ssl"
+ , "absl": "just/com_google_absl"
+ , "zlib": "just/zlib"
+ , "re2": "just/re2"
+ , "cares": "just/com_github_cares_cares"
+ , "google_apis": "just/google_apis"
+ }
+ }
+ , "just/com_github_libarchive_libarchive":
+ { "repository":
+ { "type": "archive"
+ , "content": "922b6c729d391c010ffa6228134c164886bac0f1"
+ , "fetch": "https://github.com/libarchive/libarchive/releases/download/v3.7.1/libarchive-3.7.1.tar.gz"
+ , "sha256": "5d24e40819768f74daf846b99837fc53a3a9dcdf3ce1c2003fe0596db850f0f0"
+ , "sha512": "ccd36fc5e24e5feaad15b08496c4f6373f1bbb6ba657af5dc633b9d1454c98aba9a59ccffc48b41afc1219119d46c15d4db09c5855950422946e4dc058f17b88"
+ , "subdir": "libarchive-3.7.1"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.archive"
+ , "bindings":
+ { "rules": "just/rules-archive"
+ , "zlib": "just/zlib"
+ , "ssl": "just/ssl"
+ , "bzip2": "just/bzip2"
+ , "lzma": "just/lzma"
+ }
+ }
+ , "just/com_github_libgit2_libgit2":
+ { "repository":
+ { "type": "archive"
+ , "content": "02793bbe15088985989d1ff636a23958f4a62c57"
+ , "fetch": "https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.0.tar.gz"
+ , "sha256": "d9d0f84a86bf98b73e68997f5c1543cc5067d0ca9c7a5acaba3e8d117ecefef3"
+ , "sha512": "68c8ed289de7daccaec17ea2ac49f4610325595cf90cddef763a31546a0a1c6bd400bf6180b68e2d3a8bdc3d031328efbbbaf3b61467dfc1b944e8cf3efcfd69"
+ , "subdir": "libgit2-1.7.0"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.git2"
+ , "bindings":
+ {"rules": "just/rules-git2", "zlib": "just/zlib", "ssl": "just/ssl"}
+ }
+ , "just/com_github_microsoft_gsl":
+ { "repository":
+ { "type": "archive"
+ , "content": "386f0a89a47763481223a63d5026215af8d3c827"
+ , "fetch": "https://github.com/microsoft/GSL/archive/refs/tags/v4.0.0.tar.gz"
+ , "sha256": "f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9"
+ , "sha512": "7fa7446796c6bf82fb3bff09f86a69c446a27be528bef3b17c8bc5ad2f24d5cf86bdb3d3813ecb44726e8f395020180e97e41027330d1fbf545cc0f0b44aac29"
+ , "subdir": "GSL-4.0.0/include/gsl"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.gsl"
+ , "bindings": {"rules": "just/rules"}
+ }
+ , "just/com_google_absl":
+ { "repository":
+ { "type": "archive"
+ , "content": "08a0c4a58d13f234bd3f1de6c73395ec5ab7d5f6"
+ , "fetch": "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz"
+ , "sha256": "5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36"
+ , "sha512": "50509acfc4128fd31435631f71ac8cd0350acd9e290f78502723149016e7f07c9d84182ba99e0938b1873fecda09393d3fd7af8dabfb0d89cdcdd8a69a917e70"
+ , "subdir": "abseil-cpp-20230125.3"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.absl"
+ , "bindings": {"rules": "just/rules-absl", "patches": "just/patches"}
+ }
+ , "just/fmt":
+ { "repository":
+ { "type": "zip"
+ , "content": "3af42ee467295259c9bd6533f1092268136b226d"
+ , "fetch": "https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip"
+ , "sha256": "4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281"
+ , "sha512": "e4f80c34a78490a6bb3fa79fe097dac3d660dc7900fdeac9f8e744c1f1ff414c0a54a9b8a61fc9631702b12aaaa77000673357545e5771872076154810ebbbfc"
+ , "subdir": "fmt-10.0.0"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.fmt"
+ , "bindings": {"rules": "just/rules"}
+ }
+ , "just/google_apis":
+ { "repository":
+ { "type": "archive"
+ , "content": "5d9001f3dff8dec1880c06c0de100a0c2fc65094"
+ , "fetch": "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz"
+ , "sha256": "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0"
+ , "sha512": "cdeefae807df7097174b4bb28c0900b06a68d424c00ebba4ff5add260c9c651351d5e429bfc5de42f95ebb75dadec313f7bd3991c2fa476c9104f9ea656acad4"
+ , "subdir": "googleapis-2f9af297c84c55c8b871ba4495e01ade42476c92"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.google_apis"
+ , "bindings": {"rules": "just/rules", "patches": "just/patches"}
+ }
+ , "just/json":
+ { "repository":
+ { "type": "zip"
+ , "content": "a0cf5f0e098b6a8748eb1c106b0b1994b92fead9"
+ , "fetch": "https://github.com/nlohmann/json/releases/download/v3.11.2/include.zip"
+ , "sha256": "e5c7a9f49a16814be27e4ed0ee900ecd0092bfb7dbfca65b5a421b774dccaaed"
+ , "sha512": "99d9e6d588cabe8913a37437f86acb5d4b8b98bce12423e633c11c13b61e6c7f92ef8f9a4e991baa590329ee2b5c09ca9db9894bee1e54bdd68e8d09d83cc245"
+ , "subdir": "include/nlohmann"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.json"
+ , "bindings": {"rules": "just/rules"}
+ }
+ , "just/lzma":
+ { "repository":
+ { "type": "archive"
+ , "content": "6dae9322046ff66b7074c33b24be9a98f5cee42a"
+ , "fetch": "https://github.com/xz-mirror/xz/archive/refs/tags/v5.4.0.tar.gz"
+ , "sha256": "26ec069c41e5dfae221825b9f28a4934cb6ce3bedd3f55bc0a08073f7c2e42fd"
+ , "sha512": "60aba20197d329a1e0d86b32de8a9727a98e5ff6f1eda6111c5ddf85086edeefcf9e2cc3998d237e248bf4af7cf746923b45d236e6b47d88f63cf3d57cae9e8f"
+ , "subdir": "xz-5.4.0"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.lzma"
+ , "bindings": {"rules": "just/rules-lzma"}
+ }
+ , "just/patches":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ , "subdir": "etc/patches"
+ }
+ }
+ , "just/protobuf":
+ { "repository":
+ { "type": "archive"
+ , "content": "3e7ee8fe7138998e31bd367fdd6feaeb1d98ab39"
+ , "fetch": "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz"
+ , "sha256": "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971"
+ , "sha512": "b93a4e0339ecbe085796de5b6c61feae35229d40db9019c043090bcaa483a1cce78a99487c5638482c68832fcede5579a0e5ec731221a88359b80db9bb6dc566"
+ , "subdir": "protobuf-23.4"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.protobuf"
+ , "bindings":
+ { "rules": "just/rules-protobuf"
+ , "zlib": "just/zlib"
+ , "absl": "just/com_google_absl"
+ }
+ }
+ , "just/re2":
+ { "repository":
+ { "type": "archive"
+ , "content": "8eebd70d7ebd33ac5d736090cecd7cfe1831b9e3"
+ , "fetch": "https://github.com/google/re2/archive/refs/tags/2022-04-01.tar.gz"
+ , "sha256": "1ae8ccfdb1066a731bba6ee0881baad5efd2cd661acd9569b689f2586e1a50e9"
+ , "sha512": "fc3d7cc1ee6bd771719845566d83ffc8c4e19d838748e842a1e19c7564473c9a0a061bebb3966ffa82de6515346f9bbddc2d94ceb3de89233f58826774bd7ce7"
+ , "subdir": "re2-2022-04-01"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.re2"
+ , "bindings": {"rules": "just/rules-re2"}
+ }
+ , "just/rules":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ , "subdir": "rules"
+ }
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "bindings": {"toolchain": "just/toolchain"}
+ }
+ , "just/rules-absl":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.absl"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-archive":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.archive"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-boringssl":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.boringssl"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-bzip2":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.bzip2"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-curl":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.curl"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-git2":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.git2"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-grpc":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.grpc"
+ , "bindings": {"base": "just/rules", "protoc": "just/protobuf"}
+ }
+ , "just/rules-just":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.just"
+ , "bindings":
+ { "base": "just/rules"
+ , "protoc": "just/protobuf"
+ , "grpc": "just/com_github_grpc_grpc"
+ }
+ }
+ , "just/rules-lzma":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.lzma"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-protobuf":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.protobuf"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/rules-re2":
+ { "repository": "just/rules"
+ , "target_root": "just/defaults"
+ , "rule_root": "just/rules"
+ , "target_file_name": "TARGETS.re2"
+ , "bindings": {"base": "just/rules"}
+ }
+ , "just/ssl":
+ { "repository":
+ { "type": "archive"
+ , "content": "19cdde8ba529848172c09e84e3deb2c92dc670c3"
+ , "fetch": "https://github.com/google/boringssl/archive/6195bf8242156c9a2fa75702eee058f91b86a88b.tar.gz"
+ , "sha256": "ad0b806b6c5cbd6cae121c608945d5fed468748e330632e8d53315089ad52c67"
+ , "sha512": "bd0ff23103695a08c5072ef4e88042c32b684295ee6434124d9c9292586b72863c35246cd8002ad3de3a79a9dfe10a1e0beb594c1625bdf1d6f6175821ca75a1"
+ , "subdir": "boringssl-6195bf8242156c9a2fa75702eee058f91b86a88b"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.boringssl"
+ , "bindings": {"rules": "just/rules-boringssl"}
+ }
+ , "just/toolchain":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ , "subdir": "etc/toolchain"
+ }
+ , "rule_root": "just/rules"
+ }
+ , "just/zlib":
+ { "repository":
+ { "type": "archive"
+ , "content": "88faf0fca21e0d82de44366fdd52aaadbab2e6b6"
+ , "fetch": "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz"
+ , "sha256": "ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e"
+ , "sha512": "185795044461cd78a5545250e06f6efdb0556e8d1bfe44e657b509dd6f00ba8892c8eb3febe65f79ee0b192d6af857f0e0055326d33a881449f3833f92e5f8fb"
+ , "subdir": "zlib-1.3"
+ }
+ , "target_root": "just/import targets"
+ , "target_file_name": "TARGETS.zlib"
+ , "bindings": {"rules": "just/rules"}
+ }
+ , "just/defaults":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ , "subdir": "etc/defaults"
+ }
+ }
+ , "just/import targets":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/justbuild"
+ , "branch": "v1.2.0"
+ , "commit": "a4a59ea849cc439ee67665d0668d8e1f71dfa72e"
+ , "subdir": "etc/import"
+ }
+ }
+ }
+}
diff --git a/etc/repos.template.json b/etc/repos.template.json
new file mode 100644
index 0000000..3f1e1e5
--- /dev/null
+++ b/etc/repos.template.json
@@ -0,0 +1,71 @@
+{ "main": "rules with bundled tools"
+, "repositories":
+ { "rules": {"repository": {"type": "file", "path": "rules"}}
+ , "rules with bundled tools":
+ { "repository": "rules"
+ , "target_root": "defaults"
+ , "rule_root": "rules"
+ , "bindings":
+ { "base": "just/rules"
+ , "protoc": "just/protobuf"
+ , "grpc": "just/com_github_grpc_grpc"
+ }
+ }
+ , "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
+ , "tests":
+ { "repository": {"type": "file", "path": "tests"}
+ , "bindings":
+ { "test-just": "just"
+ , "test-rules": "test-rules"
+ , "test-libs": "test-libs"
+ }
+ }
+ , "imports": {"repository": {"type": "file", "path": "etc/imports"}}
+ , "test-rules":
+ { "repository": {"type": "file", "path": "rules"}
+ , "target_root": "imports"
+ , "target_file_name": "rules.TARGETS"
+ }
+ , "test-libs":
+ { "repository": "imports"
+ , "target_file_name": "libs.TARGETS"
+ , "bindings": {"gtest": "gtest", "libz": "libz", "libcurl": "libcurl"}
+ }
+ , "gtest":
+ { "repository":
+ { "type": "archive"
+ , "fetch": "https://github.com/google/googletest/archive/refs/tags/v1.13.0.tar.gz"
+ , "content": "cbd19f97df3ab86b174520cd850d238617c156e0"
+ , "sha256": "ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363"
+ , "subdir": "googletest-1.13.0"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "gtest.TARGETS"
+ }
+ , "libz":
+ { "repository":
+ { "type": "archive"
+ , "content": "d115fc690fa59d3be51b3442158876536140b6c2"
+ , "fetch": "https://github.com/madler/zlib/releases/download/v1.2.13/zlib-1.2.13.tar.gz"
+ , "sha256": "b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
+ , "sha512": "99f0e843f52290e6950cc328820c0f322a4d934a504f66c7caa76bd0cc17ece4bf0546424fc95135de85a2656fed5115abb835fd8d8a390d60ffaf946c8887ad"
+ , "subdir": "zlib-1.2.13"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "libz.TARGETS"
+ }
+ , "libcurl":
+ { "repository":
+ { "type": "archive"
+ , "content": "540b4de2edfa015b894ad86d51b33a55f451ac99"
+ , "fetch": "https://github.com/curl/curl/releases/download/curl-8_0_1/curl-8.0.1.tar.gz"
+ , "sha256": "5fd29000a4089934f121eff456101f0a5d09e2a3e89da1d714adf06c4be887cb"
+ , "sha512": "87d945e65176613c6296f8b130bd6c5355e3ca3c62ee4010edd481950cad9760482fd3be8a84e51501c118c29ebc284b8f87c49b06f9d248e9da5819fda38f8f"
+ , "subdir": "curl-8.0.1"
+ }
+ , "target_root": "imports"
+ , "target_file_name": "libcurl.TARGETS"
+ , "bindings": {"libz": "libz"}
+ }
+ }
+}