Skip to content

Commit 83550ca

Browse files
committed
add gcc9
1 parent c90a2a7 commit 83550ca

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

default.nix

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
let pkgs = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/57be0c5d9650a5c3970439ba7a1f4a017cd98cc0.tar.gz") {
2-
overlays = [
3-
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
4-
];
5-
});
1+
let
2+
pkgs = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/57be0c5d9650a5c3970439ba7a1f4a017cd98cc0.tar.gz") {
3+
overlays = [
4+
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
5+
];
6+
});
7+
luoguGcc = import ./gcc-luogu { inherit pkgs; };
68
in with pkgs; {
79
# Basic utils
810
inherit coreutils;
@@ -14,7 +16,8 @@ in with pkgs; {
1416
inherit gzip;
1517

1618
# C, C++
17-
gcc = (callPackage ./gcc-luogu { inherit pkgs; }).gcc;
19+
gcc = luoguGcc.gcc;
20+
# gcc9 = luoguGcc.gcc9; # NOI/NOIP uses GCC 9.3.0
1821

1922
# Rust
2023
rust = rust-bin.nightly."2021-11-22".default;

gcc-luogu/default.nix

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
{ pkgs ? import <nixpkgs> {} }: with pkgs;
22
let
33
pname = "luogu-gcc";
4-
sourceCC = gcc11.cc;
5-
6-
cc = sourceCC.overrideAttrs(a: with a; {
4+
5+
cc = gcc11.cc.overrideAttrs(a: with a; {
76
inherit pname;
87
patches = patches ++ [
98
./disable-pragma-and-attribute-for-optimize.patch
109
];
1110
});
1211
gcc = wrapCC(cc);
12+
13+
cc9 = pkgs.gcc9.cc.overrideAttrs(a: with a; {
14+
inherit pname;
15+
patches = patches ++ [
16+
./disable-pragma-and-attribute-for-optimize.patch
17+
];
18+
});
19+
gcc9 = wrapCC(cc9);
1320
in {
1421
inherit gcc;
1522
inherit cc;
23+
24+
inherit gcc9;
25+
inherit cc9;
1626
}

0 commit comments

Comments
 (0)