summary refs log tree commit diff
path: root/pkgs/tools/typesetting/docbookrx/default.nix
blob: 484e98fc88cb3cfcb68d0d7bd3689b9393dae4c5 (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
55
56
57
58
{ lib
, fetchFromGitHub
, stdenv
, ruby
, bundlerEnv
# , libxml2
}:

let
  env = bundlerEnv {
    name = "docbookrx-env";
    gemdir = ./.;

    inherit ruby;

    # buildInputs = [
    #   libxml2
    # ];

    gemfile = ./Gemfile;
    lockfile = ./Gemfile.lock;
    gemset = ./gemset.nix;
  };

in stdenv.mkDerivation {

  pname = "docbookrx";
  version = "unstable-2018-05-02";

  buildInputs = [ env.wrappedRuby ];

  src = fetchFromGitHub {
    owner = "asciidoctor";
    repo = "docbookrx";
    rev = "682d8c2f7a9e1e6f546c5f7d0067353621c68a7a";
    sha256 = "07jilh17gj8xx4ps4ln787izmhv8xwwwv6fkqqg3pwjni5qikx7w";
  };

  # TODO: I don't know ruby packaging but this does the trick for now
  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp -a bin/docbookrx $out/bin
    cp -a lib $out

    runHook postInstall
  '';

  meta = with lib; {
    description = "(An early version of) a DocBook to AsciiDoc converter written in Ruby.";
    homepage = https://asciidoctor.org/;
    license = licenses.mit;
    maintainers = with maintainers; [ ];
    platforms = platforms.unix;
  };

}