nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 72 lines 1.5 kB view raw
1{ 2 lib, 3 cmake, 4 fetchFromGitHub, 5 libffi, 6 libxml2, 7 llvmPackages, 8 sphinx, 9 stdenv, 10 testers, 11 zlib, 12 # Boolean flags 13 withHTML ? true, 14 withManual ? true, 15}: 16 17let 18 inherit (llvmPackages) libclang llvm; 19in 20stdenv.mkDerivation (finalAttrs: { 21 pname = "castxml"; 22 version = "0.6.13"; 23 24 src = fetchFromGitHub { 25 owner = "CastXML"; 26 repo = "CastXML"; 27 rev = "v${finalAttrs.version}"; 28 hash = "sha256-81I+Uh2HrEenp9iAW+TO+MUyXhXRMVDI+BZuVA4C/pE="; 29 }; 30 31 nativeBuildInputs = [ cmake ] ++ lib.optionals (withManual || withHTML) [ sphinx ]; 32 33 buildInputs = [ 34 libclang 35 libffi 36 libxml2 37 llvm 38 zlib 39 ]; 40 41 cmakeFlags = [ 42 (lib.cmakeOptionType "path" "CLANG_RESOURCE_DIR" 43 "${lib.getLib libclang}/lib/clang/${lib.versions.major libclang.version}" 44 ) 45 46 (lib.cmakeBool "SPHINX_HTML" withHTML) 47 (lib.cmakeBool "SPHINX_MAN" withManual) 48 ]; 49 50 doCheck = true; 51 52 strictDeps = true; 53 54 # darwin clang adds `-isysroot` when $SDKROOT is set. this confuses the 55 # regular expressions for the disabled tests below. 56 checkPhase = '' 57 runHook preCheck 58 ctest -E 'cmd.cc-gnu-(src-cxx|c-src-c)-cmd' -j $NIX_BUILD_CORES 59 runHook postCheck 60 ''; 61 62 passthru.tests = testers.testVersion { package = finalAttrs.finalPackage; }; 63 64 meta = { 65 homepage = "https://github.com/CastXML/CastXML"; 66 description = "C-family Abstract Syntax Tree XML Output"; 67 license = lib.licenses.asl20; 68 mainProgram = "castxml"; 69 maintainers = [ ]; 70 platforms = lib.platforms.unix; 71 }; 72})