at 23.05-pre 1.4 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, cmake 5, libclang 6, libffi 7, libxml2 8, llvm 9, sphinx 10, zlib 11, withManual ? true 12, withHTML ? true 13}: 14 15stdenv.mkDerivation (finalAttrs: { 16 pname = "castxml"; 17 version = "0.4.7"; 18 19 src = fetchFromGitHub { 20 owner = "CastXML"; 21 repo = "CastXML"; 22 rev = "v${finalAttrs.version}"; 23 hash = "sha256-h2sLwhlz8AHyBK6Bbci17dvLkQ/9WEClz4lwM3GVVK8="; 24 }; 25 26 nativeBuildInputs = [ 27 cmake 28 llvm.dev 29 ] ++ lib.optionals (withManual || withHTML) [ 30 sphinx 31 ]; 32 33 buildInputs = [ 34 libclang 35 libffi 36 libxml2 37 zlib 38 ]; 39 40 propagatedBuildInputs = [ 41 libclang 42 ]; 43 44 cmakeFlags = [ 45 "-DCLANG_RESOURCE_DIR=${libclang.dev}/" 46 "-DSPHINX_HTML=${if withHTML then "ON" else "OFF"}" 47 "-DSPHINX_MAN=${if withManual then "ON" else "OFF"}" 48 ]; 49 50 # 97% tests passed, 97 tests failed out of 2881 51 # mostly because it checks command line and nix append -isystem and all 52 doCheck = false; 53 # -E exclude 4 tests based on names 54 # see https://github.com/CastXML/CastXML/issues/90 55 checkPhase = '' 56 runHook preCheck 57 ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd' 58 runHook postCheck 59 ''; 60 61 meta = with lib; { 62 homepage = "https://github.com/CastXML/CastXML"; 63 description = "C-family Abstract Syntax Tree XML Output"; 64 license = licenses.asl20; 65 maintainers = with maintainers; [ AndersonTorres ]; 66 platforms = platforms.unix; 67 }; 68})