nixpkgs/pkgs/tools/misc/fluent-bit/fix-luajit-darwin.patch
Sebastián Mancilla 09a54b14cd fluent-bit: fix build on darwin
- Update fix-luajit-darwin.patch to apply to the current version.

- Add a patch to fix compilation of cmetrics on darwin.

- Use default stdenv instead of gccStdenv. The only requirement for GCC
  was the bundled luajit having 'DEFAULT_CC = gcc' hardcoded, but it has
  been fixed with the updated fix-luajit-darwin.patch by adding
  DEFAULT_CC=cc to the arguments.
2021-11-21 09:19:33 -05:00

30 lines
1.1 KiB
Diff

diff -Naur fluent-bit.old/cmake/luajit.cmake fluent-bit.new/cmake/luajit.cmake
--- fluent-bit.old/cmake/luajit.cmake
+++ fluent-bit.new/cmake/luajit.cmake
@@ -12,15 +12,7 @@
set(LUAJIT_DEST ${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set(CFLAGS "${CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT} -fno-stack-check")
- if (CMAKE_HOST_SYSTEM_VERSION VERSION_GREATER_EQUAL 20
- AND CMAKE_HOST_SYSTEM_VERSION VERSION_LESS 21)
- set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=11.0")
- else()
- set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=10.15")
- endif()
-else()
- set(DEPLOYMENT_TARGET "")
+ set(CFLAGS "${CFLAGS} -fno-stack-check")
endif()
# luajit (UNIX)
@@ -30,7 +22,7 @@
EXCLUDE_FROM_ALL TRUE
SOURCE_DIR ${LUAJIT_SRC}
CONFIGURE_COMMAND ./configure
- BUILD_COMMAND $(MAKE) CROSS=${CROSS_PREFIX} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC" ${DEPLOYMENT_TARGET}
+ BUILD_COMMAND $(MAKE) DEFAULT_CC=cc CROSS=${CROSS_PREFIX} CFLAGS=${CFLAGS} BUILD_MODE=static "XCFLAGS=-fPIC"
INSTALL_COMMAND cp src/libluajit.a "${LUAJIT_DEST}/lib/libluajit.a")
# luajit (Windows)