summary refs log tree commit diff
path: root/pkgs/applications/audio/morituri/default.nix
blob: 6af08cf0221a90b5b6df1b2796ca4164e4b237c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ stdenv, fetchurl, python, pythonPackages, cdparanoia, cdrdao
, pygobject, gst_python, gst_plugins_base, gst_plugins_good
, setuptools, utillinux, makeWrapper }:

stdenv.mkDerivation rec {
  name = "morituri-${version}";
  version = "0.2.3";

  src = fetchurl {
    url = "http://thomas.apestaart.org/download/morituri/${name}.tar.bz2";
    sha256 = "1b30bs1y8azl04izsrl01gw9ys0lhzkn5afxi4p8qbiri2h4v210";
  };

  pythonPath = [
    pygobject gst_python pythonPackages.musicbrainzngs
    pythonPackages.pycdio pythonPackages.pyxdg setuptools
  ];

  buildInputs = [
    python cdparanoia cdrdao utillinux makeWrapper
    gst_plugins_base gst_plugins_good
  ] ++ pythonPath;

  patches = [ ./paths.patch ];

  postPatch =  ''
    substituteInPlace morituri/extern/python-command/scripts/help2man \
      --replace /usr/bin/python ${python}/bin/python

    substituteInPlace morituri/common/program.py \
      --replace umount ${utillinux}/bin/umount \
      --replace \'eject \'${utillinux}/bin/eject

    substituteInPlace morituri/program/cdparanoia.py \
      --replace '"cdparanoia"' '"${cdparanoia}/bin/cdparanoia"'

    substituteInPlace morituri/program/cdrdao.py \
      --replace "['cdrdao', ]" "['${cdrdao}/bin/cdrdao', ]" \
      --replace '"cdrdao"' '"${cdrdao}/bin/cdrdao"'
  '';

  # 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 = [ maintainers.rycee ];
    license = licenses.gpl3Plus;
  };
}