summary refs log tree commit diff
path: root/pkgs/tools/security/nitrokey-app
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/security/nitrokey-app')
-rw-r--r--pkgs/tools/security/nitrokey-app/FixInstallDestination.patch35
-rw-r--r--pkgs/tools/security/nitrokey-app/HeaderPath.patch13
-rw-r--r--pkgs/tools/security/nitrokey-app/default.nix39
3 files changed, 87 insertions, 0 deletions
diff --git a/pkgs/tools/security/nitrokey-app/FixInstallDestination.patch b/pkgs/tools/security/nitrokey-app/FixInstallDestination.patch
new file mode 100644
index 00000000000..c9de63a320b
--- /dev/null
+++ b/pkgs/tools/security/nitrokey-app/FixInstallDestination.patch
@@ -0,0 +1,35 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 16393a8..3991d2a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -219,18 +219,18 @@ IF(NOT WIN32)
+   # Install Nitrokey udev rules
+   install(FILES
+     ${CMAKE_SOURCE_DIR}/data/40-nitrokey.rules
+-    DESTINATION /etc/udev/rules.d
++    DESTINATION etc/udev/rules.d
+   )
+ 
+   # Install autocompletion scripts
+   install(FILES
+     ${CMAKE_SOURCE_DIR}/data//bash-autocomplete/nitrokey-app
+-    DESTINATION /etc/bash_completion.d
++    DESTINATION etc/bash_completion.d
+   )
+ 
+   install(FILES
+     ${CMAKE_SOURCE_DIR}/po/de_DE/nitrokey-app.mo
+-    DESTINATION /usr/share/locale/de_DE/LC_MESSAGES
++    DESTINATION share/locale/de_DE/LC_MESSAGES
+   )
+ 
+   install(FILES
+@@ -238,7 +238,7 @@ IF(NOT WIN32)
+     ${CMAKE_SOURCE_DIR}/images/quit.png
+     ${CMAKE_SOURCE_DIR}/images/safe_zahlenkreis.png
+     ${CMAKE_SOURCE_DIR}/images/settings.png
+-    DESTINATION /usr/share/nitrokey
++    DESTINATION share/nitrokey
+   )
+ 
+ ENDIF () # NOT WIN32
diff --git a/pkgs/tools/security/nitrokey-app/HeaderPath.patch b/pkgs/tools/security/nitrokey-app/HeaderPath.patch
new file mode 100644
index 00000000000..695b7559116
--- /dev/null
+++ b/pkgs/tools/security/nitrokey-app/HeaderPath.patch
@@ -0,0 +1,13 @@
+diff --git a/src/utils/hid_libusb.c b/src/utils/hid_libusb.c
+index bd8c14e..537292d 100644
+--- a/src/utils/hid_libusb.c
++++ b/src/utils/hid_libusb.c
+@@ -44,7 +44,7 @@
+ #include <wchar.h>
+ 
+ /* GNU / LibUSB */
+-#include "libusb.h"
++#include "libusb-1.0/libusb.h"
+ #include "iconv.h"
+ 
+ #include "hidapi.h"
diff --git a/pkgs/tools/security/nitrokey-app/default.nix b/pkgs/tools/security/nitrokey-app/default.nix
new file mode 100644
index 00000000000..38e083ba131
--- /dev/null
+++ b/pkgs/tools/security/nitrokey-app/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, cmake, fetchFromGitHub, libappindicator-gtk2, libnotify, libusb1, pkgconfig
+, qt5 }:
+
+stdenv.mkDerivation rec {
+  name = "nitrokey-app";
+  version = "0.4";
+
+  src = fetchFromGitHub {
+    owner = "Nitrokey";
+    repo = "nitrokey-app";
+    rev = "v${version}";
+    sha256 = "0h131847pllsr7rk7nn8vlj74byb5f14cl9h3g3pmlq5zj8ylfkx";
+  };
+
+  buildInputs = [
+    cmake
+    libappindicator-gtk2
+    libnotify
+    libusb1
+    pkgconfig
+    qt5.qtbase
+  ];
+  patches = [
+     ./FixInstallDestination.patch
+     ./HeaderPath.patch
+  ];
+  meta = {
+    description      = "Provides extra functionality for the Nitrokey Pro and Storage";
+    longDescription  = ''
+       The nitrokey-app provides a QT system tray widget with wich you can
+       access the extra functionality of a Nitrokey Storage or Nitrokey Pro.
+       See https://www.nitrokey.com/ for more information.
+    '';
+    homepage         = https://github.com/Nitrokey/nitrokey-app;
+    repositories.git = https://github.com/Nitrokey/nitrokey-app.git;
+    license          = stdenv.lib.licenses.gpl3;
+    maintainer       = stdenv.lib.maintainers.kaiha;
+  };
+}