nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 bison,
6 flex,
7 readline,
8 ncurses,
9}:
10
11stdenv.mkDerivation {
12 pname = "cdecl-blocks";
13 version = "2.5-unstable-2024-05-07";
14
15 src = fetchFromGitHub {
16 owner = "ridiculousfish";
17 repo = "cdecl-blocks";
18 rev = "0fdb58f78bdc96409b07fa2945673e2d80c74557";
19 hash = "sha256-gR+a7J20oZMnHkM1LNwQOQaUt1BO84K5CzvaASHAnRE=";
20 };
21
22 patches = [ ./test_remove_interactive_line.patch ];
23
24 strictDeps = true;
25
26 nativeBuildInputs = [
27 bison
28 flex
29 ];
30
31 buildInputs = [
32 readline
33 ncurses
34 ];
35
36 env = {
37 NIX_CFLAGS_COMPILE = toString (
38 [
39 "-DBSD"
40 "-DUSE_READLINE"
41 ]
42 ++ lib.optionals stdenv.cc.isClang [
43 "-Wno-error=int-conversion"
44 "-Wno-error=incompatible-function-pointer-types"
45 ]
46 );
47 NIX_LDFLAGS = "-lreadline";
48 };
49
50 makeFlags = [
51 "CC=${lib.getExe stdenv.cc}"
52 "PREFIX=${placeholder "out"}"
53 "BINDIR=${placeholder "out"}/bin"
54 "MANDIR=${placeholder "out"}/man1"
55 "CATDIR=${placeholder "out"}/cat1"
56 ];
57
58 doCheck = true;
59 checkTarget = "test";
60
61 preInstall = ''
62 mkdir -p $out/bin;
63 '';
64
65 meta = {
66 description = "Translator English -- C/C++ declarations";
67 homepage = "https://cdecl.org";
68 license = lib.licenses.publicDomain;
69 maintainers = with lib.maintainers; [ sigmanificient ];
70 platforms = lib.platforms.unix;
71 mainProgram = "cdecl";
72 };
73}