diff --git a/pkgs/by-name/as/assimp/package.nix b/pkgs/by-name/as/assimp/package.nix index 33a3a0b5de58..183254f19388 100644 --- a/pkgs/by-name/as/assimp/package.nix +++ b/pkgs/by-name/as/assimp/package.nix @@ -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; }; -} +}) diff --git a/pkgs/development/libraries/qt-6/modules/qt3d.nix b/pkgs/development/libraries/qt-6/modules/qt3d.nix index 4260bf3979a4..8963b75a5811 100644 --- a/pkgs/development/libraries/qt-6/modules/qt3d.nix +++ b/pkgs/development/libraries/qt-6/modules/qt3d.nix @@ -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 + ]; }