···6363 "-DWARNINGS_ARE_ERRORS=ON"
6464 ];
65656666+ NIX_CFLAGS_COMPILE = [
6767+ # Needed with GCC 12
6868+ "-Wno-error=mismatched-new-delete"
6969+ "-Wno-error=use-after-free"
7070+ ];
7171+6672 postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
6773 # Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a
6874 # bundle. That adds alot of overhead for not much benefit (CPack is currently abit broken, and needs impure access
···1111 sha256 = "sha256-xr7SYzQZiY4Bp8w1AxDX2TS/WRyrcln8JYGqTADq+ng=";
1212 };
13131414+ # Needed with GCC 12
1515+ postPatch = ''
1616+ sed '1i#include <iterator>' -i src/lyxfind.cpp
1717+ sed '1i#include <cstring>' -i src/insets/InsetListings.cpp
1818+ '';
1919+1420 # LaTeX is used from $PATH, as people often want to have it with extra pkgs
1521 nativeBuildInputs = [ pkg-config makeWrapper ];
1622 buildInputs = [
···11+From c1c2000c35ff39b09cb70fbdf66a107d3b17a674 Mon Sep 17 00:00:00 2001
22+From: Stephan Bergmann <sbergman@redhat.com>
33+Date: Wed, 12 Oct 2022 08:40:49 +0200
44+Subject: [PATCH] Fix missing #include <time.h>
55+MIME-Version: 1.0
66+Content-Type: text/plain; charset=UTF-8
77+Content-Transfer-Encoding: 8bit
88+99+At least on recent Fedora 37 beta, building now failed with
1010+1111+> CLucene/document/DateTools.cpp:26:19: error: ‘gmtime’ was not declared in this scope
1212+> 26 | tm *ptm = gmtime(&secs);
1313+> | ^~~~~~
1414+1515+etc.
1616+1717+As it turns out, after 22f9d40320e3deeaa8d6aaa7a770077c20a21dae "git-svn-id:
1818+https://clucene.svn.sourceforge.net/svnroot/clucene/branches/lucene2_3_2@2672
1919+20ef185c-fe11-0410-a618-ba9304b01011" on 2008-06-26 had commented out
2020+_CL_TIME_WITH_SYS_TIME in clucene-config.h.cmake as "not actually used for
2121+anything", then cceccfb52917b5f4da447f1cf20c135952d41442 "Presenting DateTools
2222+and deprecating DateField. DateTools still requires some testing and its own
2323+unit testing" on 2008-06-29 had introduced this use of it (into then
2424+src/CLucene/document/DateTools.H). And apparently most build environments have
2525+silently been happy ever since when the dead leading check for
2626+_CL_TIME_WITH_SYS_TIME didn't include both <sys/time.h> and <time.h>, but the
2727+following check for _CL_HAVE_SYS_TIME_H only included <sys/time.h> but not
2828+<time.h>.
2929+---
3030+ src/shared/CLucene/clucene-config.h.cmake | 3 +--
3131+ 1 file changed, 1 insertion(+), 2 deletions(-)
3232+3333+diff --git a/src/shared/CLucene/clucene-config.h.cmake b/src/shared/CLucene/clucene-config.h.cmake
3434+index bd8683a5..6fe0f92b 100644
3535+--- a/src/shared/CLucene/clucene-config.h.cmake
3636++++ b/src/shared/CLucene/clucene-config.h.cmake
3737+@@ -100,8 +100,7 @@ ${SYMBOL__T}
3838+ //#cmakedefine _CL_STAT_MACROS_BROKEN
3939+4040+ /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
4141+-//not actually used for anything...
4242+-//#cmakedefine _CL_TIME_WITH_SYS_TIME 1
4343++#cmakedefine _CL_TIME_WITH_SYS_TIME 1
4444+4545+ /* Define that we will be using -fvisibility=hidden, and
4646+ * make public classes visible using __attribute__ ((visibility("default")))
4747+--
4848+2.37.3
4949+
···1313 nativeBuildInputs = [ cmake python3 jq ];
1414 buildInputs = [ libX11 libXext zlib ];
15151616+ NIX_CFLAGS_COMPILE = [
1717+ # Needed with GCC 12
1818+ "-Wno-error=array-bounds"
1919+ "-Wno-error=uninitialized"
2020+ ];
2121+1622 # Make sure we include the drivers and icd files in the output as the cmake
1723 # generated install command only puts in the spirv-tools stuff.
1824 installPhase = ''
···6565 # Gather additional entropy at boot time for systems that may not have appropriate entropy sources.
6666 GCC_PLUGIN_LATENT_ENTROPY = yes;
67676868- GCC_PLUGIN_STRUCTLEAK = yes; # A port of the PaX structleak plugin
6969- GCC_PLUGIN_STRUCTLEAK_BYREF_ALL = yes; # Also cover structs passed by address
6868+ GCC_PLUGIN_STRUCTLEAK = option yes; # A port of the PaX structleak plugin
6969+ GCC_PLUGIN_STRUCTLEAK_BYREF_ALL = option yes; # Also cover structs passed by address
7070 GCC_PLUGIN_STACKLEAK = whenAtLeast "4.20" yes; # A port of the PaX stackleak plugin
7171 GCC_PLUGIN_RANDSTRUCT = whenOlder "5.19" yes; # A port of the PaX randstruct plugin
7272 GCC_PLUGIN_RANDSTRUCT_PERFORMANCE = whenOlder "5.19" yes;
···6060 (lib.optionalString (!useClang) "-DUSE_LD=GOLD")
6161 ];
62626363+ NIX_CFLAGS_COMPILE = [
6464+ # Needed with GCC 12
6565+ "-Wno-error=missing-template-keyword"
6666+ ];
6767+6368 inherit patches;
64696570 # fix up the use of the very weird and custom 'fdb_install' command by just