diff options
author | Attila Lendvai <attila@lendvai.name> | 2021-04-14 19:50:03 +0200 |
---|---|---|
committer | Attila Lendvai <attila@lendvai.name> | 2021-06-21 09:18:55 +0200 |
commit | aaeb941fcc289916734dd4047b0a530096f74f54 (patch) | |
tree | 5910c980639eafae2d6ae065a7c453523b76db9c /pkgs/development/tools/misc/c2ffi/default.nix | |
parent | 068b26fa111f9f1d1312167b338cf5f8a223acd9 (diff) | |
download | nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar.gz nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar.bz2 nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar.lz nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar.xz nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.tar.zst nixpkgs-aaeb941fcc289916734dd4047b0a530096f74f54.zip |
c2ffi: init at 2021-06-16
upstream doesn't have releases.
Diffstat (limited to 'pkgs/development/tools/misc/c2ffi/default.nix')
-rw-r--r-- | pkgs/development/tools/misc/c2ffi/default.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/tools/misc/c2ffi/default.nix b/pkgs/development/tools/misc/c2ffi/default.nix new file mode 100644 index 00000000000..b7a5b1dc7eb --- /dev/null +++ b/pkgs/development/tools/misc/c2ffi/default.nix @@ -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 ]; + }; +} |