-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (93 loc) · 2.54 KB
/
flake.nix
File metadata and controls
106 lines (93 loc) · 2.54 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{
description = "LiFi development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Custom lcov 1.16 package
lcov_1_16 = pkgs.stdenv.mkDerivation rec {
pname = "lcov";
version = "1.16";
src = pkgs.fetchFromGitHub {
owner = "linux-test-project";
repo = "lcov";
rev = "v${version}";
hash = "sha256-X1T5OqR6NgTNGedH1on3+XZ7369007By6tRJK8xtmbk=";
};
nativeBuildInputs = with pkgs; [
makeWrapper
perl
];
buildInputs = with pkgs; [
perl
python3
];
perlDeps = with pkgs.perlPackages; [
CaptureTiny
DateTime
DateTimeFormatW3CDTF
DevelCover
GD
JSONXS
PathTools
] ++ pkgs.lib.optionals (!pkgs.stdenv.hostPlatform.isDarwin) [
pkgs.perlPackages.MemoryProcess
];
strictDeps = true;
makeFlags = [
"PREFIX=$(out)"
"VERSION=${version}"
"RELEASE=1"
];
preBuild = ''
patchShebangs --build bin/* tests/*/*
'';
postInstall = ''
for f in "$out"/bin/{gen*,lcov,perl2lcov}; do
if [ -f "$f" ] && [ -x "$f" ]; then
wrapProgram "$f" --set PERL5LIB ${pkgs.perlPackages.makeFullPerlPath perlDeps}
fi
done
'';
meta = with pkgs.lib; {
description = "Code coverage tool that enhances GNU gcov";
homepage = "https://github.com/linux-test-project/lcov";
license = licenses.gpl2Plus;
platforms = platforms.all;
};
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
jq
bc
gum
mongosh
bun
foundry
stdenv.cc.cc.lib
lcov_1_16 # Add custom lcov 1.16
];
shellHook = ''
export LD_LIBRARY_PATH=${
pkgs.lib.makeLibraryPath [
pkgs.systemd
pkgs.stdenv.cc.cc.lib
]
}:$LD_LIBRARY_PATH
'';
};
}
);
}