Files
ghpzin e26b408a3a tradcpp: fix build with gcc15
- add "-std=gnu17" to `env.NIX_CFLAGS_COMPILE`

Last update from upstream was in 2019.

Fixes build failure with gcc15:
```
In file included from main.c:36:
bool.h:36:13: error: 'bool' cannot be defined via 'typedef'
   36 | typedef int bool;
      |             ^~~~
bool.h:36:13: note: 'bool' is a keyword with '-std=c23' onwards
bool.h:36:1: warning: useless type name in empty declaration
   36 | typedef int bool;
      | ^~~~~~~
```
2025-12-08 17:03:06 +03:00

34 lines
758 B
Nix

{
lib,
stdenv,
fetchurl,
autoreconfHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "tradcpp";
version = "0.5.3";
src = fetchurl {
url = "https://ftp.netbsd.org/pub/NetBSD/misc/dholland/tradcpp-${finalAttrs.version}.tar.gz";
hash = "sha256-4XufQs90s2DVaRvFn7U/N+QVgcRbdfzWS7ll5eL+TF4=";
};
# tradcpp only comes with BSD-make Makefile; the patch adds configure support
patches = [ ./tradcpp-configure.patch ];
# Fix build with gcc15
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
strictDeps = true;
nativeBuildInputs = [ autoreconfHook ];
meta = {
description = "Traditional (K&R-style) C macro preprocessor";
mainProgram = "tradcpp";
platforms = lib.platforms.all;
license = lib.licenses.bsd2;
};
})