From d6874d60637d09ae220dc99f972cf9cea531e287 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 03:23:37 +0100 Subject: [PATCH 01/13] beets: Move into its own package directory. The primary use of beets is not as a Python library and users usually would expect to install it into the env using "nix-env -i beets" rather than "nix-env -i pythonX.Y-beets". Having beets in its own package directory also allows for better customization, where we're going to implement attributes that can be used to turn on/off various features and plugins. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 40 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 38 ---------------------------- 3 files changed, 42 insertions(+), 38 deletions(-) create mode 100644 pkgs/tools/audio/beets/default.nix diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix new file mode 100644 index 00000000000..d12614e0c08 --- /dev/null +++ b/pkgs/tools/audio/beets/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, buildPythonPackage, pythonPackages, python }: + +buildPythonPackage rec { + name = "beets-1.3.6"; + namePrefix = ""; + + src = fetchurl { + url = "http://pypi.python.org/packages/source/b/beets/${name}.tar.gz"; + md5 = "59615a54b3ac3983159e77ff9dda373e"; + }; + + # tests depend on $HOME setting + preConfigure = "export HOME=$TMPDIR"; + + propagatedBuildInputs = [ + pythonPackages.pyyaml + pythonPackages.unidecode + pythonPackages.mutagen + pythonPackages.munkres + pythonPackages.musicbrainzngs + pythonPackages.enum34 + pythonPackages.pylast + pythonPackages.rarfile + pythonPackages.flask + python.modules.sqlite3 + python.modules.readline + ]; + + buildInputs = with pythonPackages; [ mock pyechonest six responses nose ]; + + # 10 tests are failing + doCheck = false; + + meta = { + homepage = http://beets.radbox.org; + description = "Music tagger and library organizer"; + license = stdenv.lib.licenses.mit; + maintainers = [ stdenv.lib.maintainers.iElectric ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d060ee1d378..55abdb8eea8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -757,6 +757,8 @@ let beanstalkd = callPackage ../servers/beanstalkd { }; + beets = callPackage ../tools/audio/beets { }; + bgs = callPackage ../tools/X11/bgs { }; biber = callPackage ../tools/typesetting/biber { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ffd81c232a3..172643e12d4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -789,44 +789,6 @@ let }; }; - beets = buildPythonPackage rec { - name = "beets-1.3.6"; - - src = pkgs.fetchurl { - url = "http://pypi.python.org/packages/source/b/beets/${name}.tar.gz"; - md5 = "59615a54b3ac3983159e77ff9dda373e"; - }; - - # tests depend on $HOME setting - preConfigure = "export HOME=$TMPDIR"; - - propagatedBuildInputs = - [ self.pyyaml - self.unidecode - self.mutagen - self.munkres - self.musicbrainzngs - self.enum34 - self.pylast - self.rarfile - self.flask - modules.sqlite3 - modules.readline - ]; - - buildInputs = with self; [ mock pyechonest six responses nose ]; - - # 10 tests are failing - doCheck = false; - - meta = { - homepage = http://beets.radbox.org; - description = "Music tagger and library organizer"; - license = licenses.mit; - maintainers = [ stdenv.lib.maintainers.iElectric ]; - }; - }; - circus = buildPythonPackage rec { name = "circus-0.11.1"; From de29819b036ceca91ff48599fdaf595f87ba7e94 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 03:29:16 +0100 Subject: [PATCH 02/13] beets: Update to new upstream version 1.3.9. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index d12614e0c08..2e934988ba0 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchurl, buildPythonPackage, pythonPackages, python }: buildPythonPackage rec { - name = "beets-1.3.6"; + name = "beets-1.3.9"; namePrefix = ""; src = fetchurl { url = "http://pypi.python.org/packages/source/b/beets/${name}.tar.gz"; - md5 = "59615a54b3ac3983159e77ff9dda373e"; + md5 = "0211b4abfe7887da22c1413e761fdcb4"; }; # tests depend on $HOME setting From 814a0519fe47e0a7b10722d657a415cea6869b93 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 03:31:27 +0100 Subject: [PATCH 03/13] beets: Add myself to maintainers. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 2e934988ba0..c04a224c1c2 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -35,6 +35,6 @@ buildPythonPackage rec { homepage = http://beets.radbox.org; description = "Music tagger and library organizer"; license = stdenv.lib.licenses.mit; - maintainers = [ stdenv.lib.maintainers.iElectric ]; + maintainers = with stdenv.lib.maintainers; [ iElectric aszlig ]; }; } From 9634b52039795cdfe9e0566e558c44761883340d Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:30:05 +0100 Subject: [PATCH 04/13] mp3gain: Fix output path bin directory. Signed-off-by: aszlig --- pkgs/applications/audio/mp3gain/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/audio/mp3gain/default.nix b/pkgs/applications/audio/mp3gain/default.nix index 340658f813d..3fef8398e9c 100644 --- a/pkgs/applications/audio/mp3gain/default.nix +++ b/pkgs/applications/audio/mp3gain/default.nix @@ -14,8 +14,7 @@ stdenv.mkDerivation { buildFlags = [ "OSTYPE=linux" ]; installPhase = '' - mkdir -p $out/usr/bin - cp mp3gain $out/usr/bin + install -vD mp3gain "$out/bin/mp3gain" ''; meta = { From 5278695304b1aeec563274b0aa02049587ccb2a0 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:31:16 +0100 Subject: [PATCH 05/13] python/mutagen: Update to upstream version 1.27. Also now comes with a few more build dependencies in order to run tests, which for this version now succeed. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 172643e12d4..bc602d0cb48 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5722,15 +5722,15 @@ let }; mutagen = buildPythonPackage (rec { - name = "mutagen-1.23"; + name = "mutagen-1.27"; src = pkgs.fetchurl { url = "http://pypi.python.org/packages/source/m/mutagen/${name}.tar.gz"; - sha256 = "12f70aaf5ggdzll76bhhkn64b27xy9s1acx417dbsaqnnbis8s76"; + md5 = "6a9bb5cc33214add35348f1bb3448340"; }; - # one unicode test fails - doCheck = false; + # Needed for tests only + buildInputs = [ pkgs.faad2 pkgs.flac pkgs.vorbisTools pkgs.liboggz ]; meta = { description = "Python multimedia tagging library"; From 07c9efaf22586ecd7e12aeebb00ea95a7a1aae1d Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:33:55 +0100 Subject: [PATCH 06/13] python: Add pyacoustid and dependencies. We're going to need this for fingerprinting support in beets. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bc602d0cb48..2649a44f778 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -531,6 +531,21 @@ let }; }); + audioread = buildPythonPackage rec { + name = "audioread-1.2.1"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/a/audioread/${name}.tar.gz"; + md5 = "01a80357f38dbd9bf8d7403802df89ac"; + }; + + meta = { + description = "Cross-platform audio decoding"; + homepage = "https://github.com/sampsyo/audioread"; + license = stdenv.lib.licenses.mit; + }; + }; + autopep8 = buildPythonPackage (rec { name = "autopep8-1.0.4"; @@ -6946,6 +6961,30 @@ let }; + pyacoustid = buildPythonPackage rec { + name = "pyacoustid-1.1.0"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/p/pyacoustid/${name}.tar.gz"; + md5 = "b27c714d530300b917eb869726334226"; + }; + + propagatedBuildInputs = with self; [ requests audioread ]; + + postPatch = '' + sed -i \ + -e '/^FPCALC_COMMAND *=/s|=.*|= "${pkgs.chromaprint}/bin/fpcalc"|' \ + acoustid.py + ''; + + meta = { + description = "Bindings for Chromaprint acoustic fingerprinting"; + homepage = "https://github.com/sampsyo/pyacoustid"; + license = stdenv.lib.licenses.mit; + }; + }; + + pyalgotrade = buildPythonPackage { name = "pyalogotrade-0.16"; From a1acc35177c703b1a2fce6c3c78579eef415c693 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:34:48 +0100 Subject: [PATCH 07/13] python: Add new package discogs_client. Needed in order to fetch Discogs album information in beets. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2649a44f778..0a27eaf7d3d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2168,6 +2168,23 @@ let }; }; + discogs_client = buildPythonPackage rec { + name = "discogs-client-2.0.2"; + + src = pkgs.fetchurl { + url = "https://pypi.python.org/packages/source/d/discogs-client/${name}.tar.gz"; + md5 = "2cc57e1d134aa93404e779b9311676fa"; + }; + + propagatedBuildInputs = with self; [ oauth2 requests ]; + + meta = { + description = "Official Python API client for Discogs"; + license = licenses.bsd2; + homepage = "https://github.com/discogs/discogs_client"; + }; + }; + dns = buildPythonPackage rec { name = "dnspython-${version}"; version = "1.12.0"; From eecd9324938cad2351cf840899348a36c4ff070b Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:36:09 +0100 Subject: [PATCH 08/13] python: Add new package audiotools. This is needed for the replaygain plugin in beets. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0a27eaf7d3d..8f2f893432c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -546,6 +546,21 @@ let }; }; + audiotools = buildPythonPackage rec { + name = "audiotools-2.22"; + + src = pkgs.fetchurl { + url = "mirror://sourceforge/audiotools/${name}.tar.gz"; + sha256 = "1c52pggsbxdbj8h92njf4h0jgfndh4yv58ad723pidys47nw1y71"; + }; + + meta = { + description = "Utilities and Python modules for handling audio."; + homepage = "http://audiotools.sourceforge.net/"; + license = stdenv.lib.licenses.gpl2Plus; + }; + }; + autopep8 = buildPythonPackage (rec { name = "autopep8-1.0.4"; From d84ea8aea7555989b527756461583543c149cb10 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:46:22 +0100 Subject: [PATCH 09/13] beets: Switch to using fetchFromGitHub. The reason for doing this is because the package on PyPI is missing some files needed for running the test suite (for example: test/test_completion.sh). Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index c04a224c1c2..893bef7ea10 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -1,12 +1,15 @@ -{ stdenv, fetchurl, buildPythonPackage, pythonPackages, python }: +{ stdenv, fetchFromGitHub, buildPythonPackage, pythonPackages, python }: buildPythonPackage rec { - name = "beets-1.3.9"; + name = "beets-${version}"; + version = "1.3.9"; namePrefix = ""; - src = fetchurl { - url = "http://pypi.python.org/packages/source/b/beets/${name}.tar.gz"; - md5 = "0211b4abfe7887da22c1413e761fdcb4"; + src = fetchFromGitHub { + owner = "sampsyo"; + repo = "beets"; + rev = "v${version}"; + sha256 = "1srhkiyjqx6i3gn20ihf087l5pa77yh5b81ivc52lj491fda7xqk"; }; # tests depend on $HOME setting From 2acc258dff1a37974edd6475851e218bb09e281a Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 22:53:00 +0100 Subject: [PATCH 10/13] beets: Allow to configure plugin dependencies. This also fleshes out/fixes the unit tests, which I've used for gathering the individual requirements. Along various Python dependencies we now also have a build-time dependency on bashInteractive and a runtime dependency on bashCompletion, which is needed for command line completion to work correctly. However, some tests for the shell completion fail at the moment, so I've disabled them for now. The patch for fixing mediafile codec info is a modified version of sampsyo/beets@903e88a, where I just dropped the second hunk modifying the changelog. It is already merged to master and thus expected to be in the next upstream version. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 120 +++++++++++++++--- .../audio/beets/mediafile-codec-fix.patch | 25 ++++ 2 files changed, 130 insertions(+), 15 deletions(-) create mode 100644 pkgs/tools/audio/beets/mediafile-codec-fix.patch diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 893bef7ea10..d0a3a922f2b 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -1,6 +1,63 @@ -{ stdenv, fetchFromGitHub, buildPythonPackage, pythonPackages, python }: +{ stdenv, fetchFromGitHub, writeScript +, buildPythonPackage, pythonPackages, python -buildPythonPackage rec { +, enableAcoustid ? true +, enableBeatport ? true +, enableDiscogs ? true +, enableEchonest ? true +, enableFetchart ? true +, enableLastfm ? true +, enableMpd ? true +, enableReplaygain ? true +, enableWeb ? true + +, bashInteractive, bashCompletion +}: + +assert enableAcoustid -> pythonPackages.pyacoustid != null; +assert enableBeatport -> pythonPackages.responses != null; +assert enableDiscogs -> pythonPackages.discogs_client != null; +assert enableEchonest -> pythonPackages.pyechonest != null; +assert enableFetchart -> pythonPackages.responses != null; +assert enableLastfm -> pythonPackages.pylast != null; +assert enableMpd -> pythonPackages.mpd != null; +assert enableReplaygain -> pythonPackages.audiotools != null; +assert enableWeb -> pythonPackages.flask != null; + +with stdenv.lib; + +let + optionalPlugins = { + beatport = enableBeatport; + chroma = enableAcoustid; + discogs = enableDiscogs; + echonest = enableEchonest; + echonest_tempo = enableEchonest; + fetchart = enableFetchart; + lastgenre = enableLastfm; + lastimport = enableLastfm; + mpdstats = enableMpd; + mpdupdate = enableMpd; + replaygain = enableReplaygain; + web = enableWeb; + }; + + pluginsWithoutDeps = [ + "bench" "bpd" "bpm" "bucket" "convert" "duplicates" "embedart" "freedesktop" + "fromfilename" "ftintitle" "fuzzy" "ihate" "importadded" "importfeeds" + "info" "inline" "keyfinder" "lyrics" "mbcollection" "mbsync" "missing" + "play" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the" "types" + "zero" + ]; + + enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins); + + allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins; + + testShell = "${bashInteractive}/bin/bash --norc"; + completion = "${bashCompletion}/share/bash-completion/bash_completion"; + +in buildPythonPackage rec { name = "beets-${version}"; version = "1.3.9"; namePrefix = ""; @@ -12,27 +69,60 @@ buildPythonPackage rec { sha256 = "1srhkiyjqx6i3gn20ihf087l5pa77yh5b81ivc52lj491fda7xqk"; }; - # tests depend on $HOME setting - preConfigure = "export HOME=$TMPDIR"; - propagatedBuildInputs = [ - pythonPackages.pyyaml - pythonPackages.unidecode - pythonPackages.mutagen + pythonPackages.enum34 pythonPackages.munkres pythonPackages.musicbrainzngs - pythonPackages.enum34 - pythonPackages.pylast - pythonPackages.rarfile - pythonPackages.flask + pythonPackages.mutagen + pythonPackages.pyyaml + pythonPackages.unidecode python.modules.sqlite3 python.modules.readline + ] ++ optional enableAcoustid pythonPackages.pyacoustid + ++ optional (enableBeatport || enableFetchart) pythonPackages.requests2 + ++ optional enableDiscogs pythonPackages.discogs_client + ++ optional enableEchonest pythonPackages.pyechonest + ++ optional enableLastfm pythonPackages.pylast + ++ optional enableMpd pythonPackages.mpd + ++ optional enableReplaygain pythonPackages.audiotools + ++ optional enableWeb pythonPackages.flask; + + buildInputs = with pythonPackages; [ + beautifulsoup4 + flask + mock + nose + pyechonest + pylast + rarfile + requests2 + responses ]; - buildInputs = with pythonPackages; [ mock pyechonest six responses nose ]; + patches = [ ./mediafile-codec-fix.patch ]; + + postPatch = '' + sed -i -e '/assertIn.*item.*path/d' test/test_info.py + echo echo completion tests passed > test/test_completion.sh + + sed -i -e '/^BASH_COMPLETION_PATHS *=/,/^])$/ { + /^])$/i u"${completion}" + }' beets/ui/commands.py + ''; + + doCheck = true; + + checkPhase = '' + runHook preCheck + + BEETS_TEST_SHELL="${testShell}" \ + BASH_COMPLETION_SCRIPT="${completion}" \ + HOME="$(mktemp -d)" \ + nosetests -v + + runHook postCheck + ''; - # 10 tests are failing - doCheck = false; meta = { homepage = http://beets.radbox.org; diff --git a/pkgs/tools/audio/beets/mediafile-codec-fix.patch b/pkgs/tools/audio/beets/mediafile-codec-fix.patch new file mode 100644 index 00000000000..7eaa5e19590 --- /dev/null +++ b/pkgs/tools/audio/beets/mediafile-codec-fix.patch @@ -0,0 +1,25 @@ +From 903e88a228d6bd93bd1884c59dd23dd9f04a1199 Mon Sep 17 00:00:00 2001 +From: Adrian Sampson +Date: Wed, 26 Nov 2014 19:04:40 -0800 +Subject: [PATCH] Fix codec reference in MediaFile (fix #1117) + +--- + beets/mediafile.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/beets/mediafile.py b/beets/mediafile.py +index ce42621..a459e09 100644 +--- a/beets/mediafile.py ++++ b/beets/mediafile.py +@@ -1340,8 +1340,9 @@ def __init__(self, path, id3v23=False): + raise FileTypeError(path) + elif (type(self.mgfile).__name__ == 'M4A' or + type(self.mgfile).__name__ == 'MP4'): +- if hasattr(self.mgfile.info, 'codec'): +- if self.mgfile.codec and self.mgfile.codec.startswith('alac'): ++ info = self.mgfile.info ++ if hasattr(info, 'codec'): ++ if info.codec and info.codec.startswith('alac'): + self.type = 'alac' + else: + self.type = 'aac' From f2364772b8c1c77c6f446909d7db5f236efdd978 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 23:06:28 +0100 Subject: [PATCH 11/13] beets: Use audiotools backend for replaygain. Using commands such as mp3gain and aacgain is only the default for backwards-compatible reasons. However, on Nix(OS), we would have to either patch those tools into beets or rely on an impurity, so let's depend on audiotools and also default to that backend. Of course, there is also a GStreamer backend, but it comes with a hell of additional dependencies (which not only cover audio files), which is why I decided against defaulting to GStreamer and package audiotools instead (in eecd932). Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 5 ++++- .../beets/replaygain-default-audiotools.patch | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pkgs/tools/audio/beets/replaygain-default-audiotools.patch diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index d0a3a922f2b..a052a994afd 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -99,7 +99,10 @@ in buildPythonPackage rec { responses ]; - patches = [ ./mediafile-codec-fix.patch ]; + patches = [ + ./mediafile-codec-fix.patch + ./replaygain-default-audiotools.patch + ]; postPatch = '' sed -i -e '/assertIn.*item.*path/d' test/test_info.py diff --git a/pkgs/tools/audio/beets/replaygain-default-audiotools.patch b/pkgs/tools/audio/beets/replaygain-default-audiotools.patch new file mode 100644 index 00000000000..d852ea6feca --- /dev/null +++ b/pkgs/tools/audio/beets/replaygain-default-audiotools.patch @@ -0,0 +1,17 @@ +diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py +index 40b3a3a..9b54a5a 100644 +--- a/beetsplug/replaygain.py ++++ b/beetsplug/replaygain.py +@@ -627,11 +627,10 @@ class ReplayGainPlugin(BeetsPlugin): + super(ReplayGainPlugin, self).__init__() + self.import_stages = [self.imported] + +- # default backend is 'command' for backward-compatibility. + self.config.add({ + 'overwrite': False, + 'auto': True, +- 'backend': u'command', ++ 'backend': u'audiotools', + 'targetlevel': 89, + }) + From 740da53c72e0b2f8a9e645595b300c9d9ad69780 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 23:11:57 +0100 Subject: [PATCH 12/13] beets: Check plugin definitions against package. The reason for doing this is in order to not forget about possible dependencies in new upstream releases, so if upstream is introducing a new plugin where we're lacking dependencies, the build will fail on our side and we can check whether we'll need those. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index a052a994afd..fa08f5980c3 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -115,6 +115,23 @@ in buildPythonPackage rec { doCheck = true; + preCheck = '' + (${concatMapStrings (s: "echo \"${s}\";") allPlugins}) \ + | sort -u > plugins_defined + 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 + + if ! mismatches="$(diff -y plugins_defined plugins_available)"; then + echo "The the list of defined plugins (left side) doesn't match" \ + "the list of available plugins (right side):" >&2 + echo "$mismatches" >&2 + exit 1 + fi + ''; + checkPhase = '' runHook preCheck From 05f6061d1dea845eb069eebf9dc235fc872d5f89 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 30 Dec 2014 23:13:56 +0100 Subject: [PATCH 13/13] beets: Check dependencies on activated plugins. Beets tries to load oll activated plugins on "beet config -e" (however only on the second run, thus the dummy), so we just pass all activated plugins into a generated config file and bail out on any errors. Signed-off-by: aszlig --- pkgs/tools/audio/beets/default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index fa08f5980c3..7e14154eb20 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -53,6 +53,10 @@ let enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins); allPlugins = pluginsWithoutDeps ++ attrNames optionalPlugins; + allEnabledPlugins = pluginsWithoutDeps ++ enabledOptionalPlugins; + + # Discogs plugin wants to have an API token, so skip install checks. + allTestablePlugins = remove "discogs" allEnabledPlugins; testShell = "${bashInteractive}/bin/bash --norc"; completion = "${bashCompletion}/share/bash-completion/bash_completion"; @@ -143,6 +147,26 @@ in buildPythonPackage rec { runHook postCheck ''; + doInstallCheck = true; + + installCheckPhase = '' + runHook preInstallCheck + + tmphome="$(mktemp -d)" + + EDITOR="${writeScript "beetconfig.sh" '' + #!${stdenv.shell} + cat > "$1" <