about summary refs log tree commit diff
path: root/pkgs/applications/video/entangle/default.nix
blob: cfab93dbcd71aabe4c06af80a318fc1b1ae6c222 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{ lib
, stdenv
, fetchFromGitLab
, fetchpatch
, itstool
, libxml2
, meson
, ninja
, perl
, python3
, pkgconf
, wrapGAppsHook
, at-spi2-core
, dbus
, elfutils
, libepoxy
, gexiv2
, glib
, gobject-introspection
, gst-plugins-base
, gstreamer
, gtk3
, lcms2
, libdatrie
, libgphoto2
, libgudev
, libpeas
, libraw
, libselinux
, libsepol
, libthai
, libunwind
, libxkbcommon
, orc
, pcre
, pcre2
, udev
, util-linux
, xorg
, zstd
}:

stdenv.mkDerivation rec {
  pname = "entangle";
  version = "3.0";

  src = fetchFromGitLab {
    owner = "entangle";
    repo = "entangle";
    rev = "v${version}";
    sha256 = "hz2WSDOjriQSavFlDT+35x1X5MeInq80ZrSP1WR/td0=";
  };

  patches = [
    # Fix build with meson 0.61, can be removed on next update
    # https://gitlab.com/entangle/entangle/-/issues/67
    (fetchpatch {
      url = "https://gitlab.com/entangle/entangle/-/commit/54795d275a93e94331a614c8712740fcedbdd4f0.patch";
      sha256 = "iEgqGjKa0xwSdctwvNdEV361l9nx+bz53xn3fuDgtzY=";
    })
  ];

  nativeBuildInputs = [
    itstool
    glib
    libxml2 # for xmllint
    meson
    ninja
    perl # for pod2man and build scripts
    python3 # for build scripts
    pkgconf
    wrapGAppsHook
    gobject-introspection
  ];

  buildInputs = [
    at-spi2-core
    dbus
    libepoxy
    elfutils
    gexiv2
    glib
    gst-plugins-base
    gstreamer
    gtk3
    lcms2
    libdatrie
    libgphoto2
    libgudev
    libpeas
    libraw
    libselinux
    libsepol
    libthai
    libunwind
    libxkbcommon
    orc
    pcre # required by libselinux before we USE_PCRE2
    pcre2 # required by glib-2.0
    udev
    util-linux
    zstd
  ] ++ (with xorg; [
    libXdmcp
    libXtst
  ]);

  # Disable building of doc/reference since it requires network connection to render XML to HTML
  # Patch build script shebangs
  postPatch = ''
    sed -i "/subdir('reference')/d" "docs/meson.build"
    patchShebangs --build build-aux meson_post_install.py
    sed -i meson_post_install.py \
      -e "/print('Update icon cache...')/d" \
      -e "/gtk-update-icon-cache/d"
  '';

  postInstall = ''
    substituteInPlace "$out/share/applications/org.entangle_photo.Manager.desktop" \
      --replace "Exec=entangle" "Exec=$out/bin/entangle"
  '';

  meta = with lib; {
    description = "Tethered camera control and capture";
    longDescription = ''
      Entangle uses GTK and libgphoto2 to provide a graphical interface
      for tethered photography with digital cameras.
      It includes control over camera shooting and configuration settings
      and 'hands off' shooting directly from the controlling computer.
      This app can also serve as a camera app for mobile devices.
    '';
    homepage = "https://gitlab.com/entangle/entangle";
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = with maintainers; [ ShamrockLee ];
    mainProgram = "entangle";
  };
}