Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icebox_vlog.py does not respect $(PREFIX) for chipdb location #125

Open
thoughtpolice opened this issue Feb 14, 2018 · 2 comments
Open

icebox_vlog.py does not respect $(PREFIX) for chipdb location #125

thoughtpolice opened this issue Feb 14, 2018 · 2 comments

Comments

@thoughtpolice
Copy link
Contributor

In ./icebox/icebox_vlog.py:

https://github.com/cliffordwolf/icestorm/blob/88eebff7db9d76e418ccbddd884c4e617596a428/icebox/icebox_vlog.py#L378

This doesn't respect $(PREFIX) during installation, meaning icebox_vlog can't be used (for example, when fiddling with picorv32.) This is a problem for any package that wants to install Icestorm outside of /usr/local; NixOS is the one I'm using.

I'm not sure how this should be fixed; perhaps simply as a sed invocation in the install: target?

@thoughtpolice
Copy link
Contributor Author

Here is the nixpkgs fix: NixOS/nixpkgs@fa8f4b1

From fa8f4b187f703950a9e3119549d264ff7e233123 Mon Sep 17 00:00:00 2001
From: Austin Seipp <aseipp@pobox.com>
Date: Wed, 14 Feb 2018 16:09:42 -0600
Subject: [PATCH] icestorm: fix chipdb location for icebox_vlog

Signed-off-by: Austin Seipp <aseipp@pobox.com>
---
 pkgs/development/tools/icestorm/default.nix | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pkgs/development/tools/icestorm/default.nix b/pkgs/development/tools/icestorm/default.nix
index 6351a01501d3..0307027faa2e 100644
--- a/pkgs/development/tools/icestorm/default.nix
+++ b/pkgs/development/tools/icestorm/default.nix
@@ -15,6 +15,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ python3 libftdi ];
   makeFlags = [ "PREFIX=$(out)" ];
 
+  # fix icebox_vlog chipdb path. icestorm issue:
+  #   https://github.com/cliffordwolf/icestorm/issues/125
+  patchPhase = ''
+    substituteInPlace ./icebox/icebox_vlog.py \
+      --replace /usr/local/share "$out/share"
+  '';
+
   meta = {
     description = "Documentation and tools for Lattice iCE40 FPGAs";
     longDescription = ''

@daveshah1
Copy link
Contributor

The other option would be to do the same as how arachne-pnr finds the chipdb, and use a path relative to the script (i.e. ../share/icebox/chipdb-*.txt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants