9 c2ffiBranch = "llvm-16.0.0";
10 llvmPackages = llvmPackages_16;
13 llvmPackages.stdenv.mkDerivation {
14 pname = "c2ffi-${c2ffiBranch}";
15 version = "0-unstable-2023-11-18";
17 src = fetchFromGitHub {
20 rev = "097cbe61ca02dc79ea60859aa056975131a9d985";
21 hash = "sha256-pflolW5OoEkVDozy4cjCdUIVxgE/SfVKIhQyNBDhENc=";
24 passthru.updateScript = unstableGitUpdater {
25 url = "https://github.com/rpav/c2ffi.git";
27 # Tags only exist for older LLVM versions, so they would result in nonsense names
28 # like: c2ffi-llvm-16.0.0-11.0.0.0-unstable-YYYY-MM-DD
29 hardcodeZeroVersion = true;
42 # This isn't much, but...
43 doInstallCheck = true;
44 installCheckPhase = ''
45 $out/bin/c2ffi --help 2>&1 >/dev/null
48 # LLVM may be compiled with -fno-rtti, so let's just turn it off.
49 # A mismatch between lib{clang,LLVM}* and us can lead to the link time error:
50 # undefined reference to `typeinfo for clang::ASTConsumer'
51 env.CXXFLAGS="-fno-rtti";
54 homepage = "https://github.com/rpav/c2ffi";
55 description = "LLVM based tool for extracting definitions from C, C++, and Objective C header files for use with foreign function call interfaces";
56 mainProgram = "c2ffi";
57 license = licenses.lgpl21Only;