xmlto: fix build with clang 16

Fix implicit `int` on `main` and `static` declarations. Clang 16 reports
these as errors.

+17 -3
+17 -3
pkgs/tools/typesetting/xmlto/default.nix
··· 1 - { fetchurl, lib, stdenv, libxml2, libxslt 2 - , docbook_xml_dtd_45, docbook_xsl, w3m 3 , bash, getopt, makeWrapper }: 4 5 stdenv.mkDerivation rec { ··· 10 sha256 = "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i"; 11 }; 12 13 postPatch = '' 14 patchShebangs xmlif/test/run-test 15 ··· 23 24 # `libxml2' provides `xmllint', needed at build-time and run-time. 25 # `libxslt' provides `xsltproc', used by `xmlto' at run-time. 26 - nativeBuildInputs = [ makeWrapper getopt ]; 27 buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl ]; 28 29 postInstall = ''
··· 1 + { fetchurl, fetchpatch, lib, stdenv, libxml2, libxslt 2 + , docbook_xml_dtd_45, docbook_xsl, flex, w3m 3 , bash, getopt, makeWrapper }: 4 5 stdenv.mkDerivation rec { ··· 10 sha256 = "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i"; 11 }; 12 13 + # Note: These patches modify `xmlif/xmlif.l`, which requires `flex` to be rerun. 14 + patches = [ 15 + # Fixes implicit `int` on `main`, which is an error with clang 16. 16 + (fetchpatch { 17 + url = "https://pagure.io/xmlto/c/8e34f087bf410bcc5fe445933d6ad9bae54f24b5.patch"; 18 + hash = "sha256-z5riDBZBVuFeBcjI++dAl3nTIgOPau4Gag0MJbYt+cc="; 19 + }) 20 + # Fixes implicit `int` on `ifsense`, which is also an error with clang 16. 21 + (fetchpatch { 22 + url = "https://pagure.io/xmlto/c/1375e2df75530cd198bd16ac3de38e2b0d126276.patch"; 23 + hash = "sha256-fM6ZdTigrcC9cbXiKu6oa5Hs71mrREockB1wRlw6nDk="; 24 + }) 25 + ]; 26 + 27 postPatch = '' 28 patchShebangs xmlif/test/run-test 29 ··· 37 38 # `libxml2' provides `xmllint', needed at build-time and run-time. 39 # `libxslt' provides `xsltproc', used by `xmlto' at run-time. 40 + nativeBuildInputs = [ makeWrapper flex getopt ]; 41 buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl ]; 42 43 postInstall = ''