aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/applications/misc/pgadmin/default.nix
blob: b0aabead24575dbc026e731bb4fd77839e19eb5a (plain)
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
{ stdenv, fetchurl, fetchpatch, postgresql, wxGTK, libxml2, libxslt, openssl, zlib, makeDesktopItem }:

stdenv.mkDerivation rec {
  pname = "pgadmin3";
  version = "1.22.2";

  src = fetchurl {
    url = "https://ftp.postgresql.org/pub/pgadmin/pgadmin3/v${version}/src/pgadmin3-${version}.tar.gz";
    sha256 = "1b24b356h8z188nci30xrb57l7kxjqjnh6dq9ws638phsgiv0s4v";
  };

  enableParallelBuilding = true;

  buildInputs = [ postgresql wxGTK openssl zlib ];

  patches = [
    (fetchpatch {
      sha256 = "09hp7s3zjz80rpx2j3xyznwswwfxzi70z7c05dzrdk74mqjjpkfk";
      name = "843344.patch";
      url = "https://sources.debian.net/data/main/p/pgadmin3/1.22.2-1/debian/patches/843344";
    })
  ];

  preConfigure = ''
    substituteInPlace pgadmin/ver_svn.sh --replace "bin/bash" "$shell"
  '';

  configureFlags = [
    "--with-pgsql=${postgresql}"
    "--with-libxml2=${libxml2.dev}"
    "--with-libxslt=${libxslt.dev}"
  ];

  meta = with stdenv.lib; {
    description = "PostgreSQL administration GUI tool";
    homepage = "https://www.pgadmin.org";
    license = licenses.gpl2;
    maintainers = with maintainers; [ domenkozar wmertens ];
    platforms = platforms.unix;
  };

  postFixup = let
    desktopItem = makeDesktopItem {
      name = "pgAdmin";
      desktopName = "pgAdmin III";
      genericName = "SQL Administration";
      exec = "pgadmin3";
      icon = "pgAdmin3";
      type = "Application";
      categories = "Development;";
      mimeType = "text/html";
    };
  in ''
    mkdir -p $out/share/pixmaps;
    cp pgadmin/include/images/pgAdmin3.png $out/share/pixmaps/;
    cp -rv ${desktopItem}/share/applications $out/share/
  '';
}