mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 20:03:16 +00:00
ff1a94e523
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{ lib
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, llvmPackages_16
|
|
, unstableGitUpdater
|
|
}:
|
|
|
|
let
|
|
c2ffiBranch = "llvm-16.0.0";
|
|
llvmPackages = llvmPackages_16;
|
|
in
|
|
|
|
llvmPackages.stdenv.mkDerivation {
|
|
pname = "c2ffi-${c2ffiBranch}";
|
|
version = "0-unstable-2023-11-18";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rpav";
|
|
repo = "c2ffi";
|
|
rev = "097cbe61ca02dc79ea60859aa056975131a9d985";
|
|
hash = "sha256-pflolW5OoEkVDozy4cjCdUIVxgE/SfVKIhQyNBDhENc=";
|
|
};
|
|
|
|
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'
|
|
env.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";
|
|
mainProgram = "c2ffi";
|
|
license = licenses.lgpl21Only;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|