1{ 2 lib, 3 buildPythonPackage, 4 fetchurl, 5 fetchpatch, 6 meson, 7 ninja, 8 9 pkg-config, 10 python, 11 pygobject3, 12 gobject-introspection, 13 gst_all_1, 14 isPy3k, 15 directoryListingUpdater, 16}: 17 18buildPythonPackage rec { 19 pname = "gst-python"; 20 version = "1.26.0"; 21 22 format = "other"; 23 24 outputs = [ 25 "out" 26 "dev" 27 ]; 28 29 src = fetchurl { 30 url = "https://gstreamer.freedesktop.org/src/gst-python/gst-python-${version}.tar.xz"; 31 hash = "sha256-5QRqBdd6uxVnGtAc0ZCNF9YuWgb114Qb5DQq3io/uNs="; 32 }; 33 34 patches = [ 35 # Fix segfault with PyGObject>=3.52.0 36 # https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8653 37 (fetchpatch { 38 url = "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/69bba61e548c7a63bc18137e63e41489a7de9d36.patch"; 39 stripLen = 2; 40 hash = "sha256-BfWPc8dsB09KiEm9bNT8e+jH76jiDefQlEhhLJoq7tI="; 41 }) 42 ]; 43 44 # Python 2.x is not supported. 45 disabled = !isPy3k; 46 47 depsBuildBuild = [ pkg-config ]; 48 49 nativeBuildInputs = [ 50 meson 51 ninja 52 pkg-config 53 gobject-introspection 54 gst_all_1.gst-plugins-base 55 ]; 56 57 buildInputs = [ 58 # for gstreamer-analytics-1.0 59 gst_all_1.gst-plugins-bad 60 ]; 61 62 propagatedBuildInputs = [ 63 gst_all_1.gst-plugins-base 64 pygobject3 65 ]; 66 67 checkInputs = [ 68 gst_all_1.gst-rtsp-server 69 ]; 70 71 mesonFlags = [ 72 "-Dpygi-overrides-dir=${placeholder "out"}/${python.sitePackages}/gi/overrides" 73 # Exec format error during configure 74 "-Dpython-exe=${python.pythonOnBuildForHost.interpreter}" 75 ]; 76 77 # TODO: Meson setup hook does not like buildPythonPackage 78 # https://github.com/NixOS/nixpkgs/issues/47390 79 installCheckPhase = "meson test --print-errorlogs"; 80 81 passthru = { 82 updateScript = directoryListingUpdater { }; 83 }; 84 85 meta = with lib; { 86 homepage = "https://gstreamer.freedesktop.org"; 87 description = "Python bindings for GStreamer"; 88 license = licenses.lgpl2Plus; 89 maintainers = [ ]; 90 }; 91}