|
7 | 7 | nixpkgs_23_11.url = "nixpkgs/nixos-23.11"; |
8 | 8 | }; |
9 | 9 |
|
10 | | - outputs = { self, nixpkgs_24_11, nixpkgs_24_05, nixpkgs_23_11 }: |
11 | | - let |
12 | | - lib = nixpkgs_24_11.lib; |
| 10 | + outputs = |
| 11 | + { |
| 12 | + self, |
| 13 | + nixpkgs_24_11, |
| 14 | + nixpkgs_24_05, |
| 15 | + nixpkgs_23_11, |
| 16 | + }: |
| 17 | + let |
| 18 | + lib = nixpkgs_24_11.lib; |
13 | 19 |
|
14 | | - ci-docker = { pkgs, stdenv, tagname }: |
15 | | - pkgs.dockerTools.buildLayeredImage { |
16 | | - name = "renatogarcia/icecream-ci"; |
17 | | - tag = tagname; |
| 20 | + ci-docker = |
| 21 | + { |
| 22 | + pkgs, |
| 23 | + stdenv, |
| 24 | + tagname, |
| 25 | + }: |
| 26 | + pkgs.dockerTools.buildLayeredImage { |
| 27 | + name = "renatogarcia/icecream-ci"; |
| 28 | + tag = tagname; |
18 | 29 |
|
19 | | - contents = with pkgs; [ |
20 | | - busybox |
21 | | - cmake |
22 | | - conan |
23 | | - gnumake |
24 | | - stdenv.cc |
25 | | - ]; |
| 30 | + contents = with pkgs; [ |
| 31 | + busybox |
| 32 | + cmake |
| 33 | + conan |
| 34 | + gnumake |
| 35 | + stdenv.cc |
| 36 | + ]; |
26 | 37 |
|
27 | | - # Required by clang using mktemp and failing when /tmp doesn't exist. |
28 | | - extraCommands = '' |
| 38 | + # Required by clang using mktemp and failing when /tmp doesn't exist. |
| 39 | + extraCommands = '' |
29 | 40 | mkdir -p tmp |
30 | | - ''; |
| 41 | + ''; |
31 | 42 |
|
32 | | - config = { |
33 | | - WorkingDir = "/home"; |
34 | | - Env = |
35 | | - # Required so that the linker can find the libc++ when compiling with clang |
36 | | - lib.lists.optionals (stdenv.cc.libcxx != null) [ |
37 | | - "NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1" |
38 | | - ( |
39 | | - let |
40 | | - # clang8 depends on libc++abi besides libc++ |
41 | | - findLibcxxabi = depsList: lib.lists.findFirst (drv: drv.pname == "libcxxabi") null depsList; |
42 | | - libcxxabi = findLibcxxabi (lib.lists.remove null stdenv.cc.libcxx.buildInputs); |
43 | | - in |
44 | | - if libcxxabi != null |
45 | | - then "NIX_LDFLAGS=-L${stdenv.cc.libcxx}/lib/ -L${libcxxabi.out}/lib" |
46 | | - else "NIX_LDFLAGS=-L${stdenv.cc.libcxx}/lib/" |
47 | | - ) |
48 | | - ]; |
| 43 | + config = { |
| 44 | + WorkingDir = "/home"; |
| 45 | + Env = |
| 46 | + # Required so that the linker can find the libc++ when compiling with clang |
| 47 | + lib.lists.optionals (stdenv.cc.libcxx != null) [ |
| 48 | + "NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1" |
| 49 | + ( |
| 50 | + let |
| 51 | + # clang8 depends on libc++abi besides libc++ |
| 52 | + findLibcxxabi = depsList: lib.lists.findFirst (drv: drv.pname == "libcxxabi") null depsList; |
| 53 | + libcxxabi = findLibcxxabi (lib.lists.remove null stdenv.cc.libcxx.buildInputs); |
| 54 | + in |
| 55 | + if libcxxabi != null then |
| 56 | + "NIX_LDFLAGS=-L${stdenv.cc.libcxx}/lib/ -L${libcxxabi.out}/lib" |
| 57 | + else |
| 58 | + "NIX_LDFLAGS=-L${stdenv.cc.libcxx}/lib/" |
| 59 | + ) |
| 60 | + ]; |
| 61 | + }; |
49 | 62 | }; |
50 | | - }; |
51 | 63 |
|
52 | | - pkgs_24_11 = import nixpkgs_24_11 { |
53 | | - system = "x86_64-linux"; |
54 | | - }; |
| 64 | + pkgs_24_11 = import nixpkgs_24_11 { |
| 65 | + system = "x86_64-linux"; |
| 66 | + }; |
55 | 67 |
|
56 | | - pkgs_24_05 = import nixpkgs_24_05 { |
57 | | - system = "x86_64-linux"; |
58 | | - }; |
| 68 | + pkgs_24_05 = import nixpkgs_24_05 { |
| 69 | + system = "x86_64-linux"; |
| 70 | + }; |
59 | 71 |
|
60 | | - pkgs_23_11 = import nixpkgs_23_11 { |
61 | | - system = "x86_64-linux"; |
62 | | - }; |
| 72 | + pkgs_23_11 = import nixpkgs_23_11 { |
| 73 | + system = "x86_64-linux"; |
| 74 | + }; |
63 | 75 |
|
64 | | - in |
65 | | - { |
66 | | - packages.x86_64-linux = { |
67 | | - ci-gcc6 = ci-docker { pkgs = pkgs_24_11; stdenv = pkgs_24_05.gcc6Stdenv; tagname = "gcc6-3"; }; |
68 | | - ci-gcc9 = ci-docker { pkgs = pkgs_24_11; stdenv = pkgs_24_11.gcc9Stdenv; tagname = "gcc9-3"; }; |
69 | | - ci-gcc14 = ci-docker { pkgs = pkgs_24_11; stdenv = pkgs_24_11.gcc14Stdenv; tagname = "gcc14-3"; }; |
70 | | - ci-clang8 = ci-docker { pkgs = pkgs_24_11; stdenv = pkgs_23_11.llvmPackages_8.libcxxStdenv; tagname = "clang8-3"; }; |
71 | | - ci-clang19 = ci-docker { pkgs = pkgs_24_11; stdenv = pkgs_24_11.llvmPackages_19.libcxxStdenv; tagname = "clang19-3"; }; |
| 76 | + in |
| 77 | + { |
| 78 | + packages.x86_64-linux = { |
| 79 | + ci-gcc6 = ci-docker { |
| 80 | + pkgs = pkgs_24_11; |
| 81 | + stdenv = pkgs_24_05.gcc6Stdenv; |
| 82 | + tagname = "gcc6-3"; |
| 83 | + }; |
| 84 | + ci-gcc9 = ci-docker { |
| 85 | + pkgs = pkgs_24_11; |
| 86 | + stdenv = pkgs_24_11.gcc9Stdenv; |
| 87 | + tagname = "gcc9-3"; |
| 88 | + }; |
| 89 | + ci-gcc14 = ci-docker { |
| 90 | + pkgs = pkgs_24_11; |
| 91 | + stdenv = pkgs_24_11.gcc14Stdenv; |
| 92 | + tagname = "gcc14-3"; |
| 93 | + }; |
| 94 | + ci-clang8 = ci-docker { |
| 95 | + pkgs = pkgs_24_11; |
| 96 | + stdenv = pkgs_23_11.llvmPackages_8.libcxxStdenv; |
| 97 | + tagname = "clang8-3"; |
| 98 | + }; |
| 99 | + ci-clang19 = ci-docker { |
| 100 | + pkgs = pkgs_24_11; |
| 101 | + stdenv = pkgs_24_11.llvmPackages_19.libcxxStdenv; |
| 102 | + tagname = "clang19-3"; |
| 103 | + }; |
| 104 | + }; |
72 | 105 | }; |
73 | | - }; |
74 | 106 | } |
0 commit comments