2019-04-19 19:49:07 +08:00
|
|
|
{ pkgs, asyncserial, artiq }:
|
2019-04-19 20:16:59 +08:00
|
|
|
let
|
2019-04-19 20:34:07 +08:00
|
|
|
dualPackage = (
|
2019-04-19 22:03:02 +08:00
|
|
|
{ name, version, src, pythonOptions ? {}, condaOptions ? {}}:
|
2019-04-19 20:34:07 +08:00
|
|
|
{
|
|
|
|
"${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}";
|
2019-04-19 20:34:07 +08:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
});
|
2019-04-19 20:34:07 +08:00
|
|
|
in
|
|
|
|
(dualPackage {
|
|
|
|
name = "korad_ka3005p";
|
|
|
|
version = "1.0";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "m-labs";
|
|
|
|
repo = "korad_ka3005p";
|
|
|
|
rev = "e0adec6c577d7d1b832a2b1bf20e89ac393ca27e";
|
|
|
|
sha256 = "18092zgjh63qrg6lg9mzsbr2yri7k7wb97mip5xq3zrcabmmpbk3";
|
2019-04-19 19:49:07 +08:00
|
|
|
};
|
2019-04-19 22:11:38 +08:00
|
|
|
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
|
2019-04-19 20:34:07 +08:00
|
|
|
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";
|
|
|
|
rev = "c95c52ea3fdcc8459d84bd72bb54c3dc77883968";
|
|
|
|
sha256 = "1lkdf1wwngwpmm4byaz1jbjpc9gnq3q8ig6hq305dn73cja99zn9";
|
|
|
|
};
|
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 = ''
|
|
|
|
ls
|
|
|
|
substituteInPlace lda/hidapi.py \
|
|
|
|
--replace "hidapi_lib_path = None"\
|
|
|
|
"hidapi_lib_path = '${hidapi}/lib/libhidapi-libusb.so.0'"
|
|
|
|
'';
|
|
|
|
};
|
2019-04-19 22:03:02 +08:00
|
|
|
}) // (dualPackage {
|
|
|
|
name = "newfocus8742";
|
|
|
|
version = "0.1";
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "quartiq";
|
|
|
|
repo = "newfocus8742";
|
2019-04-19 22:11:59 +08:00
|
|
|
rev = "2d97eb741f43bd5cb9eec92635101b70ad9c129c";
|
|
|
|
sha256 = "0xzx1p6qn24ckbc8pyxzq8wxn64pvrbwm2l94mblij6dblksdgmv";
|
|
|
|
};
|
|
|
|
pythonOptions = {
|
|
|
|
propagatedBuildInputs = [ 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-19 20:34:07 +08:00
|
|
|
})
|