From 743c9b579ed529c03546356cc26e0672d40f28e3 Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Sun, 19 Mar 2023 07:30:17 +1000 Subject: [PATCH 1/3] natron: 2.3.15 -> 2.5.0 And unmark as broken. This removes the OpenFX plugins which are needed for most built-in nodes. Ideally there should be a "natron-with-plugins" function anyway, so let's create that later and have the OpenFX plugins packaged separately. Fixes #103029 --- pkgs/applications/video/natron/config.pri | 20 --- pkgs/applications/video/natron/default.nix | 152 +++++++-------------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 48 insertions(+), 126 deletions(-) delete mode 100644 pkgs/applications/video/natron/config.pri diff --git a/pkgs/applications/video/natron/config.pri b/pkgs/applications/video/natron/config.pri deleted file mode 100644 index c0d236c6b975..000000000000 --- a/pkgs/applications/video/natron/config.pri +++ /dev/null @@ -1,20 +0,0 @@ -boost: LIBS += -lboost_serialization -expat: LIBS += -lexpat -expat: PKGCONFIG -= expat -cairo { - PKGCONFIG += cairo - LIBS -= $$system(pkg-config --variable=libdir cairo)/libcairo.a -} -pyside { - PKGCONFIG -= pyside - INCLUDEPATH += $$system(pkg-config --variable=includedir pyside) - INCLUDEPATH += $$system(pkg-config --variable=includedir pyside)/QtCore - INCLUDEPATH += $$system(pkg-config --variable=includedir pyside)/QtGui - INCLUDEPATH += $$system(pkg-config --variable=includedir QtGui) - LIBS += -lpyside-python2.7 -} -shiboken { - PKGCONFIG -= shiboken - INCLUDEPATH += $$system(pkg-config --variable=includedir shiboken) - LIBS += -lshiboken-python2.7 -} diff --git a/pkgs/applications/video/natron/default.nix b/pkgs/applications/video/natron/default.nix index b41503b73597..66f7ca3da2f0 100644 --- a/pkgs/applications/video/natron/default.nix +++ b/pkgs/applications/video/natron/default.nix @@ -1,98 +1,31 @@ -{ lib, stdenv, fetchurl, qt4, pkg-config, boost, expat, cairo, python2Packages, - cmake, flex, bison, pango, librsvg, librevenge, libxml2, libcdr, libzip, - poppler, imagemagick, openexr, ffmpeg, opencolorio_1, openimageio_1, - qmake4Hook, libpng, libGL, lndir, libraw, openjpeg, libwebp, fetchFromGitHub }: +{ lib +, stdenv +, fetchFromGitHub +, qt5 +, cmake +, pkg-config +, boost +, expat +, cairo +, python3 +, python3Packages +, extra-cmake-modules +, wayland +, glog +, ceres-solver +}: let - minorVersion = "2.3"; - version = "${minorVersion}.15"; - OpenColorIO-Configs = fetchurl { - url = "https://github.com/NatronGitHub/OpenColorIO-Configs/archive/Natron-v${minorVersion}.tar.gz"; - sha256 = "AZK9J+RnMyxOYcAQOAQZj5QciPQ999m6jrtBt5rdpkA="; + minorVersion = "2.5"; + version = "${minorVersion}.0"; + OpenColorIO-Configs = fetchFromGitHub { + owner = "NatronGitHub"; + repo = "OpenColorIO-Configs"; + rev = "Natron-v${minorVersion}"; + sha256 = "sha256-TD7Uge9kKbFxOmOCn+TSQovnKTmFS3uERTu5lmZFHbc="; }; - 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 ]; - }; - buildPlugin = { pluginName, sha256, nativeBuildInputs ? [], buildInputs ? [], preConfigure ? "", postPatch ? "" }: - stdenv.mkDerivation { - pname = "openfx-${pluginName}"; - version = version; - src = fetchurl { - url = "https://github.com/NatronGitHub/openfx-${pluginName}/releases/download/Natron-${version}/openfx-${pluginName}-Natron-${version}.tar.xz"; - inherit sha256; - }; - inherit nativeBuildInputs buildInputs postPatch; - 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"; - }; - cimgversion = "89b9d062ec472df3d33989e6d5d2a8b50ba0775c"; - CImgh = fetchurl { - 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="; - }; - plugins = map buildPlugin [ - ({ - pluginName = "arena"; - sha256 = "tUb6myG03mRieUAfgRZfv5Ap+cLvbpNrLMYCGTiAq8c="; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - pango librsvg librevenge libcdr opencolorio_1 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"; - sha256 = "OQg6a5wNy9TFFySjmgd1subvXRxY/ZnSOCkaoUo+ZaA="; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - libpng ffmpeg openexr opencolorio_1 openimageio_1 boost libGL - seexpr libraw openjpeg libwebp - ]; - }) - ({ - pluginName = "misc"; - sha256 = "XkdQyWI9ilF6IoP3yuHulNUZRPLX1m4lq/+RbXsrFEQ="; - buildInputs = [ - libGL - ]; - 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 - ''; - }) - ]; in -stdenv.mkDerivation { +qt5.mkDerivation { inherit version; pname = "natron"; @@ -101,28 +34,38 @@ stdenv.mkDerivation { repo = "Natron"; rev = "v${version}"; fetchSubmodules = true; - sha256 = "sha256-KuXJmmIsvwl4uqmAxXqWU+273jsdWrCuUSwWn5vuu8M="; + sha256 = "sha256-dgScbfyulZPlrngqSw7xwipldoRd8uFO8VP9mlJyhQ8="; }; - nativeBuildInputs = [ qmake4Hook pkg-config python2Packages.wrapPython ]; + cmakeFlags = [ "-DNATRON_SYSTEM_LIBS=ON" ]; - buildInputs = [ - qt4 boost expat cairo python2Packages.pyside python2Packages.pysideShiboken + nativeBuildInputs = [ + cmake + pkg-config ]; - 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 + buildInputs = [ + boost + expat + cairo + python3 + python3Packages.pyside2 + python3Packages.shiboken2 + extra-cmake-modules + wayland + glog + ceres-solver + ]; + + postInstall = '' + mkdir -p $out/share + cp -r ${OpenColorIO-Configs} $out/share/OpenColorIO-Configs ''; postFixup = '' - for i in ${lib.escapeShellArgs plugins}; do - ${lndir}/bin/lndir $i $out - done wrapProgram $out/bin/Natron \ - --set PYTHONPATH "$PYTHONPATH" + --prefix PYTHONPATH : "${python3Packages.makePythonPath [ python3Packages.pyside2 ]}" \ + --set-default OCIO "$out/share/OpenColorIO-Configs/blender/config.ocio" ''; meta = with lib; { @@ -135,6 +78,5 @@ stdenv.mkDerivation { license = lib.licenses.gpl2; maintainers = [ maintainers.puffnfresh ]; platforms = platforms.linux; - broken = true; # Last evaluated on Hydra on 2021-05-18 }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f6213897591f..97cce6b9e67c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31994,7 +31994,7 @@ with pkgs; neomutt = callPackage ../applications/networking/mailreaders/neomutt { }; - natron = callPackage ../applications/video/natron { }; + natron = qt5.callPackage ../applications/video/natron { }; natural-docs = callPackage ../applications/misc/natural-docs { }; From 0eede3e318601380c287408f45a55b8ba0249b0b Mon Sep 17 00:00:00 2001 From: Brian McKenna Date: Mon, 20 Mar 2023 16:00:59 +1000 Subject: [PATCH 2/3] natron: add missing dependencies mentioned in warnings --- pkgs/applications/video/natron/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/video/natron/default.nix b/pkgs/applications/video/natron/default.nix index 66f7ca3da2f0..cf7466dd0003 100644 --- a/pkgs/applications/video/natron/default.nix +++ b/pkgs/applications/video/natron/default.nix @@ -5,14 +5,15 @@ , cmake , pkg-config , boost -, expat , cairo +, ceres-solver +, expat +, extra-cmake-modules +, glog +, libXdmcp , python3 , python3Packages -, extra-cmake-modules , wayland -, glog -, ceres-solver }: let @@ -55,6 +56,7 @@ qt5.mkDerivation { wayland glog ceres-solver + libXdmcp ]; postInstall = '' @@ -64,7 +66,7 @@ qt5.mkDerivation { postFixup = '' wrapProgram $out/bin/Natron \ - --prefix PYTHONPATH : "${python3Packages.makePythonPath [ python3Packages.pyside2 ]}" \ + --prefix PYTHONPATH : "${python3Packages.makePythonPath [ python3Packages.qtpy python3Packages.pyside2 ]}" \ --set-default OCIO "$out/share/OpenColorIO-Configs/blender/config.ocio" ''; From 15bce5c2049dd2f19fcb4fc9d80196f81d46af2c Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Wed, 14 Jun 2023 00:51:29 +0300 Subject: [PATCH 3/3] natron: cleanup --- pkgs/applications/video/natron/default.nix | 17 +++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/video/natron/default.nix b/pkgs/applications/video/natron/default.nix index cf7466dd0003..d5c603998f3d 100644 --- a/pkgs/applications/video/natron/default.nix +++ b/pkgs/applications/video/natron/default.nix @@ -1,9 +1,9 @@ { lib , stdenv , fetchFromGitHub -, qt5 , cmake , pkg-config +, wrapQtAppsHook , boost , cairo , ceres-solver @@ -12,7 +12,6 @@ , glog , libXdmcp , python3 -, python3Packages , wayland }: @@ -23,10 +22,10 @@ let owner = "NatronGitHub"; repo = "OpenColorIO-Configs"; rev = "Natron-v${minorVersion}"; - sha256 = "sha256-TD7Uge9kKbFxOmOCn+TSQovnKTmFS3uERTu5lmZFHbc="; + hash = "sha256-TD7Uge9kKbFxOmOCn+TSQovnKTmFS3uERTu5lmZFHbc="; }; in -qt5.mkDerivation { +stdenv.mkDerivation { inherit version; pname = "natron"; @@ -35,7 +34,7 @@ qt5.mkDerivation { repo = "Natron"; rev = "v${version}"; fetchSubmodules = true; - sha256 = "sha256-dgScbfyulZPlrngqSw7xwipldoRd8uFO8VP9mlJyhQ8="; + hash = "sha256-dgScbfyulZPlrngqSw7xwipldoRd8uFO8VP9mlJyhQ8="; }; cmakeFlags = [ "-DNATRON_SYSTEM_LIBS=ON" ]; @@ -43,6 +42,7 @@ qt5.mkDerivation { nativeBuildInputs = [ cmake pkg-config + wrapQtAppsHook ]; buildInputs = [ @@ -50,8 +50,8 @@ qt5.mkDerivation { expat cairo python3 - python3Packages.pyside2 - python3Packages.shiboken2 + python3.pkgs.pyside2 + python3.pkgs.shiboken2 extra-cmake-modules wayland glog @@ -66,7 +66,7 @@ qt5.mkDerivation { postFixup = '' wrapProgram $out/bin/Natron \ - --prefix PYTHONPATH : "${python3Packages.makePythonPath [ python3Packages.qtpy python3Packages.pyside2 ]}" \ + --prefix PYTHONPATH : "${python3.pkgs.makePythonPath [ python3.pkgs.qtpy python3.pkgs.pyside2 ]}" \ --set-default OCIO "$out/share/OpenColorIO-Configs/blender/config.ocio" ''; @@ -80,5 +80,6 @@ qt5.mkDerivation { license = lib.licenses.gpl2; maintainers = [ maintainers.puffnfresh ]; platforms = platforms.linux; + broken = stdenv.isLinux && stdenv.isAarch64; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 97cce6b9e67c..b1750f1a2fc4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31994,7 +31994,7 @@ with pkgs; neomutt = callPackage ../applications/networking/mailreaders/neomutt { }; - natron = qt5.callPackage ../applications/video/natron { }; + natron = libsForQt5.callPackage ../applications/video/natron { }; natural-docs = callPackage ../applications/misc/natural-docs { };