aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/glasgow/default.nix
diff options
context:
space:
mode:
authorEmily <vcs@emily.moe>2019-08-30 21:45:56 +0100
committerAustin Seipp <aseipp@pobox.com>2019-09-01 14:22:49 -0500
commitcb5b674b5868e74bef707281848ae65c0576f808 (patch)
tree54b9585673900c9d464124bd5bf6439c846f4100 /pkgs/development/python-modules/glasgow/default.nix
parent321efae699032b4ce7d7a710b163a6114c3633fe (diff)
{glasgow,libfx2}: init at 2018-{09-01,08-27}
Diffstat (limited to 'pkgs/development/python-modules/glasgow/default.nix')
-rw-r--r--pkgs/development/python-modules/glasgow/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/glasgow/default.nix b/pkgs/development/python-modules/glasgow/default.nix
new file mode 100644
index 00000000000..264a13aed5e
--- /dev/null
+++ b/pkgs/development/python-modules/glasgow/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, sdcc
+, nmigen
+, fx2
+, libusb1
+, aiohttp
+, pyvcd
+, bitarray
+, crcmod
+, yosys
+, icestorm
+, nextpnr
+}:
+
+buildPythonPackage rec {
+ pname = "glasgow";
+ version = "unstable-2019-08-31";
+ realVersion = lib.substring 0 7 src.rev;
+
+ src = fetchFromGitHub {
+ owner = "GlasgowEmbedded";
+ repo = "Glasgow";
+ rev = "21641a13c6a0daaf8618aff3c5bfffcb26ef6cca";
+ sha256 = "1dpm1jmm4fg8xf17s6h9g5sc09gq8b6xq955sv2x11nrbqf98l4v";
+ };
+
+ nativeBuildInputs = [ sdcc ];
+
+ propagatedBuildInputs = [
+ nmigen
+ fx2
+ libusb1
+ aiohttp
+ pyvcd
+ bitarray
+ crcmod
+ ];
+
+ postPatch = ''
+ substituteInPlace software/setup.py \
+ --replace 'versioneer.get_version()' '"${realVersion}"'
+ '';
+
+ preBuild = ''
+ make -C firmware LIBFX2=${fx2}/share/libfx2
+ cp firmware/glasgow.ihex software/glasgow
+ cd software
+ '';
+
+ # a couple failing tests and also installCheck tries to build_ext again
+ doInstallCheck = false;
+ doCheck = false;
+
+ checkPhase = ''
+ python -m unittest discover
+ '';
+
+ meta = with lib; {
+ description = "Software for Glasgow, a digital interface multitool";
+ homepage = https://github.com/GlasgowEmbedded/Glasgow;
+ license = licenses.bsd0;
+ maintainers = with maintainers; [ emily ];
+ };
+}