From 621f649bfb210146e3db5141f4040d93afa877d5 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 10 Nov 2020 15:01:58 -0500 Subject: [PATCH 1/3] libsForQt5.libopenshot-audio: enable on darwin --- .../video/openshot-qt/libopenshot-audio.nix | 14 +++++++++++--- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/video/openshot-qt/libopenshot-audio.nix b/pkgs/applications/video/openshot-qt/libopenshot-audio.nix index d1a368b43ba2..b6bb87e66512 100644 --- a/pkgs/applications/video/openshot-qt/libopenshot-audio.nix +++ b/pkgs/applications/video/openshot-qt/libopenshot-audio.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchFromGitHub, pkgconfig, cmake, doxygen, alsaLib , libX11, libXft, libXrandr, libXinerama, libXext, libXcursor }: +{ stdenv, fetchFromGitHub, pkgconfig, cmake, doxygen +, alsaLib, libX11, libXft, libXrandr, libXinerama, libXext, libXcursor +, zlib, AGL, Cocoa, Foundation +}: with stdenv.lib; stdenv.mkDerivation rec { @@ -16,7 +19,12 @@ stdenv.mkDerivation rec { [ pkgconfig cmake doxygen ]; buildInputs = - [ alsaLib libX11 libXft libXrandr libXinerama libXext libXcursor ]; + optionals stdenv.isLinux [ alsaLib ] + ++ (if stdenv.isDarwin then + [ zlib AGL Cocoa Foundation ] + else + [ libX11 libXft libXrandr libXinerama libXext libXcursor ]) + ; doCheck = false; @@ -30,6 +38,6 @@ stdenv.mkDerivation rec { ''; license = with licenses; gpl3Plus; maintainers = with maintainers; [ AndersonTorres ]; - platforms = with platforms; linux; + platforms = with platforms; unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a66fefcf4495..ea41ea9810af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15355,7 +15355,9 @@ in packagekit-qt = callPackage ../tools/package-management/packagekit/qt.nix { }; - libopenshot-audio = callPackage ../applications/video/openshot-qt/libopenshot-audio.nix { }; + libopenshot-audio = callPackage ../applications/video/openshot-qt/libopenshot-audio.nix { + inherit (darwin.apple_sdk.frameworks) AGL Cocoa Foundation; + }; libqglviewer = callPackage ../development/libraries/libqglviewer { inherit (darwin.apple_sdk.frameworks) AGL; From fcd325c97482e56157e3daf4be21d7d08d69669a Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 10 Nov 2020 15:05:59 -0500 Subject: [PATCH 2/3] libsForQt5.libopenshot: enable on darwin --- pkgs/applications/video/openshot-qt/libopenshot.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/video/openshot-qt/libopenshot.nix b/pkgs/applications/video/openshot-qt/libopenshot.nix index e24b6ee41f85..1b6084a1d2f9 100644 --- a/pkgs/applications/video/openshot-qt/libopenshot.nix +++ b/pkgs/applications/video/openshot-qt/libopenshot.nix @@ -3,7 +3,9 @@ , libopenshot-audio, imagemagick, ffmpeg_3 , swig, python3 , unittest-cpp, cppzmq, zeromq -, qtbase, qtmultimedia }: +, qtbase, qtmultimedia +, llvmPackages +}: with stdenv.lib; stdenv.mkDerivation rec { @@ -27,7 +29,9 @@ stdenv.mkDerivation rec { buildInputs = [ imagemagick ffmpeg_3 swig python3 unittest-cpp - cppzmq zeromq qtbase qtmultimedia ]; + cppzmq zeromq qtbase qtmultimedia ] + ++ optional stdenv.isDarwin llvmPackages.openmp + ; LIBOPENSHOT_AUDIO_DIR = libopenshot-audio; "UNITTEST++_INCLUDE_DIR" = "${unittest-cpp}/include/UnitTest++"; @@ -46,6 +50,6 @@ stdenv.mkDerivation rec { ''; license = with licenses; gpl3Plus; maintainers = with maintainers; [ AndersonTorres ]; - platforms = with platforms; linux; + platforms = with platforms; unix; }; } From 972bcb496d13063543c2d38415d22da58bbd44c3 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 10 Nov 2020 15:08:26 -0500 Subject: [PATCH 3/3] openshot-qt: enable on darwin --- .../video/openshot-qt/default.nix | 11 ++++++++-- pkgs/top-level/all-packages.nix | 21 ++++++++----------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/video/openshot-qt/default.nix b/pkgs/applications/video/openshot-qt/default.nix index cd3176249f8a..ede47ad061f6 100644 --- a/pkgs/applications/video/openshot-qt/default.nix +++ b/pkgs/applications/video/openshot-qt/default.nix @@ -1,6 +1,7 @@ { stdenv, mkDerivationWith, fetchFromGitHub, fetchpatch , doxygen, python3Packages, libopenshot -, wrapGAppsHook, gtk3 }: +, wrapGAppsHook, gtk3 +, qtsvg }: mkDerivationWith python3Packages.buildPythonApplication rec { pname = "openshot-qt"; @@ -29,6 +30,12 @@ mkDerivationWith python3Packages.buildPythonApplication rec { postFixup = '' wrapProgram $out/bin/openshot-qt \ + '' + # Fix toolbar icons on Darwin + + stdenv.lib.optionalString stdenv.isDarwin '' + --suffix QT_PLUGIN_PATH : "${stdenv.lib.getBin qtsvg}/lib/qt-5.12.7/plugins" \ + '' + + '' "''${gappsWrapperArgs[@]}" \ "''${qtWrapperArgs[@]}" ''; @@ -47,6 +54,6 @@ mkDerivationWith python3Packages.buildPythonApplication rec { ''; license = with licenses; gpl3Plus; maintainers = with maintainers; [ AndersonTorres ]; - platforms = with platforms; linux; + platforms = with platforms; unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ea41ea9810af..75d7b2863fad 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9445,18 +9445,15 @@ in graalvm8-ee graalvm11-ee; - openshot-qt = let - # Cannot use a newer Qt (5.15) version because it requires qtwebkit - # and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b - pkgs_ = pkgs.extend(_: prev: { - pythonInterpreters = prev.pythonInterpreters.override(oldAttrs: { - pkgs = oldAttrs.pkgs.extend(_: _: { - qt5 = pkgs.qt514; - libsForQt5 = pkgs.libsForQt514; - }); - }); - }); - in pkgs_.libsForQt514.callPackage ../applications/video/openshot-qt { }; + # Cannot use a newer Qt (5.15) version because it requires qtwebkit + # and our qtwebkit fails to build with 5.15. 01bcfd3579219d60e5d07df309a000f96b2b658b + openshot-qt = (pkgs.extend (final: prev: rec { + qt5 = if stdenv.isDarwin then prev.qt5 else prev.qt514; + libsForQt5 = if stdenv.isDarwin then prev.libsForQt5 else prev.libsForQt514; + pythonInterpreters = prev.pythonInterpreters.override { + pkgs = final; + }; + })).libsForQt5.callPackage ../applications/video/openshot-qt { }; openspin = callPackage ../development/compilers/openspin { };