From a9c6372eba7a2bbf72d93299d17c00148f873e43 Mon Sep 17 00:00:00 2001 From: Floris Stoica Date: Fri, 1 Dec 2023 23:49:52 +0200 Subject: [PATCH] c3c: unstable-2021-07-30 -> 0.5.5 Update c3c compiler to the newest released stable version. --- pkgs/development/compilers/c3c/default.nix | 33 +++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/c3c/default.nix b/pkgs/development/compilers/c3c/default.nix index b68ffc045f646..4310ad931792e 100644 --- a/pkgs/development/compilers/c3c/default.nix +++ b/pkgs/development/compilers/c3c/default.nix @@ -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; {