1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 22:50:49 +00:00

Merge pull request #119564 from attila-lendvai/c2ffi

This commit is contained in:
Sandro 2021-06-21 12:30:41 +02:00 committed by GitHub
commit 7e567a3d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,56 @@
{ lib
, fetchFromGitHub
, cmake
, llvmPackages_11
, unstableGitUpdater
}:
let
c2ffiBranch = "llvm-11.0.0";
llvmPackages = llvmPackages_11;
in
llvmPackages.stdenv.mkDerivation {
pname = "c2ffi-${c2ffiBranch}";
version = "unstable-2021-04-15";
src = fetchFromGitHub {
owner = "rpav";
repo = "c2ffi";
rev = "0255131f80b21334e565231331c2b451b6bba8c4";
sha256 = "0ihysgqjyg5xwi098hxf15lpdi6g4nwpzczp495is912c48fy6b6";
};
passthru.updateScript = unstableGitUpdater {
url = "https://github.com/rpav/c2ffi.git";
branch = c2ffiBranch;
};
nativeBuildInputs = [
cmake
];
buildInputs = [
llvmPackages.llvm
llvmPackages.clang
llvmPackages.libclang
];
# This isn't much, but...
doInstallCheck = true;
installCheckPhase = ''
$out/bin/c2ffi --help 2>&1 >/dev/null
'';
# LLVM may be compiled with -fno-rtti, so let's just turn it off.
# A mismatch between lib{clang,LLVM}* and us can lead to the link time error:
# undefined reference to `typeinfo for clang::ASTConsumer'
CXXFLAGS="-fno-rtti";
meta = with lib; {
homepage = "https://github.com/rpav/c2ffi";
description = "An LLVM based tool for extracting definitions from C, C++, and Objective C header files for use with foreign function call interfaces";
license = licenses.lgpl21Only;
maintainers = with maintainers; [ attila-lendvai ];
};
}

View file

@ -14117,6 +14117,8 @@ in
swig = swig3;
swigWithJava = swig;
c2ffi = callPackage ../development/tools/misc/c2ffi { };
swfmill = callPackage ../tools/video/swfmill { };
swftools = callPackage ../tools/video/swftools {