diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/draco')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/draco/default.nix | 62 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/draco/tinygltf.nix | 30 |
2 files changed, 92 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/draco/default.nix b/nixpkgs/pkgs/development/libraries/draco/default.nix new file mode 100644 index 000000000000..1cc8a843dcd5 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/draco/default.nix @@ -0,0 +1,62 @@ +{ 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 (finalAttrs: { + version = "1.5.6"; + pname = "draco"; + + src = fetchFromGitHub { + owner = "google"; + repo = "draco"; + rev = finalAttrs.version; + hash = "sha256-2YQMav0JJMbJ2bvnN/Xv90tjE/OWLbrZDO4WlaOvcfI="; + fetchSubmodules = true; + }; + + # ld: unknown option: --start-group + postPatch = '' + substituteInPlace cmake/draco_targets.cmake \ + --replace "^Clang" "^AppleClang" + ''; + + buildInputs = [ gtest ] + ++ lib.optionals withTranscoder [ eigen ghc_filesystem tinygltf ]; + + nativeBuildInputs = [ cmake python3 ]; + + cmakeFlags = [ + "-DDRACO_ANIMATION_ENCODING=${cmakeBool withAnimation}" + "-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 { }; + + meta = with lib; { + description = "Library for compressing and decompressing 3D geometric meshes and point clouds"; + homepage = "https://google.github.io/draco/"; + changelog = "https://github.com/google/draco/releases/tag/${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ jansol ]; + platforms = platforms.all; + }; +}) diff --git a/nixpkgs/pkgs/development/libraries/draco/tinygltf.nix b/nixpkgs/pkgs/development/libraries/draco/tinygltf.nix new file mode 100644 index 000000000000..4f965c653850 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/draco/tinygltf.nix @@ -0,0 +1,30 @@ +{ lib +, stdenv +, fetchFromGitHub +, nix-update-script +, cmake +}: + +stdenv.mkDerivation rec { + version = "2.8.7"; + pname = "tinygltf"; + + src = fetchFromGitHub { + owner = "syoyo"; + repo = "tinygltf"; + rev = "v${version}"; + hash = "sha256-uQlv+mUWnqUJIXnPf2pVuRg1akcXAfqyBIzPPmm4Np4="; + }; + + nativeBuildInputs = [ cmake ]; + + passthru.updateScript = nix-update-script { }; + + 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; + }; +} |