nixpkgs/pkgs/applications/misc/pgadmin/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

59 lines
1.6 KiB
Nix

{ lib, 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 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/
'';
}