From 3dbe656a25fe095f630b9e6a0b6a72f64c3bb09f Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Sun, 3 Jan 2021 05:32:11 -0600 Subject: [PATCH] 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 --- pkgs/development/compilers/nextpnr/default.nix | 18 +++++++++--------- pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/nextpnr/default.nix b/pkgs/development/compilers/nextpnr/default.nix index 664ceb79636f..e50ac50dc57d 100644 --- a/pkgs/development/compilers/nextpnr/default.nix +++ b/pkgs/development/compilers/nextpnr/default.nix @@ -3,9 +3,9 @@ , icestorm, trellis , llvmPackages -, enableGui ? true -, wrapQtAppsHook -, qtbase +, enableGui ? false +, wrapQtAppsHook ? null +, qtbase ? null , OpenGL ? null }: @@ -14,14 +14,14 @@ let in with stdenv; mkDerivation rec { pname = "nextpnr"; - version = "2020.12.01"; + version = "2021.01.02"; srcs = [ (fetchFromGitHub { owner = "YosysHQ"; repo = "nextpnr"; - rev = "868902fbdf0b476bdccf4d25cbb80ba602d2cc11"; - sha256 = "1kb5lhixb7f4q800gjyw9xm9ff1yaq3pgna17f5f0bw6b4ds56zc"; + rev = "9b9628047c01a970cfe20f83f2b7129ed109440d"; + sha256 = "0pcv96d0n40h2ipywi909hpzlys5b6r4pamc320qk1xxhppmgkmm"; name = "nextpnr"; }) (fetchFromGitHub { @@ -48,14 +48,14 @@ with stdenv; mkDerivation rec { [ "-DCURRENT_GIT_VERSION=${lib.substring 0 7 (lib.elemAt srcs 0).rev}" "-DARCH=generic;ice40;ecp5" "-DBUILD_TESTS=ON" - "-DICEBOX_ROOT=${icestorm}/share/icebox" + "-DICESTORM_INSTALL_PREFIX=${icestorm}" "-DTRELLIS_INSTALL_PREFIX=${trellis}" "-DTRELLIS_LIBDIR=${trellis}/lib/trellis" "-DUSE_OPENMP=ON" # 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) "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0321d183b91e..ed1f7b275dc1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10076,7 +10076,10 @@ in 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; };