Skip to content

Commit

Permalink
Merge pull request #271534 from SMFloris/update-c3c
Browse files Browse the repository at this point in the history
c3c: unstable-2021-07-30 -> 0.5.5
  • Loading branch information
wegank authored May 7, 2024
2 parents 09a7bf6 + a9c6372 commit d14b019
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions pkgs/development/compilers/c3c/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; {
Expand Down

0 comments on commit d14b019

Please sign in to comment.