nixpkgs/pkgs/development/libraries/opencolorio/default.nix
Tom Hall 43110d8af5 opencolorio: refactor to use system lcms2 and tinyxml
The version of LCMS bundled with opencolorio is too old to build on
aarch64, simply because its config files date from before aarch64
was announced. However, it can use the system lcms2 if it is found.

Also de-vendor tinyxml.

In addition, the version had been bumped to 1.1.0, but 1.0.9 was still
hard-coded in the fetch uri. Some changes were necessary for 1.1.0 to build.

As the sources are fetched from github, use fetchFromGitHub instead of
fetchurl.
2018-08-30 18:03:21 +00:00

48 lines
1.4 KiB
Nix

{ stdenv, lib, fetchFromGitHub, cmake, boost, pkgconfig, lcms2, tinyxml, git }:
with lib;
stdenv.mkDerivation rec {
name = "opencolorio-${version}";
version = "1.1.0";
src = fetchFromGitHub {
owner = "imageworks";
repo = "OpenColorIO";
rev = "v${version}";
sha256 = "0cjsyn681xsg89lirlll5pqlsqg2vnk1278iiicmzjy2a2v8x7zq";
};
outputs = [ "bin" "out" "dev" ];
# TODO: Investigate whether git can be dropped: It's only used to apply patches
nativeBuildInputs = [ cmake pkgconfig git ];
buildInputs = [ lcms2 tinyxml ] ++ optional stdenv.isDarwin boost;
postPatch = ''
substituteInPlace src/core/CMakeLists.txt --replace "-Werror" ""
substituteInPlace src/pyglue/CMakeLists.txt --replace "-Werror" ""
'';
cmakeFlags = [
"-DUSE_EXTERNAL_LCMS=ON"
"-DUSE_EXTERNAL_TINYXML=ON"
# External libyamlcpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517
"-DUSE_EXTERNAL_YAML=OFF"
] ++ optional stdenv.isDarwin "-DOCIO_USE_BOOST_PTR=ON"
++ optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DOCIO_USE_SSE=OFF";
postInstall = ''
mkdir -p $bin/bin; mv $out/bin $bin/
'';
meta = with stdenv.lib; {
homepage = http://opencolorio.org;
description = "A color management framework for visual effects and animation";
license = licenses.bsd3;
maintainers = [ maintainers.goibhniu ];
platforms = platforms.unix;
};
}