nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoconf,
6 automake,
7 bison,
8 flex,
9 readline,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "cdecl";
14 version = "18.5";
15
16 src = fetchFromGitHub {
17 owner = "paul-j-lucas";
18 repo = "cdecl";
19 tag = "cdecl-${finalAttrs.version}";
20 hash = "sha256-cC098+W8cbcumBv+3ZFwGYXmens4u0aQSx5Lvw6maYM=";
21 };
22
23 strictDeps = true;
24 preConfigure = "./bootstrap";
25
26 nativeBuildInputs = [
27 autoconf
28 automake
29 bison
30 flex
31 ];
32 buildInputs = [ readline ];
33
34 env = {
35 NIX_CFLAGS_COMPILE = toString (
36 [
37 "-DBSD"
38 "-DUSE_READLINE"
39 ]
40 ++ lib.optionals stdenv.cc.isClang [
41 "-Wno-error=int-conversion"
42 "-Wno-error=incompatible-function-pointer-types"
43 ]
44 );
45 NIX_LDFLAGS = "-lreadline";
46 };
47
48 makeFlags = [
49 "CC=${stdenv.cc.targetPrefix}cc"
50 "PREFIX=${placeholder "out"}"
51 "BINDIR=${placeholder "out"}/bin"
52 "MANDIR=${placeholder "out"}/man1"
53 "CATDIR=${placeholder "out"}/cat1"
54 ];
55
56 doCheck = true;
57 checkTarget = "test";
58
59 preInstall = ''
60 mkdir -p $out/bin;
61 '';
62
63 outputs = [
64 "out"
65 "man"
66 ];
67
68 meta = {
69 description = "Composing and deciphering C (or C++) declarations or casts, aka 'gibberish'";
70 homepage = "https://github.com/paul-j-lucas/cdecl";
71 changelog = "https://github.com/paul-j-lucas/cdecl/blob/cdecl-${finalAttrs.version}/ChangeLog";
72 license = lib.licenses.gpl3Only;
73 maintainers = with lib.maintainers; [ sigmanificient ];
74 platforms = lib.platforms.unix;
75 mainProgram = "cdecl";
76 };
77})