diff options
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r-- | pkgs/applications/audio/morituri/default.nix | 55 | ||||
-rw-r--r-- | pkgs/applications/audio/morituri/paths.patch | 87 | ||||
-rw-r--r-- | pkgs/applications/audio/whipper/default.nix | 48 | ||||
-rw-r--r-- | pkgs/applications/audio/whipper/paths.patch | 105 |
4 files changed, 153 insertions, 142 deletions
diff --git a/pkgs/applications/audio/morituri/default.nix b/pkgs/applications/audio/morituri/default.nix deleted file mode 100644 index d4c67bb5622c..000000000000 --- a/pkgs/applications/audio/morituri/default.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ stdenv, fetchgit, pythonPackages, cdparanoia, cdrdao -, gst-python, gst-plugins-base, gst-plugins-good -, utillinux, makeWrapper, substituteAll, autoreconfHook }: - -let - inherit (pythonPackages) python; -in stdenv.mkDerivation rec { - name = "morituri-${version}"; - version = "0.2.3.20151109"; - namePrefix = ""; - - src = fetchgit { - url = "https://github.com/thomasvs/morituri.git"; - fetchSubmodules = true; - rev = "135b2f7bf27721177e3aeb1d26403f1b29116599"; - sha256 = "1sl5y5j3gdbynf2v0gf9dwd2hzawj8lm8ywadid7qm34yn8lx12k"; - }; - - pythonPath = with pythonPackages; [ - pygobject2 gst-python musicbrainzngs - pycdio pyxdg setuptools - CDDB - ]; - - nativeBuildInputs = [ autoreconfHook ]; - buildInputs = [ - python cdparanoia cdrdao utillinux makeWrapper - gst-plugins-base gst-plugins-good - ] ++ pythonPath; - - patches = [ - (substituteAll { - src = ./paths.patch; - inherit cdrdao cdparanoia python utillinux; - }) - ]; - - # This package contains no binaries to patch or strip. - dontPatchELF = true; - dontStrip = true; - - postInstall = '' - wrapProgram "$out/bin/rip" \ - --prefix PYTHONPATH : "$PYTHONPATH" \ - --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" - ''; - - meta = with stdenv.lib; { - homepage = http://thomas.apestaart.org/morituri/trac/; - description = "A CD ripper aiming for accuracy over speed"; - maintainers = with maintainers; [ rycee jgeerds ]; - license = licenses.gpl3Plus; - platforms = platforms.linux; - }; -} diff --git a/pkgs/applications/audio/morituri/paths.patch b/pkgs/applications/audio/morituri/paths.patch deleted file mode 100644 index b3372dae48bf..000000000000 --- a/pkgs/applications/audio/morituri/paths.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/doc/Makefile.am b/doc/Makefile.am -index c115c2c..78c883e 100644 ---- a/doc/Makefile.am -+++ b/doc/Makefile.am -@@ -24,7 +24,7 @@ morituri.ics: $(top_srcdir)/morituri.doap - man_MANS = rip.1 - - rip.1: $(top_srcdir)/morituri/extern/python-command/scripts/help2man $(top_srcdir)/morituri -- PYTHONPATH=$(top_srcdir) $(PYTHON) $(top_srcdir)/morituri/extern/python-command/scripts/help2man morituri.rip.main.Rip rip > rip.1 -+ PYTHONPATH=$(top_srcdir):$(PYTHONPATH) $(PYTHON) $(top_srcdir)/morituri/extern/python-command/scripts/help2man morituri.rip.main.Rip rip > rip.1 - - clean-local: - @rm -rf reference -diff --git a/morituri/common/program.py b/morituri/common/program.py -index d340fdd..15cb751 100644 ---- a/morituri/common/program.py -+++ b/morituri/common/program.py -@@ -92,13 +92,13 @@ class Program(log.Loggable): - """ - Load the given device. - """ -- os.system('eject -t %s' % device) -+ os.system('@utillinux@/bin/eject -t %s' % device) - - def ejectDevice(self, device): - """ - Eject the given device. - """ -- os.system('eject %s' % device) -+ os.system('@utillinux@/bin/eject %s' % device) - - def unmountDevice(self, device): - """ -@@ -112,7 +112,7 @@ class Program(log.Loggable): - proc = open('/proc/mounts').read() - if device in proc: - print 'Device %s is mounted, unmounting' % device -- os.system('umount %s' % device) -+ os.system('@utillinux@/bin/umount %s' % device) - - def getFastToc(self, runner, toc_pickle, device): - """ -Submodule morituri/extern/python-command contains modified content -diff --git a/morituri/program/cdparanoia.py b/morituri/program/cdparanoia.py -index 46176d5..fce14a5 100644 ---- a/morituri/program/cdparanoia.py -+++ b/morituri/program/cdparanoia.py -@@ -278,7 +278,7 @@ class ReadTrackTask(log.Loggable, task.Task): - stopTrack, stopOffset) - - bufsize = 1024 -- argv = ["cdparanoia", "--stderr-progress", -+ argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress", - "--sample-offset=%d" % self._offset, ] - if self._device: - argv.extend(["--force-cdrom-device", self._device, ]) -@@ -551,7 +551,7 @@ _VERSION_RE = re.compile( - - def getCdParanoiaVersion(): - getter = common.VersionGetter('cdparanoia', -- ["cdparanoia", "-V"], -+ ["@cdparanoia@/bin/cdparanoia", "-V"], - _VERSION_RE, - "%(version)s %(release)s") - -diff --git a/morituri/program/cdrdao.py b/morituri/program/cdrdao.py -index c6fba64..c4d0306 100644 ---- a/morituri/program/cdrdao.py -+++ b/morituri/program/cdrdao.py -@@ -257,7 +257,7 @@ class CDRDAOTask(ctask.PopenTask): - - def start(self, runner): - self.debug('Starting cdrdao with options %r', self.options) -- self.command = ['cdrdao', ] + self.options -+ self.command = ['@cdrdao@/bin/cdrdao', ] + self.options - - ctask.PopenTask.start(self, runner) - -@@ -515,7 +515,7 @@ _VERSION_RE = re.compile( - - def getCDRDAOVersion(): - getter = common.VersionGetter('cdrdao', -- ["cdrdao"], -+ ["@cdrdao@/bin/cdrdao"], - _VERSION_RE, - "%(version)s") - diff --git a/pkgs/applications/audio/whipper/default.nix b/pkgs/applications/audio/whipper/default.nix new file mode 100644 index 000000000000..162d5459d648 --- /dev/null +++ b/pkgs/applications/audio/whipper/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchFromGitHub, python2, cdparanoia, cdrdao, flac +, sox, accuraterip-checksum, utillinux, substituteAll }: + +python2.pkgs.buildPythonApplication rec { + name = "whipper-${version}"; + version = "0.7.0"; + + src = fetchFromGitHub { + owner = "JoeLametta"; + repo = "whipper"; + rev = "v${version}"; + sha256 = "04m8s0s9dcnly9l6id8vv99n9kbjrjid79bss52ay9yvwng0frmj"; + }; + + pythonPath = with python2.pkgs; [ + pygobject2 musicbrainzngs urllib3 chardet + pycdio setuptools mutagen + requests + ]; + + checkInputs = with python2.pkgs; [ + twisted + ]; + + patches = [ + (substituteAll { + src = ./paths.patch; + inherit cdrdao cdparanoia utillinux flac sox; + accurateripChecksum = accuraterip-checksum; + }) + ]; + + # some tests require internet access + # https://github.com/JoeLametta/whipper/issues/291 + doCheck = false; + + preCheck = '' + HOME=$TMPDIR + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/JoeLametta/whipper; + description = "A CD ripper aiming for accuracy over speed"; + maintainers = with maintainers; [ rycee jgeerds ]; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/audio/whipper/paths.patch b/pkgs/applications/audio/whipper/paths.patch new file mode 100644 index 000000000000..9fe9f7a57c51 --- /dev/null +++ b/pkgs/applications/audio/whipper/paths.patch @@ -0,0 +1,105 @@ +--- a/whipper/program/arc.py ++++ b/whipper/program/arc.py +@@ -3,8 +3,8 @@ + import logging + logger = logging.getLogger(__name__) + +-ARB = 'accuraterip-checksum' +-FLAC = 'flac' ++ARB = '@accurateripChecksum@/bin/accuraterip-checksum' ++FLAC = '@flac@/bin/flac' + + + def _execute(cmd, **redirects): +--- a/whipper/program/cdparanoia.py ++++ b/whipper/program/cdparanoia.py +@@ -280,10 +280,10 @@ + + bufsize = 1024 + if self._overread: +- argv = ["cd-paranoia", "--stderr-progress", ++ argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress", + "--sample-offset=%d" % self._offset, "--force-overread", ] + else: +- argv = ["cd-paranoia", "--stderr-progress", ++ argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress", + "--sample-offset=%d" % self._offset, ] + if self._device: + argv.extend(["--force-cdrom-device", self._device, ]) +@@ -560,7 +560,7 @@ + + def getCdParanoiaVersion(): + getter = common.VersionGetter('cd-paranoia', +- ["cd-paranoia", "-V"], ++ ["@cdparanoia@/bin/cdparanoia", "-V"], + _VERSION_RE, + "%(version)s %(release)s") + +@@ -585,7 +585,7 @@ + def __init__(self, device=None): + # cdparanoia -A *always* writes cdparanoia.log + self.cwd = tempfile.mkdtemp(suffix='.whipper.cache') +- self.command = ['cd-paranoia', '-A'] ++ self.command = ['@cdparanoia@/bin/cdparanoia', '-A'] + if device: + self.command += ['-d', device] + +--- a/whipper/program/cdrdao.py ++++ b/whipper/program/cdrdao.py +@@ -9,7 +9,7 @@ + import logging + logger = logging.getLogger(__name__) + +-CDRDAO = 'cdrdao' ++CDRDAO = '@cdrdao@/bin/cdrdao' + + + def read_toc(device, fast_toc=False): +--- a/whipper/program/sox.py ++++ b/whipper/program/sox.py +@@ -4,7 +4,7 @@ + import logging + logger = logging.getLogger(__name__) + +-SOX = 'sox' ++SOX = '@sox@/bin/sox' + + + def peak_level(track_path): +--- a/whipper/program/soxi.py ++++ b/whipper/program/soxi.py +@@ -6,7 +6,7 @@ + import logging + logger = logging.getLogger(__name__) + +-SOXI = 'soxi' ++SOXI = '@sox@/bin/soxi' + + + class AudioLengthTask(ctask.PopenTask): +--- a/whipper/program/utils.py ++++ b/whipper/program/utils.py +@@ -9,7 +9,7 @@ + Eject the given device. + """ + logger.debug("ejecting device %s", device) +- os.system('eject %s' % device) ++ os.system('@utillinux@/bin/eject %s' % device) + + + def load_device(device): +@@ -17,7 +17,7 @@ + Load the given device. + """ + logger.debug("loading (eject -t) device %s", device) +- os.system('eject -t %s' % device) ++ os.system('@utillinux@/bin/eject -t %s' % device) + + + def unmount_device(device): +@@ -32,4 +32,4 @@ + proc = open('/proc/mounts').read() + if device in proc: + print 'Device %s is mounted, unmounting' % device +- os.system('umount %s' % device) ++ os.system('@utillinux@/bin/umount %s' % device) |