Merge pull request #165346 from jansol/draco

This commit is contained in:
Sandro 2022-03-27 11:41:39 +02:00 committed by GitHub
commit 7f8d80df88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 3 deletions

View file

@ -1,35 +1,52 @@
{ lib
, stdenv
, fetchFromGitHub
, nix-update-script
, cmake
, python3
, gtest
, withAnimation ? true
, withTranscoder ? true
, eigen
, ghc_filesystem
, tinygltf
}:
let
cmakeBool = b: if b then "ON" else "OFF";
in
stdenv.mkDerivation rec {
version = "1.5.0";
version = "1.5.2";
pname = "draco";
src = fetchFromGitHub {
owner = "google";
repo = "draco";
rev = version;
hash = "sha256-BoJg2lZBPVVm6Nc0XK8QSISpe+B8tpgRg9PFncN4+fY=";
sha256 = "sha256-o6KQJFrnxx2kz6g3vXk1w435OmaJhAJjzsKM/gmVJ2M=";
fetchSubmodules = true;
};
buildInputs = [ gtest ]
++ lib.optionals withTranscoder [ eigen ghc_filesystem tinygltf ];
nativeBuildInputs = [ cmake python3 ];
cmakeFlags = [
"-DDRACO_ANIMATION_ENCODING=${cmakeBool withAnimation}"
"-DDRACO_TRANSCODER_SUPPORTED=${cmakeBool withTranscoder}"
"-DDRACO_GOOGLETEST_PATH=${gtest}"
"-DBUILD_SHARED_LIBS=${cmakeBool true}"
"-DDRACO_TRANSCODER_SUPPORTED=${cmakeBool withTranscoder}"
] ++ lib.optionals withTranscoder [
"-DDRACO_EIGEN_PATH=${eigen}/include/eigen3"
"-DDRACO_FILESYSTEM_PATH=${ghc_filesystem}"
"-DDRACO_TINYGLTF_PATH=${tinygltf}"
];
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
description = "Library for compressing and decompressing 3D geometric meshes and point clouds";
homepage = "https://google.github.io/draco/";

View file

@ -0,0 +1,32 @@
{ lib
, stdenv
, fetchFromGitHub
, nix-update-script
, cmake
}:
stdenv.mkDerivation rec {
version = "2.5.0";
pname = "tinygltf";
src = fetchFromGitHub {
owner = "syoyo";
repo = "tinygltf";
rev = "v${version}";
sha256 = "sha256-Pw4iNJs0bKALVPFBYUJe5/WjHxdffungCKfJFJEpDas=";
};
nativeBuildInputs = [ cmake ];
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
description = "Header only C++11 tiny glTF 2.0 library";
homepage = "https://github.com/syoyo/tinygltf";
license = licenses.mit;
maintainers = with maintainers; [ jansol ];
platforms = platforms.all;
};
}

View file

@ -10550,6 +10550,8 @@ with pkgs;
tinyfecvpn = callPackage ../tools/networking/tinyfecvpn { };
tinygltf = callPackage ../development/libraries/tinygltf { };
tinyobjloader = callPackage ../development/libraries/tinyobjloader { };
tinyprog = callPackage ../development/embedded/fpga/tinyprog { };