0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

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,
cmake,
zlib,
nix-update-script,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "assimp";
version = "5.4.3";
version = "6.0.2";
outputs = [
"out"
"lib"
@ -18,28 +19,42 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "assimp";
repo = "assimp";
rev = "v${version}";
hash = "sha256-sOYhYHBz3Tg+pi1OIJ1mGmsjEc6dPO6nFH0aolfpLRA=";
tag = "v${finalAttrs.version}";
hash = "sha256-ixtqK+3iiL17GEbEVHz5S6+gJDDQP7bVuSfRMJMGEOY=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
zlib
];
cmakeFlags = [ "-DASSIMP_BUILD_ASSIMP_TOOLS=ON" ];
strictDeps = true;
enableParallelBuilding = true;
env.NIX_CFLAGS_COMPILE = toString ([
# Needed with GCC 12
"-Wno-error=array-bounds"
]);
cmakeFlags = [
(lib.cmakeBool "ASSIMP_BUILD_ASSIMP_TOOLS" true)
];
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";
mainProgram = "assimp";
homepage = "https://www.assimp.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ ehmry ];
platforms = platforms.linux ++ platforms.darwin;
license = lib.licenses.bsd3;
maintainers = [ ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
})

View file

@ -1,4 +1,5 @@
{
lib,
qtModule,
qtbase,
qtdeclarative,
@ -8,10 +9,23 @@
qtModule {
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 = [
qtbase
qtdeclarative
qtmultimedia
assimp
];
cmakeFlags = [
(lib.cmakeBool "FEATURE_qt3d_system_assimp" true) # use nix assimp
(lib.cmakeBool "TEST_assimp" true) # required for internal cmake asserts
];
}