1{ stdenv, fetchFromGitHub, beets, pythonPackages, glibcLocales }:
2
3pythonPackages.buildPythonApplication rec {
4 name = "beets-copyartifacts";
5
6 src = fetchFromGitHub {
7 repo = "beets-copyartifacts";
8 owner = "sbarakat";
9 rev = "d0bb75c8fc8fe125e8191d73de7ade6212aec0fd";
10 sha256 = "19b4lqq1p45n348ssmql60jylw2fw7vfj9j22nly5qj5qx51j3g5";
11 };
12
13 postPatch = ''
14 sed -i -e '/install_requires/,/\]/{/beets/d}' setup.py
15 sed -i -e '/namespace_packages/d' setup.py
16 printf 'from pkgutil import extend_path\n__path__ = extend_path(__path__, __name__)\n' >beetsplug/__init__.py
17
18 # Skip test which is already failing upstream.
19 sed -i -e '1i import unittest' \
20 -e 's/\(^ *\)# failing/\1@unittest.skip/' \
21 tests/test_reimport.py
22 '';
23
24 nativeBuildInputs = [ beets pythonPackages.nose glibcLocales ];
25
26 checkPhase = "LANG=en_US.UTF-8 nosetests";
27
28 meta = {
29 description = "Beets plugin to move non-music files during the import process";
30 homepage = https://github.com/sbarakat/beets-copyartifacts;
31 license = stdenv.lib.licenses.mit;
32 };
33}