about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
blob: d07a841c3c021455354a336f718575a778ef3521 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation rec {
  pname = "tinyobjloader";
  version = "1.0.7";

  src = fetchFromGitHub {
    owner = "tinyobjloader";
    repo = "tinyobjloader";
    rev = "v${version}";
    sha256 = "sha256-BNffbicnLTGK2GQ2/bB328LFU9fqHxrpAVj2hJaekWc=";
  };

  nativeBuildInputs = [ cmake ];

  # https://github.com/tinyobjloader/tinyobjloader/issues/336
  postPatch = ''
    substituteInPlace tinyobjloader.pc.in \
      --replace '$'{prefix}/@TINYOBJLOADER_LIBRARY_DIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
      --replace '$'{prefix}/@TINYOBJLOADER_INCLUDE_DIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
  '';

  meta = with lib; {
    homepage = "https://github.com/tinyobjloader/tinyobjloader";
    description = "Tiny but powerful single file wavefront obj loader";
    license = licenses.mit;
    maintainers = [ maintainers.ivar ];
    platforms = platforms.all;
  };
}