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