2019-02-14 15:29:42 +08:00
|
|
|
{ pkgs ? import <nixpkgs> {}}:
|
|
|
|
let
|
2019-02-14 20:16:56 +08:00
|
|
|
artiqSrc = <artiqSrc>;
|
2019-02-14 19:31:46 +08:00
|
|
|
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
2019-02-14 15:29:42 +08:00
|
|
|
''
|
|
|
|
cp --no-preserve=mode,ownership -R ${./artiq} $out
|
2019-02-14 19:31:46 +08:00
|
|
|
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
|
|
|
|
HASH=`nix-hash --type sha256 --base32 ${artiqSrc}`
|
|
|
|
cat > $out/pkgs/artiq-src.nix << EOF
|
|
|
|
{ fetchgit }:
|
|
|
|
fetchgit {
|
|
|
|
url = "git://github.com/m-labs/artiq.git";
|
|
|
|
rev = "$REV";
|
|
|
|
sha256 = "$HASH";
|
|
|
|
leaveDotGit = true;
|
|
|
|
}
|
|
|
|
EOF
|
2019-02-15 22:34:56 +08:00
|
|
|
echo \"5e.`cut -c1-8 <<< $REV`\" > $out/pkgs/artiq-version.nix
|
2019-02-14 15:29:42 +08:00
|
|
|
'';
|
2019-02-15 18:17:34 +08:00
|
|
|
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
|
2019-02-19 15:11:50 +08:00
|
|
|
python3pkgs = pkgs.callPackage "${generatedNix}/pkgs/python3Packages.nix" {};
|
2019-02-19 15:28:45 +08:00
|
|
|
artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix";
|
2019-02-15 18:17:34 +08:00
|
|
|
jobs = builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs;
|
2019-02-14 15:29:42 +08:00
|
|
|
in
|
|
|
|
jobs // {
|
2019-02-15 23:43:55 +08:00
|
|
|
generated-nix = pkgs.lib.hydraJob generatedNix;
|
2019-02-17 22:37:33 +08:00
|
|
|
channel = pkgs.releaseTools.channel rec {
|
2019-02-14 17:26:52 +08:00
|
|
|
name = "main";
|
2019-02-14 17:49:40 +08:00
|
|
|
src = generatedNix;
|
2019-02-14 15:29:42 +08:00
|
|
|
constituents = builtins.attrValues jobs;
|
|
|
|
};
|
2019-02-19 15:11:50 +08:00
|
|
|
docs = pkgs.runCommand "docs"
|
|
|
|
{
|
|
|
|
buildInputs = [
|
|
|
|
(pkgs.python3.withPackages(ps: [python3pkgs.sphinx-argparse python3pkgs.sphinxcontrib-wavedrom ps.sphinx_rtd_theme ps.sphinx]))
|
|
|
|
];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir $out
|
2019-02-19 15:28:45 +08:00
|
|
|
VERSIONEER_OVERRIDE=${artiqVersion} HOME=`mktemp -d` sphinx-build ${artiqSrc}/doc/manual $out/html
|
2019-02-19 15:11:50 +08:00
|
|
|
mkdir $out/nix-support
|
|
|
|
echo doc manual $out/html >> $out/nix-support/hydra-build-products
|
|
|
|
'';
|
2019-02-17 22:43:20 +08:00
|
|
|
extended-tests = pkgs.runCommand "extended-tests" {
|
2019-02-19 00:57:06 +08:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
(pkgs.python3.withPackages(ps: [artiqpkgs.artiq artiqpkgs.artiq-board-kc705-nist_clock]))
|
2019-02-19 11:35:35 +08:00
|
|
|
artiqpkgs.binutils-or1k
|
2019-02-19 00:57:06 +08:00
|
|
|
artiqpkgs.openocd
|
|
|
|
pkgs.iputils
|
|
|
|
];
|
2019-02-17 22:43:20 +08:00
|
|
|
} "cp ${./extended-tests.py} $out;";
|
2019-02-14 15:29:42 +08:00
|
|
|
}
|