2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2023-02-01 12:53:11 +00:00
|
|
|
, stdenv
|
2021-01-05 08:02:59 +00:00
|
|
|
, fetchFromGitHub
|
2023-02-01 12:53:11 +00:00
|
|
|
, wrapQtAppsHook
|
2021-01-05 08:02:59 +00:00
|
|
|
, pkg-config
|
|
|
|
, qmake
|
2023-02-01 12:53:11 +00:00
|
|
|
, qtwayland
|
2021-01-05 08:02:59 +00:00
|
|
|
, qtsvg
|
|
|
|
, postgresql
|
2024-04-10 13:20:23 +00:00
|
|
|
, cups
|
|
|
|
, libxml2
|
2021-01-05 08:02:59 +00:00
|
|
|
}:
|
2019-10-01 21:46:38 +00:00
|
|
|
|
2023-02-01 12:53:11 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-10-01 21:46:38 +00:00
|
|
|
pname = "pgmodeler";
|
2024-04-09 03:13:39 +00:00
|
|
|
version = "1.1.2";
|
2019-10-01 21:46:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pgmodeler";
|
|
|
|
repo = "pgmodeler";
|
|
|
|
rev = "v${version}";
|
2024-04-09 03:13:39 +00:00
|
|
|
sha256 = "sha256-urKAsuYmK8dsXhP+I7p27PXXYRapPtkI8FqARfLwnEw=";
|
2019-10-01 21:46:38 +00:00
|
|
|
};
|
|
|
|
|
2023-02-01 12:53:11 +00:00
|
|
|
nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ];
|
2024-04-10 13:20:23 +00:00
|
|
|
qmakeFlags = [ "pgmodeler.pro" "CONFIG+=release" ] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"PGSQL_INC=${postgresql}/include"
|
|
|
|
"PGSQL_LIB=${postgresql.lib}/lib/libpq.dylib"
|
|
|
|
"XML_INC=${libxml2.dev}/include/libxml2"
|
|
|
|
"XML_LIB=${libxml2.out}/lib/libxml2.dylib"
|
|
|
|
"PREFIX=${placeholder "out"}/Applications/pgModeler.app/Contents"
|
|
|
|
];
|
2019-10-01 21:46:38 +00:00
|
|
|
|
|
|
|
# todo: libpq would suffice here. Unfortunately this won't work, if one uses only postgresql.lib here.
|
2024-04-10 13:20:23 +00:00
|
|
|
buildInputs = [ postgresql qtsvg ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ qtwayland ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ cups libxml2 ];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
for item in pgmodeler pgmodeler-{cli,se,ch}
|
|
|
|
do
|
|
|
|
ln -s $out/Applications/pgModeler.app/Contents/MacOS/$item $out/bin
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontWrapQtApps = stdenv.isDarwin;
|
2019-10-01 21:46:38 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-10-01 21:46:38 +00:00
|
|
|
description = "A database modeling tool for PostgreSQL";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://pgmodeler.io/";
|
2019-10-01 21:46:38 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = [ maintainers.esclear ];
|
2024-04-10 13:20:23 +00:00
|
|
|
platforms = platforms.unix;
|
2019-10-01 21:46:38 +00:00
|
|
|
};
|
2020-04-01 01:11:51 +00:00
|
|
|
}
|