2021-12-19 01:06:50 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-03-30 09:31:56 +00:00
|
|
|
, nix-update-script
|
2021-12-19 01:06:50 +00:00
|
|
|
, cmake
|
|
|
|
, python3
|
2022-03-30 09:31:56 +00:00
|
|
|
, gtest
|
2021-12-19 01:06:50 +00:00
|
|
|
, withAnimation ? true
|
|
|
|
, withTranscoder ? true
|
2022-03-30 09:31:56 +00:00
|
|
|
, eigen
|
|
|
|
, ghc_filesystem
|
|
|
|
, tinygltf
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
let
|
|
|
|
cmakeBool = b: if b then "ON" else "OFF";
|
|
|
|
in
|
2020-09-25 04:45:31 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-07-18 16:21:45 +00:00
|
|
|
version = "1.5.3";
|
2020-09-25 04:45:31 +00:00
|
|
|
pname = "draco";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "draco";
|
|
|
|
rev = version;
|
2022-07-18 16:21:45 +00:00
|
|
|
sha256 = "sha256-LbWtZtgvZQdgwAGHVsouH6cAIVXP+9Q5n8KjzaBRrBQ=";
|
2021-12-19 01:06:50 +00:00
|
|
|
fetchSubmodules = true;
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
buildInputs = [ gtest ]
|
|
|
|
++ lib.optionals withTranscoder [ eigen ghc_filesystem tinygltf ];
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 ];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
2021-12-19 01:06:50 +00:00
|
|
|
"-DDRACO_ANIMATION_ENCODING=${cmakeBool withAnimation}"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DDRACO_GOOGLETEST_PATH=${gtest}"
|
2021-12-19 01:06:50 +00:00
|
|
|
"-DBUILD_SHARED_LIBS=${cmakeBool true}"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DDRACO_TRANSCODER_SUPPORTED=${cmakeBool withTranscoder}"
|
|
|
|
] ++ lib.optionals withTranscoder [
|
|
|
|
"-DDRACO_EIGEN_PATH=${eigen}/include/eigen3"
|
|
|
|
"-DDRACO_FILESYSTEM_PATH=${ghc_filesystem}"
|
|
|
|
"-DDRACO_TINYGLTF_PATH=${tinygltf}"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Library for compressing and decompressing 3D geometric meshes and point clouds";
|
|
|
|
homepage = "https://google.github.io/draco/";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jansol ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|