summary refs log tree commit diff
path: root/pkgs/applications/science/misc/sasview/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/misc/sasview/default.nix')
-rw-r--r--pkgs/applications/science/misc/sasview/default.nix89
1 files changed, 38 insertions, 51 deletions
diff --git a/pkgs/applications/science/misc/sasview/default.nix b/pkgs/applications/science/misc/sasview/default.nix
index d12f9454ce7..51dea275578 100644
--- a/pkgs/applications/science/misc/sasview/default.nix
+++ b/pkgs/applications/science/misc/sasview/default.nix
@@ -1,70 +1,57 @@
-{ lib, fetchFromGitHub, gcc, python2 }:
+{ lib
+, python3
+, fetchFromGitHub
+, which
+, wrapQtAppsHook
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "sasview";
+  version = "5.0.4";
 
-let
-  xhtml2pdf = import ./xhtml2pdf.nix {
-    inherit lib;
-    fetchPypi = python2.pkgs.fetchPypi;
-    buildPythonPackage = python2.pkgs.buildPythonPackage;
-    html5lib = python2.pkgs.html5lib;
-    httplib2 = python2.pkgs.httplib2;
-    nose = python2.pkgs.nose;
-    pillow = python2.pkgs.pillow;
-    pypdf2 = python2.pkgs.pypdf2;
-    reportlab = python2.pkgs.reportlab;
+  src = fetchFromGitHub {
+    owner = "SasView";
+    repo = "sasview";
+    rev = "v${version}";
+    hash = "sha256-TjcchqA6GCvkr59ZgDuGglan2RxLp+aMjJk28XhvoiY=";
   };
 
-in
-
-python2.pkgs.buildPythonApplication rec {
-  pname = "sasview";
-  version = "4.2.0";
-
-  checkInputs = with python2.pkgs; [
-    pytest
-    unittest-xml-reporting
+  nativeBuildInputs = [
+    python3.pkgs.pyqt5
+    wrapQtAppsHook
   ];
 
-  checkPhase = ''
-    # fix the following error:
-    # imported module 'sas.sascalc.data_util.uncertainty' has this __file__ attribute:
-    #   /build/source/build/lib.linux-x86_64-2.7/sas/sascalc/data_util/uncertainty.py
-    # which is not the same as the test file we want to collect:
-    #   /build/source/dist/tmpbuild/sasview/sas/sascalc/data_util/uncertainty.py
-    rm -r dist/tmpbuild
-
-    HOME=$(mktemp -d) py.test
-  '';
-
-  propagatedBuildInputs = with python2.pkgs; [
+  propagatedBuildInputs = with python3.pkgs; [
     bumps
-    gcc
     h5py
-    libxslt
     lxml
-    matplotlib
-    numpy
-    pyparsing
     periodictable
     pillow
-    pylint
-    pyopencl
-    reportlab
+    pyparsing
+    pyqt5
+    qt5reactor
     sasmodels
     scipy
-    six
-    sphinx
-    wxPython
+    setuptools
     xhtml2pdf
   ];
 
-  src = fetchFromGitHub {
-    owner = "SasView";
-    repo = "sasview";
-    rev = "v${version}";
-    sha256 = "0k3486h46k6406h0vla8h68fd78wh3dcaq5w6f12jh6g4cjxv9qa";
-  };
+  postBuild = ''
+    ${python3.interpreter} src/sas/qtgui/convertUI.py
+  '';
+
+  dontWrapQtApps = true;
+
+  makeWrapperArgs = [
+    "\${qtWrapperArgs[@]}"
+  ];
+
+  checkInputs = with python3.pkgs; [
+    pytestCheckHook
+    unittest-xml-reporting
+  ];
 
-  patches = [ ./pyparsing-fix.patch ./local_config.patch ];
+  pytestFlagsArray = [ "test" ];
 
   meta = with lib; {
     homepage = "https://www.sasview.org";