From c1620c4635e3d4fb52a698a16c0c9faaad3dde00 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 19 Aug 2019 22:02:35 -0700 Subject: [PATCH] nextpnr: fix GUI --- .../development/compilers/nextpnr/default.nix | 27 ++++++++++--------- pkgs/top-level/all-packages.nix | 6 +---- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/pkgs/development/compilers/nextpnr/default.nix b/pkgs/development/compilers/nextpnr/default.nix index 7ce57146cf8..c1e01ef7782 100644 --- a/pkgs/development/compilers/nextpnr/default.nix +++ b/pkgs/development/compilers/nextpnr/default.nix @@ -2,17 +2,15 @@ , boost, python3, eigen , icestorm, trellis -# TODO(thoughtpolice) Currently the GUI build seems broken at runtime on my -# laptop (and over a remote X server on my server...), so mark it broken for -# now, with intent to fix later. -, enableGui ? false -, qtbase, wrapQtAppsHook +, enableGui ? true +, wrapQtAppsHook +, qtbase }: let boostPython = boost.override { python = python3; enablePython = true; }; in -stdenv.mkDerivation rec { +with stdenv; mkDerivation rec { pname = "nextpnr"; version = "2019.08.21"; @@ -25,10 +23,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] - ++ (stdenv.lib.optional enableGui wrapQtAppsHook); + ++ (lib.optional enableGui wrapQtAppsHook); buildInputs = [ boostPython python3 eigen ] - ++ (stdenv.lib.optional enableGui qtbase); + ++ (lib.optional enableGui qtbase); enableParallelBuilding = true; cmakeFlags = @@ -41,7 +39,7 @@ stdenv.mkDerivation rec { "-DSERIALIZE_CHIPDB=OFF" # use PyPy for icestorm if enabled "-DPYTHON_EXECUTABLE=${icestorm.pythonInterp}" - ] ++ (stdenv.lib.optional (!enableGui) "-DBUILD_GUI=OFF"); + ] ++ (lib.optional (!enableGui) "-DBUILD_GUI=OFF"); # Fix the version number. This is a bit stupid (and fragile) in practice # but works ok. We should probably make this overrideable upstream. @@ -50,13 +48,18 @@ stdenv.mkDerivation rec { --replace 'git log -1 --format=%h' 'echo ${substring 0 11 src.rev}' ''; - meta = with stdenv.lib; { + + postFixup = lib.optionalString enableGui '' + wrapQtApp $out/bin/nextpnr-generic + wrapQtApp $out/bin/nextpnr-ice40 + wrapQtApp $out/bin/nextpnr-ecp5 + ''; + + meta = with lib; { description = "Place and route tool for FPGAs"; homepage = https://github.com/yosyshq/nextpnr; license = licenses.isc; platforms = platforms.all; maintainers = with maintainers; [ thoughtpolice emily ]; - - broken = enableGui; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 74706fc3ebf..f107493bb3d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8175,11 +8175,7 @@ in neko = callPackage ../development/compilers/neko { }; - nextpnr = libsForQt5.callPackage ../development/compilers/nextpnr { - # QT 5.12 has a weird regression involving the floorplanning window having - # a 'blank' or 'transparent' background, so fall back to 5.11 for now. - qtbase = qt511.qtbase; - }; + nextpnr = libsForQt5.callPackage ../development/compilers/nextpnr { }; nasm = callPackage ../development/compilers/nasm { };