nixpkgs/pkgs/development/libraries/draco/default.nix

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

68 lines
1.7 KiB
Nix
Raw Normal View History

2021-12-10 02:05:06 +01:00
{ lib
, stdenv
, fetchFromGitHub
2022-03-23 01:42:12 +01:00
, nix-update-script
2021-12-10 02:05:06 +01:00
, cmake
, python3
2022-03-23 01:42:12 +01:00
, gtest
2021-12-10 02:05:06 +01:00
, withAnimation ? true
, withTranscoder ? true
2022-03-23 01:42:12 +01:00
, eigen
, ghc_filesystem
, tinygltf
2020-05-12 18:41:38 +02:00
}:
2021-12-10 02:05:06 +01:00
let
cmakeBool = b: if b then "ON" else "OFF";
in
stdenv.mkDerivation (finalAttrs: {
2024-01-19 00:51:08 +01:00
version = "1.5.7";
2020-05-12 18:41:38 +02:00
pname = "draco";
src = fetchFromGitHub {
owner = "google";
repo = "draco";
rev = finalAttrs.version;
2024-01-19 00:51:08 +01:00
hash = "sha256-p0Mn4kGeBBKL7Hoz4IBgb6Go6MdkgE7WZgxAnt1tE/0=";
2021-12-10 02:05:06 +01:00
fetchSubmodules = true;
2020-05-12 18:41:38 +02:00
};
2023-02-09 07:31:53 +01:00
# ld: unknown option: --start-group
postPatch = ''
substituteInPlace cmake/draco_targets.cmake \
--replace "^Clang" "^AppleClang"
'';
2022-03-23 01:42:12 +01:00
buildInputs = [ gtest ]
++ lib.optionals withTranscoder [ eigen ghc_filesystem tinygltf ];
2021-12-10 02:05:06 +01:00
nativeBuildInputs = [ cmake python3 ];
2020-05-12 18:41:38 +02:00
cmakeFlags = [
2021-12-10 02:05:06 +01:00
"-DDRACO_ANIMATION_ENCODING=${cmakeBool withAnimation}"
2022-03-23 01:42:12 +01:00
"-DDRACO_GOOGLETEST_PATH=${gtest}"
2021-12-10 02:05:06 +01:00
"-DBUILD_SHARED_LIBS=${cmakeBool true}"
2022-03-23 01:42:12 +01: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 18:41:38 +02:00
];
2024-01-09 20:27:24 +01:00
CXXFLAGS = [
# error: expected ')' before 'value' in 'explicit GltfValue(uint8_t value)'
"-include cstdint"
];
passthru.updateScript = nix-update-script { };
2022-03-23 01:42:12 +01:00
meta = with lib; {
2020-05-12 18:41:38 +02:00
description = "Library for compressing and decompressing 3D geometric meshes and point clouds";
homepage = "https://google.github.io/draco/";
2022-11-01 01:32:17 +01:00
changelog = "https://github.com/google/draco/releases/tag/${version}";
2020-05-12 18:41:38 +02:00
license = licenses.asl20;
maintainers = with maintainers; [ jansol ];
platforms = platforms.all;
};
})