alfis: Add support for GUI dialogs

This commit is contained in:
gardspirito 2021-11-04 19:53:23 +03:00
parent bc9b956714
commit ad2f75b559
No known key found for this signature in database
GPG Key ID: 5BC37C66336029C5
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,5 @@
{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config
, withGui ? true, webkitgtk, Cocoa, WebKit
}:
{ stdenv, lib, fetchFromGitHub, rustPlatform, pkg-config, withGui ? true
, webkitgtk, Cocoa, WebKit, dialog, makeWrapper }:
rustPlatform.buildRustPackage rec {
pname = "alfis";
@ -27,10 +26,16 @@ rustPlatform.buildRustPackage rec {
"--skip=dns::client::tests::test_udp_client"
];
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = lib.optional (withGui && stdenv.isLinux) webkitgtk
++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ];
postInstall = lib.optionalString (withGui && stdenv.isLinux) ''
cp $out/bin/alfis{,_unwrapped}
makeWrapper $out/bin/alfis{_unwrapped,} \
--prefix PATH : ${lib.makeBinPath [ dialog ]}
'';
meta = with lib; {
description = "Alternative Free Identity System";
homepage = "https://alfis.name";

View File

@ -28669,6 +28669,7 @@ with pkgs;
alfis = callPackage ../applications/blockchains/alfis {
inherit (darwin.apple_sdk.frameworks) Cocoa WebKit;
dialog = gnome.zenity;
};
alfis-nogui = alfis.override {
withGui = false;