nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 ocamlPackages,
6 pkg-config,
7 autoreconfHook,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "coccinelle";
12 version = "1.3.0";
13
14 src = fetchFromGitHub {
15 repo = "coccinelle";
16 rev = finalAttrs.version;
17 owner = "coccinelle";
18 hash = "sha256-be95cuFP6bAdpCT0Z9zBAx9cc3gYuuXAmHYaI/bmyTE=";
19 };
20
21 nativeBuildInputs = with ocamlPackages; [
22 autoreconfHook
23 pkg-config
24 ocaml
25 findlib
26 menhir
27 ];
28
29 buildInputs = with ocamlPackages; [
30 ocaml_pcre
31 parmap
32 pyml
33 stdcompat
34 ];
35
36 strictDeps = true;
37
38 postPatch = ''
39 # Ensure dependencies from Nixpkgs are picked up.
40 rm -rf bundles/
41 '';
42
43 meta = {
44 description = "Program to apply semantic patches to C code";
45 longDescription = ''
46 Coccinelle is a program matching and transformation engine which
47 provides the language SmPL (Semantic Patch Language) for
48 specifying desired matches and transformations in C code.
49 Coccinelle was initially targeted towards performing collateral
50 evolutions in Linux. Such evolutions comprise the changes that
51 are needed in client code in response to evolutions in library
52 APIs, and may include modifications such as renaming a function,
53 adding a function argument whose value is somehow
54 context-dependent, and reorganizing a data structure. Beyond
55 collateral evolutions, Coccinelle is successfully used (by us
56 and others) for finding and fixing bugs in systems code.
57 '';
58
59 homepage = "https://coccinelle.gitlabpages.inria.fr/website/";
60 license = lib.licenses.gpl2Only;
61 platforms = lib.platforms.unix;
62 maintainers = [ lib.maintainers.thoughtpolice ];
63 };
64})