pgmodeler: add darwin build (#301513)

* pgmodeler: add darwin build

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>

* pgmodeler: add missing library

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>

* pgmodeler: fix macOS Application generation

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>

---------

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>

authored by Florian Weijia Wang and committed by GitHub d50ce37b c8beb5cc

+23 -3
+23 -3
pkgs/applications/misc/pgmodeler/default.nix
··· 7 7 , qtwayland 8 8 , qtsvg 9 9 , postgresql 10 + , cups 11 + , libxml2 10 12 }: 11 13 12 14 stdenv.mkDerivation rec { ··· 21 23 }; 22 24 23 25 nativeBuildInputs = [ pkg-config qmake wrapQtAppsHook ]; 24 - qmakeFlags = [ "pgmodeler.pro" "CONFIG+=release" ]; 26 + qmakeFlags = [ "pgmodeler.pro" "CONFIG+=release" ] ++ lib.optionals stdenv.isDarwin [ 27 + "PGSQL_INC=${postgresql}/include" 28 + "PGSQL_LIB=${postgresql.lib}/lib/libpq.dylib" 29 + "XML_INC=${libxml2.dev}/include/libxml2" 30 + "XML_LIB=${libxml2.out}/lib/libxml2.dylib" 31 + "PREFIX=${placeholder "out"}/Applications/pgModeler.app/Contents" 32 + ]; 25 33 26 34 # todo: libpq would suffice here. Unfortunately this won't work, if one uses only postgresql.lib here. 27 - buildInputs = [ postgresql qtsvg qtwayland ]; 35 + buildInputs = [ postgresql qtsvg ] 36 + ++ lib.optionals stdenv.isLinux [ qtwayland ] 37 + ++ lib.optionals stdenv.isDarwin [ cups libxml2 ]; 38 + 39 + postInstall = lib.optionalString stdenv.isDarwin '' 40 + mkdir -p $out/bin 41 + for item in pgmodeler pgmodeler-{cli,se,ch} 42 + do 43 + ln -s $out/Applications/pgModeler.app/Contents/MacOS/$item $out/bin 44 + done 45 + ''; 46 + 47 + dontWrapQtApps = stdenv.isDarwin; 28 48 29 49 meta = with lib; { 30 50 description = "A database modeling tool for PostgreSQL"; 31 51 homepage = "https://pgmodeler.io/"; 32 52 license = licenses.gpl3; 33 53 maintainers = [ maintainers.esclear ]; 34 - platforms = platforms.linux; 54 + platforms = platforms.unix; 35 55 }; 36 56 }