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

170 lines
6.1 KiB
Nix
Raw Normal View History

2019-04-19 19:49:07 +08:00
{ pkgs, asyncserial, artiq }:
2019-04-19 20:16:59 +08:00
let
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 = "cd doc";
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
'';
};
"conda-${name}" = import ./conda-build.nix { inherit pkgs; } {
2019-04-19 21:55:57 +08:00
name = "conda-${name}";
src = import ./conda-fake-source.nix { inherit pkgs; } ({
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";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "korad_ka3005p";
2019-04-23 13:52:12 +08:00
rev = "e8c02ade175b842972f76a27919a4aaf8190de90";
sha256 = "1svgnx52amvy9xl0b2wkz0ii4ycjvjv96ac0g07zkxabdqm5ff65";
2019-04-19 19:49:07 +08:00
};
2019-04-19 22:11:38 +08:00
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
condaOptions = { dependencies = [ "asyncserial" ]; };
2019-04-19 21:55:57 +08:00
}) // (dualPackage {
name = "novatech409b";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "novatech409b";
2019-04-23 13:52:12 +08:00
rev = "442e82e2234c0bf951da2084a77861f8977755c8";
sha256 = "032qgg48dy2k31vj0q8bfni0iy2kcyscd32bq60h701wvass6jv7";
2019-04-19 21:55:57 +08:00
};
2019-04-19 22:11:38 +08:00
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
2019-04-19 21:55:57 +08:00
condaOptions = { dependencies = [ "asyncserial" ]; };
2019-04-19 23:01:03 +08:00
}) // (dualPackage {
name = "lda";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "lda";
2019-04-23 13:52:12 +08:00
rev = "4329da1497f496839ce20beebce0d79ed453941f";
sha256 = "00c15a03xy9vbca0j2zfy89l3ghbdmmv5wqfksm6pdwy4z036cwa";
2019-04-19 23:01:03 +08:00
};
pythonOptions = {
propagatedBuildInputs = [ artiq ];
postPatch = ''
substituteInPlace lda/hidapi.py \
--replace "hidapi_lib_path = None"\
"hidapi_lib_path = '${hidapi}/lib/libhidapi-libusb.so.0'"
'';
};
2019-04-20 00:10:17 +08:00
}) // (dualPackage {
name = "thorlabs_tcube";
version = "1.0";
src = pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "thorlabs_tcube";
2019-04-23 13:52:12 +08:00
rev = "b72e7ba7de8355bd93dd20d53b6f15386dff229d";
sha256 = "1lqwqflwbfdykmhf6g0pwgiq7i2vf67ybj4l8n3jn16vny21b41s";
2019-04-20 00:10:17 +08:00
};
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
condaOptions = { dependencies = [ "asyncserial" ]; };
2019-04-19 22:03:02 +08:00
}) // (dualPackage {
name = "newfocus8742";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "newfocus8742";
2019-04-22 22:37:10 +08:00
rev = "31a92595d1cb77d9256b891ec17eed0fbeceb1bc";
sha256 = "1dww0y83d4i6nma1q5hnaagih94c32bxlla5p6a5a8zkc4x2pky9";
};
pythonOptions = {
propagatedBuildInputs = [ pkgs.python3Packages.pyusb artiq ];
# no unit tests so do a simple smoke test
checkPhase = "python -m newfocus8742.aqctl_newfocus8742 --version";
2019-04-19 22:03:02 +08:00
};
2019-04-22 22:59:19 +08:00
}) // (dualPackage {
name = "hut2";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "hut2";
rev = "acfd62dcd60d37250e2d1b691344c6e65b6e83eb";
sha256 = "0dpx3c5aclj7gki6iaybjbx9rqrxnwccpxcvjwp594ccbcswvclr";
};
pythonOptions = {
propagatedBuildInputs = [ artiq ];
# no unit tests without hardware so do a simple smoke test
checkPhase = "python -m hut2.aqctl_hut2 --version";
};
}) // 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 {
version = "0.1";
name = "toptica-lasersdk-artiq-${version}";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "lasersdk-artiq";
rev = "d38bb985e7ddffc9ac9d94fe136cac10947bfd72";
sha256 = "03a09lc81l2l787yjm0xjpnjvs5x77ndmks3xxh25yyxdhsdf1fl";
};
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"
'';
propagatedBuildInputs = [ toptica-lasersdk artiq ];
};
2019-04-23 00:01:37 +08:00
} // (dualPackage {
name = "highfinesse-net";
version = "0.1";
src = pkgs.fetchFromGitHub {
owner = "quartiq";
repo = "highfinesse-net";
rev = "6864ae5da5cbc67953b968010115db951e52a272";
sha256 = "1k8xacgam5xghxvljvdzpsdhhq86fra13hkvdy7y301s9nyp30s4";
};
pythonOptions = {
propagatedBuildInputs = [ artiq ];
# no unit tests without hardware so do a simple smoke test
checkPhase = "python -m highfinesse_net.aqctl_highfinesse_net --version";
};
})