2021-01-03 00:47:09 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, writeScript, glibcLocales, diffPlugins, substituteAll
|
2018-12-02 12:41:15 +01:00
|
|
|
, pythonPackages, imagemagick, gobject-introspection, gst_all_1
|
2019-02-26 12:45:54 +01:00
|
|
|
, runtimeShell
|
beets: Add patch to fix Python 3.7 compatibility
Since 0f38d9669ffd74991b65a9c40cdbcf2a98438d1f, the default Python
version for Python 3 is now Python 3.7.
It has been a while since beets had a new release, but the fix for
Python 3.7 is already in master (and it's also rather small), so I
decided to cherry-pick the commit as a patch.
I've built the package along with its tests and they failed at first,
but the errors were unrelated. So I disabled the tests for pylint, as
they're failing right now.
In addition I also needed to temporarily revert
0d2f06ae3a1f8347dc09cd0dfe6d12b757368e4d, which supposedly should fix
issues with Python 2 but aparently breaks Python 3 support and during
the beets tests we get a ModuleNotFoundError for the "_gi_gst" module.
However I didn't further investigate why this happens, as I'm time
constrained right now. But after disabling the pylint tests and the
revert of the mentioned gst-python commit, the beets tests succeed.
Signed-off-by: aszlig <aszlig@nix.build>
Cc: @jtojnar, @lopsided98 (for introducing the gst-python change)
Cc: @domenkozar, @pjones (other beets maintainers)
2018-11-29 03:51:06 +01:00
|
|
|
, fetchpatch
|
2021-02-01 03:27:37 +01:00
|
|
|
, unstableGitUpdater
|
2014-12-30 03:23:37 +01:00
|
|
|
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
# Attributes needed for tests of the external plugins
|
|
|
|
, callPackage, beets
|
|
|
|
|
2021-01-03 00:47:09 +01:00
|
|
|
, enableAbsubmit ? lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor ? null
|
|
|
|
, enableAcousticbrainz ? true
|
|
|
|
, enableAcoustid ? true
|
|
|
|
, enableBadfiles ? true, flac ? null, mp3val ? null
|
|
|
|
, enableBeatport ? true
|
|
|
|
, enableBpsync ? true
|
|
|
|
, enableConvert ? true, ffmpeg ? null
|
|
|
|
, enableDeezer ? true
|
|
|
|
, enableDiscogs ? true
|
|
|
|
, enableEmbyupdate ? true
|
|
|
|
, enableFetchart ? true
|
|
|
|
, enableGmusic ? true
|
|
|
|
, enableKeyfinder ? true, keyfinder-cli ? null
|
|
|
|
, enableKodiupdate ? true
|
|
|
|
, enableLastfm ? true
|
|
|
|
, enableLoadext ? true
|
|
|
|
, enableMpd ? true
|
|
|
|
, enablePlaylist ? true
|
|
|
|
, enableReplaygain ? true
|
|
|
|
, enableSonosUpdate ? true
|
|
|
|
, enableSubsonicplaylist ? true
|
|
|
|
, enableSubsonicupdate ? true
|
|
|
|
, enableThumbnails ? true
|
|
|
|
, enableWeb ? true
|
2014-12-30 22:53:00 +01:00
|
|
|
|
2015-12-18 05:34:46 +01:00
|
|
|
# External plugins
|
2021-01-03 00:47:09 +01:00
|
|
|
, enableAlternatives ? false
|
|
|
|
, enableCheck ? false, liboggz ? null
|
|
|
|
, enableCopyArtifacts ? false
|
|
|
|
, enableExtraFiles ? false
|
2015-12-18 05:34:46 +01:00
|
|
|
|
2016-09-28 17:46:29 +02:00
|
|
|
, bashInteractive, bash-completion
|
2014-12-30 22:53:00 +01:00
|
|
|
}:
|
|
|
|
|
2021-01-03 00:47:09 +01:00
|
|
|
assert enableAbsubmit -> essentia-extractor != null;
|
|
|
|
assert enableAcoustid -> pythonPackages.pyacoustid != null;
|
2015-10-26 10:26:48 +01:00
|
|
|
assert enableBadfiles -> flac != null && mp3val != null;
|
2021-01-03 00:47:09 +01:00
|
|
|
assert enableBeatport -> pythonPackages.requests_oauthlib != null;
|
|
|
|
assert enableBpsync -> enableBeatport;
|
2019-12-07 07:08:54 +01:00
|
|
|
assert enableCheck -> flac != null && mp3val != null && liboggz != null;
|
2021-01-03 00:47:09 +01:00
|
|
|
assert enableConvert -> ffmpeg != null;
|
|
|
|
assert enableDiscogs -> pythonPackages.discogs_client != null;
|
|
|
|
assert enableFetchart -> pythonPackages.responses != null;
|
|
|
|
assert enableGmusic -> pythonPackages.gmusicapi != null;
|
|
|
|
assert enableKeyfinder -> keyfinder-cli != null;
|
|
|
|
assert enableLastfm -> pythonPackages.pylast != null;
|
|
|
|
assert enableMpd -> pythonPackages.mpd2 != null;
|
|
|
|
assert enableReplaygain -> ffmpeg != null;
|
|
|
|
assert enableSonosUpdate -> pythonPackages.soco != null;
|
|
|
|
assert enableThumbnails -> pythonPackages.pyxdg != null;
|
|
|
|
assert enableWeb -> pythonPackages.flask != null;
|
|
|
|
|
|
|
|
with lib;
|
2014-12-30 22:53:00 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
optionalPlugins = {
|
2019-11-18 06:13:12 +01:00
|
|
|
absubmit = enableAbsubmit;
|
2016-02-09 21:43:50 +01:00
|
|
|
acousticbrainz = enableAcousticbrainz;
|
2015-10-26 10:26:48 +01:00
|
|
|
badfiles = enableBadfiles;
|
2021-01-03 00:47:09 +01:00
|
|
|
beatport = enableBeatport;
|
|
|
|
bpsync = enableBpsync;
|
2014-12-30 22:53:00 +01:00
|
|
|
chroma = enableAcoustid;
|
2016-05-02 17:18:07 +02:00
|
|
|
convert = enableConvert;
|
2021-01-03 00:47:09 +01:00
|
|
|
deezer = enableDeezer;
|
2014-12-30 22:53:00 +01:00
|
|
|
discogs = enableDiscogs;
|
2016-02-02 16:07:25 +01:00
|
|
|
embyupdate = enableEmbyupdate;
|
2014-12-30 22:53:00 +01:00
|
|
|
fetchart = enableFetchart;
|
2017-06-28 22:27:17 +02:00
|
|
|
gmusic = enableGmusic;
|
2016-09-10 01:44:10 +02:00
|
|
|
keyfinder = enableKeyfinder;
|
2017-06-28 22:27:17 +02:00
|
|
|
kodiupdate = enableKodiupdate;
|
2014-12-30 22:53:00 +01:00
|
|
|
lastgenre = enableLastfm;
|
|
|
|
lastimport = enableLastfm;
|
2019-09-23 06:23:56 +02:00
|
|
|
loadext = enableLoadext;
|
2014-12-30 22:53:00 +01:00
|
|
|
mpdstats = enableMpd;
|
|
|
|
mpdupdate = enableMpd;
|
2019-09-23 06:23:56 +02:00
|
|
|
playlist = enablePlaylist;
|
2014-12-30 22:53:00 +01:00
|
|
|
replaygain = enableReplaygain;
|
2018-06-29 21:11:13 +02:00
|
|
|
sonosupdate = enableSonosUpdate;
|
2021-01-03 00:47:09 +01:00
|
|
|
subsonicplaylist = enableSubsonicplaylist;
|
2019-09-23 06:23:56 +02:00
|
|
|
subsonicupdate = enableSubsonicupdate;
|
2015-04-13 22:04:51 +02:00
|
|
|
thumbnails = enableThumbnails;
|
2014-12-30 22:53:00 +01:00
|
|
|
web = enableWeb;
|
|
|
|
};
|
|
|
|
|
|
|
|
pluginsWithoutDeps = [
|
2021-01-03 00:47:09 +01:00
|
|
|
"bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart"
|
|
|
|
"export" "filefilter" "fish" "freedesktop" "fromfilename" "ftintitle" "fuzzy"
|
2019-11-18 06:13:12 +01:00
|
|
|
"hook" "ihate" "importadded" "importfeeds" "info" "inline" "ipfs" "lyrics"
|
2021-01-03 00:47:09 +01:00
|
|
|
"mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "parentwork" "permissions" "play"
|
2019-11-18 06:13:12 +01:00
|
|
|
"plexupdate" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the"
|
2021-01-03 00:47:09 +01:00
|
|
|
"types" "unimported" "zero"
|
2014-12-30 22:53:00 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins);
|
|
|
|
|
|
|
|
allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins;
|
2014-12-30 23:13:56 +01:00
|
|
|
allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins;
|
|
|
|
|
2014-12-30 22:53:00 +01:00
|
|
|
testShell = "${bashInteractive}/bin/bash --norc";
|
2016-09-28 17:46:29 +02:00
|
|
|
completion = "${bash-completion}/share/bash-completion/bash_completion";
|
2014-12-30 22:53:00 +01:00
|
|
|
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
# This is a stripped down beets for testing of the external plugins.
|
|
|
|
externalTestArgs.beets = (beets.override {
|
|
|
|
enableAlternatives = false;
|
|
|
|
enableCopyArtifacts = false;
|
2020-08-07 23:05:13 +02:00
|
|
|
enableExtraFiles = false;
|
2021-01-03 00:47:09 +01:00
|
|
|
}).overrideAttrs (const {
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
doInstallCheck = false;
|
|
|
|
});
|
|
|
|
|
beets: Fix building plugins with Python 3
Since the switch to using python3Packages in commit
72934aa94e322eb3d5be277d667466643f78e706, the plugins no longer build
because they end up with a mix of Python 2 and Python 3 packages.
The reason for this is that the Beets package itself uses callPackage to
reference the plugins, however the overrides are not applied there and
thus the plugins end up getting pythonPackages from the top-level which
is Python 2 and beets with Python 3 dependencies.
Unfortunately this is not the only reason for the builds to fail,
because both plugins did not actually support Python 3.
For the copyartifacts plugin, the fix is rather easy because we only
need to advance to two more recent commits from upstream, which already
contain fixes for Python 3.
The alternatives plugin on the other hand is not maintained anymore, but
there is a fork at https://github.com/wisp3rwind/beets-alternatives
which has a bunch of fixes. In 2e4aded366914d625a2f31208e8ac8548cb43a7e
I already backported one of these fixes to the version from
https://github.com/geigerzaehler/beets-alternatives, but for Python 3
support it's a bit more complicated than just one little fix.
So instead of adding another series of patches which replicate the code
base of the fork and become a maintenance burden, I opted to directly
switch to the fork and remove the patch on our side.
Signed-off-by: aszlig <aszlig@nix.build>
Cc: @domenkozar, @pjones, @Profpatsch
2018-08-02 01:41:36 +02:00
|
|
|
pluginArgs = externalTestArgs // { inherit pythonPackages; };
|
|
|
|
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
plugins = {
|
2021-01-03 00:47:09 +01:00
|
|
|
alternatives = callPackage ./plugins/alternatives.nix pluginArgs;
|
|
|
|
check = callPackage ./plugins/check.nix pluginArgs;
|
|
|
|
copyartifacts = callPackage ./plugins/copyartifacts.nix pluginArgs;
|
|
|
|
extrafiles = callPackage ./plugins/extrafiles.nix pluginArgs;
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
};
|
|
|
|
|
2016-12-03 05:21:00 +01:00
|
|
|
in pythonPackages.buildPythonApplication rec {
|
2018-07-24 18:17:24 +02:00
|
|
|
pname = "beets";
|
2021-01-03 00:47:09 +01:00
|
|
|
# While there is a stable version, 1.4.9, it is more than 1000 commits behind
|
|
|
|
# master and lacks many bug fixes and improvements[1]. Also important,
|
|
|
|
# unstable does not require bs1770gain[2].
|
|
|
|
# [1]: https://discourse.beets.io/t/forming-a-beets-core-team/639
|
|
|
|
# [2]: https://github.com/NixOS/nixpkgs/pull/90504
|
2021-02-01 03:27:56 +01:00
|
|
|
version = "unstable-2021-01-29";
|
2014-12-30 03:23:37 +01:00
|
|
|
|
2014-12-30 22:46:22 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-11-28 08:52:26 +01:00
|
|
|
owner = "beetbox";
|
2014-12-30 22:46:22 +01:00
|
|
|
repo = "beets";
|
2021-02-01 03:27:56 +01:00
|
|
|
rev = "04ea754d00e2873ae9aa2d9e07c5cefd790eaee2";
|
|
|
|
sha256 = "sha256-BIa3hnOsBxThbA2WCE4q9eaFNtObr3erZBBqobVOSiQ=";
|
2014-12-30 03:23:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2016-12-06 16:47:17 +01:00
|
|
|
pythonPackages.six
|
2016-12-03 05:21:00 +01:00
|
|
|
pythonPackages.enum34
|
|
|
|
pythonPackages.jellyfish
|
|
|
|
pythonPackages.munkres
|
|
|
|
pythonPackages.musicbrainzngs
|
|
|
|
pythonPackages.mutagen
|
|
|
|
pythonPackages.pyyaml
|
|
|
|
pythonPackages.unidecode
|
2017-02-19 23:35:24 +01:00
|
|
|
pythonPackages.gst-python
|
|
|
|
pythonPackages.pygobject3
|
2021-01-03 00:47:09 +01:00
|
|
|
pythonPackages.reflink
|
|
|
|
pythonPackages.confuse
|
|
|
|
pythonPackages.mediafile
|
2018-12-02 12:41:15 +01:00
|
|
|
gobject-introspection
|
2019-11-18 06:13:12 +01:00
|
|
|
] ++ optional enableAbsubmit essentia-extractor
|
|
|
|
++ optional enableAcoustid pythonPackages.pyacoustid
|
2021-01-03 00:47:09 +01:00
|
|
|
++ optional enableBeatport pythonPackages.requests_oauthlib
|
2016-02-02 16:07:25 +01:00
|
|
|
++ optional (enableFetchart
|
2021-01-03 00:47:09 +01:00
|
|
|
|| enableDeezer
|
2016-02-09 21:43:50 +01:00
|
|
|
|| enableEmbyupdate
|
2017-06-28 22:27:17 +02:00
|
|
|
|| enableKodiupdate
|
2019-09-23 06:23:56 +02:00
|
|
|
|| enableLoadext
|
|
|
|
|| enablePlaylist
|
2021-01-03 00:47:09 +01:00
|
|
|
|| enableSubsonicplaylist
|
2019-09-23 06:23:56 +02:00
|
|
|
|| enableSubsonicupdate
|
2016-02-09 21:43:50 +01:00
|
|
|
|| enableAcousticbrainz)
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
pythonPackages.requests
|
2019-12-07 07:08:54 +01:00
|
|
|
++ optional enableCheck plugins.check
|
2021-01-03 00:47:09 +01:00
|
|
|
++ optional enableConvert ffmpeg
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
++ optional enableDiscogs pythonPackages.discogs_client
|
|
|
|
++ optional enableGmusic pythonPackages.gmusicapi
|
|
|
|
++ optional enableKeyfinder keyfinder-cli
|
|
|
|
++ optional enableLastfm pythonPackages.pylast
|
|
|
|
++ optional enableMpd pythonPackages.mpd2
|
2018-06-29 21:11:13 +02:00
|
|
|
++ optional enableSonosUpdate pythonPackages.soco
|
beets: Run tests for external plugins
In order to run the tests for the external plugins of beets, we need to
have beets itself as a dependency. So in order to do that, we now pass
beets without plugins and tests to the nativeBuildInputs of the plugins
so that we can run them.
As soon as the plugins are built they become part of the final beets,
which also has tests enabled, so disabling the tests for beets
derivation that is used for external plugin tests is a non-issue here
because they're going to be executed anyway.
Enabling tests for the alternatives plugin is pretty straightforward,
but in order to run tests for the copyartifacts plugin, we need to bump
the source code to the latest Git master.
The reason for this is that the version that was in use until now
required to have the beets source directory alongside of the
copyartifacts source code, but we already have beets available as a
normal dependency.
Updating copyartifacts to latest master largely consists of unit test
changes and a few Python 3 compatibility changes. However, one change
has the biggest stat, which is
sbarakat/beets-copyartifacts@1a0c281da0be7251f414397960a83d60dc3a1520.
Fortunately, the last change is just moving the implementation to a
newer API from upstream beets and by the looks of the implementation it
seems to break support for moving files. However, reverting this commit
also reveals that moving files was already broken before, so it wouldn't
matter much whether we have this version bump or not.
Tested with the following command:
nix-build -E '(import ./. {}).beets.override {
enableAlternatives = true;
enableCopyArtifacts = true;
}'
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @domenkozar, @pjones, @Profpatsch, @michalrus
2017-09-02 02:03:03 +02:00
|
|
|
++ optional enableThumbnails pythonPackages.pyxdg
|
|
|
|
++ optional enableWeb pythonPackages.flask
|
|
|
|
++ optional enableAlternatives plugins.alternatives
|
2020-08-07 23:05:13 +02:00
|
|
|
++ optional enableCopyArtifacts plugins.copyartifacts
|
|
|
|
++ optional enableExtraFiles plugins.extrafiles
|
|
|
|
;
|
2014-12-30 22:53:00 +01:00
|
|
|
|
2019-02-20 20:07:21 +01:00
|
|
|
buildInputs = [
|
2015-06-01 05:51:04 +02:00
|
|
|
imagemagick
|
2017-02-19 23:35:24 +01:00
|
|
|
] ++ (with gst_all_1; [
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-ugly
|
|
|
|
]);
|
2014-12-30 03:23:37 +01:00
|
|
|
|
2019-02-20 20:07:21 +01:00
|
|
|
checkInputs = with pythonPackages; [
|
|
|
|
beautifulsoup4
|
|
|
|
mock
|
|
|
|
nose
|
|
|
|
rarfile
|
|
|
|
responses
|
2020-03-24 23:21:57 +01:00
|
|
|
# Although considered as plugin dependencies, they are needed for the
|
|
|
|
# tests, for disabling them via an override makes the build fail. see:
|
|
|
|
# https://github.com/beetbox/beets/blob/v1.4.9/setup.py
|
|
|
|
pylast
|
|
|
|
mpd2
|
|
|
|
discogs_client
|
|
|
|
pyxdg
|
2019-02-20 20:07:21 +01:00
|
|
|
];
|
|
|
|
|
2014-12-30 23:06:28 +01:00
|
|
|
patches = [
|
2021-01-03 00:47:09 +01:00
|
|
|
# Bash completion fix for Nix
|
|
|
|
./bash-completion-always-print.patch
|
|
|
|
# From some reason upstream assumes the program 'keyfinder-cli' is located
|
|
|
|
# in the path as `KeyFinder`
|
2016-09-10 01:44:10 +02:00
|
|
|
./keyfinder-default-bin.patch
|
2021-01-03 00:47:09 +01:00
|
|
|
]
|
|
|
|
# We need to force ffmpeg as the default, since we do not package
|
|
|
|
# bs1770gain, and set the absolute path there, to avoid impurities.
|
|
|
|
++ lib.optional enableReplaygain (substituteAll {
|
|
|
|
src = ./replaygain-default-ffmpeg.patch;
|
|
|
|
ffmpeg = getBin ffmpeg;
|
2020-06-20 22:45:32 +02:00
|
|
|
})
|
2021-01-03 00:47:09 +01:00
|
|
|
# Put absolute Nix paths in place
|
|
|
|
++ lib.optional enableConvert (substituteAll {
|
|
|
|
src = ./convert-plugin-ffmpeg-path.patch;
|
|
|
|
ffmpeg = getBin ffmpeg;
|
|
|
|
})
|
|
|
|
++ lib.optional enableBadfiles (substituteAll {
|
|
|
|
src = ./badfiles-plugin-nix-paths.patch;
|
|
|
|
inherit mp3val flac;
|
|
|
|
})
|
|
|
|
;
|
2020-08-05 02:20:23 +02:00
|
|
|
|
2021-01-03 00:47:09 +01:00
|
|
|
# Disable failing tests
|
2014-12-30 22:53:00 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '/assertIn.*item.*path/d' test/test_info.py
|
2016-02-10 02:41:15 +01:00
|
|
|
echo echo completion tests passed > test/rsrc/test_completion.sh
|
2014-12-30 22:53:00 +01:00
|
|
|
|
2021-01-03 00:47:09 +01:00
|
|
|
sed -i -e 's/len(mf.images)/0/' test/test_zero.py
|
2014-12-30 22:53:00 +01:00
|
|
|
'';
|
|
|
|
|
2018-05-13 21:30:50 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/zsh/site-functions
|
|
|
|
cp extra/_beet $out/share/zsh/site-functions/
|
|
|
|
'';
|
|
|
|
|
2014-12-30 22:53:00 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2014-12-30 23:11:57 +01:00
|
|
|
preCheck = ''
|
|
|
|
find beetsplug -mindepth 1 \
|
|
|
|
\! -path 'beetsplug/__init__.py' -a \
|
|
|
|
\( -name '*.py' -o -path 'beetsplug/*/__init__.py' \) -print \
|
|
|
|
| sed -n -re 's|^beetsplug/([^/.]+).*|\1|p' \
|
|
|
|
| sort -u > plugins_available
|
|
|
|
|
2017-06-14 11:29:31 +02:00
|
|
|
${diffPlugins allPlugins "plugins_available"}
|
2014-12-30 23:11:57 +01:00
|
|
|
'';
|
|
|
|
|
2014-12-30 22:53:00 +01:00
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
2015-04-13 22:04:51 +02:00
|
|
|
LANG=en_US.UTF-8 \
|
2015-09-26 09:29:13 +02:00
|
|
|
LOCALE_ARCHIVE=${assert stdenv.isLinux; glibcLocales}/lib/locale/locale-archive \
|
2014-12-30 22:53:00 +01:00
|
|
|
BEETS_TEST_SHELL="${testShell}" \
|
|
|
|
BASH_COMPLETION_SCRIPT="${completion}" \
|
2019-02-20 20:07:21 +01:00
|
|
|
HOME="$(mktemp -d)" nosetests -v
|
2014-12-30 22:53:00 +01:00
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
2014-12-30 03:23:37 +01:00
|
|
|
|
2014-12-30 23:13:56 +01:00
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
tmphome="$(mktemp -d)"
|
|
|
|
|
|
|
|
EDITOR="${writeScript "beetconfig.sh" ''
|
2019-02-26 12:45:54 +01:00
|
|
|
#!${runtimeShell}
|
2014-12-30 23:13:56 +01:00
|
|
|
cat > "$1" <<CFG
|
2015-01-22 10:33:48 +01:00
|
|
|
plugins: ${concatStringsSep " " allEnabledPlugins}
|
2014-12-30 23:13:56 +01:00
|
|
|
CFG
|
|
|
|
''}" HOME="$tmphome" "$out/bin/beet" config -e
|
|
|
|
EDITOR=true HOME="$tmphome" "$out/bin/beet" config -e
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2014-12-30 03:23:37 +01:00
|
|
|
|
2017-02-19 23:35:24 +01:00
|
|
|
makeWrapperArgs = [ "--set GI_TYPELIB_PATH \"$GI_TYPELIB_PATH\"" "--set GST_PLUGIN_SYSTEM_PATH_1_0 \"$GST_PLUGIN_SYSTEM_PATH_1_0\"" ];
|
|
|
|
|
2019-12-07 07:08:54 +01:00
|
|
|
passthru = {
|
|
|
|
externalPlugins = plugins;
|
2021-02-01 03:27:37 +01:00
|
|
|
updateScript = unstableGitUpdater { url = "https://github.com/beetbox/beets"; };
|
2019-12-07 07:08:54 +01:00
|
|
|
};
|
|
|
|
|
2014-12-30 03:23:37 +01:00
|
|
|
meta = {
|
|
|
|
description = "Music tagger and library organizer";
|
2020-03-25 14:27:55 +01:00
|
|
|
homepage = "http://beets.io";
|
2015-06-01 05:51:04 +02:00
|
|
|
license = licenses.mit;
|
2021-01-03 10:58:39 +01:00
|
|
|
maintainers = with maintainers; [ aszlig domenkozar doronbehar lovesegfault pjones ];
|
2015-09-26 09:29:13 +02:00
|
|
|
platforms = platforms.linux;
|
2014-12-30 03:23:37 +01:00
|
|
|
};
|
|
|
|
}
|