-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
84 lines (82 loc) · 2.61 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "Yet Another Pointer Analysis for LLVM";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable;
levers = {
url = "github:kquick/nix-levers";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, levers }:
{
apps = levers.eachSystem (system: rec
{
default = yapall;
yapall = {
type = "app";
program = "${self.packages.${system}.yapall}/bin/yapall";
};
});
checks = levers.eachSystem (system: {
yapall-package = self.packages.${system}.yapall;
});
packages = levers.eachSystem (system:
let pkgs = import nixpkgs { inherit system; };
in rec {
default = yapall;
yapall = pkgs.rustPlatform.buildRustPackage {
pname = "yapall";
version = "0.0.0";
src = self;
cargoLock = {
lockFile = ./Cargo.lock;
};
LLVM_SYS_140_PREFIX = "${pkgs.llvm_14.dev}/";
RUSTC_LLVM_14 = "${pkgs.rustc}/bin/rustc";
buildInputs = [
pkgs.llvm_14.dev
pkgs.libxml2
pkgs.zlib
];
# Disable nix default of hardening, which will cause compilation of
# various tests at -O0 to fail because _FORTIFY_SOURCE requires some
# level of optimization.
hardeningDisable = [ "all" ];
nativeCheckInputs = [
pkgs.clang_14
pkgs.lit
pkgs.llvm_14
];
preCheck = "lit tests/pointer/soundness";
meta = with pkgs.lib; {
description = "Yet Another Pointer Analysis for LLVM";
license = licenses.bsd3;
homepage = "https://github.com/GaloisInc/yapall";
};
};
});
devShells = levers.eachSystem (system:
let pkgs = import nixpkgs { inherit system; };
in
{
# buildRustPackage doesn't provide assistance here, so simply
# manually create a shell.
default = pkgs.mkShell {
packages = [
pkgs.rustc
pkgs.cargo
pkgs.llvm_14
pkgs.clang_14
pkgs.llvm_14.dev
pkgs.libxml2
pkgs.zlib
pkgs.lit
pkgs.rust-analyzer
];
LLVM_SYS_140_PREFIX = "${pkgs.llvm_14.dev}/";
RUSTC_LLVM_14 = "${pkgs.rustc}/bin/rustc";
hardeningDisable = [ "all" ];
};
});
};
}