about summary refs log tree commit diff
path: root/pkgs/by-name/xm/xmltoman/package.nix
blob: d62238c717804887baf5e1b3b18f4b633007404e (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
{ lib
, stdenvNoCC
, fetchFromGitHub
, perlPackages
, perl
, installShellFiles
}:

stdenvNoCC.mkDerivation rec {
  pname = "xmltoman";
  version = "0.6";

  src = fetchFromGitHub {
    owner = "atsb";
    repo = "xmltoman";
    rev = version;
    hash = "sha256-EmFdGIeBEcTY0Pqp7BJded9WB/DaXWcMNWh6aTsZlLg=";
  };

  nativeBuildInputs = [
    perl
    installShellFiles
  ];

  buildInputs = [
    perlPackages.XMLTokeParser
  ];

  dontBuild = true;

  # File installation and setup similar to Makefile commands below.
  installPhase = ''
    runHook preInstall

    mkdir -p $out
    perl xmltoman xml/xmltoman.1.xml > xmltoman.1
    perl xmltoman xml/xmlmantohtml.1.xml > xmlmantohtml.1
    install -d $out/bin $out/share/xmltoman
    install -m 0755 xmltoman xmlmantohtml $out/bin
    install -m 0644 xmltoman.dtd xmltoman.css xmltoman.xsl $out/share/xmltoman
    installManPage *.1

    runHook postInstall
  '';

  meta = with lib; {
    description = "Two very simple scripts for converting xml to groff or html";
    homepage = "https://github.com/atsb/xmltoman";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ tochiaha ];
    mainProgram = "xmltoman";
    platforms = platforms.all;
  };
}