2020-05-20 03:19:00 +00:00
|
|
|
{ pkgs ? import ./nix {
|
2020-05-24 11:11:37 +00:00
|
|
|
overlays = [ (import ./nix/overlay.nix) ];
|
|
|
|
}
|
2020-05-20 03:19:00 +00:00
|
|
|
}:
|
2018-12-04 20:35:33 +00:00
|
|
|
|
2020-05-24 11:11:37 +00:00
|
|
|
let
|
2021-07-07 21:23:09 +00:00
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
2021-07-05 15:34:20 +00:00
|
|
|
pkg = pkgs.rustPlatform.buildRustPackage {
|
|
|
|
name = "ofborg";
|
2021-12-29 18:01:07 +00:00
|
|
|
src = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
|
2021-07-05 15:34:20 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
pkgconfig
|
|
|
|
pkgs.rustPackages.clippy
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
openssl
|
2021-07-07 21:23:09 +00:00
|
|
|
] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.CoreFoundation
|
|
|
|
]);
|
2021-07-05 15:34:20 +00:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cargo clippy
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = false; # Tests require access to a /nix/ and a nix daemon
|
|
|
|
checkInputs = with pkgs; [
|
|
|
|
nix
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2022-04-02 01:07:53 +00:00
|
|
|
"hubcaps-0.3.16" = "sha256-/BFXGccu27K8heK4IL7JnS/U7zatTk9wRybhtxppADM=";
|
2021-07-05 15:34:20 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2018-12-04 20:35:33 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2021-07-05 15:34:20 +00:00
|
|
|
inherit pkg;
|
2020-04-25 12:32:42 +00:00
|
|
|
|
2021-07-05 15:34:20 +00:00
|
|
|
ofborg.rs = pkgs.runCommand "ofborg-rs-symlink-compat" { src = pkg; } ''
|
2018-05-04 15:41:44 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
for f in $(find $src -type f); do
|
|
|
|
bn=$(basename "$f")
|
|
|
|
ln -s "$f" "$out/bin/$bn"
|
|
|
|
|
|
|
|
# Rust 1.n? or Cargo starting outputting bins with dashes
|
|
|
|
# instead of underscores ... breaking all the callers.
|
|
|
|
if echo "$bn" | grep -q "-"; then
|
|
|
|
ln -s "$f" "$out/bin/$(echo "$bn" | tr '-' '_')"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
test -e $out/bin/builder
|
|
|
|
test -e $out/bin/github_comment_filter
|
|
|
|
test -e $out/bin/github_comment_poster
|
|
|
|
test -e $out/bin/log_message_collector
|
|
|
|
test -e $out/bin/evaluation_filter
|
|
|
|
'';
|
2018-02-03 23:34:43 +00:00
|
|
|
|
2018-08-08 17:28:14 +00:00
|
|
|
ofborg.php = import ./php { inherit pkgs; };
|
2017-11-30 03:32:33 +00:00
|
|
|
}
|