Skip to content

Commit 20b2600

Browse files
c3c: 0.6.6 -> 0.7.0 (NixOS#394608)
2 parents b2b0718 + 510482f commit 20b2600

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

maintainers/maintainer-list.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9913,6 +9913,12 @@
99139913
github = "the-furry-hubofeverything";
99149914
githubId = 53921912;
99159915
};
9916+
hucancode = {
9917+
email = "[email protected]";
9918+
github = "hucancode";
9919+
githubId = 15852849;
9920+
name = "Bang Nguyen Huu";
9921+
};
99169922
hufman = {
99179923
email = "[email protected]";
99189924
github = "hufman";

pkgs/by-name/c3/c3c/package.nix

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,62 @@
99
libffi,
1010
xar,
1111
versionCheckHook,
12+
rev ? "unknown",
13+
debug ? false,
14+
checks ? true,
1215
}:
13-
16+
let
17+
inherit (lib.strings) optionalString;
18+
in
1419
llvmPackages.stdenv.mkDerivation (finalAttrs: {
15-
pname = "c3c";
16-
version = "0.6.6";
20+
21+
pname = "c3c${optionalString debug "-debug"}";
22+
version = "0.7.0";
1723

1824
src = fetchFromGitHub {
1925
owner = "c3lang";
2026
repo = "c3c";
2127
tag = "v${finalAttrs.version}";
22-
hash = "sha256-+rNj1SmiBYBw3Ncx2uS8X5OA/qDvJ8SFpZOQVRCgvmM=";
28+
hash = "sha256-SCUMyc8Gf7TAOXRppooNiyfbM84CUoIvokgvNgODqw8=";
2329
};
2430

31+
cmakeBuildType = if debug then "Debug" else "Release";
32+
2533
postPatch = ''
26-
substituteInPlace CMakeLists.txt \
27-
--replace-fail "\''${LLVM_LIBRARY_DIRS}" "${llvmPackages.lld.lib}/lib ${llvmPackages.llvm.lib}/lib"
34+
substituteInPlace git_hash.cmake \
35+
--replace-fail "\''${GIT_HASH}" "${rev}"
2836
'';
2937

3038
nativeBuildInputs = [ cmake ];
39+
cmakeFlags = [
40+
"-DC3_ENABLE_CLANGD_LSP=${if debug then "ON" else "OFF"}"
41+
"-DC3_LLD_DIR=${llvmPackages.lld.lib}/lib"
42+
"-DLLVM_CRT_LIBRARY_DIR=${llvmPackages.compiler-rt}/lib/darwin"
43+
];
3144

3245
buildInputs = [
3346
llvmPackages.llvm
3447
llvmPackages.lld
48+
llvmPackages.compiler-rt
3549
curl
3650
libxml2
3751
libffi
3852
] ++ lib.optionals llvmPackages.stdenv.hostPlatform.isDarwin [ xar ];
3953

4054
nativeCheckInputs = [ python3 ];
4155

42-
doCheck = llvmPackages.stdenv.system == "x86_64-linux";
56+
doCheck =
57+
lib.elem llvmPackages.stdenv.system [
58+
"x86_64-linux"
59+
"x86_64-darwin"
60+
"aarch64-darwin"
61+
]
62+
&& checks;
4363

4464
checkPhase = ''
4565
runHook preCheck
46-
( cd ../resources/testproject; ../../build/c3c build )
47-
( cd ../test; python src/tester.py ../build/c3c test_suite )
66+
( cd ../resources/testproject; ../../build/c3c build --trust=full )
67+
( cd ../test; ../build/c3c compile-run -O1 src/test_suite_runner.c3 -- ../build/c3c test_suite )
4868
runHook postCheck
4969
'';
5070

@@ -56,6 +76,7 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
5676
homepage = "https://github.com/c3lang/c3c";
5777
license = licenses.lgpl3Only;
5878
maintainers = with maintainers; [
79+
hucancode
5980
anas
6081
];
6182
platforms = platforms.all;

0 commit comments

Comments
 (0)