smatch: move to by-name and modernize derivation (#343686)

This commit is contained in:
Aleksana
2024-09-22 23:22:02 +08:00
committed by GitHub
3 changed files with 50 additions and 45 deletions
+50
View File
@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
sqlite,
openssl,
buildllvmsparse ? false,
buildc2xml ? false,
libllvm,
libxml2,
}:
let
version = "1.73";
in
stdenv.mkDerivation {
pname = "smatch";
inherit version;
src = fetchFromGitHub {
owner = "error27";
repo = "smatch";
rev = version;
sha256 = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME=";
};
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [
"-Wno-incompatible-function-pointer-types"
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
sqlite
openssl
] ++ lib.optionals buildllvmsparse [ libllvm ] ++ lib.optionals buildc2xml [ libxml2.dev ];
makeFlags = [
"PREFIX=${placeholder "out"}"
"CXX=${stdenv.cc.targetPrefix}c++"
];
meta = {
description = "Semantic analysis tool for C";
homepage = "https://sparse.docs.kernel.org/";
maintainers = with lib.maintainers; [ momeemt ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
};
}
@@ -1,43 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, sqlite
, openssl
, buildllvmsparse ? false
, buildc2xml ? false
, libllvm
, libxml2
}:
stdenv.mkDerivation rec {
pname = "smatch";
version = "1.73";
src = fetchFromGitHub {
owner = "error27";
repo = "smatch";
rev = version;
sha256 = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME=";
};
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isClang [
"-Wno-incompatible-function-pointer-types"
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ sqlite openssl ]
++ lib.optionals buildllvmsparse [ libllvm ]
++ lib.optionals buildc2xml [ libxml2.dev ];
makeFlags = [ "PREFIX=${placeholder "out"}" "CXX=${stdenv.cc.targetPrefix}c++" ];
meta = with lib; {
description = "Semantic analysis tool for C";
homepage = "https://sparse.docs.kernel.org/";
maintainers = [ ];
license = licenses.gpl2Plus;
platforms = platforms.all;
};
}
-2
View File
@@ -18628,8 +18628,6 @@ with pkgs;
sloc = nodePackages.sloc;
smatch = callPackage ../development/tools/analysis/smatch { };
smc = callPackage ../tools/misc/smc { };
snakemake = callPackage ../applications/science/misc/snakemake { };