Skip to content

Commit

Permalink
beets: Set Python version via top-level attribute
Browse files Browse the repository at this point in the history
This largely reverts commit 5993127.

The main reason is that it breaks the plugins, because the mentioned
commit didn't change the attributes for the plugins as well.

But instead of just fixing the attributes when we import the plugin
packages, let's just override pythonPackages in all-packages.nix.

Right now, Beets is in transition to Python 3, so we don't need to wait
that long until we can remove the dependency on Python 2:

https://github.com/beetbox/beets/releases/tag/v1.4.1

Once Python 3 support is no longer beta, we can just change this by
changing one line only instead of several.

Tested this by building beets with both external plugins.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @FRidh
  • Loading branch information
aszlig committed Dec 3, 2016
1 parent a76f524 commit 1f9cbcd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
54 changes: 27 additions & 27 deletions pkgs/tools/audio/beets/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, writeScript, glibcLocales
, python2Packages, imagemagick
, pythonPackages, imagemagick

, enableAcousticbrainz ? true
, enableAcoustid ? true
Expand All @@ -22,17 +22,17 @@
, bashInteractive, bash-completion
}:

assert enableAcoustid -> python2Packages.pyacoustid != null;
assert enableAcoustid -> pythonPackages.pyacoustid != null;
assert enableBadfiles -> flac != null && mp3val != null;
assert enableConvert -> ffmpeg != null;
assert enableDiscogs -> python2Packages.discogs_client != null;
assert enableFetchart -> python2Packages.responses != null;
assert enableDiscogs -> pythonPackages.discogs_client != null;
assert enableFetchart -> pythonPackages.responses != null;
assert enableKeyfinder -> keyfinder-cli != null;
assert enableLastfm -> python2Packages.pylast != null;
assert enableMpd -> python2Packages.mpd != null;
assert enableLastfm -> pythonPackages.pylast != null;
assert enableMpd -> pythonPackages.mpd != null;
assert enableReplaygain -> bs1770gain != null;
assert enableThumbnails -> python2Packages.pyxdg != null;
assert enableWeb -> python2Packages.flask != null;
assert enableThumbnails -> pythonPackages.pyxdg != null;
assert enableWeb -> pythonPackages.flask != null;

with stdenv.lib;

Expand Down Expand Up @@ -72,7 +72,7 @@ let
testShell = "${bashInteractive}/bin/bash --norc";
completion = "${bash-completion}/share/bash-completion/bash_completion";

in python2Packages.buildPythonApplication rec {
in pythonPackages.buildPythonApplication rec {
name = "beets-${version}";
version = "1.4.1";

Expand All @@ -84,34 +84,34 @@ in python2Packages.buildPythonApplication rec {
};

propagatedBuildInputs = [
python2Packages.enum34
python2Packages.jellyfish
python2Packages.munkres
python2Packages.musicbrainzngs
python2Packages.mutagen
python2Packages.pathlib
python2Packages.pyyaml
python2Packages.unidecode
] ++ optional enableAcoustid python2Packages.pyacoustid
pythonPackages.enum34
pythonPackages.jellyfish
pythonPackages.munkres
pythonPackages.musicbrainzngs
pythonPackages.mutagen
pythonPackages.pathlib
pythonPackages.pyyaml
pythonPackages.unidecode
] ++ optional enableAcoustid pythonPackages.pyacoustid
++ optional (enableFetchart
|| enableEmbyupdate
|| enableAcousticbrainz)
python2Packages.requests2
pythonPackages.requests2
++ optional enableConvert ffmpeg
++ optional enableDiscogs python2Packages.discogs_client
++ optional enableDiscogs pythonPackages.discogs_client
++ optional enableKeyfinder keyfinder-cli
++ optional enableLastfm python2Packages.pylast
++ optional enableMpd python2Packages.mpd
++ optional enableThumbnails python2Packages.pyxdg
++ optional enableWeb python2Packages.flask
++ optional enableLastfm pythonPackages.pylast
++ optional enableMpd pythonPackages.mpd
++ optional enableThumbnails pythonPackages.pyxdg
++ optional enableWeb pythonPackages.flask
++ optional enableAlternatives (import ./alternatives-plugin.nix {
inherit stdenv python2Packages fetchFromGitHub;
inherit stdenv pythonPackages fetchFromGitHub;
})
++ optional enableCopyArtifacts (import ./copyartifacts-plugin.nix {
inherit stdenv python2Packages fetchFromGitHub;
inherit stdenv pythonPackages fetchFromGitHub;
});

buildInputs = with python2Packages; [
buildInputs = with pythonPackages; [
beautifulsoup4
imagemagick
mock
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,9 @@ in

beanstalkd = callPackage ../servers/beanstalkd { };

beets = callPackage ../tools/audio/beets { };
beets = callPackage ../tools/audio/beets {
pythonPackages = python2Packages;
};

bgs = callPackage ../tools/X11/bgs { };

Expand Down

0 comments on commit 1f9cbcd

Please sign in to comment.