Unverified Commit e6817f33 authored by K900's avatar K900 Committed by GitHub
Browse files

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

parents 3f03e898 521e3e5e
Loading
Loading
Loading
Loading
+29 −14
Original line number Diff line number Diff line
@@ -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;

  cmakeFlags = [
    (lib.cmakeBool "ASSIMP_BUILD_ASSIMP_TOOLS" true)
  ];

  # 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
  '';

  env.NIX_CFLAGS_COMPILE = toString ([
    # Needed with GCC 12
    "-Wno-error=array-bounds"
  ]);
  passthru.updateScript = nix-update-script { };

  meta = with lib; {
  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;
  };
}
})
+14 −0
Original line number Diff line number Diff line
{
  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
  ];
}