2021-11-13 12:59:21 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, webkitgtk
|
|
|
|
, zenity
|
|
|
|
, Cocoa
|
|
|
|
, Security
|
|
|
|
, WebKit
|
|
|
|
, withGui ? true
|
|
|
|
}:
|
2021-07-07 17:35:01 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "alfis";
|
2022-03-12 00:56:14 +00:00
|
|
|
version = "0.6.11";
|
2021-07-07 17:35:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Revertron";
|
|
|
|
repo = "Alfis";
|
|
|
|
rev = "v${version}";
|
2022-03-12 00:56:14 +00:00
|
|
|
sha256 = "sha256-vm/JBJh58UaSem18RpJuPUzM2GCy4RfCb6Hr1B7KWQA=";
|
2021-07-07 17:35:01 +00:00
|
|
|
};
|
|
|
|
|
2022-03-12 00:56:14 +00:00
|
|
|
cargoSha256 = "sha256-8ijGO8up0qVQ/kVX5/DveKyovYLh7jm+d7vooS1waAA=";
|
2021-07-07 17:35:01 +00:00
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# these want internet access, disable them
|
|
|
|
"--skip=dns::client::tests::test_tcp_client"
|
|
|
|
"--skip=dns::client::tests::test_udp_client"
|
|
|
|
];
|
|
|
|
|
2021-11-04 16:53:23 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
2021-11-13 12:59:21 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security
|
|
|
|
++ lib.optional (withGui && stdenv.isLinux) webkitgtk
|
2021-07-07 17:35:01 +00:00
|
|
|
++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ];
|
|
|
|
|
2021-11-16 00:10:25 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
2021-11-13 12:59:21 +00:00
|
|
|
buildFeatures = [
|
|
|
|
"doh"
|
|
|
|
] ++ lib.optional withGui "webgui";
|
2021-11-16 00:10:25 +00:00
|
|
|
|
2021-11-04 16:53:23 +00:00
|
|
|
postInstall = lib.optionalString (withGui && stdenv.isLinux) ''
|
2021-11-08 14:25:59 +00:00
|
|
|
wrapProgram $out/bin/alfis \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ zenity ]}
|
2021-11-04 16:53:23 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-07 17:35:01 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Alternative Free Identity System";
|
|
|
|
homepage = "https://alfis.name";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ misuzu ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|