flake: contain sipyco to nac3artiq-profile

This commit is contained in:
Sebastien Bourdeauducq 2022-04-19 10:34:55 +08:00
parent a19e9c0bec
commit 837aaa95f1
2 changed files with 23 additions and 35 deletions

View File

@ -18,28 +18,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs"
"sipyco": "sipyco"
}
},
"sipyco": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1649724535,
"narHash": "sha256-15Nun4EY35j+6SPZkjzZtyH/ncxLS60KuGJjFh5kSTc=",
"owner": "m-labs",
"repo": "sipyco",
"rev": "939f84f9b5eef7efbf7423c735d1834783b6140e",
"type": "github"
},
"original": {
"owner": "m-labs",
"repo": "sipyco",
"type": "github"
} }
} }
}, },

View File

@ -2,10 +2,8 @@
description = "The third-generation ARTIQ compiler"; description = "The third-generation ARTIQ compiler";
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11; inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
inputs.sipyco.url = github:m-labs/sipyco;
inputs.sipyco.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, sipyco }: outputs = { self, nixpkgs }:
let let
pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
in rec { in rec {
@ -83,23 +81,34 @@
); );
nac3artiq-profile = pkgs.stdenvNoCC.mkDerivation { nac3artiq-profile = pkgs.stdenvNoCC.mkDerivation {
name = "nac3artiq-profile"; name = "nac3artiq-profile";
src = pkgs.fetchFromGitHub { srcs = [
(pkgs.fetchFromGitHub {
owner = "m-labs";
repo = "sipyco";
rev = "939f84f9b5eef7efbf7423c735d1834783b6140e";
sha256 = "sha256-15Nun4EY35j+6SPZkjzZtyH/ncxLS60KuGJjFh5kSTc=";
})
(pkgs.fetchFromGitHub {
owner = "m-labs"; owner = "m-labs";
repo = "artiq"; repo = "artiq";
rev = "dd57fdc530baf926a5f354dc1c2bd90564affd96"; rev = "dd57fdc530baf926a5f354dc1c2bd90564affd96";
sha256 = "sha256-hcqVcToYWkc3oDFkKr9wZUF65ydiSYVHdmiGiu2Mc1c="; sha256 = "sha256-hcqVcToYWkc3oDFkKr9wZUF65ydiSYVHdmiGiu2Mc1c=";
}; })
];
buildInputs = [ buildInputs = [
(python3-mimalloc.withPackages(ps: [ ps.numpy ps.jsonschema sipyco.packages.x86_64-linux.sipyco nac3artiq-instrumented ])) (python3-mimalloc.withPackages(ps: [ ps.numpy ps.jsonschema nac3artiq-instrumented ]))
pkgs.lld_13 pkgs.lld_13
pkgs.llvmPackages_13.llvm.out pkgs.llvmPackages_13.llvm.out
]; ];
phases = [ "buildPhase" "installPhase" ]; phases = [ "buildPhase" "installPhase" ];
buildPhase = buildPhase =
'' ''
export PYTHONPATH=$src srcs=($srcs)
python -m artiq.frontend.artiq_ddb_template $src/artiq/examples/nac3devices/nac3devices.json > device_db.py sipyco=''${srcs[0]}
cp $src/artiq/examples/nac3devices/nac3devices.py . artiq=''${srcs[1]}
export PYTHONPATH=$sipyco:$artiq
python -m artiq.frontend.artiq_ddb_template $artiq/artiq/examples/nac3devices/nac3devices.json > device_db.py
cp $artiq/artiq/examples/nac3devices/nac3devices.py .
python -m artiq.frontend.artiq_compile nac3devices.py python -m artiq.frontend.artiq_compile nac3devices.py
''; '';
installPhase = installPhase =