2017-08-25 23:35:18 +01:00
|
|
|
{
|
|
|
|
stdenv, fetchurl, lib,
|
2018-02-27 18:07:43 +00:00
|
|
|
libxslt, pandoc, asciidoctor, pkgconfig,
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib, libcap_ng, libqb, libseccomp, polkit, protobuf, qtbase, qttools, qtsvg,
|
2018-02-27 18:07:43 +00:00
|
|
|
audit,
|
2017-08-25 23:35:18 +01:00
|
|
|
libgcrypt ? null,
|
|
|
|
libsodium ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
assert libgcrypt != null -> libsodium == null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-07-13 02:52:16 +01:00
|
|
|
version = "0.7.4";
|
2017-08-25 23:35:18 +01:00
|
|
|
name = "usbguard-${version}";
|
|
|
|
|
2018-02-27 18:07:43 +00:00
|
|
|
repo = "https://github.com/USBGuard/usbguard";
|
2017-08-25 23:35:18 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${repo}/releases/download/${name}/${name}.tar.gz";
|
2018-07-13 02:52:16 +01:00
|
|
|
sha256 = "1qkskd6q5cwlh2cpcsbzmmmgk6w63z0825wlb2sjwqq3kfgwjb3k";
|
2017-08-25 23:35:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
libxslt
|
2018-02-27 18:07:43 +00:00
|
|
|
asciidoctor
|
2017-08-25 23:35:18 +01:00
|
|
|
pandoc # for rendering documentation
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib
|
2017-08-25 23:35:18 +01:00
|
|
|
libcap_ng
|
|
|
|
libqb
|
|
|
|
libseccomp
|
|
|
|
polkit
|
|
|
|
protobuf
|
2018-02-27 18:07:43 +00:00
|
|
|
audit
|
2017-08-25 23:35:18 +01:00
|
|
|
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
]
|
|
|
|
++ (lib.optional (libgcrypt != null) libgcrypt)
|
|
|
|
++ (lib.optional (libsodium != null) libsodium);
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-bundled-catch"
|
|
|
|
"--with-bundled-pegtl"
|
|
|
|
"--with-dbus"
|
|
|
|
"--with-gui-qt=qt5"
|
|
|
|
"--with-polkit"
|
|
|
|
]
|
|
|
|
++ (lib.optional (libgcrypt != null) "--with-crypto-library=gcrypt")
|
|
|
|
++ (lib.optional (libsodium != null) "--with-crypto-library=sodium");
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The USBGuard software framework helps to protect your computer against BadUSB.";
|
2018-02-27 18:07:43 +00:00
|
|
|
homepage = "https://usbguard.github.io/";
|
2017-08-25 23:35:18 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.tnias ];
|
|
|
|
};
|
|
|
|
}
|