depot/third_party/nixpkgs/pkgs/development/libraries/openimageio/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

76 lines
1.4 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, boost
, cmake
, giflib
, libjpeg
, libpng
, libtiff
, opencolorio
, openexr
, robin-map
, unzip
, fmt
}:
stdenv.mkDerivation rec {
pname = "openimageio";
version = "2.5.5.0";
src = fetchFromGitHub {
owner = "OpenImageIO";
repo = "oiio";
rev = "v${version}";
hash = "sha256-FtUZqk1m9ahdnwhrBeMFkUbV0dangMY/w9ShevCASfo=";
};
# Workaround broken zlib version detecion in CMake < 3.37.
postPatch = ''
substituteInPlace ./src/cmake/Config.cmake.in \
--replace " @ZLIB_VERSION@" ""
'';
outputs = [ "bin" "out" "dev" "doc" ];
nativeBuildInputs = [
cmake
unzip
];
buildInputs = [
boost
giflib
libjpeg
libpng
libtiff
opencolorio
openexr
robin-map
];
propagatedBuildInputs = [
fmt
];
cmakeFlags = [
"-DUSE_PYTHON=OFF"
"-DUSE_QT=OFF"
# GNUInstallDirs
"-DCMAKE_INSTALL_LIBDIR=lib" # needs relative path for pkg-config
# Do not install a copy of fmt header files
"-DINTERNALIZE_FMT=OFF"
];
postFixup = ''
substituteInPlace $dev/lib/cmake/OpenImageIO/OpenImageIOTargets-*.cmake \
--replace "\''${_IMPORT_PREFIX}/lib/lib" "$out/lib/lib"
'';
meta = with lib; {
homepage = "https://openimageio.org";
description = "Library and tools for reading and writing images";
license = licenses.bsd3;
maintainers = [ ];
platforms = platforms.unix;
};
}