whipper: replace morituri

morituri has been dead for a while now and uses gst-python which is
no longer supported wth Python 2. whipper is a maintained fork,
packaged, for example, in Arch.
This commit is contained in:
Jan Tojnar 2018-09-13 16:42:28 +02:00
parent 884c629832
commit a74b4cf6ac
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
6 changed files with 156 additions and 144 deletions

View file

@ -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;
};
}

View file

@ -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")

View file

@ -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;
};
}

View file

@ -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)

View file

@ -297,6 +297,7 @@ mapAliases ({
wineStaging = wine-staging; # added 2018-01-08
winusb = woeusb; # added 2017-12-22
wireguard = wireguard-tools; # added 2018-05-19
morituri = whipper; # added 2018-09-13
x11 = xlibsWrapper; # added 2015-09
xbmc = kodi; # added 2018-04-25
xbmcPlain = kodiPlain; # added 2018-04-25

View file

@ -3615,8 +3615,6 @@ with pkgs;
mmv = callPackage ../tools/misc/mmv { };
morituri = callPackage ../applications/audio/morituri { };
most = callPackage ../tools/misc/most { };
motion = callPackage ../applications/video/motion { };
@ -5834,6 +5832,8 @@ with pkgs;
welkin = callPackage ../tools/graphics/welkin {};
whipper = callPackage ../applications/audio/whipper { };
whois = callPackage ../tools/networking/whois { };
wireguard-tools = callPackage ../tools/networking/wireguard-tools { };