about summary refs log tree commit diff
path: root/pkgs/applications/video/openshot-qt/default.nix
blob: 5d8b68200ded6459f44e8be2b7d49df237d9e225 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{ lib
, stdenv
, mkDerivationWith
, fetchFromGitHub
, fetchpatch
, doxygen
, gtk3
, libopenshot
, python3
, qtsvg
, wrapGAppsHook
}:

mkDerivationWith python3.pkgs.buildPythonApplication rec {
  pname = "openshot-qt";
  version = "2.6.1";

  src = fetchFromGitHub {
    owner = "OpenShot";
    repo = "openshot-qt";
    rev = "v${version}";
    hash = "sha256-29fAg4SDoAFzv6q43Dcs2HdaeKZfPEzlGqCcICiPSF0=";
  };

  nativeBuildInputs = [
    doxygen
    wrapGAppsHook
  ];

  buildInputs = [
    gtk3
  ];

  propagatedBuildInputs = with python3.pkgs; [
    httplib2
    libopenshot
    pyqtwebengine
    pyzmq
    requests
    sip_4
  ];

  preConfigure = ''
    # tries to create caching directories during install
    export HOME=$(mktemp -d)
  '';

  # Following Arch PKGBUILD for Python 3.10 compatibility
  # https://github.com/OpenShot/openshot-qt/issues/4608
  # https://github.com/archlinux/svntogit-community/commits/packages/openshot/trunk
  patches = [
    (fetchpatch {
      name = "video-widget.patch";
      url = "https://github.com/OpenShot/openshot-qt/commit/9748a13268d66a5949aebc970637b5903756d018.patch";
      hash = "sha256-QwLtcooDJeYWDp80a1dUFo2so/zEWqqsq5IgkXWX324=";
    })
    (fetchpatch {
      name = "python-3.10-int.patch";
      url = "https://github.com/OpenShot/openshot-qt/commit/fff785eb1e3e0c30ed6ca57e2d1933aaa807ae22.patch";
      hash = "sha256-ee/s7rhF71ot5oPkGK+j59mL1B3e72xoH27KFoDL8s8=";
    })
  ];

  doCheck = false;

  dontWrapGApps = true;
  dontWrapQtApps = true;

  postFixup = ''
    wrapProgram $out/bin/openshot-qt \
  ''
  # Fix toolbar icons on Darwin
  + lib.optionalString stdenv.isDarwin ''
    --suffix QT_PLUGIN_PATH : "${lib.getBin qtsvg}/lib/qt-5.12.7/plugins" \
  '' + ''
    "''${gappsWrapperArgs[@]}" \
    "''${qtWrapperArgs[@]}"
  '';

  passthru = {
    inherit libopenshot;
    inherit (libopenshot) libopenshot-audio;
  };

  meta = with lib; {
    homepage = "http://openshot.org/";
    description = "Free, open-source video editor";
    longDescription = ''
      OpenShot Video Editor is a free, open-source video editor for Linux.
      OpenShot can take your videos, photos, and music files and help you
      create the film you have always dreamed of. Easily add sub-titles,
      transitions, and effects, and then export your film to DVD, YouTube,
      Vimeo, Xbox 360, and many other common formats.
    '';
    license = with licenses; gpl3Plus;
    maintainers = with maintainers; [ AndersonTorres ];
    platforms = with platforms; unix;
  };
}