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

stdenv.mkDerivation rec {
  version = "6.1.0";
  pname = "schemaspy";

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

  dontUnpack = true;

  buildInputs = [
    jre
  ];

  nativeBuildInputs = [
    makeWrapper
  ];

  wrappedPath = lib.makeBinPath [
    graphviz
  ];

  installPhase = ''
    install -D ${src} "$out/share/java/${pname}-${version}.jar"

    makeWrapper ${jre}/bin/java $out/bin/schemaspy \
      --add-flags "-jar $out/share/java/${pname}-${version}.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 ];
  };
}