about summary refs log tree commit diff
path: root/pkgs/applications/graphics/foxotron
diff options
context:
space:
mode:
authorManuel Frischknecht <manuel.frischknecht@macd.com>2024-01-19 01:25:41 +0100
committerManuel Frischknecht <manuel.frischknecht@gmail.com>2024-01-22 21:24:20 +0100
commit5ff0ef514f4a5f69213f933b54474bc83f231bd6 (patch)
tree9419b709356a3587b7024ce32bda28237c5c364d /pkgs/applications/graphics/foxotron
parent27a65c2b26d67d564dd52135993ceac3ceb0d067 (diff)
foxotron: fetch assimp patches to fix build
Foxotron vendors a lot of dependencies (see the `external` directory and
the various submodules it contains). One of them (`FBX`) fails to build
with current versions of GCC because the compiler cannot resolve the
type `std::uint32_t`. The affected file still imports the type via
`#include <stdint.h>`, which has been superseded by `#include <cstdint>`
in C++11.

The upstream patch applied here fixes this build issue by introducing
the missing include line of `<cstdint>`.

The new addition to `postPatch` disables a `-Werror` setting that
(currently) seemingly only causes assimp builds failures on darwin.

Co-authored-by: Cosima Neidahl <opna2608@protonmail.com>
Diffstat (limited to 'pkgs/applications/graphics/foxotron')
-rw-r--r--pkgs/applications/graphics/foxotron/default.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/foxotron/default.nix b/pkgs/applications/graphics/foxotron/default.nix
index af16095a7d5da..079515b4b2143 100644
--- a/pkgs/applications/graphics/foxotron/default.nix
+++ b/pkgs/applications/graphics/foxotron/default.nix
@@ -1,6 +1,7 @@
 { stdenv
 , lib
 , fetchFromGitHub
+, fetchpatch
 , nix-update-script
 , cmake
 , pkg-config
@@ -35,9 +36,24 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-s1eWZMVitVSP7nJJ5wXvnV8uI6yto7LmvlvocOwVAxw=";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "0001-assimp-Include-cstdint-for-std-uint32_t.patch";
+      url = "https://github.com/assimp/assimp/commit/108e3192a201635e49e99a91ff2044e1851a2953.patch";
+      stripLen = 1;
+      extraPrefix = "externals/assimp/";
+      hash = "sha256-rk0EFmgeZVwvx3NJOOob5Jwj9/J+eOtuAzfwp88o+J4=";
+    })
+  ];
+
   postPatch = ''
     substituteInPlace CMakeLists.txt \
       --replace "set(CMAKE_OSX_ARCHITECTURES x86_64)" ""
+
+    # Outdated vendored assimp, many warnings with newer compilers, too old for CMake option to control this
+    # Note that this -Werror caused issues on darwin, so make sure to re-check builds there before removing this
+    substituteInPlace externals/assimp/code/CMakeLists.txt \
+      --replace 'TARGET_COMPILE_OPTIONS(assimp PRIVATE -Werror)' ""
   '';
 
   nativeBuildInputs = [ cmake pkg-config makeWrapper ];