You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.8 KiB

9 months ago
  1. { stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
  2. python3Packages.buildPythonPackage rec {
  3. pname = "artiq";
  4. version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
  5. src = import ./artiq-src.nix { inherit fetchgit; };
  6. preBuild = "export VERSIONEER_OVERRIDE=${version}";
  7. nativeBuildInputs = [ qt5.wrapQtAppsHook ];
  8. propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq ]
  9. ++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0") [ binutils-arm ])
  10. ++ (with pythonDeps; [ sipyco pyqtgraph-qt5 pythonparser ])
  11. ++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 ])
  12. ++ [(if (lib.strings.versionAtLeast version "6.0") then pythonDeps.qasync else python3Packages.quamash)];
  13. dontWrapQtApps = true;
  14. postFixup = ''
  15. wrapQtApp "$out/bin/artiq_dashboard"
  16. wrapQtApp "$out/bin/artiq_browser"
  17. wrapQtApp "$out/bin/artiq_session"
  18. '';
  19. # Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
  20. # Allows subprocesses using python to find all packages you have installed
  21. makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
  22. checkInputs = [ binutils-or1k outputcheck ];
  23. checkPhase =
  24. ''
  25. python -m unittest discover -v artiq.test
  26. TESTDIR=`mktemp -d`
  27. cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR
  28. LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit
  29. '';
  30. meta = with lib; {
  31. description = "A leading-edge control system for quantum information experiments";
  32. homepage = https://m-labs/artiq;
  33. license = licenses.lgpl3;
  34. maintainers = [ maintainers.sb0 ];
  35. };
  36. }