nextpnr: fix GUI

This commit is contained in:
Emily 2019-08-19 22:02:35 -07:00 committed by Austin Seipp
parent 35994c61d6
commit c1620c4635
2 changed files with 16 additions and 17 deletions

View File

@ -2,17 +2,15 @@
, boost, python3, eigen , boost, python3, eigen
, icestorm, trellis , icestorm, trellis
# TODO(thoughtpolice) Currently the GUI build seems broken at runtime on my , enableGui ? true
# laptop (and over a remote X server on my server...), so mark it broken for , wrapQtAppsHook
# now, with intent to fix later. , qtbase
, enableGui ? false
, qtbase, wrapQtAppsHook
}: }:
let let
boostPython = boost.override { python = python3; enablePython = true; }; boostPython = boost.override { python = python3; enablePython = true; };
in in
stdenv.mkDerivation rec { with stdenv; mkDerivation rec {
pname = "nextpnr"; pname = "nextpnr";
version = "2019.08.21"; version = "2019.08.21";
@ -25,10 +23,10 @@ stdenv.mkDerivation rec {
nativeBuildInputs nativeBuildInputs
= [ cmake ] = [ cmake ]
++ (stdenv.lib.optional enableGui wrapQtAppsHook); ++ (lib.optional enableGui wrapQtAppsHook);
buildInputs buildInputs
= [ boostPython python3 eigen ] = [ boostPython python3 eigen ]
++ (stdenv.lib.optional enableGui qtbase); ++ (lib.optional enableGui qtbase);
enableParallelBuilding = true; enableParallelBuilding = true;
cmakeFlags = cmakeFlags =
@ -41,7 +39,7 @@ stdenv.mkDerivation rec {
"-DSERIALIZE_CHIPDB=OFF" "-DSERIALIZE_CHIPDB=OFF"
# use PyPy for icestorm if enabled # use PyPy for icestorm if enabled
"-DPYTHON_EXECUTABLE=${icestorm.pythonInterp}" "-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 # Fix the version number. This is a bit stupid (and fragile) in practice
# but works ok. We should probably make this overrideable upstream. # 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}' --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"; description = "Place and route tool for FPGAs";
homepage = https://github.com/yosyshq/nextpnr; homepage = https://github.com/yosyshq/nextpnr;
license = licenses.isc; license = licenses.isc;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ thoughtpolice emily ]; maintainers = with maintainers; [ thoughtpolice emily ];
broken = enableGui;
}; };
} }

View File

@ -8175,11 +8175,7 @@ in
neko = callPackage ../development/compilers/neko { }; neko = callPackage ../development/compilers/neko { };
nextpnr = libsForQt5.callPackage ../development/compilers/nextpnr { 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;
};
nasm = callPackage ../development/compilers/nasm { }; nasm = callPackage ../development/compilers/nasm { };