You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
6.6 KiB

9 months ago
3 years ago
9 months ago
3 years ago
3 years ago
  1. { pkgs ? import <nixpkgs> {}}:
  2. with pkgs;
  3. let
  4. artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0";
  5. pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq6; };
  6. boards = [
  7. { target = "kasli"; variant = "tester"; }
  8. { target = "kc705"; variant = "nist_clock"; }
  9. ];
  10. boardPackages = pkgs.lib.lists.foldr (board: start:
  11. let
  12. boardBinaries = import ./artiq-board.nix { inherit pkgs; } {
  13. target = board.target;
  14. variant = board.variant;
  15. };
  16. in
  17. start // {
  18. "artiq-board-${board.target}-${board.variant}" = boardBinaries;
  19. }) {} boards;
  20. mainPackages = rec {
  21. inherit (pythonDeps) sipyco asyncserial pythonparser pyqtgraph-qt5 artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck qasync;
  22. binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; };
  23. binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; };
  24. llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {};
  25. rustc = callPackage ./pkgs/rust/rustc-with-crates.nix
  26. ((lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
  27. stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
  28. }) //
  29. { inherit llvm-or1k; });
  30. cargo = callPackage ./pkgs/rust/cargo.nix { inherit rustc; };
  31. cargo-vendor = callPackage ./pkgs/rust/cargo-vendor.nix {};
  32. llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; };
  33. libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; };
  34. artiq = callPackage ./pkgs/artiq.nix { inherit pythonDeps binutils-or1k binutils-arm llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; };
  35. artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; });
  36. openocd = callPackage ./pkgs/openocd.nix {};
  37. };
  38. condaNoarch = {
  39. conda-pythonparser = import ./conda/build.nix { inherit pkgs; } {
  40. pname = "conda-pythonparser";
  41. inherit (pythonDeps.pythonparser) version;
  42. src = import ./conda/fake-source.nix { inherit pkgs; } {
  43. name = "pythonparser";
  44. inherit (pythonDeps.pythonparser) version src;
  45. extraSrcCommands = "patch -p1 < ${./pkgs/pythonparserver.patch}";
  46. dependencies = ["regex"];
  47. };
  48. };
  49. conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
  50. pname = "conda-sipyco";
  51. inherit (pythonDeps.sipyco) version;
  52. src = import ./conda/fake-source.nix { inherit pkgs; } {
  53. name = "sipyco";
  54. inherit (pythonDeps.sipyco) version src;
  55. dependencies = ["numpy"];
  56. };
  57. };
  58. conda-quamash = import ./conda/build.nix { inherit pkgs; } {
  59. pname = "conda-quamash";
  60. inherit (pkgs.python3Packages.quamash) version;
  61. src = import ./conda/fake-source.nix { inherit pkgs; } {
  62. name = "quamash";
  63. inherit (pkgs.python3Packages.quamash) version src;
  64. };
  65. };
  66. conda-qasync = import ./conda/build.nix { inherit pkgs; } {
  67. pname = "conda-qasync";
  68. inherit (pythonDeps.qasync) version;
  69. src = import ./conda/fake-source.nix { inherit pkgs; } {
  70. name = "qasync";
  71. inherit (pythonDeps.qasync) version src;
  72. };
  73. };
  74. conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix {
  75. inherit pkgs;
  76. inherit (mainPackages.openocd) bscan_spi_bitstreams;
  77. };
  78. conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
  79. conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {
  80. pname = "conda-asyncserial";
  81. inherit (pythonDeps.asyncserial) version;
  82. src = import ./conda/fake-source.nix { inherit pkgs; } {
  83. name = "asyncserial";
  84. inherit (pythonDeps.asyncserial) version src;
  85. dependencies = ["pyserial"];
  86. };
  87. };
  88. };
  89. condaLinux = rec {
  90. conda-binutils-or1k = import ./conda/binutils.nix {
  91. inherit pkgs;
  92. inherit (mainPackages.binutils-or1k) version src;
  93. target = "or1k-linux";
  94. };
  95. conda-binutils-arm = import ./conda/binutils.nix {
  96. inherit pkgs;
  97. inherit (mainPackages.binutils-arm) version src;
  98. target = "armv7-unknown-linux-gnueabihf";
  99. };
  100. conda-llvm-or1k = import ./conda/llvm-or1k.nix {
  101. inherit pkgs;
  102. inherit (mainPackages.llvm-or1k) version;
  103. src = mainPackages.llvm-or1k.llvm-src;
  104. };
  105. conda-llvmlite-artiq = import ./conda/llvmlite-artiq.nix {
  106. inherit pkgs conda-llvm-or1k;
  107. inherit (mainPackages.llvmlite-artiq) version src;
  108. };
  109. };
  110. condaWindowsLegacy = {
  111. conda-windows-binutils-or1k = import ./conda-windows/redistribute.nix {
  112. inherit pkgs;
  113. name = "binutils-or1k";
  114. filename = "binutils-or1k-linux-2.27-h93a10e1_6.tar.bz2";
  115. baseurl = "https://anaconda.org/m-labs/binutils-or1k-linux/2.27/download/win-64/";
  116. sha256 = "0gbks36hfsx3893mihj0bdmg5vwccrq5fw8xp9b9xb8p5pr8qhzx";
  117. };
  118. conda-windows-llvm-or1k = import ./conda-windows/redistribute.nix {
  119. inherit pkgs;
  120. name = "llvm-or1k";
  121. filename = "llvm-or1k-6.0.0-25.tar.bz2";
  122. baseurl = "https://anaconda.org/m-labs/llvm-or1k/6.0.0/download/win-64/";
  123. sha256 = "06mnrg79rn9ni0d5z0x3jzb300nhqhbc2h9qbq5m50x3sgm8km63";
  124. };
  125. conda-windows-llvmlite-artiq = import ./conda-windows/redistribute.nix {
  126. inherit pkgs;
  127. name = "llvmlite-artiq";
  128. filename = "llvmlite-artiq-0.23.0.dev-py35_5.tar.bz2";
  129. baseurl = "https://anaconda.org/m-labs/llvmlite-artiq/0.23.0.dev/download/win-64/";
  130. sha256 = "10w24w5ljvan06pbvwqj4pzal072jnyynmwm42dn06pq88ryz9wj";
  131. };
  132. };
  133. condaWindowsExperimental = rec {
  134. conda-windows-binutils-or1k = import ./conda-windows/binutils.nix {
  135. inherit pkgs;
  136. inherit (mainPackages.binutils-or1k) version src;
  137. target = "or1k-linux";
  138. };
  139. conda-windows-binutils-arm = import ./conda-windows/binutils.nix {
  140. inherit pkgs;
  141. inherit (mainPackages.binutils-or1k) version src;
  142. target = "armv7-unknown-linux-gnueabihf";
  143. };
  144. conda-windows-llvm-or1k = import ./conda-windows/llvm-or1k.nix {
  145. inherit pkgs;
  146. inherit (mainPackages.llvm-or1k) version;
  147. src = mainPackages.llvm-or1k.llvm-src;
  148. };
  149. conda-windows-llvmlite-artiq = import ./conda-windows/llvmlite-artiq.nix {
  150. inherit pkgs conda-windows-llvm-or1k;
  151. inherit (mainPackages.llvmlite-artiq) version src;
  152. };
  153. };
  154. condaWindows = if artiq6 then condaWindowsExperimental else condaWindowsLegacy;
  155. in
  156. boardPackages // mainPackages // condaNoarch // condaLinux // condaWindows