assimp: 5.4.3 -> 6.0.2, modernize (#422357)

This commit is contained in:
K900 2025-07-04 15:55:19 +03:00 committed by GitHub
commit e6817f33bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 14 deletions

View File

@ -4,11 +4,12 @@
fetchFromGitHub, fetchFromGitHub,
cmake, cmake,
zlib, zlib,
nix-update-script,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "assimp"; pname = "assimp";
version = "5.4.3"; version = "6.0.2";
outputs = [ outputs = [
"out" "out"
"lib" "lib"
@ -18,28 +19,42 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "assimp"; owner = "assimp";
repo = "assimp"; repo = "assimp";
rev = "v${version}"; tag = "v${finalAttrs.version}";
hash = "sha256-sOYhYHBz3Tg+pi1OIJ1mGmsjEc6dPO6nFH0aolfpLRA="; hash = "sha256-ixtqK+3iiL17GEbEVHz5S6+gJDDQP7bVuSfRMJMGEOY=";
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ buildInputs = [
zlib zlib
]; ];
cmakeFlags = [ "-DASSIMP_BUILD_ASSIMP_TOOLS=ON" ]; strictDeps = true;
enableParallelBuilding = true;
env.NIX_CFLAGS_COMPILE = toString ([ cmakeFlags = [
# Needed with GCC 12 (lib.cmakeBool "ASSIMP_BUILD_ASSIMP_TOOLS" true)
"-Wno-error=array-bounds" ];
]);
meta = with lib; { # Some matrix tests fail on non-86_64-linux:
# https://github.com/assimp/assimp/issues/6246
# https://github.com/assimp/assimp/issues/6247
doCheck = !(stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isx86_64);
checkPhase = ''
runHook preCheck
bin/unit
runHook postCheck
'';
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/assimp/assimp/releases/tag/${finalAttrs.src.tag}";
description = "Library to import various 3D model formats"; description = "Library to import various 3D model formats";
mainProgram = "assimp"; mainProgram = "assimp";
homepage = "https://www.assimp.org/"; homepage = "https://www.assimp.org/";
license = licenses.bsd3; license = lib.licenses.bsd3;
maintainers = with maintainers; [ ehmry ]; maintainers = [ ];
platforms = platforms.linux ++ platforms.darwin; platforms = lib.platforms.linux ++ lib.platforms.darwin;
}; };
} })

View File

@ -1,4 +1,5 @@
{ {
lib,
qtModule, qtModule,
qtbase, qtbase,
qtdeclarative, qtdeclarative,
@ -8,10 +9,23 @@
qtModule { qtModule {
pname = "qt3d"; pname = "qt3d";
# make absolutely sure the vendored assimp is not used
# patch cmake to accept assimp 6.x versions
postPatch = ''
rm -rf src/3rdparty/assimp/src
substituteInPlace src/core/configure.cmake --replace-fail "WrapQt3DAssimp 5" "WrapQt3DAssimp 6"
'';
propagatedBuildInputs = [ propagatedBuildInputs = [
qtbase qtbase
qtdeclarative qtdeclarative
qtmultimedia qtmultimedia
assimp assimp
]; ];
cmakeFlags = [
(lib.cmakeBool "FEATURE_qt3d_system_assimp" true) # use nix assimp
(lib.cmakeBool "TEST_assimp" true) # required for internal cmake asserts
];
} }