Skip to content

Commit 86f6f86

Browse files
committed
add testlib
1 parent 2ca53fd commit 86f6f86

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
(self: super: {
1717
gcc930 = nixpkgs_gcc930.legacyPackages.${super.system}.gcc9;
1818
})
19+
(import ./testlib/overlay.nix)
1920
(import ./gcc/overlay.nix)
2021
(import ./checker/overlay.nix)
2122
];

gcc/overlay.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ self: super: with super; let
66
inherit pname;
77
patches = patches ++ additionalPatches;
88
});
9+
extraBuildCommands = ''
10+
echo "-idirafter ${testlib}/include" >> $out/nix-support/libc-cflags
11+
'';
912
};
1013
in {
1114
luogu-gcc = applyLuogu gcc13 [

testlib/overlay.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
self: super: with super; {
2+
testlib = runCommandLocal "testlib" {
3+
version = "0.9.41";
4+
headerFile = fetchurl {
5+
url = "https://github.com/MikeMirzayanov/testlib/raw/68f9f300b6abebec82d2a68d8ca04394f2664fb6/testlib.h";
6+
sha256 = "sha256-cPdMVw8rRdYwhq5uTEG7tcX/1EKMupkUu8A5bSm+ENg=";
7+
};
8+
} ''
9+
set -e
10+
mkdir -p $out/include
11+
cp -v $headerFile $out/include/testlib.h
12+
'';
13+
}

0 commit comments

Comments
 (0)