1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 makeWrapper,
6 libuchardet,
7 dos2unix,
8 file,
9}:
10
11stdenv.mkDerivation {
12 pname = "subedit";
13 version = "1.2.2";
14
15 src = fetchFromGitHub {
16 owner = "helixarch";
17 repo = "subedit";
18 rev = "74e11816d7b4813064a2434a5abc0f78f66c0e53";
19 sha256 = "sha256-3ywBBCWbwDqNNkxRupNJX6mYKxVFnoCFKav3Hc4E+8A=";
20 };
21
22 nativeBuildInputs = [ makeWrapper ];
23
24 buildInputs = [
25 libuchardet
26 dos2unix
27 file
28 ];
29
30 installPhase = ''
31 mkdir -p $out/bin
32 install -m555 subedit $out/bin/
33 '';
34
35 postFixup = ''
36 wrapProgram $out/bin/subedit --prefix PATH : "${
37 lib.makeBinPath [
38 libuchardet
39 dos2unix
40 file
41 ]
42 }"
43 '';
44
45 meta = with lib; {
46 homepage = "https://github.com/helixarch/subedit";
47 description = "Command-line subtitle editor written in BASH";
48 mainProgram = "subedit";
49 license = licenses.gpl2Plus;
50 maintainers = with maintainers; [ ppom ];
51 };
52}