2018-09-05 14:12:02 +02:00
|
|
|
{ buildPythonPackage, fetchurl, meson, ninja, stdenv, pkgconfig, python, pygobject3
|
2018-12-02 12:41:15 +01:00
|
|
|
, gobject-introspection, gst-plugins-base, isPy3k
|
2014-02-02 16:07:03 +01:00
|
|
|
}:
|
|
|
|
|
2018-06-23 15:27:58 +02:00
|
|
|
let
|
2017-08-13 21:42:30 +02:00
|
|
|
pname = "gst-python";
|
2018-10-17 03:42:48 +02:00
|
|
|
version = "1.14.4";
|
2017-08-13 21:42:30 +02:00
|
|
|
name = "${pname}-${version}";
|
2018-06-23 15:27:58 +02:00
|
|
|
in buildPythonPackage rec {
|
|
|
|
inherit pname version;
|
|
|
|
format = "other";
|
2014-02-02 16:07:03 +01:00
|
|
|
|
2018-09-05 14:12:02 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2014-02-02 16:07:03 +01:00
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
2014-10-21 20:28:37 +02:00
|
|
|
"${meta.homepage}/src/gst-python/${name}.tar.xz"
|
|
|
|
"mirror://gentoo/distfiles/${name}.tar.xz"
|
2014-02-02 16:07:03 +01:00
|
|
|
];
|
2018-10-17 03:42:48 +02:00
|
|
|
sha256 = "06ssx19fs6pg4d32p9ph9w4f0xwmxaw2dxfj17rqkn5njd7v5zfh";
|
2014-02-02 16:07:03 +01:00
|
|
|
};
|
|
|
|
|
2018-09-05 14:12:02 +02:00
|
|
|
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";
|
|
|
|
})
|
2018-09-05 14:12:02 +02:00
|
|
|
# Fixes `from gi.repository import Gst` when gst-python's site-package is in
|
|
|
|
# PYTHONPATH
|
|
|
|
(fetchurl {
|
|
|
|
url = https://gitlab.freedesktop.org/gstreamer/gst-python/commit/d64bbc1e0c3c948c148f505cc5f856ce56732880.diff;
|
|
|
|
sha256 = "1n9pxmcl1x491mp47avpcw2a6n71lm0haz6mfas168prkgsk8q3r";
|
|
|
|
})
|
|
|
|
# Fixes python2 build from the above changes
|
|
|
|
(fetchurl {
|
|
|
|
url = https://gitlab.freedesktop.org/gstreamer/gst-python/commit/f79ac2d1434d7ba9717f3e943cfdc76e121eb5dd.diff;
|
|
|
|
sha256 = "17a164b0v36g0kwiqdlkjx6g0pjhcs6ilizck7iky8bgjnmiypm1";
|
|
|
|
})
|
2018-09-05 14:12:02 +02:00
|
|
|
];
|
2016-04-24 14:39:30 +02:00
|
|
|
|
2018-09-05 14:12:02 +02:00
|
|
|
# TODO: First python_dep in meson.build needs to be removed
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace meson.build --replace python3 python${if isPy3k then "3" else "2"}
|
|
|
|
'';
|
2015-09-18 14:24:19 +02:00
|
|
|
|
2019-02-15 10:08:27 +01:00
|
|
|
nativeBuildInputs = [ meson ninja pkgconfig python gobject-introspection gst-plugins-base ];
|
2014-02-02 16:07:03 +01:00
|
|
|
|
2018-04-03 09:36:38 +02:00
|
|
|
mesonFlags = [
|
2018-09-05 14:12:02 +02:00
|
|
|
"-Dpython=python${if isPy3k then "3" else "2"}"
|
|
|
|
"-Dpygi-overrides-dir=${placeholder "out"}/${python.sitePackages}/gi/overrides"
|
2017-09-08 21:03:20 +02:00
|
|
|
];
|
2014-02-02 16:07:03 +01:00
|
|
|
|
2018-09-05 14:12:02 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
# TODO: Meson setup hook does not like buildPythonPackage
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/47390
|
|
|
|
installCheckPhase = "meson test --print-errorlogs";
|
2018-04-03 09:36:38 +02:00
|
|
|
|
2015-09-18 14:24:19 +02:00
|
|
|
propagatedBuildInputs = [ gst-plugins-base pygobject3 ];
|
2014-08-12 22:18:25 +02:00
|
|
|
|
2014-02-02 16:07:03 +01:00
|
|
|
meta = {
|
2017-09-16 21:28:31 +02:00
|
|
|
homepage = https://gstreamer.freedesktop.org;
|
2014-02-02 16:07:03 +01:00
|
|
|
|
|
|
|
description = "Python bindings for GStreamer";
|
|
|
|
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.lgpl2Plus;
|
2014-02-02 16:07:03 +01:00
|
|
|
};
|
|
|
|
}
|