2018-12-04 20:35:33 +00:00
|
|
|
{ pkgs ? import ./nix {} }:
|
|
|
|
|
2017-12-05 01:43:40 +00:00
|
|
|
let
|
2018-12-04 20:35:33 +00:00
|
|
|
ofborgOverrides = {
|
|
|
|
crateOverrides = pkgs.defaultCrateOverrides // {
|
|
|
|
ofborg = attrs: {
|
|
|
|
buildInputs = pkgs.lib.optional pkgs.stdenv.isDarwin
|
|
|
|
pkgs.darwin.apple_sdk.frameworks.Security;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
drv = (pkgs.callPackage ./ofborg/Cargo.nix {
|
|
|
|
cratesIO = pkgs.callPackage ./ofborg/crates-io.nix {};
|
|
|
|
}).ofborg {};
|
|
|
|
|
|
|
|
src = stripDeps (drv.override ofborgOverrides);
|
|
|
|
|
2017-12-05 01:43:40 +00:00
|
|
|
stripDeps = pkg: pkgs.runCommand "${pkg.name}-deps-stripped" {}
|
|
|
|
''
|
|
|
|
cp -r ${pkg} $out
|
|
|
|
chmod -R a+w $out
|
|
|
|
rm -rf $out/lib
|
|
|
|
find $out/bin -name '*.d' -delete
|
|
|
|
chmod -R a-w $out
|
|
|
|
'';
|
2018-12-04 20:35:33 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
ofborg.rs = pkgs.runCommand "ofborg-rs-symlink-compat" { inherit src; } ''
|
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-08-07 20:21:42 +00:00
|
|
|
|
|
|
|
# Verify that the outpath contains the version number matching the
|
|
|
|
# Cargo.toml
|
|
|
|
if ! grep -q 'version = "${drv.crateVersion}"' ${./ofborg/Cargo.toml}; then
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-04 20:35:33 +00:00
|
|
|
Build failed because you bumped the Cargo
|
|
|
|
version without regenerating the carnix
|
|
|
|
file.
|
2018-08-07 20:21:42 +00:00
|
|
|
|
2018-12-04 20:35:33 +00:00
|
|
|
Run:
|
2018-08-07 20:21:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-04 20:35:33 +00:00
|
|
|
nix-shell --run ./nix/update-carnix.sh
|
2018-08-07 20:21:42 +00:00
|
|
|
|
|
|
|
|
2018-12-04 20:35:33 +00:00
|
|
|
and commit those changes.
|
2018-08-07 20:21:42 +00:00
|
|
|
|
|
|
|
|
2018-12-04 20:35:33 +00:00
|
|
|
EOF
|
2018-08-07 20:21:42 +00:00
|
|
|
fi
|
2018-05-04 15:41:44 +00:00
|
|
|
'';
|
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
|
|
|
}
|