-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds `config.h` for macOS (Intel and Apple Silicon). This was tested on both Intel and Apple Silicon Macs. This will allow building `@openssh//:sshd` on macOS after this and #3149 have been merged.
- Loading branch information
Showing
21 changed files
with
1,984 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module( | ||
name = "libxcrypt", | ||
version = "4.4.36.bcr.1", | ||
bazel_compatibility = [ | ||
">=7.1.0", | ||
], | ||
compatibility_level = 4, | ||
) | ||
|
||
bazel_dep(name = "rules_cc", version = "0.0.10") | ||
bazel_dep(name = "platforms", version = "0.0.10") | ||
bazel_dep(name = "rules_coreutils", version = "1.0.0-beta.6") | ||
bazel_dep(name = "bazel_skylib", version = "1.4.0") | ||
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.16") | ||
|
||
bazel_dep(name = "rules_python", version = "0.37.1", dev_dependency = True) |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template") | ||
|
||
expand_template( | ||
name = "header", | ||
out = "crypt.h", | ||
substitutions = { | ||
"@BEGIN_DECLS@": "__BEGIN_DECLS", | ||
"@DEFAULT_PREFIX_ENABLED@": "1", | ||
"@XCRYPT_VERSION_MAJOR@": "4", | ||
"@XCRYPT_VERSION_MINOR@": "4", | ||
"@XCRYPT_VERSION_STR@": "4.4", | ||
"@END_DECLS@": "__END_DECLS", | ||
}, | ||
template = "//lib:crypt.h.in", | ||
visibility = ["//lib:__pkg__"], | ||
) | ||
|
||
genrule( | ||
name = "cfg", | ||
srcs = ["//config"], | ||
outs = ["config.h"], | ||
cmd = "$(CP) $< $@", | ||
cmd_bat = "$(CP) $< $@", | ||
toolchains = ["@rules_coreutils//coreutils/toolchain/cp:resolved"], | ||
visibility = ["//lib:__pkg__"], | ||
) | ||
|
||
genrule( | ||
name = "hashes", | ||
srcs = ["//crypt-hashes"], | ||
outs = ["crypt-hashes.h"], | ||
cmd = "$(CP) $< $@", | ||
cmd_bat = "$(CP) $< $@", | ||
toolchains = ["@rules_coreutils//coreutils/toolchain/cp:resolved"], | ||
visibility = ["//lib:__pkg__"], | ||
) | ||
|
||
genrule( | ||
name = "symbol-vers", | ||
srcs = ["//crypt-symbol-vers"], | ||
outs = ["crypt-symbol-vers.h"], | ||
cmd = "$(CP) $< $@", | ||
cmd_bat = "$(CP) $< $@", | ||
toolchains = ["@rules_coreutils//coreutils/toolchain/cp:resolved"], | ||
visibility = ["//lib:__pkg__"], | ||
) | ||
|
||
alias( | ||
name = "libxcrypt", | ||
actual = "//lib", | ||
visibility = ["//visibility:public"], | ||
) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../MODULE.bazel |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
config_setting( | ||
name = "amd64-linux", | ||
constraint_values = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:linux", | ||
], | ||
) | ||
|
||
config_setting( | ||
name = "arm64-linux", | ||
constraint_values = [ | ||
"@platforms//cpu:aarch64", | ||
"@platforms//os:linux", | ||
], | ||
) | ||
|
||
config_setting( | ||
name = "amd64-macos", | ||
constraint_values = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:macos", | ||
], | ||
) | ||
|
||
config_setting( | ||
name = "arm64-macos", | ||
constraint_values = [ | ||
"@platforms//cpu:aarch64", | ||
"@platforms//os:macos", | ||
], | ||
) | ||
|
||
alias( | ||
name = "config", | ||
actual = select( | ||
{ | ||
":amd64-linux": "amd64-linux.h", | ||
":arm64-linux": "arm64-linux.h", | ||
":amd64-macos": "amd64-macos.h", | ||
":arm64-macos": "arm64-macos.h", | ||
}, | ||
no_match_error = "No `config.h` available for target platform", | ||
), | ||
visibility = ["//:__pkg__"], | ||
) |
Oops, something went wrong.