c3c: unstable-2021-07-30 -> 0.5.5
Update c3c compiler to the newest released stable version.
This commit is contained in:
committed by
Weijia Wang
parent
901ff63f9c
commit
a9c6372eba
@@ -3,38 +3,51 @@
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, python3
|
||||
, curl
|
||||
, libxml2
|
||||
, libffi
|
||||
, xar
|
||||
}:
|
||||
|
||||
llvmPackages.stdenv.mkDerivation rec {
|
||||
pname = "c3c";
|
||||
version = "unstable-2021-07-30";
|
||||
version = "0.5.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "c3lang";
|
||||
repo = pname;
|
||||
rev = "2246b641b16e581aec9059c8358858e10a548d94";
|
||||
sha256 = "VdMKdQsedDQCnsmTxO4HnBj5GH/EThspnotvrAscSqE=";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-iOljE1BRVc92NJZj+nr1G6KkBTCwJEUOadXHUDNoPGk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "\''${LLVM_LIBRARY_DIRS}" "${llvmPackages.lld.lib}/lib ${llvmPackages.llvm.lib}/lib"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
llvmPackages.llvm
|
||||
llvmPackages.lld
|
||||
curl
|
||||
libxml2
|
||||
libffi
|
||||
] ++ lib.optionals llvmPackages.stdenv.isDarwin [
|
||||
xar
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ python3 ];
|
||||
|
||||
doCheck = true;
|
||||
doCheck = llvmPackages.stdenv.system == "x86_64-linux";
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
( cd ../resources/testproject; ../../build/c3c build )
|
||||
( cd ../test; python src/tester.py ../build/c3c test_suite )
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 c3c $out/bin/c3c
|
||||
cp -r lib $out
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user