2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchPypi, buildPythonPackage
|
|
|
|
, libmediainfo
|
|
|
|
, setuptools_scm
|
|
|
|
, pytest, glibcLocales }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pymediainfo";
|
2020-05-15 21:57:56 +00:00
|
|
|
version = "4.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-05-15 21:57:56 +00:00
|
|
|
sha256 = "0vg2icmsc44k1ra898rjfp912xijsn96s0zplax6w13lpzb9jb9r";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pymediainfo/__init__.py \
|
|
|
|
--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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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";
|
|
|
|
homepage = "https://github.com/sbraz/pymediainfo";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jfrankenau ];
|
|
|
|
};
|
|
|
|
}
|