2018-03-09 09:19:33 +00:00
|
|
|
{ stdenv, fetchPypi, buildPythonPackage
|
|
|
|
, libmediainfo
|
|
|
|
, setuptools_scm
|
|
|
|
, pytest, glibcLocales }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymediainfo";
|
2020-11-29 14:04:38 +00:00
|
|
|
version = "5.0.3";
|
2018-03-09 09:19:33 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-11-29 14:04:38 +00:00
|
|
|
sha256 = "ea61a3b0e0ed6de42ebb2233cf1a9312c57dce95101c025f9f081c10ecec48fb";
|
2018-03-09 09:19:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pymediainfo/__init__.py \
|
2019-03-04 14:36:31 +00:00
|
|
|
--replace "libmediainfo.0.dylib" \
|
|
|
|
"${libmediainfo}/lib/libmediainfo.0${stdenv.hostPlatform.extensions.sharedLibrary}" \
|
|
|
|
--replace "libmediainfo.dylib" \
|
|
|
|
"${libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}" \
|
|
|
|
--replace "libmediainfo.so.0" \
|
|
|
|
"${libmediainfo}/lib/libmediainfo${stdenv.hostPlatform.extensions.sharedLibrary}.0"
|
2018-03-09 09:19:33 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools_scm ];
|
|
|
|
|
|
|
|
checkInputs = [ glibcLocales pytest ];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
py.test -k 'not test_parse_url' tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Python wrapper for the mediainfo library";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/sbraz/pymediainfo";
|
2018-03-09 09:19:33 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jfrankenau ];
|
|
|
|
};
|
|
|
|
}
|