about summary refs log tree commit diff
path: root/pkgs/development/tools/database/schemaspy/default.nix
blob: a1d355259865e809ac90f71d8e6d662183a7eac5 (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
{ lib, stdenv, fetchurl, jre, makeWrapper, graphviz }:

stdenv.mkDerivation rec {
  version = "6.0.0-rc2";
  name = "schemaspy-${version}";

  src = fetchurl {
    url = "https://github.com/schemaspy/schemaspy/releases/download/v${version}/${name}.jar";
    sha256 = "0ph1l62hy163m2hgybhkccqbcj6brna1vdbr7536zc37lzjxq9rn";
  };

  unpackPhase = "true";

  buildInputs = [
    jre
    makeWrapper
  ];

  buildPhase = "true";

  wrappedPath = lib.makeBinPath [
    graphviz
  ];

  installPhase =
    ''
      mkdir -p "$out/share/java"
      cp ${src} "$out/share/java/${name}.jar"

      mkdir -p $out/bin
      makeWrapper ${jre}/bin/java $out/bin/schemaspy \
        --add-flags "-jar $out/share/java/${name}.jar" \
        --prefix PATH : "$wrappedPath"
    '';

  meta = with lib; {
    homepage = "http://schemaspy.org";
    description = "Document your database simply and easily";
    license = licenses.mit;
    maintainers = with maintainers; [ jraygauthier ];
  };
}