3
0
Fork 0
forked from mirrors/nixpkgs

nextpnr: 2020.12.01 -> 2021.01.02, bugfixes, no GUI by default

Upstream NextPNR has moved to disable the GUI by default; it tends to
cause the most complications/bug reports and has various complexities
and failure modes (e.g. I've still had problems getting it working
efficiently on my Ice Lake laptop.)

Instead, disable GUI support by default, and add a new `nextpnrWithGui`
derivation that enables it. This cuts the closure size down by 40ish
percent (~800MB -> ~500MB) and makes it a neglibile amount faster.

It also fixes two bugs:

  1) We were using the old `ICEBOX_ROOT` parameter for ice40 support,
     now known as `ICESTORM_ICE40_PREFIX`, and

  2) the CMake option `SERIALIZE_CHIPDB` was renamed to `..._CHIPDBS`
     (with an 'S' suffix) which should speed up the build at the cost
     of RAM usage

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2021-01-03 05:32:11 -06:00
parent b7c5fe8741
commit 3dbe656a25
No known key found for this signature in database
GPG key ID: 25D2038DEB08021D
2 changed files with 13 additions and 10 deletions

View file

@ -3,9 +3,9 @@
, icestorm, trellis , icestorm, trellis
, llvmPackages , llvmPackages
, enableGui ? true , enableGui ? false
, wrapQtAppsHook , wrapQtAppsHook ? null
, qtbase , qtbase ? null
, OpenGL ? null , OpenGL ? null
}: }:
@ -14,14 +14,14 @@ let
in in
with stdenv; mkDerivation rec { with stdenv; mkDerivation rec {
pname = "nextpnr"; pname = "nextpnr";
version = "2020.12.01"; version = "2021.01.02";
srcs = [ srcs = [
(fetchFromGitHub { (fetchFromGitHub {
owner = "YosysHQ"; owner = "YosysHQ";
repo = "nextpnr"; repo = "nextpnr";
rev = "868902fbdf0b476bdccf4d25cbb80ba602d2cc11"; rev = "9b9628047c01a970cfe20f83f2b7129ed109440d";
sha256 = "1kb5lhixb7f4q800gjyw9xm9ff1yaq3pgna17f5f0bw6b4ds56zc"; sha256 = "0pcv96d0n40h2ipywi909hpzlys5b6r4pamc320qk1xxhppmgkmm";
name = "nextpnr"; name = "nextpnr";
}) })
(fetchFromGitHub { (fetchFromGitHub {
@ -48,14 +48,14 @@ with stdenv; mkDerivation rec {
[ "-DCURRENT_GIT_VERSION=${lib.substring 0 7 (lib.elemAt srcs 0).rev}" [ "-DCURRENT_GIT_VERSION=${lib.substring 0 7 (lib.elemAt srcs 0).rev}"
"-DARCH=generic;ice40;ecp5" "-DARCH=generic;ice40;ecp5"
"-DBUILD_TESTS=ON" "-DBUILD_TESTS=ON"
"-DICEBOX_ROOT=${icestorm}/share/icebox" "-DICESTORM_INSTALL_PREFIX=${icestorm}"
"-DTRELLIS_INSTALL_PREFIX=${trellis}" "-DTRELLIS_INSTALL_PREFIX=${trellis}"
"-DTRELLIS_LIBDIR=${trellis}/lib/trellis" "-DTRELLIS_LIBDIR=${trellis}/lib/trellis"
"-DUSE_OPENMP=ON" "-DUSE_OPENMP=ON"
# warning: high RAM usage # warning: high RAM usage
"-DSERIALIZE_CHIPDB=OFF" "-DSERIALIZE_CHIPDBS=OFF"
] ]
++ (lib.optional (!enableGui) "-DBUILD_GUI=OFF") ++ (lib.optional enableGui "-DBUILD_GUI=ON")
++ (lib.optional (enableGui && stdenv.isDarwin) ++ (lib.optional (enableGui && stdenv.isDarwin)
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"); "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks");

View file

@ -10076,7 +10076,10 @@ in
neko = callPackage ../development/compilers/neko { }; neko = callPackage ../development/compilers/neko { };
nextpnr = libsForQt5.callPackage ../development/compilers/nextpnr { nextpnr = callPackage ../development/compilers/nextpnr { };
nextpnrWithGui = libsForQt5.callPackage ../development/compilers/nextpnr {
enableGui = true;
inherit (darwin.apple_sdk.frameworks) OpenGL; inherit (darwin.apple_sdk.frameworks) OpenGL;
}; };