1
0
Fork 0
nix-scripts/artiq-full/extras.nix

207 lines
7.5 KiB
Nix
Raw Normal View History

2019-11-07 19:34:36 +08:00
{ pkgs, sipyco, asyncserial, artiq }:
2019-04-19 20:16:59 +08:00
let
2019-11-14 15:22:17 +08:00
condaBuild = import ./fast/conda-build.nix { inherit pkgs; };
condaFakeSource = import ./fast/conda-fake-source.nix { inherit pkgs; };
dualPackage = (
2019-04-19 22:03:02 +08:00
{ name, version, src, pythonOptions ? {}, condaOptions ? {}}:
{
"${name}" = pkgs.python3Packages.buildPythonPackage ({
inherit version;
name = "${name}-${version}";
inherit src;
} // pythonOptions);
2019-04-23 13:52:12 +08:00
"${name}-manual-html" = pkgs.stdenv.mkDerivation {
name = "${name}-manual-html-${version}";
inherit version src;
buildInputs = (with pkgs.python3Packages; [ sphinx sphinx_rtd_theme sphinx-argparse ]) ++ [ artiq ];
preBuild = ''
2019-07-17 20:22:13 +08:00
export SOURCE_DATE_EPOCH=${import ./fast/pkgs/artiq-timestamp.nix { inherit (pkgs) stdenv fetchgit git; }}
cd doc
'';
2019-04-23 13:52:12 +08:00
makeFlags = [ "html" ];
installPhase =
let
dest = "$out/share/doc/${name}-manual";
in
''
mkdir -p ${dest}
cp -r _build/html ${dest}/
mkdir -p $out/nix-support/
echo doc manual ${dest}/html index.html >> $out/nix-support/hydra-build-products
'';
};
2019-11-14 15:22:17 +08:00
"conda-${name}" = condaBuild {
2019-04-19 21:55:57 +08:00
name = "conda-${name}";
2019-11-14 15:22:17 +08:00
src = condaFakeSource ({
inherit name version src;
} // condaOptions);
};
}
);
2019-04-19 23:01:03 +08:00
# https://github.com/m-labs/artiq/issues/23
hidapi = pkgs.hidapi.overrideAttrs (oa: {
src = pkgs.fetchFromGitHub {
owner = "signal11";
repo = "hidapi";
rev = "a6a622ffb680c55da0de787ff93b80280498330f";
sha256 = "17n7c4v3jjrnzqwxpflggxjn6vkzscb32k4kmxqjbfvjqnx7qp7j";
};
});
in
(dualPackage {
name = "korad_ka3005p";
2019-11-07 19:34:36 +08:00
version = "1.1";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "korad_ka3005p";
2019-11-07 19:34:36 +08:00
rev = "a0cfaa5792a211e166d224314c4d0be4881b9b8d";
sha256 = "1bxzyjyvdhsbm9hj7ypf0vgkd1lvc340bb6lx3wchvh30n7bv9gv";
2019-04-19 19:49:07 +08:00
};
2019-11-07 19:34:36 +08:00
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
2019-04-19 21:55:57 +08:00
}) // (dualPackage {
name = "novatech409b";
2019-11-07 19:34:36 +08:00
version = "1.1";
2019-04-19 21:55:57 +08:00
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "novatech409b";
2019-11-07 19:34:36 +08:00
rev = "8740b3e7b254e03395135e6bc128bbaca70d4fbb";
sha256 = "0mwm434y83y8jb30fpz69z6z3b6sxbc8dv3nw0hq4wc7iginx89d";
2019-04-19 21:55:57 +08:00
};
2019-11-07 19:34:36 +08:00
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
2019-04-19 23:01:03 +08:00
}) // (dualPackage {
name = "lda";
2019-11-07 19:34:36 +08:00
version = "1.1";
2019-04-19 23:01:03 +08:00
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "lda";
2019-11-07 19:34:36 +08:00
rev = "6138a94a1116c8f7b40b8bd8bb161f847065aab6";
sha256 = "1009k9pq8wx5zxrljkxr1g95g8q979i7mq3csksdkd3d0v2jvqif";
2019-04-19 23:01:03 +08:00
};
pythonOptions = {
2019-11-07 19:34:36 +08:00
propagatedBuildInputs = [ sipyco ];
2019-04-19 23:01:03 +08:00
postPatch = ''
substituteInPlace lda/hidapi.py \
--replace "hidapi_lib_path = None"\
"hidapi_lib_path = '${hidapi}/lib/libhidapi-libusb.so.0'"
'';
};
2019-11-07 19:34:36 +08:00
condaOptions = { dependencies = [ "sipyco" ]; };
2019-04-20 00:10:17 +08:00
}) // (dualPackage {
name = "thorlabs_tcube";
2019-11-07 19:34:36 +08:00
version = "1.1";
2019-04-20 00:10:17 +08:00
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "thorlabs_tcube";
2019-11-07 19:34:36 +08:00
rev = "8b85292d76a69ae72ba8da32b894c87c794574ba";
sha256 = "09cy9nhydcwdib21wb0qg1cinvibfbszwgphrmf2ajw5kqpr1d6a";
2019-04-20 00:10:17 +08:00
};
2019-11-07 19:34:36 +08:00
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
2019-04-19 22:03:02 +08:00
}) // (dualPackage {
name = "newfocus8742";
2019-11-07 19:34:36 +08:00
version = "0.2";
2019-04-19 22:03:02 +08:00
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "newfocus8742";
2019-11-07 19:34:36 +08:00
rev = "9f6092b724b33b934aa4d3a1d6a20c295cd1d02d";
sha256 = "0qf05ghylnqf3l5vjx5dc748wi84xn6p6lb6f9r8p6f1z7z67fb8";
};
pythonOptions = {
2019-11-07 19:34:36 +08:00
propagatedBuildInputs = [ sipyco pkgs.python3Packages.pyusb ];
# no unit tests so do a simple smoke test
2019-11-07 19:34:36 +08:00
checkPhase = "python -m newfocus8742.aqctl_newfocus8742 -h";
2019-04-19 22:03:02 +08:00
};
2019-11-07 19:34:36 +08:00
condaOptions = { dependencies = [ "sipyco" ]; };
2019-04-22 22:59:19 +08:00
}) // (dualPackage {
name = "hut2";
2019-11-07 19:34:36 +08:00
version = "0.2";
2019-04-22 22:59:19 +08:00
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "hut2";
2019-11-12 22:18:38 +08:00
rev = "68369d5d63d233827840a9a752d90454a4e03baa";
sha256 = "0r832c0icz8v3w27ci13024bqfslj1gx6dwhjv11ksw229xdcghd";
2019-04-22 22:59:19 +08:00
};
pythonOptions = {
2019-11-07 19:34:36 +08:00
propagatedBuildInputs = [ sipyco ];
2019-04-22 22:59:19 +08:00
# no unit tests without hardware so do a simple smoke test
2019-11-07 19:34:36 +08:00
checkPhase = "python -m hut2.aqctl_hut2 -h";
2019-04-22 22:59:19 +08:00
};
2019-11-07 19:34:36 +08:00
condaOptions = { dependencies = [ "sipyco" ]; };
}) // rec {
2019-04-22 23:30:29 +08:00
toptica-lasersdk = pkgs.python3Packages.buildPythonPackage rec {
version = "2.0.0";
name = "toptica-lasersdk-${version}";
format = "wheel";
src = pkgs.fetchurl {
url = "https://files.pythonhosted.org/packages/6b/e2/5c98407215884c2570453a78bc0d6f0bbe619f06593847ccd6a2f1d3fe59/toptica_lasersdk-2.0.0-py3-none-any.whl";
sha256 = "1k5d9ah8qzp75hh63nh9l5dk808v9ybpmzlhrdc3sxmas3ajv8s7";
};
propagatedBuildInputs = [ pkgs.python3Packages.pyserial ];
};
toptica-lasersdk-artiq = pkgs.python3Packages.buildPythonPackage rec {
2019-11-07 19:34:36 +08:00
version = "0.2";
name = "toptica-lasersdk-artiq-${version}";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "lasersdk-artiq";
2019-11-07 19:34:36 +08:00
rev = "f96d0e81aa47beb468fa4d73d92dad0872d8a960";
sha256 = "1z6yc4h7fjw5b3f50asdk1kp65sj4hhxmdzsh1ay8g3n1c9g3hh5";
};
postPatch = ''
substituteInPlace lasersdk_artiq/aqctl_laser.py \
--replace "toptica.lasersdk.async.client" \
"toptica.lasersdk.asyncio.client"
substituteInPlace lasersdk_artiq/test.py \
--replace "toptica.lasersdk.async.client" \
"toptica.lasersdk.asyncio.client"
'';
2019-11-07 19:34:36 +08:00
propagatedBuildInputs = [ sipyco toptica-lasersdk ];
};
conda-toptica-lasersdk-artiq = condaBuild {
name = "conda-toptica-lasersdk-artiq";
src = condaFakeSource {
name = "toptica-lasersdk-artiq";
inherit (toptica-lasersdk-artiq) version src;
dependencies = [ "sipyco" "lasersdk =1.3.1" ];
};
};
2019-04-23 00:01:37 +08:00
} // (dualPackage {
name = "highfinesse-net";
2019-11-07 19:34:36 +08:00
version = "0.2";
2019-04-23 00:01:37 +08:00
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "highfinesse-net";
2019-11-07 19:34:36 +08:00
rev = "595daeb036592cf0254989e9b2cf8fac4844b6bc";
sha256 = "1nq7mnirprlac453rxfarf0wpdw77jmji2m22ks4nwjlb43ahmaz";
2019-04-23 00:01:37 +08:00
};
pythonOptions = {
2019-11-07 19:34:36 +08:00
propagatedBuildInputs = [ sipyco ];
2019-04-23 00:01:37 +08:00
# no unit tests without hardware so do a simple smoke test
2019-11-07 19:34:36 +08:00
checkPhase = "python -m highfinesse_net.aqctl_highfinesse_net -h";
2019-04-23 00:01:37 +08:00
};
2019-11-07 19:34:36 +08:00
condaOptions = { dependencies = [ "sipyco" ]; };
2019-11-14 15:22:17 +08:00
}) // rec {
artiq-comtools = pkgs.python3Packages.buildPythonPackage rec {
name = "artiq-comtools-${version}";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "artiq-comtools";
rev = "398f6becdaf89ec2e115106778467f9a766a2007";
sha256 = "02i2a1mmzc7jixq4nkbmi1a4c0gk6kmm8bv1dxrka7m56nb9sk9w";
};
propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ];
};
conda-artiq-comtools = condaBuild {
name = "conda-artiq-comtools";
src = condaFakeSource {
name = "artiq-comtools";
inherit (artiq-comtools) version src;
dependencies = [ "sipyco" "numpy" "aiohttp >=3" ];
};
};
}