c3c: 0.6.6 -> 0.7.0 (#394608)

This commit is contained in:
Arne Keller 2025-04-08 09:27:22 +02:00 committed by GitHub
commit 20b2600fa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 9 deletions

View File

@ -9913,6 +9913,12 @@
github = "the-furry-hubofeverything";
githubId = 53921912;
};
hucancode = {
email = "hucancode@gmail.com";
github = "hucancode";
githubId = 15852849;
name = "Bang Nguyen Huu";
};
hufman = {
email = "hufman@gmail.com";
github = "hufman";

View File

@ -9,29 +9,43 @@
libffi,
xar,
versionCheckHook,
rev ? "unknown",
debug ? false,
checks ? true,
}:
let
inherit (lib.strings) optionalString;
in
llvmPackages.stdenv.mkDerivation (finalAttrs: {
pname = "c3c";
version = "0.6.6";
pname = "c3c${optionalString debug "-debug"}";
version = "0.7.0";
src = fetchFromGitHub {
owner = "c3lang";
repo = "c3c";
tag = "v${finalAttrs.version}";
hash = "sha256-+rNj1SmiBYBw3Ncx2uS8X5OA/qDvJ8SFpZOQVRCgvmM=";
hash = "sha256-SCUMyc8Gf7TAOXRppooNiyfbM84CUoIvokgvNgODqw8=";
};
cmakeBuildType = if debug then "Debug" else "Release";
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail "\''${LLVM_LIBRARY_DIRS}" "${llvmPackages.lld.lib}/lib ${llvmPackages.llvm.lib}/lib"
substituteInPlace git_hash.cmake \
--replace-fail "\''${GIT_HASH}" "${rev}"
'';
nativeBuildInputs = [ cmake ];
cmakeFlags = [
"-DC3_ENABLE_CLANGD_LSP=${if debug then "ON" else "OFF"}"
"-DC3_LLD_DIR=${llvmPackages.lld.lib}/lib"
"-DLLVM_CRT_LIBRARY_DIR=${llvmPackages.compiler-rt}/lib/darwin"
];
buildInputs = [
llvmPackages.llvm
llvmPackages.lld
llvmPackages.compiler-rt
curl
libxml2
libffi
@ -39,12 +53,18 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
nativeCheckInputs = [ python3 ];
doCheck = llvmPackages.stdenv.system == "x86_64-linux";
doCheck =
lib.elem llvmPackages.stdenv.system [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
&& checks;
checkPhase = ''
runHook preCheck
( cd ../resources/testproject; ../../build/c3c build )
( cd ../test; python src/tester.py ../build/c3c test_suite )
( cd ../resources/testproject; ../../build/c3c build --trust=full )
( cd ../test; ../build/c3c compile-run -O1 src/test_suite_runner.c3 -- ../build/c3c test_suite )
runHook postCheck
'';
@ -56,6 +76,7 @@ llvmPackages.stdenv.mkDerivation (finalAttrs: {
homepage = "https://github.com/c3lang/c3c";
license = licenses.lgpl3Only;
maintainers = with maintainers; [
hucancode
anas
];
platforms = platforms.all;