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

152 lines
5.4 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);
"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-19 23:13:41 +08:00
rev = "51df56fcb5270b4f41bb37dc5338dd66eef21565";
sha256 = "17dsf1bfaiy26wvn97lpxpypnx3crg45r2n6764mc7234gk2k0j4";
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-19 23:13:41 +08:00
rev = "ad1dbfd5287d3910bc61bcd4db4df045c3ca53ab";
sha256 = "16292n8kswk91gdxvf450hkh38lk31v8rgmfrl2mnfdladahg1ax";
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";
rev = "c7a011f9b235c86f9c98a8aeb335acb00d525d7d";
sha256 = "1dg37911v3pg97d14yhk648xrz5g0yv176csqbcv0iv3v1nvsyhd";
};
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";
rev = "350aa142c0843647800b5052a9de7ef66b812898";
sha256 = "1js9h02pay62vxdpkzsjphnf1p0yzdjky1x8csz7lh5kbyahl9vr";
};
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";
};
})