2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, qt4, pkg-config, boost, expat, cairo, python2Packages,
|
2020-04-24 23:36:52 +00:00
|
|
|
cmake, flex, bison, pango, librsvg, librevenge, libxml2, libcdr, libzip,
|
2020-06-18 07:06:33 +00:00
|
|
|
poppler, imagemagick, openexr, ffmpeg_3, opencolorio, openimageio,
|
2021-03-09 03:18:52 +00:00
|
|
|
qmake4Hook, libpng, libGL, lndir, libraw, openjpeg, libwebp, fetchFromGitHub }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-03-09 03:18:52 +00:00
|
|
|
minorVersion = "2.3";
|
|
|
|
version = "${minorVersion}.15";
|
2020-04-24 23:36:52 +00:00
|
|
|
OpenColorIO-Configs = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://github.com/NatronGitHub/OpenColorIO-Configs/archive/Natron-v${minorVersion}.tar.gz";
|
|
|
|
sha256 = "AZK9J+RnMyxOYcAQOAQZj5QciPQ999m6jrtBt5rdpkA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
seexpr = stdenv.mkDerivation rec {
|
|
|
|
version = "1.0.1";
|
|
|
|
pname = "seexpr";
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/wdas/SeExpr/archive/rel-${version}.tar.gz";
|
|
|
|
sha256 = "1ackh0xs4ip7mk34bam8zd4qdymkdk0dgv8x0f2mf6gbyzzyh7lp";
|
|
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ libpng flex bison ];
|
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
buildPlugin = { pluginName, sha256, nativeBuildInputs ? [], buildInputs ? [], preConfigure ? "", postPatch ? "" }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "openfx-${pluginName}";
|
|
|
|
version = version;
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://github.com/NatronGitHub/openfx-${pluginName}/releases/download/Natron-${version}/openfx-${pluginName}-Natron-${version}.tar.xz";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
inherit nativeBuildInputs buildInputs postPatch;
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
makeFlagsArray+=("CONFIG=release")
|
|
|
|
makeFlagsArray+=("PLUGINPATH=$out/Plugins/OFX/Natron")
|
|
|
|
${preConfigure}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
lodepngcpp = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/lvandeve/lodepng/a70c086077c0eaecbae3845e4da4424de5f43361/lodepng.cpp";
|
|
|
|
sha256 = "1dxkkr4jbmvlwfr7m16i1mgcj1pqxg9s1a7y3aavs9rrk0ki8ys2";
|
|
|
|
};
|
|
|
|
lodepngh = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/lvandeve/lodepng/a70c086077c0eaecbae3845e4da4424de5f43361/lodepng.h";
|
|
|
|
sha256 = "14drdikd0vws3wwpyqq7zzm5z3kg98svv4q4w0hr45q6zh6hs0bq";
|
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
cimgversion = "89b9d062ec472df3d33989e6d5d2a8b50ba0775c";
|
2020-04-24 23:36:52 +00:00
|
|
|
CImgh = fetchurl {
|
2021-03-09 03:18:52 +00:00
|
|
|
url = "https://raw.githubusercontent.com/dtschump/CImg/${cimgversion}/CImg.h";
|
|
|
|
sha256 = "sha256-NbYpZDNj2oZ+wqoEkRwwCjiujdr+iGOLA0Pa0Ynso6U=";
|
|
|
|
};
|
|
|
|
inpainth = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/dtschump/CImg/${cimgversion}/plugins/inpaint.h";
|
|
|
|
sha256 = "sha256-cd28a3VOs5002GkthHkbIUrxZfKuGhqIYO4Oxe/2HIQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
plugins = map buildPlugin [
|
|
|
|
({
|
|
|
|
pluginName = "arena";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "tUb6myG03mRieUAfgRZfv5Ap+cLvbpNrLMYCGTiAq8c=";
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
pango librsvg librevenge libcdr opencolorio libxml2 libzip
|
|
|
|
poppler imagemagick
|
|
|
|
];
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's|pkg-config poppler-glib|pkg-config poppler poppler-glib|g' Makefile.master
|
|
|
|
for i in Extra Bundle; do
|
|
|
|
cp ${lodepngcpp} $i/lodepng.cpp
|
|
|
|
cp ${lodepngh} $i/lodepng.h
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
({
|
|
|
|
pluginName = "io";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "OQg6a5wNy9TFFySjmgd1subvXRxY/ZnSOCkaoUo+ZaA=";
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2020-06-18 07:06:33 +00:00
|
|
|
libpng ffmpeg_3 openexr opencolorio openimageio boost libGL
|
2021-03-09 03:18:52 +00:00
|
|
|
seexpr libraw openjpeg libwebp
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
})
|
|
|
|
({
|
|
|
|
pluginName = "misc";
|
2021-03-09 03:18:52 +00:00
|
|
|
sha256 = "XkdQyWI9ilF6IoP3yuHulNUZRPLX1m4lq/+RbXsrFEQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
libGL
|
|
|
|
];
|
2021-03-09 03:18:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
cp '${inpainth}' CImg/Inpaint/inpaint.h
|
|
|
|
patch -p0 -dCImg < CImg/Inpaint/inpaint.h.patch # taken from the Makefile; it gets skipped if the file already exists
|
|
|
|
cp '${CImgh}' CImg/CImg.h
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit version;
|
2021-03-09 03:18:52 +00:00
|
|
|
pname = "natron";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NatronGitHub";
|
|
|
|
repo = "Natron";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
sha256 = "sha256-KuXJmmIsvwl4uqmAxXqWU+273jsdWrCuUSwWn5vuu8M=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ qmake4Hook pkg-config python2Packages.wrapPython ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
qt4 boost expat cairo python2Packages.pyside python2Packages.pysideShiboken
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export MAKEFLAGS=-j$NIX_BUILD_CORES
|
|
|
|
cp ${./config.pri} config.pri
|
|
|
|
mkdir OpenColorIO-Configs
|
|
|
|
tar -xf ${OpenColorIO-Configs} --strip-components=1 -C OpenColorIO-Configs
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for i in ${lib.escapeShellArgs plugins}; do
|
|
|
|
${lndir}/bin/lndir $i $out
|
|
|
|
done
|
|
|
|
wrapProgram $out/bin/Natron \
|
|
|
|
--set PYTHONPATH "$PYTHONPATH"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Node-graph based, open-source compositing software";
|
|
|
|
longDescription = ''
|
|
|
|
Node-graph based, open-source compositing software. Similar in
|
|
|
|
functionalities to Adobe After Effects and Nuke by The Foundry.
|
|
|
|
'';
|
|
|
|
homepage = "https://natron.fr/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.puffnfresh ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|