2023-10-01 00:38:07 +02:00
|
|
|
|
{ lib
|
|
|
|
|
, buildPythonPackage
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, click
|
|
|
|
|
, mutagen
|
|
|
|
|
, nmslib
|
|
|
|
|
, peewee
|
|
|
|
|
, regex
|
|
|
|
|
, scikit-learn
|
|
|
|
|
, unidecode
|
|
|
|
|
, setuptools-scm
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
lb_matching_tools = buildPythonPackage rec {
|
|
|
|
|
pname = "listenbrainz-matching-tools";
|
|
|
|
|
# ensure this matches ListenBrainz-Content-Resolver’s requirements.txt entry
|
|
|
|
|
version = "2023-07-19.0";
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "metabrainz";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = "v-${version}";
|
|
|
|
|
sha256 = "sha256-SOUNw1kmXm8j7iZAROf+pVJao5eFjgNmgrtYMO09upA=";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
regex
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
setuptools-scm
|
|
|
|
|
];
|
|
|
|
|
|
2023-10-04 14:09:53 +02:00
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = "0.1.dev1+${version}";
|
2023-10-01 00:38:07 +02:00
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "ListenBrainz-Content-Resolver";
|
2023-10-04 13:39:00 +02:00
|
|
|
|
version = "unstable-2023-10-03";
|
2023-10-01 00:38:07 +02:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "metabrainz";
|
|
|
|
|
repo = pname;
|
2023-10-04 13:31:52 +02:00
|
|
|
|
rev = "6caa43df1d17a974ae27a91f1aaf663952cf0ed9";
|
2023-10-04 13:39:00 +02:00
|
|
|
|
sha256 = "sha256-m11buP7AhpLXmIPK9z3r3Gtr8L6A5MAt+SyuIT5bK9Q=";
|
2023-10-01 00:38:07 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
# Make model discoverable by setuptools’ find_packages
|
|
|
|
|
touch lb_content_resolver/model/__init__.py
|
2023-10-04 13:39:00 +02:00
|
|
|
|
|
|
|
|
|
# pythonRelaxDepsHook does not work when this packages’ version is set to unstable-YYYY-MM-DD
|
|
|
|
|
sed -i setup.py -e 's/"\([^=]*\)==[^"]*"/"\1"/g'
|
2023-10-01 00:38:07 +02:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
click
|
|
|
|
|
lb_matching_tools
|
|
|
|
|
mutagen
|
|
|
|
|
nmslib
|
|
|
|
|
peewee
|
|
|
|
|
regex
|
|
|
|
|
scikit-learn
|
|
|
|
|
unidecode
|
|
|
|
|
];
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
setuptools-scm
|
|
|
|
|
];
|
|
|
|
|
|
2023-10-04 14:09:53 +02:00
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = "0.1.dev1+${version}";
|
2023-10-01 00:38:07 +02:00
|
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
|
mkdir -p $out/bin
|
2023-10-04 13:39:45 +02:00
|
|
|
|
cp $src/resolve.py $out/bin/lb-content-resolver
|
2023-10-01 00:38:07 +02:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Resolver for ListenBrainz playlists from JSPF to local playlists";
|
|
|
|
|
homepage = "https://github.com/metabrainz/listenbrainz-content-resolver";
|
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
|
maintainers = with maintainers; [ sbruder ];
|
|
|
|
|
platforms = platforms.linux;
|
|
|
|
|
};
|
|
|
|
|
}
|