noptica-rs/shell.nix

76 lines
2.7 KiB
Nix
Raw Normal View History

2019-08-29 12:18:17 +08:00
let
pkgs = import <nixpkgs> { };
2019-08-29 12:18:17 +08:00
fx2 = pkgs.python3Packages.buildPythonPackage rec {
pname = "fx2";
version = "0.8";
2019-08-29 12:18:17 +08:00
# not using Pypi as it lacks the firmware sources
src = pkgs.fetchFromGitHub {
owner = "whitequark";
repo = "libfx2";
rev = "v${version}";
sha256 = "0b3zp50mschsxi2v3192dmnpw32gwblyl8aswlz9a0vx1qg3ibzn";
2019-08-29 12:18:17 +08:00
};
nativeBuildInputs = with pkgs; [ gnumake sdcc ];
propagatedBuildInputs = with pkgs.python3Packages; [ libusb1 crcmod ];
preBuild = ''
cd software
python setup.py build_ext
'';
};
nmigen = pkgs.python3Packages.buildPythonPackage {
name = "nmigen";
version = "2019-10-06";
src = pkgs.fetchgit {
url = "https://github.com/m-labs/nmigen";
rev = "2512a9a12d2c062b8f34330c379ec523b125f38d";
sha256 = "0mi2snd8daabdmcbmc10hxzjmnmx85rnx1njqmrj1ll2jin3ncq7";
leaveDotGit = true;
2019-08-29 12:18:17 +08:00
};
checkPhase = "PATH=${pkgs.yosys}/bin:${pkgs.symbiyosys}/bin:${pkgs.yices}/bin:$PATH python -m unittest discover nmigen.test -v";
nativeBuildInputs = with pkgs; [ pkgs.python3Packages.setuptools_scm git ];
2019-08-29 12:18:17 +08:00
propagatedBuildInputs = with pkgs.python3Packages; [ bitarray pyvcd jinja2 ];
};
glasgow = pkgs.python3Packages.buildPythonApplication rec {
pname = "glasgow";
version = "2019-10-07";
src = pkgs.fetchgit {
url = "https://github.com/GlasgowEmbedded/Glasgow";
rev = "bfe49bebc4483b32eed8ec127a98a9fa2e77e7d4";
sha256 = "0wvn7ysixgxm35ghdp0cdqfp5pxpbxvr1r9d5amcz3ss6bd2844c";
2019-08-29 12:18:17 +08:00
fetchSubmodules = true;
leaveDotGit = true;
2019-08-29 12:18:17 +08:00
};
patches = [ ./glasgow-applet.diff ];
nativeBuildInputs = with pkgs; [ pkgs.python3Packages.setuptools_scm git gnumake sdcc ];
2019-08-29 12:18:17 +08:00
propagatedBuildInputs = (
2019-10-03 19:06:41 +08:00
[ fx2 nmigen ] ++
(with pkgs.python3Packages; [ setuptools libusb1 aiohttp pyvcd bitarray crcmod ]) ++
2019-10-03 19:06:41 +08:00
(with pkgs; [ yosys nextpnr icestorm ]));
2019-08-29 12:18:17 +08:00
preBuild = ''
cd software
python setup.py build_ext
'';
# tests are currently broken since nMigen migration
doCheck = false;
};
2019-10-08 15:23:04 +08:00
pyqtgraph-qt5 = pkgs.python3Packages.buildPythonPackage rec {
name = "pyqtgraph_qt5-${version}";
version = "0.10.0";
doCheck = false;
src = pkgs.fetchFromGitHub {
owner = "pyqtgraph";
repo = "pyqtgraph";
rev = "1426e334e1d20542400d77c72c132b04c6d17ddb";
sha256 = "1079haxyr316jf0wpirxdj0ry6j8mr16cqr0dyyrd5cnxwl7zssh";
};
propagatedBuildInputs = with pkgs.python3Packages; [ scipy numpy pyqt5 pyopengl ];
};
2019-08-29 12:18:17 +08:00
in
pkgs.mkShell {
2019-10-08 15:23:04 +08:00
buildInputs = [
glasgow
(pkgs.python3.withPackages(ps: [ps.quamash ps.pyqt5 pyqtgraph-qt5]))
pkgs.rustc pkgs.cargo
];
2019-08-29 12:18:17 +08:00
}