2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, python3Packages
|
|
|
|
, fetchFromGitHub
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
, chromaprint
|
2023-10-09 19:29:22 +00:00
|
|
|
, gettext
|
2021-05-20 23:08:51 +00:00
|
|
|
, qt5
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
, enablePlayback ? true
|
|
|
|
, gst_all_1
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pythonPackages = python3Packages;
|
2023-08-10 07:59:29 +00:00
|
|
|
pyqt5 =
|
|
|
|
if enablePlayback then
|
|
|
|
pythonPackages.pyqt5_with_qtmultimedia
|
|
|
|
else
|
|
|
|
pythonPackages.pyqt5
|
2020-04-24 23:36:52 +00:00
|
|
|
;
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
|
|
|
pythonPackages.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "picard";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.9.2";
|
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metabrainz";
|
2023-08-10 07:59:29 +00:00
|
|
|
repo = "picard";
|
2022-12-28 21:21:41 +00:00
|
|
|
rev = "refs/tags/release-${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-Sk4QlwJqqgCWAgguhIVscJfpf/5imoHYN9yVWv5qYG8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
qt5.wrapQtAppsHook
|
|
|
|
] ++ lib.optionals (pyqt5.multimediaEnabled) [
|
2021-05-20 23:08:51 +00:00
|
|
|
gst_all_1.gst-libav
|
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gst-plugins-good
|
|
|
|
gst_all_1.gst-vaapi
|
|
|
|
gst_all_1.gstreamer
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [
|
|
|
|
qt5.qtbase
|
|
|
|
qt5.qtwayland
|
|
|
|
] ++ lib.optionals (pyqt5.multimediaEnabled) [
|
|
|
|
qt5.qtmultimedia.bin
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
|
|
chromaprint
|
2021-05-20 23:08:51 +00:00
|
|
|
discid
|
|
|
|
fasteners
|
2022-01-19 23:45:15 +00:00
|
|
|
markdown
|
2023-10-09 19:29:22 +00:00
|
|
|
mutagen
|
2022-01-19 23:45:15 +00:00
|
|
|
pyjwt
|
2023-10-09 19:29:22 +00:00
|
|
|
pyqt5
|
|
|
|
python-dateutil
|
2022-01-19 23:45:15 +00:00
|
|
|
pyyaml
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
setupPyGlobalFlags = [ "build" "--disable-autoupdate" ];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# In order to spare double wrapping, we use:
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
2023-10-09 19:29:22 +00:00
|
|
|
'' + lib.optionalString (pyqt5.multimediaEnabled) ''
|
2021-05-20 23:08:51 +00:00
|
|
|
makeWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
2023-08-10 07:59:29 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://picard.musicbrainz.org";
|
|
|
|
changelog = "https://picard.musicbrainz.org/changelog";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The official MusicBrainz tagger";
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ ehmry paveloom ];
|
2020-10-11 12:50:04 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|