Commit 02fa99fd authored by Luna Nova's avatar Luna Nova Committed by Matthieu Coudron
Browse files

lua_5_3_compat, lua_5_4_compat: set LUA_COMPAT_5_x as LUA_COMPAT_ALL was removed

Fixes NixOS#218227
parent 0c657495
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ plat = if (stdenv.isLinux && lib.versionOlder self.luaversion "5.4") then "linux
       else if stdenv.hostPlatform.isBSD then "bsd"
       else if stdenv.hostPlatform.isUnix then "posix"
       else "generic";

compatFlags = if (lib.versionOlder self.luaversion "5.3") then " -DLUA_COMPAT_ALL"
              else if (lib.versionOlder self.luaversion "5.4") then " -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2"
              else " -DLUA_COMPAT_5_3";
in

stdenv.mkDerivation rec {
@@ -89,7 +93,7 @@ stdenv.mkDerivation rec {
  configurePhase = ''
    runHook preConfigure

    makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat " -DLUA_COMPAT_ALL"} $(${
    makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat compatFlags} $(${
      if lib.versionAtLeast luaversion "5.2" then "SYSCFLAGS" else "MYCFLAGS"})' )
    makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"})