2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2022-11-21 17:40:18 +00:00
|
|
|
, fetchpatch
|
2021-12-06 16:07:01 +00:00
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
|
|
|
, webkitgtk
|
|
|
|
, zenity
|
|
|
|
, Cocoa
|
|
|
|
, Security
|
|
|
|
, WebKit
|
|
|
|
, withGui ? true
|
2021-07-14 22:03:04 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "alfis";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "0.8.3";
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Revertron";
|
|
|
|
repo = "Alfis";
|
|
|
|
rev = "v${version}";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-QOKFnre5MW9EvrKrKBHWpOxi2fBKTDMhzCDX3ISd2cQ=";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cargoPatches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "bump-rust-web-view.patch";
|
|
|
|
url = "https://github.com/Revertron/Alfis/commit/03b461a740ab6ccbacd576eafc7a3faf4a66648f.patch";
|
|
|
|
sha256 = "sha256-CSqSMdVD31w7QxxXWtjKmqlaEirmbs1EVuiefSf1NKY=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
cargoSha256 = "sha256-B4xI++U6RCljXCyaOmNj/SwA6I16zoiZsgk2VTiKfkg=";
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
checkFlags = [
|
|
|
|
# these want internet access, disable them
|
|
|
|
"--skip=dns::client::tests::test_tcp_client"
|
|
|
|
"--skip=dns::client::tests::test_udp_client"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper ];
|
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security
|
|
|
|
++ lib.optional (withGui && stdenv.isLinux) webkitgtk
|
2021-07-14 22:03:04 +00:00
|
|
|
++ lib.optionals (withGui && stdenv.isDarwin) [ Cocoa WebKit ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = [
|
|
|
|
"doh"
|
|
|
|
] ++ lib.optional withGui "webgui";
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (withGui && stdenv.isLinux) ''
|
|
|
|
wrapProgram $out/bin/alfis \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ zenity ]}
|
|
|
|
'';
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Alternative Free Identity System";
|
|
|
|
homepage = "https://alfis.name";
|
|
|
|
license = licenses.agpl3Only;
|
|
|
|
maintainers = with maintainers; [ misuzu ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|