From 69ff55d18810ee2266f85a8995009c4ce36fa7b3 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 12 Oct 2024 11:25:32 -0300 Subject: [PATCH 1/2] kid3: use regular callPackage instead of customized one Plus formatter. --- pkgs/applications/audio/kid3/default.nix | 134 ++++++++++++----------- pkgs/top-level/all-packages.nix | 6 +- 2 files changed, 74 insertions(+), 66 deletions(-) diff --git a/pkgs/applications/audio/kid3/default.nix b/pkgs/applications/audio/kid3/default.nix index 8cc6f6d8ec604..8403db5c9f3fb 100644 --- a/pkgs/applications/audio/kid3/default.nix +++ b/pkgs/applications/audio/kid3/default.nix @@ -1,47 +1,44 @@ -{ chromaprint -, cmake -, docbook_xml_dtd_45 -, docbook_xsl -, fetchurl -, ffmpeg -, flac -, id3lib -, kdePackages -, lib -, libogg -, libvorbis -, libxslt -, mp4v2 -, pkg-config -, python3 -, qtbase -, qtdeclarative -, qtmultimedia -, qttools -, readline -, stdenv -, taglib -, wrapQtAppsHook -, zlib -, withCLI ? true -, withKDE ? true -, withQt ? false +{ + lib, + chromaprint, + cmake, + docbook_xml_dtd_45, + docbook_xsl, + fetchurl, + ffmpeg, + flac, + id3lib, + kdePackages, + libogg, + libvorbis, + libxslt, + mp4v2, + pkg-config, + python3, + qt6, + readline, + stdenv, + taglib, + zlib, + # Boolean flags + withCLI ? true, + withKDE ? true, + withQt ? false, }: let - inherit (lib) optionals; + inherit (qt6) + qtbase + qtdeclarative + qtmultimedia + qttools + wrapQtAppsHook + ; apps = lib.concatStringsSep ";" ( - optionals withCLI [ "CLI" ] - ++ optionals withKDE [ "KDE" ] - ++ optionals withQt [ "Qt" ] + lib.optionals withCLI [ "CLI" ] ++ lib.optionals withKDE [ "KDE" ] ++ lib.optionals withQt [ "Qt" ] ); - mainProgram = - if withQt then "kid3-qt" - else if withKDE then "kid3" - else "kid3-cli"; - in stdenv.mkDerivation (finalAttrs: { pname = "kid3"; @@ -62,29 +59,34 @@ stdenv.mkDerivation (finalAttrs: { wrapQtAppsHook ]; - buildInputs = [ - chromaprint - ffmpeg - flac - id3lib - libogg - libvorbis - libxslt - mp4v2 - qtbase - qtdeclarative - qtmultimedia - readline - taglib - zlib - ] ++ lib.optionals withKDE (with kdePackages; [ - kconfig - kconfigwidgets - kcoreaddons - kio - kxmlgui - phonon - ]); + buildInputs = + [ + chromaprint + ffmpeg + flac + id3lib + libogg + libvorbis + libxslt + mp4v2 + qtbase + qtdeclarative + qtmultimedia + readline + taglib + zlib + ] + ++ lib.optionals withKDE ( + with kdePackages; + [ + kconfig + kconfigwidgets + kcoreaddons + kio + kxmlgui + phonon + ] + ); cmakeFlags = [ (lib.cmakeFeature "WITH_APPS" apps) ]; @@ -95,10 +97,8 @@ stdenv.mkDerivation (finalAttrs: { }; meta = { - description = "Simple and powerful audio tag editor"; - inherit mainProgram; homepage = "https://kid3.kde.org/"; - license = lib.licenses.lgpl2Plus; + description = "Simple and powerful audio tag editor"; longDescription = '' If you want to easily tag multiple MP3, Ogg/Vorbis, FLAC, MPC, MP4/AAC, MP2, Opus, Speex, TrueAudio, WavPack, WMA, WAV and AIFF files (e.g. full @@ -128,6 +128,14 @@ stdenv.mkDerivation (finalAttrs: { - Edit synchronized lyrics and event timing codes, import and export LRC files. ''; + license = lib.licenses.lgpl2Plus; + mainProgram = + if withQt then + "kid3-qt" + else if withKDE then + "kid3" + else + "kid3-cli"; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.linux; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b15df4f0cfdef..6d139905f9890 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30397,9 +30397,9 @@ with pkgs; khard = callPackage ../applications/misc/khard { }; - kid3-cli = qt6Packages.callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = false; }; - kid3-kde = qt6Packages.callPackage ../applications/audio/kid3 { withCLI = true; withKDE = true; withQt = false; }; - kid3-qt = qt6Packages.callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = true; }; + kid3-cli = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = false; }; + kid3-kde = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = true; withQt = false; }; + kid3-qt = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = true; }; kid3 = kid3-kde; kile = callPackage ../applications/editors/kile { }; From 9cdf75404de6f498fe5ecb84a71f01647d2a700b Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sat, 12 Oct 2024 11:28:04 -0300 Subject: [PATCH 2/2] kid3: migrate to by-name --- .../audio/kid3/default.nix => by-name/ki/kid3/package.nix} | 0 pkgs/top-level/all-packages.nix | 7 +++---- 2 files changed, 3 insertions(+), 4 deletions(-) rename pkgs/{applications/audio/kid3/default.nix => by-name/ki/kid3/package.nix} (100%) diff --git a/pkgs/applications/audio/kid3/default.nix b/pkgs/by-name/ki/kid3/package.nix similarity index 100% rename from pkgs/applications/audio/kid3/default.nix rename to pkgs/by-name/ki/kid3/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d139905f9890..b9951f8195117 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -30397,10 +30397,9 @@ with pkgs; khard = callPackage ../applications/misc/khard { }; - kid3-cli = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = false; }; - kid3-kde = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = true; withQt = false; }; - kid3-qt = callPackage ../applications/audio/kid3 { withCLI = true; withKDE = false; withQt = true; }; - kid3 = kid3-kde; + kid3-cli = kid3.override { withCLI = true; withKDE = false; withQt = false; }; + kid3-kde = kid3.override { withCLI = true; withKDE = true; withQt = false; }; + kid3-qt = kid3.override { withCLI = true; withKDE = false; withQt = true; }; kile = callPackage ../applications/editors/kile { };