Without the `no-werror.patch`, the compilation would fail with the following warning:
```
clang-7: error: argument unused during compilation: '-fno-strict-overflow' [-Werror,-Wunused-command-line-argument]
```
To fix this, the compiler command line options `-pedantic-errors` and `-Werror` were patched out of the build script so that the warning would not become an error and stop the build. This is not ideal as this piece of code is changed fairly frequently, which requires fixing the patch. In the next kitty version the patch would need to be fixed again.
A better alternative is to just not pass `-fno-strict-overflow` to the compiler. This is done by disabling the `strictoverflow` hardening feature.
Otherwise it fails with:
In file included from /build/source/src/allegro/include/allegro/base.h:41,
from /build/source/src/allegro/include/allegro.h:25,
from /build/source/src/./she/alleg4/alleg_surface.h:11,
from /build/source/src/she/alleg4/alleg_surface.cpp:11:
/build/source/src/allegro/include/allegro/alcompat.h:44:22: error: conflicting declaration of C function 'fixed fadd(fixed, fixed)'
44 | AL_ALIAS(fixed fadd(fixed x, fixed y), fixadd(x, y))
| ^~~~
/build/source/src/allegro/include/allegro/internal/alconfig.h:164:49: note: in definition of macro 'AL_ALIAS'
164 | static __attribute__((unused)) __inline__ DECL \
| ^~~~
In file included from /nix/store/y57skwl8a5vbkrjrc30ygdw9vr1p6n19-gcc-9.2.0/include/c++/9.2.0/cmath:45,
from /nix/store/y57skwl8a5vbkrjrc30ygdw9vr1p6n19-gcc-9.2.0/include/c++/9.2.0/math.h:36,
from /build/source/src/./base/base.h:13,
from /build/source/src/./config.h:40,
from /build/source/src/she/alleg4/alleg_surface.cpp:8:
/nix/store/2v6pi2wj3lcsc3j48n7flx9mgqyii1lv-glibc-2.30-dev/include/bits/mathcalls-narrow.h:24:20: note: previous declaration 'float fadd(double, double)'
24 | __MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
| ^~~~~~~~~~~~~~~
Includes the following fixes for Darwin:
- Build an application bundle
- Don't install the .desktop file and icons
- Get rid of unused cmake variables
- Don't list avahi as a dependency, since it's not used
This avoids using NIX_CFLAGS_COMPILE by switching to hardeningDisable.
The hack is also only needed for darwin sources and is not specific to
clang.
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>