Commit a55906b5 authored by Sigmanificient's avatar Sigmanificient
Browse files

bootil: fix build with gcc 14

parent 9acf0d6d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
  stdenv,
  fetchFromGitHub,
  premake4,
  zlib,
}:

stdenv.mkDerivation {
@@ -16,12 +17,18 @@ stdenv.mkDerivation {
    sha256 = "1njdj6nvmwf7j2fwqbyvd1cf5l52797vk2wnsliylqdzqcjmfpij";
  };

  enableParallelBuilding = true;

  # Avoid guessing where files end up. Just use current directory.
  postPatch = ''
    substituteInPlace projects/premake4.lua \
      --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
      --replace-fail 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
    substituteInPlace projects/bootil.lua \
      --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
      --replace-fail 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'

    rm src/3rdParty/zlib -rf
    mkdir src/3rdParty/zlib
    cp -r ${zlib.dev}/include/z{conf,lib}.h src/3rdParty/zlib
  '';

  nativeBuildInputs = [ premake4 ];