about summary refs log tree commit diff
path: root/pkgs/development/python-modules/gst-python/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/gst-python/default.nix')
-rw-r--r--pkgs/development/python-modules/gst-python/default.nix40
1 files changed, 27 insertions, 13 deletions
diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix
index 49f44bb16e44..8cbc08dbbfd0 100644
--- a/pkgs/development/python-modules/gst-python/default.nix
+++ b/pkgs/development/python-modules/gst-python/default.nix
@@ -1,38 +1,52 @@
-{ buildPythonPackage, fetchurl, stdenv, meson, ninja, pkgconfig, python, pygobject3
-, gst-plugins-base, ncurses
+{ buildPythonPackage, fetchurl, meson, ninja, stdenv, pkgconfig, python, pygobject3
+, gobjectIntrospection, gst-plugins-base, isPy3k
 }:
 
 let
   pname = "gst-python";
-  version = "1.14.2";
+  version = "1.14.4";
   name = "${pname}-${version}";
 in buildPythonPackage rec {
   inherit pname version;
   format = "other";
 
+  outputs = [ "out" "dev" ];
+
   src = fetchurl {
     urls = [
       "${meta.homepage}/src/gst-python/${name}.tar.xz"
       "mirror://gentoo/distfiles/${name}.tar.xz"
       ];
-    sha256 = "08nb011acyvlz48fqh8c084k0dlssz9b7wha7zzk797inidbwh6w";
+    sha256 = "06ssx19fs6pg4d32p9ph9w4f0xwmxaw2dxfj17rqkn5njd7v5zfh";
   };
 
-  outputs = [ "out" "dev" ];
+  patches = [
+    # Meson build does not support Python 2 at the moment
+    # https://bugzilla.gnome.org/show_bug.cgi?id=796092
+    (fetchurl {
+      name = "0002-meson-use-new-python-module.patch";
+      url = https://bugzilla.gnome.org/attachment.cgi?id=371989;
+      sha256 = "1k46nvw175c1wvkqnx783i9d4w9vn431spcl48jb3y224jj3va08";
+    })
+  ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig python ];
+  # TODO: First python_dep in meson.build needs to be removed
+  postPatch = ''
+    substituteInPlace meson.build --replace python3 python${if isPy3k then "3" else "2"}
+  '';
 
-  # XXX: in the Libs.private field of python3.pc
-  buildInputs = [ ncurses ];
+  nativeBuildInputs = [ meson ninja pkgconfig python gobjectIntrospection ];
 
   mesonFlags = [
-    "-Dpygi-overrides-dir=${python.sitePackages}/gi/overrides"
+    "-Dpython=python${if isPy3k then "3" else "2"}"
+    "-Dpygi-overrides-dir=${placeholder "out"}/${python.sitePackages}/gi/overrides"
   ];
 
-  postPatch = ''
-    chmod +x scripts/pythondetector # patchShebangs requires executable file
-    patchShebangs scripts/pythondetector
-  '';
+  doCheck = true;
+
+  # TODO: Meson setup hook does not like buildPythonPackage
+  # https://github.com/NixOS/nixpkgs/issues/47390
+  installCheckPhase = "meson test --print-errorlogs";
 
   propagatedBuildInputs = [ gst-plugins-base pygobject3 ];