11 stdenv.mkDerivation rec {
16 url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
17 hash = "sha256-nmRjT8TOZ5eyBLy4iXzhT90KtIyldpb3h2fFnK5XgJU=";
22 name = "CVE-2023-40305.part-1.patch";
23 url = "https://git.savannah.gnu.org/cgit/indent.git/patch/?id=df4ab2d19e247d059e0025789ba513418073ab6f";
24 hash = "sha256-OLXBlYTdEuFK8SIsyC5Xr/hHWlvXiRqY2h79w+H5pGk=";
27 name = "CVE-2023-40305.part-2.patch";
28 url = "https://git.savannah.gnu.org/cgit/indent.git/patch/?id=2685cc0bef0200733b634932ea7399b6cf91b6d7";
29 hash = "sha256-t+QF7N1aqQ28J2O8esZ2bc5K042cUuZR4MeMeuWIgPw=";
33 # avoid https://savannah.gnu.org/bugs/?64751
35 sed -E -i '/output\/else-comment-2-br(-ce)?.c/d' regression/TEST
36 sed -E -i 's/else-comment-2-br(-ce)?.c//g' regression/TEST
39 makeFlags = [ "AR=${stdenv.cc.targetPrefix}ar" ];
42 nativeBuildInputs = [ texinfo ];
43 buildInputs = [ libintl ];
44 depsBuildBuild = [ buildPackages.stdenv.cc ]; # needed when cross-compiling
46 env.NIX_CFLAGS_COMPILE = toString (
47 lib.optional stdenv.cc.isClang "-Wno-implicit-function-declaration"
48 ++ lib.optional (stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion stdenv.cc) "13") "-Wno-unused-but-set-variable"
51 hardeningDisable = [ "format" ];
55 passthru.tests.static = pkgsStatic.indent;
57 homepage = "https://www.gnu.org/software/indent/";
58 description = "Source code reformatter";
59 mainProgram = "indent";
60 license = lib.licenses.gpl3Plus;
61 maintainers = [ lib.maintainers.mmahut ];
62 platforms = lib.platforms.unix;