summary refs log tree commit diff
path: root/pkgs/applications/video/kazam
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-04-15 13:39:47 +0200
committerJan Tojnar <jtojnar@gmail.com>2018-04-15 13:45:01 +0200
commit8416cd0326c3c8845cc9796223e9ab802290002f (patch)
tree3b1d992190c747d1601b42ce64ff14d1e5bdfd82 /pkgs/applications/video/kazam
parentfe21f168572e7033257ddd83605a417ad3fa8954 (diff)
downloadnixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar.gz
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar.bz2
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar.lz
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar.xz
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.tar.zst
nixpkgs-8416cd0326c3c8845cc9796223e9ab802290002f.zip
kazam: 1.4.3 → 1.4.5
Diffstat (limited to 'pkgs/applications/video/kazam')
-rw-r--r--pkgs/applications/video/kazam/bug_1190693.patch14
-rw-r--r--pkgs/applications/video/kazam/datadir.patch11
-rw-r--r--pkgs/applications/video/kazam/default.nix57
-rw-r--r--pkgs/applications/video/kazam/fix-paths.patch22
4 files changed, 48 insertions, 56 deletions
diff --git a/pkgs/applications/video/kazam/bug_1190693.patch b/pkgs/applications/video/kazam/bug_1190693.patch
deleted file mode 100644
index 9f00c6b6079..00000000000
--- a/pkgs/applications/video/kazam/bug_1190693.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-=== modified file 'kazam/frontend/indicator.py'
---- a/kazam/frontend/indicator.py	2013-01-26 01:53:53 +0000
-+++ b/kazam/frontend/indicator.py	2013-06-13 18:18:37 +0000
-@@ -291,3 +291,9 @@
-         def start_recording(self):
-             logger.debug("Recording started.")
-             self.indicator.set_from_icon_name("kazam-recording")
-+
-+        def hide_it(self):
-+            self.indicator.set_visible(False)
-+
-+        def show_it(self):
-+            self.indicator.set_visible(True)
-
diff --git a/pkgs/applications/video/kazam/datadir.patch b/pkgs/applications/video/kazam/datadir.patch
deleted file mode 100644
index 114d4228be2..00000000000
--- a/pkgs/applications/video/kazam/datadir.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/bin/kazam       2014-02-03 23:11:38.465614061 +0100
-+++ b/bin/kazam-1     2014-02-03 23:12:28.447058700 +0100
-@@ -68,7 +68,7 @@
-         # when base install path is not /usr
-         curpath = os.path.abspath(__file__)
-         curpath = os.path.realpath(curpath)
--        datadir = curpath.split('bin/')[0] + "share/kazam/"
-+        datadir = os.path.realpath(os.path.join(curpath, "./../../", "share/kazam/"))
- 
-     try:
-         import platform
diff --git a/pkgs/applications/video/kazam/default.nix b/pkgs/applications/video/kazam/default.nix
index b67c4a43cf5..9ffd62d068a 100644
--- a/pkgs/applications/video/kazam/default.nix
+++ b/pkgs/applications/video/kazam/default.nix
@@ -1,46 +1,41 @@
-{ stdenv, fetchurl, python3Packages, gst_all_1, makeWrapper, gobjectIntrospection
-, gtk3, libwnck3, keybinder, intltool, libcanberra-gtk2 }:
+{ stdenv, fetchurl, substituteAll, python3, gst_all_1, wrapGAppsHook, gobjectIntrospection
+, gtk3, libwnck3, keybinder3, intltool, libcanberra-gtk3, libappindicator-gtk3, libpulseaudio }:
 
-
-python3Packages.buildPythonApplication rec {
+python3.pkgs.buildPythonApplication rec {
   name = "kazam-${version}";
-  version = "1.4.3";
+  version = "1.4.5";
   namePrefix = "";
 
   src = fetchurl {
     url = "https://launchpad.net/kazam/stable/${version}/+download/kazam-${version}.tar.gz";
-    sha256 = "00bcn0yj9xrv87sf6xd3wpilsjgjpsj15zzpjh351ffpjnr0ica8";
+    sha256 = "1qygnrvm6aqixbyivhssp70hs0llxwk7lh3j7idxa2jbkk06hj4f";
   };
 
-  # TODO: keybinder, appindicator3
-  buildInputs = with python3Packages;
-    [ pygobject3 pyxdg pycairo gst_all_1.gstreamer gst_all_1.gst-plugins-base
-      gst_all_1.gst-plugins-good gobjectIntrospection gtk3 libwnck3 distutils_extra
-      intltool dbus-python ];
-
-  # TODO: figure out why PYTHONPATH is not passed automatically for those programs
-  pythonPath = with python3Packages;
-    [ pygobject3 pyxdg pycairo dbus-python ];
-
-  patches = [ ./datadir.patch ./bug_1190693.patch ];
-  prePatch = ''
-    rm setup.cfg
-    substituteInPlace kazam/backend/grabber.py --replace "/usr/bin/canberra-gtk-play" "${libcanberra-gtk2}/bin/canberra-gtk-play"
-  '';
+  nativeBuildInputs = [ gobjectIntrospection python3.pkgs.distutils_extra intltool wrapGAppsHook ];
+  buildInputs = [
+    gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good gtk3 libwnck3
+    keybinder3 libappindicator-gtk3
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [ pygobject3 pyxdg pycairo dbus-python ];
+
+  patches = [
+    # Fix paths
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libcanberra = libcanberra-gtk3;
+      inherit libpulseaudio;
+    })
+    # Fix compability with Python 3.4
+    (fetchurl {
+      url = https://sources.debian.org/data/main/k/kazam/1.4.5-2/debian/patches/configparser_api_changes.patch;
+      sha256 = "0yvmipnh98s7y07cp1f113l0qqfw65k13an96byq707z3ymv1c2h";
+    })
+  ];
 
   # no tests
   doCheck = false;
 
-  preFixup = ''
-    wrapProgram $out/bin/kazam \
-      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-      --prefix LD_LIBRARY_PATH ":" "${stdenv.lib.makeLibraryPath [ gtk3 gst_all_1.gstreamer keybinder ]}" \
-      --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \
-      --prefix XDG_DATA_DIRS : "${gtk3.out}/share" \
-      --set GST_REGISTRY "/tmp/kazam.gstreamer.registry";
-  '';
-
-
   meta = with stdenv.lib; {
     description = "A screencasting program created with design in mind";
     homepage = https://code.launchpad.net/kazam;
diff --git a/pkgs/applications/video/kazam/fix-paths.patch b/pkgs/applications/video/kazam/fix-paths.patch
new file mode 100644
index 00000000000..43e360830ab
--- /dev/null
+++ b/pkgs/applications/video/kazam/fix-paths.patch
@@ -0,0 +1,22 @@
+--- a/kazam/backend/grabber.py
++++ b/kazam/backend/grabber.py
+@@ -72,7 +72,7 @@
+         #
+         if prefs.shutter_sound and (not self.god):
+             soundfile = os.path.join(prefs.datadir, 'sounds', prefs.sound_files[prefs.shutter_type])
+-            subprocess.call(['/usr/bin/canberra-gtk-play', '-f', soundfile])
++            subprocess.call(['@libcanberra@/bin/canberra-gtk-play', '-f', soundfile])
+ 
+         if self.xid:
+             if prefs.capture_borders_pic:
+--- a/kazam/pulseaudio/ctypes_pulseaudio.py
++++ b/kazam/pulseaudio/ctypes_pulseaudio.py
+@@ -20,7 +20,7 @@
+ #       MA 02110-1301, USA.
+ 
+ from ctypes import *
+-PA = CDLL('libpulse.so.0')
++PA = CDLL('@libpulseaudio@/lib/libpulse.so.0')
+ 
+ #
+ # Pulse Audio constants and defines