2021-05-04 21:53:14 +00:00
|
|
|
{ lib
|
2024-08-16 15:46:21 +00:00
|
|
|
, python312Packages
|
2021-05-04 21:53:14 +00:00
|
|
|
, fetchFromGitHub
|
2023-09-12 07:57:27 +00:00
|
|
|
|
2021-05-04 21:53:14 +00:00
|
|
|
, chromaprint
|
2023-09-12 07:57:27 +00:00
|
|
|
, gettext
|
2021-05-04 21:53:14 +00:00
|
|
|
, qt5
|
2023-09-12 07:57:27 +00:00
|
|
|
|
2020-03-27 10:04:51 +00:00
|
|
|
, enablePlayback ? true
|
|
|
|
, gst_all_1
|
|
|
|
}:
|
2012-09-04 23:15:23 +00:00
|
|
|
|
2016-08-14 10:37:20 +00:00
|
|
|
let
|
2024-08-16 15:46:21 +00:00
|
|
|
pythonPackages = python312Packages;
|
2023-08-05 10:24:23 +00:00
|
|
|
pyqt5 =
|
|
|
|
if enablePlayback then
|
2024-01-07 15:05:58 +00:00
|
|
|
pythonPackages.pyqt5-multimedia
|
2023-08-05 10:24:23 +00:00
|
|
|
else
|
2023-10-12 07:58:25 +00:00
|
|
|
pythonPackages.pyqt5;
|
2021-05-04 21:53:14 +00:00
|
|
|
in
|
|
|
|
pythonPackages.buildPythonApplication rec {
|
2018-06-23 13:27:58 +00:00
|
|
|
pname = "picard";
|
2024-07-10 12:21:09 +00:00
|
|
|
# nix-update --commit picard --version-regex 'release-(.*)'
|
2024-09-05 19:54:04 +00:00
|
|
|
version = "2.12.3";
|
2023-09-12 07:57:27 +00:00
|
|
|
format = "setuptools";
|
2012-09-04 23:15:23 +00:00
|
|
|
|
2019-01-31 18:58:26 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "metabrainz";
|
2023-08-05 10:24:23 +00:00
|
|
|
repo = "picard";
|
2022-12-06 16:37:16 +00:00
|
|
|
rev = "refs/tags/release-${version}";
|
2024-09-05 19:54:04 +00:00
|
|
|
hash = "sha256-ysHOiX8b9tlUaQDGl4qHUVLrLUF9MUDc4+vOQB76cj4=";
|
2012-09-04 23:15:23 +00:00
|
|
|
};
|
|
|
|
|
2023-05-30 07:32:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
qt5.wrapQtAppsHook
|
2024-08-16 15:52:30 +00:00
|
|
|
pythonPackages.pytestCheckHook
|
2023-05-30 07:32:41 +00:00
|
|
|
] ++ lib.optionals (pyqt5.multimediaEnabled) [
|
2021-05-04 21:53:14 +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-05-30 07:32:41 +00:00
|
|
|
];
|
2023-08-05 10:24:23 +00:00
|
|
|
|
2023-05-30 07:32:41 +00:00
|
|
|
buildInputs = [
|
|
|
|
qt5.qtbase
|
|
|
|
qt5.qtwayland
|
|
|
|
] ++ lib.optionals (pyqt5.multimediaEnabled) [
|
|
|
|
qt5.qtmultimedia.bin
|
|
|
|
];
|
2012-09-04 23:15:23 +00:00
|
|
|
|
2016-08-14 10:37:20 +00:00
|
|
|
propagatedBuildInputs = with pythonPackages; [
|
2018-11-02 17:47:58 +00:00
|
|
|
chromaprint
|
2021-05-04 21:53:14 +00:00
|
|
|
discid
|
|
|
|
fasteners
|
2022-01-14 02:10:48 +00:00
|
|
|
markdown
|
2023-09-12 07:57:27 +00:00
|
|
|
mutagen
|
2022-01-14 02:10:48 +00:00
|
|
|
pyjwt
|
2023-09-12 07:57:27 +00:00
|
|
|
pyqt5
|
|
|
|
python-dateutil
|
2022-01-14 02:10:48 +00:00
|
|
|
pyyaml
|
2012-09-04 23:15:23 +00:00
|
|
|
];
|
|
|
|
|
2024-10-30 18:23:01 +00:00
|
|
|
setupPyGlobalFlags = [ "build" "--disable-autoupdate" "--localedir=${placeholder "out"}/share/locale" ];
|
2023-09-06 17:19:20 +00:00
|
|
|
|
2023-08-05 10:24:23 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
2024-08-16 15:52:30 +00:00
|
|
|
doCheck = true;
|
2023-08-05 10:24:23 +00:00
|
|
|
|
2020-03-27 10:04:24 +00:00
|
|
|
# In order to spare double wrapping, we use:
|
|
|
|
preFixup = ''
|
|
|
|
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
2023-09-12 07:57:27 +00:00
|
|
|
'' + lib.optionalString (pyqt5.multimediaEnabled) ''
|
2021-05-04 21:53:14 +00:00
|
|
|
makeWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
2023-08-05 10:24:23 +00:00
|
|
|
'';
|
2019-08-09 12:37:35 +00:00
|
|
|
|
2024-08-16 15:54:10 +00:00
|
|
|
meta = {
|
2023-09-12 07:57:27 +00:00
|
|
|
homepage = "https://picard.musicbrainz.org";
|
|
|
|
changelog = "https://picard.musicbrainz.org/changelog";
|
2012-09-04 23:15:23 +00:00
|
|
|
description = "Official MusicBrainz tagger";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "picard";
|
2024-08-16 15:54:10 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
platforms = lib.platforms.all;
|
2024-08-16 15:54:43 +00:00
|
|
|
maintainers = with lib.maintainers; [ doronbehar ];
|
2012-09-04 23:15:23 +00:00
|
|
|
};
|
|
|
|
}
|