assimp: fix build with gcc15
- add patch from merged upstream PR: https://www.github.com/assimp/assimp/pull/6283 Fixes build failure with gcc15: ``` /build/source/code/AssetLib/X3D/X3DGeoHelper.cpp: In static member function 'static void Assimp::X3DGeoHelper::coordIdx_str2lines_arr(const std::vector<int>&, std::vector<aiFace>&)': /build/source/code/AssetLib/X3D/X3DGeoHelper.cpp:194:20: error: array subscript -1 is outside array bounds of 'int [2305843009213693951]' [-Werror=array-bounds=] 194 | if (f_data.back() != (-1)) { | ~~~~~~~~~~~^~ In file included from /nix/store/9jzssiinw6a2dib6k3hzd48j6ywck4iw-gcc-15.2.0/include/c++/15.2.0/x86_64-unknown-linux-gnu/bits/c++allocator.h:33, from /nix/store/9jzssiinw6a2dib6k3hzd48j6ywck4iw-gcc-15.2.0/include/c++/15.2.0/bits/allocator.h:46, from /nix/store/9jzssiinw6a2dib6k3hzd48j6ywck4iw-gcc-15.2.0/include/c++/15.2.0/string:45, from /build/source/include/assimp/types.h:78, from /build/source/code/AssetLib/X3D/X3DGeoHelper.h:6, from /build/source/code/AssetLib/X3D/X3DGeoHelper.cpp:1: ```
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cmake,
|
||||
zlib,
|
||||
nix-update-script,
|
||||
@@ -23,6 +24,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-ixtqK+3iiL17GEbEVHz5S6+gJDDQP7bVuSfRMJMGEOY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix build with gcc15
|
||||
# https://github.com/assimp/assimp/pull/6283
|
||||
(fetchpatch {
|
||||
name = "assimp-fix-invalid-vector-gcc15.patch";
|
||||
url = "https://github.com/assimp/assimp/commit/59bc03d931270b6354690512d0c881eec8b97678.patch";
|
||||
hash = "sha256-O+JPwcOdyFtmFE7eZojHo1DUavF5EhLYlUyxtYo/KF4=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [
|
||||
|
||||
Reference in New Issue
Block a user