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"; github = "the-furry-hubofeverything";
githubId = 53921912; githubId = 53921912;
}; };
hucancode = {
email = "hucancode@gmail.com";
github = "hucancode";
githubId = 15852849;
name = "Bang Nguyen Huu";
};
hufman = { hufman = {
email = "hufman@gmail.com"; email = "hufman@gmail.com";
github = "hufman"; github = "hufman";

View File

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