From e48d440fd4ad28cacb6b6f9d24117b38dc9655f8 Mon Sep 17 00:00:00 2001 From: Stewart Mackenzie Date: Sun, 6 Mar 2016 23:54:07 +0800 Subject: [PATCH 01/21] Problem: ARTIQ setup via conda or src is complex Solution: Provide a single command to download, compile and install dependencies. --- nix/README.rst | 22 +++++++ nix/artiq.nix | 125 +++++++++++++++++++++++++++++++++++++++ nix/binutils-or1k.nix | 32 ++++++++++ nix/default.nix | 15 +++++ nix/fetch-llvm-clang.nix | 22 +++++++ nix/llvm-or1k.nix | 36 +++++++++++ nix/llvmlite.nix | 20 +++++++ 7 files changed, 272 insertions(+) create mode 100644 nix/README.rst create mode 100644 nix/artiq.nix create mode 100644 nix/binutils-or1k.nix create mode 100644 nix/default.nix create mode 100644 nix/fetch-llvm-clang.nix create mode 100644 nix/llvm-or1k.nix create mode 100644 nix/llvmlite.nix diff --git a/nix/README.rst b/nix/README.rst new file mode 100644 index 000000000..c2d6df2eb --- /dev/null +++ b/nix/README.rst @@ -0,0 +1,22 @@ +Install ARTIQ via the Nix Package Manager +=========================== + +Nix does not support windows. + +* Install the nix package manager + + * many linux distros already have a package for the `nix package manager `_ + + * for example: $ apt-get install nix + + * if you would like to install via sh (please be sure you `understand `_ the dangers involved when curl piping to sh. Also ensure you have read the contents of the script and feel comfortable executing it. Otherwise there is the `manual `_) + + * $ curl https://nixos.org/nix/install | sh + + * $ source ~/.nix-profile/etc/profile.d/nix.sh + +* $ git clone github.com/m-labs/artiq +* $ cd artiq/nix +* $ nix-env -i -f default.nix + +The above command will setup your entire environment. diff --git a/nix/artiq.nix b/nix/artiq.nix new file mode 100644 index 000000000..af5c20737 --- /dev/null +++ b/nix/artiq.nix @@ -0,0 +1,125 @@ +{ stdenv, fetchFromGitHub, fetchsvn, python35Packages, qt5Full, llvm-or1k, llvmlite, python35}: + +let + +levenshtein = python35Packages.buildPythonPackage rec { + name = "levenshtein"; + src = fetchFromGitHub { + owner = "ztane"; + repo = "python-Levenshtein"; + rev = "854e61a05bb8b750e990add96df412cd5448b75e"; + sha256 = "1yf21kg1g2ivm5a4dx1jra9k0c33np54d0hk5ymnfyc4f6pg386q"; + }; + doCheck = false; +}; + +sphinx-argparse = python35Packages.buildPythonPackage rec { + name = "sphinx-argparse"; + src = fetchFromGitHub { + owner = "ribozz"; + repo = "sphinx-argparse"; + rev = "cc95938b8fbf870f7a5c012d4d84a29cfbac5e06"; + sha256 = "1rsjlsnrpd4i4zx2sylilf6lfi77k0fclbhilrgx1m53ixllwg38"; + }; + buildInputs = with python35Packages; [ sphinx ]; + doCheck = false; +}; + +pythonparser = python35Packages.buildPythonPackage rec { + name = "pythonparser"; + src = fetchFromGitHub { + owner = "m-labs"; + repo = "pythonparser"; + rev = "8bdc7badbd08e2196b864e12889ea9191ca6e09c"; + sha256 = "1f538wnjlqah0dsvq256k2rv7s7bffsvjcxy8fq0x3a4g0s6pm9d"; + }; + buildInputs = with python35Packages; [ regex ]; + doCheck = false; +}; + +ml-pyserial = python35Packages.buildPythonPackage rec { + name = "pyserial"; + src = fetchFromGitHub { + owner = "m-labs"; + repo = "pyserial"; + rev = "f30653b23f01c1cc27eb9731afc8ad66a723a4c0"; + sha256 = "18xwsmpklggrm07b17ficpyjxnfgpw0k9lbz44nq4iflr8gmf33f"; + }; + buildInputs = with python35Packages; [ regex ]; + doCheck = false; +}; + +pyqtgraph = python35Packages.buildPythonPackage rec { + name = "pyqtgraph"; + src = fetchFromGitHub { + owner = "m-labs"; + repo = "pyqtgraph"; + rev = "8e9ee6fd3cabcc06d25cde5f13921e5d9d11c588"; + sha256 = "0ynhsd4nlbz4pgwch0w767a9ybazn5f33rakpjdrcwldvrrrng6y"; + }; + buildInputs = with python35Packages; [ numpy ]; + doCheck = false; +}; + +outputcheck = python35Packages.buildPythonPackage rec { + name = "outputcheck"; + version = "0.4.2"; + src = fetchFromGitHub { + owner = "stp"; + repo = "OutputCheck"; + rev = "e0f533d3c5af2949349856c711bf4bca50022b48"; + sha256 = "1y27vz6jq6sywas07kz3v01sqjd0sga9yv9w2cksqac3v7wmf2a0"; + }; + prePatch = '' + substituteInPlace setup.py \ + --replace "version.get_git_version()" "\"${version}\"" \ + --replace "import version" "" + ''; + doCheck = false; +}; + +quamash = python35Packages.buildPythonPackage rec { + name = "quamash"; + src = fetchFromGitHub { + owner = "harvimt"; + repo = "quamash"; + rev = "bbab9e30e10b71a95687b03a93524173fb7b43f0"; + sha256 = "08hp2q4ifj6z2ww05c7zsy0cd732k9rnaims1j43vr4hhxx950mk"; + }; + buildInputs = with python35Packages; [ pyqt5 ]; + doCheck = false; +}; + +lit = python35Packages.buildPythonPackage rec { + name = "lit"; + version = "262719"; + source = fetchsvn { + url = "http://llvm.org/svn/llvm-project/llvm/trunk/"; + rev = "${version}"; + sha256 = "1iashczfh30v9ark4xijk6z2q07c1kb70nar00mwnfix77gkb2v6"; + }; + src = source + /utils/lit; + doCheck = false; +}; + +in + +python35Packages.buildPythonPackage rec { + version = "336482"; + name = "artiq-${version}"; + src = ./..; + buildInputs = with python35Packages; [ + llvm-or1k llvmlite sphinx-argparse levenshtein + pyqtgraph aiohttp pygit2 pythonparser numpy + dateutil sphinx quamash scipy outputcheck + prettytable lit ml-pyserial h5py cython regex qt5Full pyqt5 ]; + doCheck = false; + meta = with stdenv.lib; { + description = ""; + homepage = https://m-labs/artiq; + license = licenses.gpl3; + maintainers = [ maintainers.sjmackenzie ]; + platforms = [ "x86_64-linux" ]; + }; +} + diff --git a/nix/binutils-or1k.nix b/nix/binutils-or1k.nix new file mode 100644 index 000000000..0ebdbcd24 --- /dev/null +++ b/nix/binutils-or1k.nix @@ -0,0 +1,32 @@ +{ stdenv +, fetchurl +}: + +stdenv.mkDerivation rec { + basename = "binutils"; + platform = "or1k"; + version = "2.26"; + name = "${basename}_${platform}-${version}"; + src = fetchurl { + url = "https://ftp.gnu.org/gnu/binutils/${basename}-${version}.tar.bz2"; + sha256 = "1ngc2h3knhiw8s22l8y6afycfaxr5grviqy7mwvm4bsl14cf9b62"; + }; + configureFlags = + [ "--enable-shared" "--enable-deterministic-archives" "--target=or1k-linux"]; + enableParallelBuilding = true; + meta = { + description = "Tools for manipulating binaries (linker, assembler, etc.)"; + longDescription = '' + The GNU Binutils are a collection of binary tools. The main + ones are `ld' (the GNU linker) and `as' (the GNU assembler). + They also include the BFD (Binary File Descriptor) library, + `gprof', `nm', `strip', etc. + ''; + homepage = http://www.gnu.org/software/binutils/; + license = stdenv.lib.licenses.gpl3Plus; + /* Give binutils a lower priority than gcc-wrapper to prevent a + collision due to the ld/as wrappers/symlinks in the latter. */ + priority = "10"; + }; +} + diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 000000000..3561ff763 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,15 @@ +{system ? builtins.currentSystem}: +let + pkgs = import {inherit system;}; + callPackage = pkgs.lib.callPackageWith (pkgs // self ); + +self = { + binutils-ork1 = callPackage ./binutils-or1k.nix {}; + llvm-src = callPackage ./fetch-llvm-clang.nix {}; + llvm-or1k = callPackage ./llvm-or1k.nix {}; + llvmlite = callPackage ./llvmlite.nix {}; + artiq = callPackage ./artiq.nix { }; +}; +artiq = self.artiq; +in +artiq diff --git a/nix/fetch-llvm-clang.nix b/nix/fetch-llvm-clang.nix new file mode 100644 index 000000000..cb53f93d0 --- /dev/null +++ b/nix/fetch-llvm-clang.nix @@ -0,0 +1,22 @@ +{ runCommand, fetchFromGitHub, git }: + +let +llvm-src = fetchFromGitHub { + rev = "ff2fe8c318eb7c934a2f2ac8da61a00d62becf1f"; + owner = "openrisc"; + repo = "llvm-or1k"; + sha256 = "061pvc4z5i92s1xwz9ir6yqnk5vb0xd8cs9php4yy01dyvpblql7"; +}; +clang-src = fetchFromGitHub { + rev = "030259ccc14261d02163cce28adb0c11243d0a99"; + owner = "openrisc"; + repo = "clang-or1k"; + sha256 = "1w7dk469svskr1c7ywcl9xsxbnvl40c28nffivpclijcvsh43463"; +}; +in +runCommand "llvm_or1k_src" {}'' +mkdir -p $out +mkdir -p $out/tools/clang +cp -r ${llvm-src}/* $out/ +cp -r ${clang-src}/* $out/tools/clang +'' diff --git a/nix/llvm-or1k.nix b/nix/llvm-or1k.nix new file mode 100644 index 000000000..95d74061e --- /dev/null +++ b/nix/llvm-or1k.nix @@ -0,0 +1,36 @@ +{ stdenv +, git +, llvm-src +, perl, groff, cmake, libxml2, python, libffi, valgrind +, ... +}: + +stdenv.mkDerivation rec { + name = "llvm_or1k"; + src = llvm-src; + + buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind; + + preBuild = '' + NIX_BUILD_CORES=4 + makeFlagsArray=(-j''$NIX_BUILD_CORES) + mkdir -p $out/ + ''; + + cmakeFlags = with stdenv; [ + "-DLLVM_TARGETS_TO_BUILD=OR1K;X86" + "-DCMAKE_BUILD_TYPE=Rel" + "-DLLVM_ENABLE_ASSERTIONS=ON" + "-DCMAKE_BUILD_TYPE=Release" + ]; + + enableParallelBuilding = true; + meta = { + description = "Collection of modular and reusable compiler and toolchain technologies"; + homepage = http://llvm.org/; + license = stdenv.lib.licenses.bsd3; + maintainers = with stdenv.lib.maintainers; [ sj_mackenzie ]; + platforms = stdenv.lib.platforms.all; + }; +} + diff --git a/nix/llvmlite.nix b/nix/llvmlite.nix new file mode 100644 index 000000000..4fd99a482 --- /dev/null +++ b/nix/llvmlite.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchgit, llvm-or1k, makeWrapper, python35, ncurses, zlib }: +let +version = "0f4ebae"; +in +stdenv.mkDerivation rec { + name = "llvmlite-${version}"; + src = fetchgit { + url = "https://github.com/m-labs/llvmlite"; + rev = "0f4ebae43c2d2a084deb8b693e3d42a7b2c82222"; + sha256 = "0lnxxyjw2dapzqanms6jx64zxwhyrcria1yz49dzlb1306hzclj0"; + leaveDotGit = true; + }; + + buildInputs = [ makeWrapper python35 ncurses zlib llvm-or1k]; + + installPhase = '' + LLVM_CONFIG=${llvm-or1k}/llvm_or1k/bin/llvm-config + python3 setup.py install --prefix=$out + ''; +} From d2e47844dddf90b8661492898605507adee2fde7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 12 Aug 2018 21:20:02 +0800 Subject: [PATCH 02/21] nix: fixes --- nix/artiq.nix | 16 ++++++++++++++-- nix/llvmlite.nix | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index af5c20737..5be35279e 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -49,6 +49,18 @@ ml-pyserial = python35Packages.buildPythonPackage rec { doCheck = false; }; +asyncserial = python35Packages.buildPythonPackage rec { + name = "asyncserial"; + src = fetchFromGitHub { + owner = "m-labs"; + repo = "asyncserial"; + rev = "d95bc1d6c791b0e9785935d2f62f628eb5cdf98d"; + sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k"; + }; + buildInputs = with python35Packages; [ ml-pyserial ]; + doCheck = false; +}; + pyqtgraph = python35Packages.buildPythonPackage rec { name = "pyqtgraph"; src = fetchFromGitHub { @@ -108,11 +120,11 @@ python35Packages.buildPythonPackage rec { version = "336482"; name = "artiq-${version}"; src = ./..; - buildInputs = with python35Packages; [ + propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite sphinx-argparse levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil sphinx quamash scipy outputcheck - prettytable lit ml-pyserial h5py cython regex qt5Full pyqt5 ]; + prettytable lit ml-pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; diff --git a/nix/llvmlite.nix b/nix/llvmlite.nix index 4fd99a482..762c09cf7 100644 --- a/nix/llvmlite.nix +++ b/nix/llvmlite.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, llvm-or1k, makeWrapper, python35, ncurses, zlib }: +{ stdenv, fetchgit, llvm-or1k, makeWrapper, python35, ncurses, zlib, python35Packages }: let version = "0f4ebae"; in @@ -7,11 +7,11 @@ stdenv.mkDerivation rec { src = fetchgit { url = "https://github.com/m-labs/llvmlite"; rev = "0f4ebae43c2d2a084deb8b693e3d42a7b2c82222"; - sha256 = "0lnxxyjw2dapzqanms6jx64zxwhyrcria1yz49dzlb1306hzclj0"; + sha256 = "0n90w0x001k0zyn8zz6jxc9i78agqv15m55vz2raw1y0rfw16mfl"; leaveDotGit = true; }; - buildInputs = [ makeWrapper python35 ncurses zlib llvm-or1k]; + buildInputs = [ makeWrapper python35 ncurses zlib llvm-or1k python35Packages.setuptools ]; installPhase = '' LLVM_CONFIG=${llvm-or1k}/llvm_or1k/bin/llvm-config From 34329cf3665728c198beef65b98432ecaf6c70eb Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 13 Aug 2018 12:12:36 +0800 Subject: [PATCH 03/21] artiq_flash: target Kasli by default --- RELEASE_NOTES.rst | 2 ++ artiq/frontend/artiq_flash.py | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index 83d10d2ac..0c96a5cd4 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -21,6 +21,8 @@ ARTIQ-4 server address argument and the notify port. * The master now has a ``--name`` argument. If given, the dashboard is labelled with this name rather than the server address. +* ``artiq_flash`` targets Kasli by default. Use ``-t kc705`` to flash a KC705 + instead. * ``artiq_flash -m/--adapter`` has been changed to ``artiq_flash -V/--variant``. * The ``proxy`` action of ``artiq_flash`` is determined automatically and should not be specified manually anymore. diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 5fca7702a..b8b2754bb 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -51,9 +51,9 @@ Prerequisites: parser.add_argument("-J", "--jump", type=str, default=None, help="SSH host to jump through") - parser.add_argument("-t", "--target", default="kc705", + parser.add_argument("-t", "--target", default="kasli", help="target board, default: %(default)s, one of: " - "kc705 kasli sayma") + "kasli sayma kc705") parser.add_argument("-V", "--variant", default=None, help="board variant") parser.add_argument("-I", "--preinit-command", default=[], action="append", @@ -258,14 +258,6 @@ def main(): init_logger(args) config = { - "kc705": { - "programmer": partial(ProgrammerXC7, board="kc705", proxy="bscan_spi_xc7k325t.bit"), - "def_variant": "nist_clock", - "gateware": ("spi0", 0x000000), - "bootloader": ("spi0", 0xaf0000), - "storage": ("spi0", 0xb30000), - "firmware": ("spi0", 0xb40000), - }, "kasli": { "programmer": partial(ProgrammerXC7, board="kasli", proxy="bscan_spi_xc7a100t.bit"), "def_variant": "opticlock", @@ -283,6 +275,14 @@ def main(): "firmware": ("spi1", 0x050000), "rtm_gateware": ("spi1", 0x200000), }, + "kc705": { + "programmer": partial(ProgrammerXC7, board="kc705", proxy="bscan_spi_xc7k325t.bit"), + "def_variant": "nist_clock", + "gateware": ("spi0", 0x000000), + "bootloader": ("spi0", 0xaf0000), + "storage": ("spi0", 0xb30000), + "firmware": ("spi0", 0xb40000), + }, }[args.target] variant = args.variant From ec97d636170fd64894fde297b834dcea780b4669 Mon Sep 17 00:00:00 2001 From: Stewart Mackenzie Date: Mon, 13 Aug 2018 17:42:25 +0800 Subject: [PATCH 04/21] nix: separated buildtime & runtime dependencies --- nix/artiq.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 5be35279e..e9a287250 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -120,11 +120,8 @@ python35Packages.buildPythonPackage rec { version = "336482"; name = "artiq-${version}"; src = ./..; - propagatedBuildInputs = with python35Packages; [ - llvm-or1k llvmlite sphinx-argparse levenshtein - pyqtgraph aiohttp pygit2 pythonparser numpy - dateutil sphinx quamash scipy outputcheck - prettytable lit ml-pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; + buildInputs = with python35Packages; [ lit outputcheck sphinx sphinx-argparse ]; + propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable ml-pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; From 700383506215a79b750d42f2c5edf447ef177295 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 00:21:51 +0800 Subject: [PATCH 05/21] nix: update license --- nix/artiq.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index e9a287250..7819bc774 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -126,7 +126,7 @@ python35Packages.buildPythonPackage rec { meta = with stdenv.lib; { description = ""; homepage = https://m-labs/artiq; - license = licenses.gpl3; + license = licenses.lgpl3; maintainers = [ maintainers.sjmackenzie ]; platforms = [ "x86_64-linux" ]; }; From 487720d13b2be827f211b7cf8ea424b8cdad9e31 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 00:25:01 +0800 Subject: [PATCH 06/21] nix: remove sphinx (used for building doc, not running ARTIQ) --- nix/artiq.nix | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 7819bc774..f94103894 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -13,18 +13,6 @@ levenshtein = python35Packages.buildPythonPackage rec { doCheck = false; }; -sphinx-argparse = python35Packages.buildPythonPackage rec { - name = "sphinx-argparse"; - src = fetchFromGitHub { - owner = "ribozz"; - repo = "sphinx-argparse"; - rev = "cc95938b8fbf870f7a5c012d4d84a29cfbac5e06"; - sha256 = "1rsjlsnrpd4i4zx2sylilf6lfi77k0fclbhilrgx1m53ixllwg38"; - }; - buildInputs = with python35Packages; [ sphinx ]; - doCheck = false; -}; - pythonparser = python35Packages.buildPythonPackage rec { name = "pythonparser"; src = fetchFromGitHub { @@ -120,7 +108,7 @@ python35Packages.buildPythonPackage rec { version = "336482"; name = "artiq-${version}"; src = ./..; - buildInputs = with python35Packages; [ lit outputcheck sphinx sphinx-argparse ]; + buildInputs = with python35Packages; [ lit outputcheck ]; propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable ml-pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { From 0b1ce0ea3236d60589dd42a46f0747e122a67469 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 00:25:55 +0800 Subject: [PATCH 07/21] nix: use original pyqtgraph and pyserial --- nix/artiq.nix | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index f94103894..b270c21ba 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -25,18 +25,6 @@ pythonparser = python35Packages.buildPythonPackage rec { doCheck = false; }; -ml-pyserial = python35Packages.buildPythonPackage rec { - name = "pyserial"; - src = fetchFromGitHub { - owner = "m-labs"; - repo = "pyserial"; - rev = "f30653b23f01c1cc27eb9731afc8ad66a723a4c0"; - sha256 = "18xwsmpklggrm07b17ficpyjxnfgpw0k9lbz44nq4iflr8gmf33f"; - }; - buildInputs = with python35Packages; [ regex ]; - doCheck = false; -}; - asyncserial = python35Packages.buildPythonPackage rec { name = "asyncserial"; src = fetchFromGitHub { @@ -45,19 +33,7 @@ asyncserial = python35Packages.buildPythonPackage rec { rev = "d95bc1d6c791b0e9785935d2f62f628eb5cdf98d"; sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k"; }; - buildInputs = with python35Packages; [ ml-pyserial ]; - doCheck = false; -}; - -pyqtgraph = python35Packages.buildPythonPackage rec { - name = "pyqtgraph"; - src = fetchFromGitHub { - owner = "m-labs"; - repo = "pyqtgraph"; - rev = "8e9ee6fd3cabcc06d25cde5f13921e5d9d11c588"; - sha256 = "0ynhsd4nlbz4pgwch0w767a9ybazn5f33rakpjdrcwldvrrrng6y"; - }; - buildInputs = with python35Packages; [ numpy ]; + buildInputs = with python35Packages; [ pyserial ]; doCheck = false; }; @@ -109,7 +85,7 @@ python35Packages.buildPythonPackage rec { name = "artiq-${version}"; src = ./..; buildInputs = with python35Packages; [ lit outputcheck ]; - propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable ml-pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; + propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; From 73cf071b1a88dabcfead6e9c8b1536b4d49c1d09 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 00:33:52 +0800 Subject: [PATCH 08/21] nix: update LLVM and llvmlite, remove clang (not needed for running) --- nix/fetch-llvm-clang.nix | 14 +++----------- nix/llvm-or1k.nix | 16 +++++++++++++--- nix/llvmlite.nix | 6 +++--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/nix/fetch-llvm-clang.nix b/nix/fetch-llvm-clang.nix index cb53f93d0..d337eaa8e 100644 --- a/nix/fetch-llvm-clang.nix +++ b/nix/fetch-llvm-clang.nix @@ -2,21 +2,13 @@ let llvm-src = fetchFromGitHub { - rev = "ff2fe8c318eb7c934a2f2ac8da61a00d62becf1f"; - owner = "openrisc"; + rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7"; + owner = "m-labs"; repo = "llvm-or1k"; - sha256 = "061pvc4z5i92s1xwz9ir6yqnk5vb0xd8cs9php4yy01dyvpblql7"; -}; -clang-src = fetchFromGitHub { - rev = "030259ccc14261d02163cce28adb0c11243d0a99"; - owner = "openrisc"; - repo = "clang-or1k"; - sha256 = "1w7dk469svskr1c7ywcl9xsxbnvl40c28nffivpclijcvsh43463"; + sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa"; }; in runCommand "llvm_or1k_src" {}'' mkdir -p $out -mkdir -p $out/tools/clang cp -r ${llvm-src}/* $out/ -cp -r ${clang-src}/* $out/tools/clang '' diff --git a/nix/llvm-or1k.nix b/nix/llvm-or1k.nix index 95d74061e..403e95fd3 100644 --- a/nix/llvm-or1k.nix +++ b/nix/llvm-or1k.nix @@ -18,10 +18,20 @@ stdenv.mkDerivation rec { ''; cmakeFlags = with stdenv; [ - "-DLLVM_TARGETS_TO_BUILD=OR1K;X86" - "-DCMAKE_BUILD_TYPE=Rel" - "-DLLVM_ENABLE_ASSERTIONS=ON" "-DCMAKE_BUILD_TYPE=Release" + "-DLLVM_BUILD_LLVM_DYLIB=ON" + "-DLLVM_LINK_LLVM_DYLIB=ON" + "-DLLVM_TARGETS_TO_BUILD=X86" + "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K" + "-DLLVM_ENABLE_ASSERTIONS=OFF" + "-DLLVM_INSTALL_UTILS=ON" + "-DLLVM_INCLUDE_TESTS=OFF" + "-DLLVM_INCLUDE_DOCS=OFF" + "-DLLVM_INCLUDE_EXAMPLES=OFF" + "-DCLANG_ENABLE_ARCMT=OFF" + "-DCLANG_ENABLE_STATIC_ANALYZER=OFF" + "-DCLANG_INCLUDE_TESTS=OFF" + "-DCLANG_INCLUDE_DOCS=OFF" ]; enableParallelBuilding = true; diff --git a/nix/llvmlite.nix b/nix/llvmlite.nix index 762c09cf7..6f5d1516d 100644 --- a/nix/llvmlite.nix +++ b/nix/llvmlite.nix @@ -6,15 +6,15 @@ stdenv.mkDerivation rec { name = "llvmlite-${version}"; src = fetchgit { url = "https://github.com/m-labs/llvmlite"; - rev = "0f4ebae43c2d2a084deb8b693e3d42a7b2c82222"; - sha256 = "0n90w0x001k0zyn8zz6jxc9i78agqv15m55vz2raw1y0rfw16mfl"; + rev = "401dfb713166bdd2bc0d3ab2b7ebf12e7a434130"; + sha256 = "1ci1pnpspv1pqz712yix1nmplq7568vpsr6gzzl3a33w9s0sw2nq"; leaveDotGit = true; }; buildInputs = [ makeWrapper python35 ncurses zlib llvm-or1k python35Packages.setuptools ]; installPhase = '' - LLVM_CONFIG=${llvm-or1k}/llvm_or1k/bin/llvm-config + LLVM_CONFIG=${llvm-or1k}/bin/llvm-config python3 setup.py install --prefix=$out ''; } From 477dcdbad4d05d4308b0a193efd06ad14bdd3a49 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 09:39:21 +0800 Subject: [PATCH 09/21] nix: use latest python3 --- nix/artiq.nix | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index b270c21ba..f029b0ce5 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -1,8 +1,8 @@ -{ stdenv, fetchFromGitHub, fetchsvn, python35Packages, qt5Full, llvm-or1k, llvmlite, python35}: +{ stdenv, fetchFromGitHub, fetchsvn, python3Packages, qt5Full, llvm-or1k, llvmlite, python3}: let -levenshtein = python35Packages.buildPythonPackage rec { +levenshtein = python3Packages.buildPythonPackage rec { name = "levenshtein"; src = fetchFromGitHub { owner = "ztane"; @@ -13,7 +13,7 @@ levenshtein = python35Packages.buildPythonPackage rec { doCheck = false; }; -pythonparser = python35Packages.buildPythonPackage rec { +pythonparser = python3Packages.buildPythonPackage rec { name = "pythonparser"; src = fetchFromGitHub { owner = "m-labs"; @@ -21,11 +21,11 @@ pythonparser = python35Packages.buildPythonPackage rec { rev = "8bdc7badbd08e2196b864e12889ea9191ca6e09c"; sha256 = "1f538wnjlqah0dsvq256k2rv7s7bffsvjcxy8fq0x3a4g0s6pm9d"; }; - buildInputs = with python35Packages; [ regex ]; + buildInputs = with python3Packages; [ regex ]; doCheck = false; }; -asyncserial = python35Packages.buildPythonPackage rec { +asyncserial = python3Packages.buildPythonPackage rec { name = "asyncserial"; src = fetchFromGitHub { owner = "m-labs"; @@ -33,11 +33,11 @@ asyncserial = python35Packages.buildPythonPackage rec { rev = "d95bc1d6c791b0e9785935d2f62f628eb5cdf98d"; sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k"; }; - buildInputs = with python35Packages; [ pyserial ]; + buildInputs = with python3Packages; [ pyserial ]; doCheck = false; }; -outputcheck = python35Packages.buildPythonPackage rec { +outputcheck = python3Packages.buildPythonPackage rec { name = "outputcheck"; version = "0.4.2"; src = fetchFromGitHub { @@ -54,7 +54,7 @@ outputcheck = python35Packages.buildPythonPackage rec { doCheck = false; }; -quamash = python35Packages.buildPythonPackage rec { +quamash = python3Packages.buildPythonPackage rec { name = "quamash"; src = fetchFromGitHub { owner = "harvimt"; @@ -62,11 +62,11 @@ quamash = python35Packages.buildPythonPackage rec { rev = "bbab9e30e10b71a95687b03a93524173fb7b43f0"; sha256 = "08hp2q4ifj6z2ww05c7zsy0cd732k9rnaims1j43vr4hhxx950mk"; }; - buildInputs = with python35Packages; [ pyqt5 ]; + buildInputs = with python3Packages; [ pyqt5 ]; doCheck = false; }; -lit = python35Packages.buildPythonPackage rec { +lit = python3Packages.buildPythonPackage rec { name = "lit"; version = "262719"; source = fetchsvn { @@ -80,12 +80,12 @@ lit = python35Packages.buildPythonPackage rec { in -python35Packages.buildPythonPackage rec { +python3Packages.buildPythonPackage rec { version = "336482"; name = "artiq-${version}"; src = ./..; - buildInputs = with python35Packages; [ lit outputcheck ]; - propagatedBuildInputs = with python35Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; + buildInputs = with python3Packages; [ lit outputcheck ]; + propagatedBuildInputs = with python3Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; From c3759379bd9140082c4013d7fe1003c8fba4216b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 09:53:15 +0800 Subject: [PATCH 10/21] nix: upgrade pyqtgraph and switch it to Qt5 --- nix/artiq.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index f029b0ce5..49cedf765 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -66,6 +66,19 @@ quamash = python3Packages.buildPythonPackage rec { doCheck = false; }; +pyqtgraph-qt5 = python3Packages.buildPythonPackage rec { + name = "pyqtgraph_qt5-${version}"; + version = "0.10.0"; + doCheck = false; + src = fetchFromGitHub { + owner = "pyqtgraph"; + repo = "pyqtgraph"; + rev = "1426e334e1d20542400d77c72c132b04c6d17ddb"; + sha256 = "1079haxyr316jf0wpirxdj0ry6j8mr16cqr0dyyrd5cnxwl7zssh"; + }; + propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ]; +}; + lit = python3Packages.buildPythonPackage rec { name = "lit"; version = "262719"; @@ -85,7 +98,7 @@ python3Packages.buildPythonPackage rec { name = "artiq-${version}"; src = ./..; buildInputs = with python3Packages; [ lit outputcheck ]; - propagatedBuildInputs = with python3Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; + propagatedBuildInputs = with python3Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; From 57bd3e4109d692b9f75bc97fdaa6516abba27c99 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 10:01:48 +0800 Subject: [PATCH 11/21] nix: also use latest python3 for llvmlite --- nix/llvmlite.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/llvmlite.nix b/nix/llvmlite.nix index 6f5d1516d..e03f408e8 100644 --- a/nix/llvmlite.nix +++ b/nix/llvmlite.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, llvm-or1k, makeWrapper, python35, ncurses, zlib, python35Packages }: +{ stdenv, fetchgit, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }: let version = "0f4ebae"; in @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { leaveDotGit = true; }; - buildInputs = [ makeWrapper python35 ncurses zlib llvm-or1k python35Packages.setuptools ]; + buildInputs = [ makeWrapper python3 ncurses zlib llvm-or1k python3Packages.setuptools ]; installPhase = '' LLVM_CONFIG=${llvm-or1k}/bin/llvm-config From ac9dcb74978d291e3f8c250adc7ce4e1bfdc3d49 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 10:05:07 +0800 Subject: [PATCH 12/21] nix: fix and update binutils-or1k --- nix/binutils-or1k.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nix/binutils-or1k.nix b/nix/binutils-or1k.nix index 0ebdbcd24..f9fa99ad0 100644 --- a/nix/binutils-or1k.nix +++ b/nix/binutils-or1k.nix @@ -1,18 +1,21 @@ -{ stdenv -, fetchurl +{ stdenv, buildPackages +, fetchurl, zlib }: stdenv.mkDerivation rec { basename = "binutils"; platform = "or1k"; - version = "2.26"; + version = "2.30"; name = "${basename}_${platform}-${version}"; src = fetchurl { - url = "https://ftp.gnu.org/gnu/binutils/${basename}-${version}.tar.bz2"; - sha256 = "1ngc2h3knhiw8s22l8y6afycfaxr5grviqy7mwvm4bsl14cf9b62"; + url = "https://ftp.gnu.org/gnu/binutils/binutils-${version}.tar.bz2"; + sha256 = "028cklfqaab24glva1ks2aqa1zxa6w6xmc8q34zs1sb7h22dxspg"; }; configureFlags = [ "--enable-shared" "--enable-deterministic-archives" "--target=or1k-linux"]; + outputs = [ "out" "info" "man" ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + buildInputs = [ zlib ]; enableParallelBuilding = true; meta = { description = "Tools for manipulating binaries (linker, assembler, etc.)"; @@ -29,4 +32,3 @@ stdenv.mkDerivation rec { priority = "10"; }; } - From 2e6c0b6a6d5a9ac2cc67ff4c5783333e151e5f9f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 10:06:03 +0800 Subject: [PATCH 13/21] nix: propagate artiq subdependencies --- nix/artiq.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 49cedf765..a21df0105 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -21,7 +21,7 @@ pythonparser = python3Packages.buildPythonPackage rec { rev = "8bdc7badbd08e2196b864e12889ea9191ca6e09c"; sha256 = "1f538wnjlqah0dsvq256k2rv7s7bffsvjcxy8fq0x3a4g0s6pm9d"; }; - buildInputs = with python3Packages; [ regex ]; + propagatedBuildInputs = with python3Packages; [ regex ]; doCheck = false; }; @@ -33,7 +33,7 @@ asyncserial = python3Packages.buildPythonPackage rec { rev = "d95bc1d6c791b0e9785935d2f62f628eb5cdf98d"; sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k"; }; - buildInputs = with python3Packages; [ pyserial ]; + propagatedBuildInputs = with python3Packages; [ pyserial ]; doCheck = false; }; @@ -62,7 +62,7 @@ quamash = python3Packages.buildPythonPackage rec { rev = "bbab9e30e10b71a95687b03a93524173fb7b43f0"; sha256 = "08hp2q4ifj6z2ww05c7zsy0cd732k9rnaims1j43vr4hhxx950mk"; }; - buildInputs = with python3Packages; [ pyqt5 ]; + propagatedBuildInputs = with python3Packages; [ pyqt5 ]; doCheck = false; }; From 2c55f2ce4b2eeb6462534df6eaacbbde3f344740 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 10:06:23 +0800 Subject: [PATCH 14/21] nix: install binutils-or1k --- nix/artiq.nix | 4 ++-- nix/default.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index a21df0105..930389a4e 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, fetchsvn, python3Packages, qt5Full, llvm-or1k, llvmlite, python3}: +{ stdenv, fetchFromGitHub, fetchsvn, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite, python3}: let @@ -98,7 +98,7 @@ python3Packages.buildPythonPackage rec { name = "artiq-${version}"; src = ./..; buildInputs = with python3Packages; [ lit outputcheck ]; - propagatedBuildInputs = with python3Packages; [ llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; + propagatedBuildInputs = with python3Packages; [ binutils-or1k llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { description = ""; diff --git a/nix/default.nix b/nix/default.nix index 3561ff763..b536227ba 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,7 +4,7 @@ let callPackage = pkgs.lib.callPackageWith (pkgs // self ); self = { - binutils-ork1 = callPackage ./binutils-or1k.nix {}; + binutils-or1k = callPackage ./binutils-or1k.nix {}; llvm-src = callPackage ./fetch-llvm-clang.nix {}; llvm-or1k = callPackage ./llvm-or1k.nix {}; llvmlite = callPackage ./llvmlite.nix {}; From 4155853482160da3c9a514b38c566ed7389c2c13 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 16 Aug 2018 13:03:55 +0800 Subject: [PATCH 15/21] nix: add Clang back --- nix/fetch-llvm-clang.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nix/fetch-llvm-clang.nix b/nix/fetch-llvm-clang.nix index d337eaa8e..686aef9a6 100644 --- a/nix/fetch-llvm-clang.nix +++ b/nix/fetch-llvm-clang.nix @@ -7,8 +7,16 @@ llvm-src = fetchFromGitHub { repo = "llvm-or1k"; sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa"; }; +clang-src = fetchFromGitHub { + rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3"; + owner = "m-labs"; + repo = "clang-or1k"; + sha256 = "0w5f450i76y162aswi2c7jip8x3arzljaxhbqp8qfdffm0rdbjp4"; +}; in runCommand "llvm_or1k_src" {}'' mkdir -p $out +mkdir -p $out/tools/clang cp -r ${llvm-src}/* $out/ +cp -r ${clang-src}/* $out/tools/clang '' From 3d332ccc0bdc9769fbeee893412373c9568b0429 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Aug 2018 12:19:16 +0800 Subject: [PATCH 16/21] nix: update README --- nix/README.rst | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/nix/README.rst b/nix/README.rst index c2d6df2eb..ce0e0931c 100644 --- a/nix/README.rst +++ b/nix/README.rst @@ -1,22 +1,28 @@ Install ARTIQ via the Nix Package Manager -=========================== +========================================= -Nix does not support windows. +These instructions provide an alternative route to install ARTIQ for people who do not wish to use conda. -* Install the nix package manager +This sets up an environment suitable for using ARTIQ, including the ARTIQ-Python compiler, device drivers, and the graphical user interfaces. This works correctly on Linux, and partially works with WSL introduced in Windows 10. - * many linux distros already have a package for the `nix package manager `_ +ARTIQ firmware and gateware development tools (e.g. rustc, Migen) and ARTIQ core device flashing tools (OpenOCD, proxy bitstreams) are currently not available on Nix. Pull requests welcome! - * for example: $ apt-get install nix +* Install the Nix package manager - * if you would like to install via sh (please be sure you `understand `_ the dangers involved when curl piping to sh. Also ensure you have read the contents of the script and feel comfortable executing it. Otherwise there is the `manual `_) + * many Linux distros already have a package for the `Nix package manager `_ - * $ curl https://nixos.org/nix/install | sh + * for example: ``$ apt-get install nix`` - * $ source ~/.nix-profile/etc/profile.d/nix.sh + * if you would like to install via sh -* $ git clone github.com/m-labs/artiq -* $ cd artiq/nix -* $ nix-env -i -f default.nix + * $ ``wget https://nixos.org/nix/install`` + + * $ ``sh install`` + + * $ ``source ~/.nix-profile/etc/profile.d/nix.sh`` + +* $ ``git clone github.com/m-labs/artiq`` +* $ ``cd artiq/nix`` +* $ ``nix-env -i -f default.nix`` The above command will setup your entire environment. From 233c841f2e9e65e4bf2f3d48d1ffe78a9801eef1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Aug 2018 12:19:38 +0800 Subject: [PATCH 17/21] nix: remove bogus version string --- nix/artiq.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 930389a4e..2b4b4c603 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, fetchsvn, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite, python3}: +{ stdenv, fetchFromGitHub, fetchsvn, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite, python3 }: let @@ -94,8 +94,7 @@ lit = python3Packages.buildPythonPackage rec { in python3Packages.buildPythonPackage rec { - version = "336482"; - name = "artiq-${version}"; + name = "artiq"; src = ./..; buildInputs = with python3Packages; [ lit outputcheck ]; propagatedBuildInputs = with python3Packages; [ binutils-or1k llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; @@ -108,4 +107,3 @@ python3Packages.buildPythonPackage rec { platforms = [ "x86_64-linux" ]; }; } - From e978430c54dc1ec400d89ee2b26f53fcb6921075 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Aug 2018 12:27:17 +0800 Subject: [PATCH 18/21] nix: add warnings to README --- nix/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/README.rst b/nix/README.rst index ce0e0931c..7df289bd4 100644 --- a/nix/README.rst +++ b/nix/README.rst @@ -3,7 +3,7 @@ Install ARTIQ via the Nix Package Manager These instructions provide an alternative route to install ARTIQ for people who do not wish to use conda. -This sets up an environment suitable for using ARTIQ, including the ARTIQ-Python compiler, device drivers, and the graphical user interfaces. This works correctly on Linux, and partially works with WSL introduced in Windows 10. +This sets up an environment suitable for using ARTIQ, including the ARTIQ-Python compiler, device drivers, and the graphical user interfaces. This works correctly on Linux, and partially works (but not to a level that we would consider usable) with WSL introduced in Windows 10. ARTIQ firmware and gateware development tools (e.g. rustc, Migen) and ARTIQ core device flashing tools (OpenOCD, proxy bitstreams) are currently not available on Nix. Pull requests welcome! @@ -25,4 +25,4 @@ ARTIQ firmware and gateware development tools (e.g. rustc, Migen) and ARTIQ core * $ ``cd artiq/nix`` * $ ``nix-env -i -f default.nix`` -The above command will setup your entire environment. +The above command will setup your entire environment. Note that it will compile LLVM and Clang, which uses a lot of CPU time and disk space. From 341437ea5007248c96e962396df3459d337711c0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 17 Aug 2018 13:20:56 +0800 Subject: [PATCH 19/21] nix: remove outputcheck and lit --- nix/artiq.nix | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 2b4b4c603..9f360e538 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -37,23 +37,6 @@ asyncserial = python3Packages.buildPythonPackage rec { doCheck = false; }; -outputcheck = python3Packages.buildPythonPackage rec { - name = "outputcheck"; - version = "0.4.2"; - src = fetchFromGitHub { - owner = "stp"; - repo = "OutputCheck"; - rev = "e0f533d3c5af2949349856c711bf4bca50022b48"; - sha256 = "1y27vz6jq6sywas07kz3v01sqjd0sga9yv9w2cksqac3v7wmf2a0"; - }; - prePatch = '' - substituteInPlace setup.py \ - --replace "version.get_git_version()" "\"${version}\"" \ - --replace "import version" "" - ''; - doCheck = false; -}; - quamash = python3Packages.buildPythonPackage rec { name = "quamash"; src = fetchFromGitHub { @@ -79,24 +62,11 @@ pyqtgraph-qt5 = python3Packages.buildPythonPackage rec { propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ]; }; -lit = python3Packages.buildPythonPackage rec { - name = "lit"; - version = "262719"; - source = fetchsvn { - url = "http://llvm.org/svn/llvm-project/llvm/trunk/"; - rev = "${version}"; - sha256 = "1iashczfh30v9ark4xijk6z2q07c1kb70nar00mwnfix77gkb2v6"; - }; - src = source + /utils/lit; - doCheck = false; -}; - in python3Packages.buildPythonPackage rec { name = "artiq"; src = ./..; - buildInputs = with python3Packages; [ lit outputcheck ]; propagatedBuildInputs = with python3Packages; [ binutils-or1k llvm-or1k llvmlite levenshtein pyqtgraph-qt5 aiohttp pygit2 pythonparser numpy dateutil quamash scipy prettytable pyserial asyncserial h5py cython regex qt5Full pyqt5 ]; doCheck = false; meta = with stdenv.lib; { From 23ea8c81f3320a9fad3ca178ef79c9e6b57acb75 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 19 Aug 2018 21:18:40 +0800 Subject: [PATCH 20/21] nix: update pythonparser --- nix/artiq.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/artiq.nix b/nix/artiq.nix index 9f360e538..c959c8a17 100644 --- a/nix/artiq.nix +++ b/nix/artiq.nix @@ -18,8 +18,8 @@ pythonparser = python3Packages.buildPythonPackage rec { src = fetchFromGitHub { owner = "m-labs"; repo = "pythonparser"; - rev = "8bdc7badbd08e2196b864e12889ea9191ca6e09c"; - sha256 = "1f538wnjlqah0dsvq256k2rv7s7bffsvjcxy8fq0x3a4g0s6pm9d"; + rev = "5b391fe86f43bb9f4f96c5bc0532e2a112db2936"; + sha256 = "1gw1fk4y2l6bwq0fg2a9dfc1rvq8cv492dyil96amjdhsxvnx35b"; }; propagatedBuildInputs = with python3Packages; [ regex ]; doCheck = false; From 7f523e7e50e3b52086cf6f5e4eda8aa7f2aa2840 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 24 Aug 2018 19:03:25 +0800 Subject: [PATCH 21/21] nix: add shell starter --- nix/shell.nix | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 nix/shell.nix diff --git a/nix/shell.nix b/nix/shell.nix new file mode 100644 index 000000000..8fbdadb65 --- /dev/null +++ b/nix/shell.nix @@ -0,0 +1,8 @@ +{system ? builtins.currentSystem}: +let + pkgs = import {inherit system;}; + artiq = pkgs.callPackage ./default.nix {}; +in +pkgs.mkShell { + buildInputs = [ artiq ]; +}