1{ stdenv, fetchurl, python, mutagen, wrapPython, opusTools, mpg123 }:
2
3let version = "0.12.2"; in
4stdenv.mkDerivation rec {
5 name = "dir2opus-${version}";
6
7 pythonPath = [ mutagen ];
8 buildInputs = [ wrapPython ];
9 propagatedBuildInputs = [ opusTools mpg123 ];
10
11 src = fetchurl {
12 url = "https://github.com/ehmry/dir2opus/archive/${version}.tar.gz";
13 name = "${name}.tar.gz";
14 sha256 = "0bl8fa9zhccihnj1v3lpz5jb737frf9za06xb7j5rsjws6xky80d";
15 };
16
17 postPatch = "sed -i -e 's|#!/usr/bin/python|#!${python}/bin/python|' dir2opus";
18
19 installPhase =
20 ''
21 mkdir -p $out/bin $out/share/man/man1
22 cp dir2opus $out/bin
23 cp dir2opus.1 $out/share/man/man1
24 '';
25
26 postFixup = "wrapPythonPrograms";
27
28 meta = with stdenv.lib; {
29 homepage = https://github.com/ehmry/dir2opus;
30 maintainers = [ maintainers.ehmry ];
31 license = licenses.gpl2;
32 platforms = platforms.unix;
33 };
34}