summary refs log tree commit diff
path: root/pkgs/applications/backup/vorta
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2021-06-24 02:26:45 +0300
committerArtturin <Artturin@artturin.com>2021-06-24 20:03:21 +0300
commiteaf590d941ddb5aa3538774ec428ed428ddebde0 (patch)
treeb376ddd28c1e7d8e78b604d9d90f441d7a3c24ac /pkgs/applications/backup/vorta
parent5abe2cd1acdf4e56b16ed7f7f6e3cb588b54a110 (diff)
downloadnixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar.gz
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar.bz2
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar.lz
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar.xz
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.tar.zst
nixpkgs-eaf590d941ddb5aa3538774ec428ed428ddebde0.zip
vorta: enable tests and install the desktop file
Diffstat (limited to 'pkgs/applications/backup/vorta')
-rw-r--r--pkgs/applications/backup/vorta/default.nix69
1 files changed, 58 insertions, 11 deletions
diff --git a/pkgs/applications/backup/vorta/default.nix b/pkgs/applications/backup/vorta/default.nix
index 347a0de0503..dc02e65bb7b 100644
--- a/pkgs/applications/backup/vorta/default.nix
+++ b/pkgs/applications/backup/vorta/default.nix
@@ -1,11 +1,12 @@
 { lib
-, python3
+, python3Packages
 , fetchFromGitHub
 , wrapQtAppsHook
 , borgbackup
+, qt5
 }:
 
-python3.pkgs.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "vorta";
   version = "0.7.7";
 
@@ -16,19 +17,34 @@ python3.pkgs.buildPythonApplication rec {
     sha256 = "sha256-AH9CvoWAaNLPLC+NL+VXtYq9CNCMt0AFtC1ZGXSlcHQ=";
   };
 
-  postPatch = ''
-    sed -i -e '/setuptools_git/d' -e '/pytest-runner/d' setup.cfg
-  '';
-
   nativeBuildInputs = [ wrapQtAppsHook ];
 
-  propagatedBuildInputs = with python3.pkgs; [
-    paramiko peewee pyqt5 python-dateutil APScheduler psutil qdarkstyle
-    secretstorage appdirs setuptools
+  propagatedBuildInputs = with python3Packages; [
+    paramiko
+    peewee
+    pyqt5
+    python-dateutil
+    APScheduler
+    psutil
+    qdarkstyle
+    secretstorage
+    appdirs
+    setuptools
   ];
 
-  # QT setup in tests broken.
-  doCheck = false;
+  postPatch = ''
+    substituteInPlace setup.cfg \
+    --replace setuptools_git "" \
+    --replace pytest-runner ""
+
+    substituteInPlace src/vorta/assets/metadata/com.borgbase.Vorta.desktop \
+    --replace Exec=vorta "Exec=$out/bin/vorta" \
+    --replace com.borgbase.Vorta "com.borgbase.Vorta-symbolic"
+  '';
+
+  postInstall = ''
+    install -Dm644 src/vorta/assets/metadata/com.borgbase.Vorta.desktop $out/share/applications/com.borgbase.Vorta.desktop
+  '';
 
   preFixup = ''
     makeWrapperArgs+=(
@@ -37,6 +53,37 @@ python3.pkgs.buildPythonApplication rec {
     )
   '';
 
+  checkInputs = with python3Packages; [
+    pytest-qt
+    pytest-mock
+    pytestCheckHook
+  ];
+
+  preCheck = ''
+    export HOME=$(mktemp -d)
+    # For tests/test_misc.py::test_autostart
+    mkdir -p $HOME/.config/autostart
+    export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
+    export QT_QPA_PLATFORM=offscreen
+  '';
+
+  disabledTestPaths = [
+    "tests/test_archives.py"
+    "tests/test_borg.py"
+    "tests/test_lock.py"
+    "tests/test_notifications.py"
+  ];
+
+  disabledTests = [
+    "diff_archives_dict_issue-Users"
+    "diff_archives-test"
+    "test_repo_unlink"
+    "test_repo_add_success"
+    "test_ssh_dialog"
+    "test_create"
+    "test_scheduler_create_backup"
+  ];
+
   meta = with lib; {
     license = licenses.gpl3Only;
     homepage = "https://vorta.borgbase.com/";