-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
49 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,7 @@ | ||
"""Repository rule to autoconfigure a toolchain using the system mkosi.""" | ||
"""Repository rule to configure a toolchain using nixpkgs mkosi.""" | ||
|
||
def _write_build(rctx, path): | ||
if not path: | ||
path = "" | ||
rctx.template( | ||
"BUILD", | ||
Label("//bazel/mkosi:BUILD.tpl"), | ||
substitutions = { | ||
"{GENERATOR}": "@constellation//bazel/mkosi/mkosi_configure.bzl%find_system_mkosi", | ||
"{MKOSI_PATH}": str(path), | ||
}, | ||
executable = False, | ||
) | ||
|
||
def _find_system_mkosi_impl(rctx): | ||
mkosi_path = rctx.which("mkosi") | ||
if rctx.attr.verbose: | ||
if mkosi_path: | ||
print("Found mkosi at '%s'" % mkosi_path) # buildifier: disable=print | ||
else: | ||
print("No system mkosi found.") # buildifier: disable=print | ||
_write_build(rctx = rctx, path = mkosi_path) | ||
|
||
_find_system_mkosi = repository_rule( | ||
implementation = _find_system_mkosi_impl, | ||
doc = """Create a repository that defines an mkosi toolchain based on the system mkosi.""", | ||
local = True, | ||
environ = ["PATH"], | ||
attrs = { | ||
"verbose": attr.bool( | ||
doc = "If true, print status messages.", | ||
), | ||
}, | ||
) | ||
|
||
def find_system_mkosi(name, verbose = False): | ||
_find_system_mkosi(name = name, verbose = verbose) | ||
def register_mkosi(name): | ||
native.register_toolchains( | ||
"@constellation//bazel/mkosi:mkosi_nix_toolchain", | ||
"@%s//:mkosi_auto_toolchain" % name, | ||
"@constellation//bazel/mkosi:mkosi_missing_toolchain", | ||
) |
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters