3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/draco/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Nix
Raw Normal View History

2021-12-10 01:05:06 +00:00
{ lib
, stdenv
, fetchFromGitHub
2022-03-23 00:42:12 +00:00
, nix-update-script
2021-12-10 01:05:06 +00:00
, cmake
, python3
2022-03-23 00:42:12 +00:00
, gtest
2021-12-10 01:05:06 +00:00
, withAnimation ? true
, withTranscoder ? true
2022-03-23 00:42:12 +00:00
, eigen
, ghc_filesystem
, tinygltf
2020-05-12 17:41:38 +01:00
}:
2021-12-10 01:05:06 +00:00
let
cmakeBool = b: if b then "ON" else "OFF";
in
2020-05-12 17:41:38 +01:00
stdenv.mkDerivation rec {
2022-03-23 00:42:12 +00:00
version = "1.5.2";
2020-05-12 17:41:38 +01:00
pname = "draco";
src = fetchFromGitHub {
owner = "google";
repo = "draco";
rev = version;
2022-03-23 00:42:12 +00:00
sha256 = "sha256-o6KQJFrnxx2kz6g3vXk1w435OmaJhAJjzsKM/gmVJ2M=";
2021-12-10 01:05:06 +00:00
fetchSubmodules = true;
2020-05-12 17:41:38 +01:00
};
2022-03-23 00:42:12 +00:00
buildInputs = [ gtest ]
++ lib.optionals withTranscoder [ eigen ghc_filesystem tinygltf ];
2021-12-10 01:05:06 +00:00
nativeBuildInputs = [ cmake python3 ];
2020-05-12 17:41:38 +01:00
cmakeFlags = [
2021-12-10 01:05:06 +00:00
"-DDRACO_ANIMATION_ENCODING=${cmakeBool withAnimation}"
2022-03-23 00:42:12 +00:00
"-DDRACO_GOOGLETEST_PATH=${gtest}"
2021-12-10 01:05:06 +00:00
"-DBUILD_SHARED_LIBS=${cmakeBool true}"
2022-03-23 00:42:12 +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-05-12 17:41:38 +01:00
];
2022-03-23 00:42:12 +00:00
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
2020-05-12 17:41:38 +01: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;
};
}