python3.pkgs.gst-python: clean up

* Format with nixpkgs-fmt
* Reorder attributes according to estabilished convention
* Drop unnecessaty mirror
* Move pname & version into the main attrset
This commit is contained in:
Jan Tojnar 2020-03-17 02:30:05 +01:00
parent 2044b58ef3
commit 0a01b0c7d2
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -1,22 +1,26 @@
{ buildPythonPackage, fetchurl, meson, ninja, stdenv, pkgconfig, python, pygobject3 { buildPythonPackage
, gobject-introspection, gst-plugins-base, isPy3k , fetchurl
, meson
, ninja
, stdenv
, pkgconfig
, python
, pygobject3
, gobject-introspection
, gst-plugins-base
, isPy3k
}: }:
let buildPythonPackage rec {
pname = "gst-python"; pname = "gst-python";
version = "1.14.4"; version = "1.14.4";
name = "${pname}-${version}";
in buildPythonPackage rec {
inherit pname version;
format = "other"; format = "other";
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
src = fetchurl { src = fetchurl {
urls = [ url = "${meta.homepage}/src/gst-python/${pname}-${version}.tar.xz";
"${meta.homepage}/src/gst-python/${name}.tar.xz"
"mirror://gentoo/distfiles/${name}.tar.xz"
];
sha256 = "06ssx19fs6pg4d32p9ph9w4f0xwmxaw2dxfj17rqkn5njd7v5zfh"; sha256 = "06ssx19fs6pg4d32p9ph9w4f0xwmxaw2dxfj17rqkn5njd7v5zfh";
}; };
@ -41,12 +45,19 @@ in buildPythonPackage rec {
}) })
]; ];
# TODO: First python_dep in meson.build needs to be removed nativeBuildInputs = [
postPatch = '' meson
substituteInPlace meson.build --replace python3 python${if isPy3k then "3" else "2"} ninja
''; pkgconfig
python
gobject-introspection
gst-plugins-base
];
nativeBuildInputs = [ meson ninja pkgconfig python gobject-introspection gst-plugins-base ]; propagatedBuildInputs = [
gst-plugins-base
pygobject3
];
mesonFlags = [ mesonFlags = [
"-Dpython=python${if isPy3k then "3" else "2"}" "-Dpython=python${if isPy3k then "3" else "2"}"
@ -59,10 +70,13 @@ in buildPythonPackage rec {
# https://github.com/NixOS/nixpkgs/issues/47390 # https://github.com/NixOS/nixpkgs/issues/47390
installCheckPhase = "meson test --print-errorlogs"; installCheckPhase = "meson test --print-errorlogs";
propagatedBuildInputs = [ gst-plugins-base pygobject3 ]; # TODO: First python_dep in meson.build needs to be removed
postPatch = ''
substituteInPlace meson.build --replace python3 python${if isPy3k then "3" else "2"}
'';
meta = { meta = {
homepage = https://gstreamer.freedesktop.org; homepage = "https://gstreamer.freedesktop.org";
description = "Python bindings for GStreamer"; description = "Python bindings for GStreamer";