about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/compilers/nextpnr/default.nix
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/nextpnr/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/nextpnr/default.nix40
1 files changed, 30 insertions, 10 deletions
diff --git a/nixpkgs/pkgs/development/compilers/nextpnr/default.nix b/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
index 357f26cf3141..f0c1ba14c48a 100644
--- a/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
+++ b/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
@@ -14,14 +14,26 @@ let
 in
 with stdenv; mkDerivation rec {
   pname = "nextpnr";
-  version = "2019.08.31";
+  version = "2019.10.13";
 
-  src = fetchFromGitHub {
-    owner  = "yosyshq";
-    repo   = "nextpnr";
-    rev    = "c0b7379e8672b6263152d5e340e62f22179fdc8b";
-    sha256 = "174n962xiwyzy53cn192h9rq95h951k3xy6bs43p5ya592ai5mjh";
-  };
+  srcs = [
+    (fetchFromGitHub {
+      owner  = "YosysHQ";
+      repo   = "nextpnr";
+      rev    = "c365dd1cabc3a4308ab9110534918623622c246b";
+      sha256 = "1344pyq9xb5y1vxsnfgr488drfjsa6ls1jck0z9hwam6vg55s10r";
+      name   = "nextpnr";
+    })
+    (fetchFromGitHub {
+      owner  = "YosysHQ";
+      repo   = "nextpnr-tests";
+      rev    = "8f93e7e0f897b1b5da469919c9a43ba28b623b2a";
+      sha256 = "0zpd0w49k9l7rs3wmi2v8z5s4l4lad5rprs5l83w13667himpzyc";
+      name   = "nextpnr-tests";
+    })
+  ];
+
+  sourceRoot = "nextpnr";
 
   nativeBuildInputs
      = [ cmake ]
@@ -34,14 +46,13 @@ with stdenv; mkDerivation rec {
   enableParallelBuilding = true;
   cmakeFlags =
     [ "-DARCH=generic;ice40;ecp5"
+      "-DBUILD_TESTS=ON"
       "-DICEBOX_ROOT=${icestorm}/share/icebox"
       "-DTRELLIS_ROOT=${trellis}/share/trellis"
       "-DPYTRELLIS_LIBDIR=${trellis}/lib/trellis"
       "-DUSE_OPENMP=ON"
       # warning: high RAM usage
       "-DSERIALIZE_CHIPDB=OFF"
-      # use PyPy for icestorm if enabled
-      "-DPYTHON_EXECUTABLE=${icestorm.pythonInterp}"
     ]
     ++ (lib.optional (!enableGui) "-DBUILD_GUI=OFF")
     ++ (lib.optional (enableGui && stdenv.isDarwin)
@@ -51,9 +62,18 @@ with stdenv; mkDerivation rec {
   # but works ok. We should probably make this overrideable upstream.
   patchPhase = with builtins; ''
     substituteInPlace ./CMakeLists.txt \
-      --replace 'git log -1 --format=%h' 'echo ${substring 0 11 src.rev}'
+      --replace 'git log -1 --format=%h' 'echo ${substring 0 11 (elemAt srcs 0).rev}'
+
+    # use PyPy for icestorm if enabled
+    substituteInPlace ./ice40/family.cmake \
+      --replace ''\'''${PYTHON_EXECUTABLE}' '${icestorm.pythonInterp}'
+  '';
+
+  preBuild = ''
+    ln -s ../nextpnr-tests tests
   '';
 
+  doCheck = true;
 
   postFixup = lib.optionalString enableGui ''
     wrapQtApp $out/bin/nextpnr-generic