git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #5443 from rycee/morituri-cleanup

Cleanup of the 'morituri' expression.

commit415df72d0d8dd8a96d22f5619b1d37951786f144 authorDomen Kožar <domen@dev.si> dateTue 23 Dec 2014, 16:16 (12 years ago) parent4a637879715af3
2 files changed+89−20
pkgs/applications/audio/morituri/default.nix+8−18 pkgs/applications/audio/morituri/paths.patch+81−2
pkgs/applications/audio/morituri/default.nix+8−18
@@ -1,10 +1,11 @@
11{ stdenv, fetchurl, python, pythonPackages, cdparanoia, cdrdao
22, pygobject, gst_python, gst_plugins_base, gst_plugins_good
3−, setuptools, utillinux, makeWrapper }:
3+, setuptools, utillinux, makeWrapper, substituteAll }:
44
55stdenv.mkDerivation rec {
66 name = "morituri-${version}";
77 version = "0.2.3";
8+ namePrefix = "";
89
910 src = fetchurl {
1011 url = "http://thomas.apestaart.org/download/morituri/${name}.tar.bz2";
@@ -21,23 +22,12 @@ stdenv.mkDerivation rec {
2122 gst_plugins_base gst_plugins_good
2223 ] ++ pythonPath;
2324
24− patches = [ ./paths.patch ];
25−
26− postPatch = ''
27− substituteInPlace morituri/extern/python-command/scripts/help2man \
28− --replace /usr/bin/python ${python}/bin/python
29−
30− substituteInPlace morituri/common/program.py \
31− --replace umount ${utillinux}/bin/umount \
32− --replace \'eject \'${utillinux}/bin/eject
33−
34− substituteInPlace morituri/program/cdparanoia.py \
35− --replace '"cdparanoia"' '"${cdparanoia}/bin/cdparanoia"'
36−
37− substituteInPlace morituri/program/cdrdao.py \
38− --replace "['cdrdao', ]" "['${cdrdao}/bin/cdrdao', ]" \
39− --replace '"cdrdao"' '"${cdrdao}/bin/cdrdao"'
40− '';
25+ patches = [
26+ (substituteAll {
27+ src = ./paths.patch;
28+ inherit cdrdao cdparanoia python utillinux;
29+ })
30+ ];
4131
4232 # This package contains no binaries to patch or strip.
4333 dontPatchELF = true;
pkgs/applications/audio/morituri/paths.patch+81−2
@@ -1,6 +1,6 @@
11diff -Nurp morituri-0.2.3-orig/doc/Makefile.in morituri-0.2.3/doc/Makefile.in
2−--- morituri-0.2.3-orig/doc/Makefile.in 2014-11-01 00:13:01.231364181 +0100
3−+++ morituri-0.2.3/doc/Makefile.in 2014-11-01 00:13:56.691812229 +0100
2+--- morituri-0.2.3-orig/doc/Makefile.in 2014-12-23 12:44:46.222410092 +0100
3++++ morituri-0.2.3/doc/Makefile.in 2014-12-23 12:46:49.619756940 +0100
44@@ -486,7 +486,7 @@ morituri.ics: $(top_srcdir)/morituri.doa
55 -moap doap -f $(top_srcdir)/morituri.doap ical > morituri.ics
66
@@ -10,3 +10,82 @@ diff -Nurp morituri-0.2.3-orig/doc/Makefile.in morituri-0.2.3/doc/Makefile.in
1010
1111 clean-local:
1212 @rm -rf reference
13+diff -Nurp morituri-0.2.3-orig/morituri/common/program.py morituri-0.2.3/morituri/common/program.py
14+--- morituri-0.2.3-orig/morituri/common/program.py 2014-12-23 12:44:46.218410048 +0100
15++++ morituri-0.2.3/morituri/common/program.py 2014-12-23 12:46:49.647757245 +0100
16+@@ -92,13 +92,13 @@ class Program(log.Loggable):
17+ """
18+ Load the given device.
19+ """
20+- os.system('eject -t %s' % device)
21++ os.system('@utillinux@/bin/eject -t %s' % device)
22+
23+ def ejectDevice(self, device):
24+ """
25+ Eject the given device.
26+ """
27+- os.system('eject %s' % device)
28++ os.system('@utillinux@/bin/eject %s' % device)
29+
30+ def unmountDevice(self, device):
31+ """
32+@@ -112,7 +112,7 @@ class Program(log.Loggable):
33+ proc = open('/proc/mounts').read()
34+ if device in proc:
35+ print 'Device %s is mounted, unmounting' % device
36+- os.system('umount %s' % device)
37++ os.system('@utillinux@/bin/umount %s' % device)
38+
39+ def getFastToc(self, runner, toc_pickle, device):
40+ """
41+diff -Nurp morituri-0.2.3-orig/morituri/extern/python-command/scripts/help2man morituri-0.2.3/morituri/extern/python-command/scripts/help2man
42+--- morituri-0.2.3-orig/morituri/extern/python-command/scripts/help2man 2014-12-23 12:44:46.206409916 +0100
43++++ morituri-0.2.3/morituri/extern/python-command/scripts/help2man 2014-12-23 12:46:49.631757074 +0100
44+@@ -1,4 +1,4 @@
45+-#!/usr/bin/python
46++#!@python@/bin/python
47+
48+ # -*- Mode: Python -*-
49+ # vi:si:et:sw=4:sts=4:ts=4
50+diff -Nurp morituri-0.2.3-orig/morituri/program/cdparanoia.py morituri-0.2.3/morituri/program/cdparanoia.py
51+--- morituri-0.2.3-orig/morituri/program/cdparanoia.py 2014-12-23 12:44:46.202409873 +0100
52++++ morituri-0.2.3/morituri/program/cdparanoia.py 2014-12-23 12:46:49.659757376 +0100
53+@@ -278,7 +278,7 @@ class ReadTrackTask(log.Loggable, task.T
54+ stopTrack, stopOffset)
55+
56+ bufsize = 1024
57+- argv = ["cdparanoia", "--stderr-progress",
58++ argv = ["@cdparanoia@/bin/cdparanoia", "--stderr-progress",
59+ "--sample-offset=%d" % self._offset, ]
60+ if self._device:
61+ argv.extend(["--force-cdrom-device", self._device, ])
62+@@ -551,7 +551,7 @@ _VERSION_RE = re.compile(
63+
64+ def getCdParanoiaVersion():
65+ getter = common.VersionGetter('cdparanoia',
66+- ["cdparanoia", "-V"],
67++ ["@cdparanoia@/bin/cdparanoia", "-V"],
68+ _VERSION_RE,
69+ "%(version)s %(release)s")
70+
71+diff -Nurp morituri-0.2.3-orig/morituri/program/cdrdao.py morituri-0.2.3/morituri/program/cdrdao.py
72+--- morituri-0.2.3-orig/morituri/program/cdrdao.py 2014-12-23 12:44:46.202409873 +0100
73++++ morituri-0.2.3/morituri/program/cdrdao.py 2014-12-23 12:46:49.667757463 +0100
74+@@ -257,7 +257,7 @@ class CDRDAOTask(ctask.PopenTask):
75+
76+ def start(self, runner):
77+ self.debug('Starting cdrdao with options %r', self.options)
78+- self.command = ['cdrdao', ] + self.options
79++ self.command = ['@cdrdao@/bin/cdrdao', ] + self.options
80+
81+ ctask.PopenTask.start(self, runner)
82+
83+@@ -515,7 +515,7 @@ _VERSION_RE = re.compile(
84+
85+ def getCDRDAOVersion():
86+ getter = common.VersionGetter('cdrdao',
87+- ["cdrdao"],
88++ ["@cdrdao@/bin/cdrdao"],
89+ _VERSION_RE,
90+ "%(version)s")
91+