summary refs log tree commit diff
path: root/pkgs/applications/audio/csound/csound-manual/default.nix
blob: 5cc8d71383b7e45f0664070221a12baa8d11d5c5 (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
{
  stdenv, fetchFromGitHub, docbook_xsl,
  docbook_xml_dtd_45, python, pygments,
  libxslt
}:

stdenv.mkDerivation {
  pname = "csound-manual";
  version = "unstable-2019-02-22";

  src = fetchFromGitHub {
    owner = "csound";
    repo = "manual";
    rev = "3b0bdc83f9245261b4b85a57c3ed636d5d924a4f";
    sha256 = "074byjhaxraapyg54dxgg7hi1d4978aa9c1rmyi50p970nsxnacn";
  };

  prePatch = ''
    substituteInPlace manual.xml \
      --replace "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \
                "${docbook_xml_dtd_45}/xml/dtd/docbook/docbookx.dtd"
  '';

  nativeBuildInputs = [ libxslt.bin ];

  buildInputs = [ docbook_xsl python pygments ];

  buildPhase = ''
    make XSL_BASE_PATH=${docbook_xsl}/share/xml/docbook-xsl html-dist
  '';

  installPhase = ''
    mkdir -p $out/share/doc/csound
    cp -r ./html $out/share/doc/csound
  '';

  meta = {
    description = "The Csound Canonical Reference Manual";
    homepage = "https://github.com/csound/manual";
    license = stdenv.lib.licenses.fdl12Plus;
    maintainers = [ stdenv.lib.maintainers.hlolli ];
    platforms = stdenv.lib.platforms.all;
  };
}