Change:
I'm trying to build octave with QT5 and with GUI (of course, when I try to build it with GUI, right?). Unfortunately, after the build: Apply this patch: and then system: host os: multi-user?: sandbox: version: channels(m): nixpkgs:
I just noticed that I do not even get the GUI feature when building octave from nixpkgs (neither nor has a GUI).
Pinging: touched the package recently, is the maintainer of the package.
I’ll try to have a look when I have some time. I’ll let you know what I can achieve.
Here is what the configure script says:
yes, I got that and I fixed it. See for my attempt to build with Qt5 (which succeeds, but starting octave with gui fails - see PR).

Discussion:
<del> { stdenv, fetchurl, gfortran, readline, ncurses, perl, flex, texinfo, qhull , libsndfile, portaudio, libX11, graphicsmagick, pcre, pkgconfig, libGL, libGLU, fltk , fftw, fftwSinglePrec, zlib, curl, qrupdate, openblas, arpack, libwebp, gl2ps , qt ? null, qscintilla ? null, ghostscript ? null, llvm ? null, hdf5 ? null,glpk ? null , suitesparse ? null, gnuplot ? null, jdk ? null, python ? null, overridePlatforms ? null </del> <ins> { stdenv , fetchurl , gfortran , readline , ncurses , perl , flex , texinfo , qhull , libsndfile , portaudio , libX11 , graphicsmagick , pcre , pkgconfig , libGL , libGLU , fltk # Both are needed for discrete Fourier transform , fftw , fftwSinglePrec , zlib , curl , qrupdate , openblas , arpack , libwebp , gl2ps , ghostscript ? null , hdf5 ? null , glpk ? null , suitesparse ? null , gnuplot ? null , jdk ? null , python ? null , overridePlatforms ? null , sundials_2 ? null # Qt / GUI is disabled by default , enableQt ? false , qtbase ? null , qtsvg ? null , qtscript ? null , qscintilla ? null , qttools ? null # JIT is disabled by default , enableJIT ? false , llvm ? null </ins> }: let

stdenv.mkDerivation rec { version = "5.2.0"; pname = "octave"; src = fetchurl { url = "mirror://gnu/octave/${pname}-${version}.tar.gz"; sha256 = "1qcmcpsq1lfka19fxzvxjwjhg113c39a9a0x8plkhvwdqyrn5sig"; }; <del> buildInputs = [ gfortran readline ncurses perl flex texinfo qhull graphicsmagick pcre pkgconfig fltk zlib curl openblas libsndfile fftw fftwSinglePrec portaudio qrupdate arpack libwebp gl2ps ] ++ (stdenv.lib.optional (qt != null) qt) ++ (stdenv.lib.optional (qscintilla != null) qscintilla) ++ (stdenv.lib.optional (ghostscript != null) ghostscript) ++ (stdenv.lib.optional (llvm != null) llvm) ++ (stdenv.lib.optional (hdf5 != null) hdf5) ++ (stdenv.lib.optional (glpk != null) glpk) ++ (stdenv.lib.optional (suitesparse != null) suitesparse) ++ (stdenv.lib.optional (jdk != null) jdk) ++ (stdenv.lib.optional (gnuplot != null) gnuplot) ++ (stdenv.lib.optional (python != null) python) ++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]) ; # makeinfo is required by Octave at runtime to display help prePatch = '' substituteInPlace libinterp/corefcn/help.cc  --replace 'Vmakeinfo_program = "makeinfo"'  'Vmakeinfo_program = "${texinfo}/bin/makeinfo"' ''; </del> <ins> buildInputs = [ readline ncurses perl flex qhull graphicsmagick pcre fltk zlib curl openblas libsndfile fftw fftwSinglePrec portaudio qrupdate arpack libwebp gl2ps ] ++ (stdenv.lib.optionals enableQt [ qtbase qtsvg qscintilla ]) ++ (stdenv.lib.optional (ghostscript != null) ghostscript) ++ (stdenv.lib.optional (hdf5 != null) hdf5) ++ (stdenv.lib.optional (glpk != null) glpk) ++ (stdenv.lib.optional (suitesparse != null) suitesparse) ++ (stdenv.lib.optional (jdk != null) jdk) ++ (stdenv.lib.optional (sundials_2 != null) sundials_2) ++ (stdenv.lib.optional (gnuplot != null) gnuplot) ++ (stdenv.lib.optional (python != null) python) ++ (stdenv.lib.optionals (!stdenv.isDarwin) [ libGL libGLU libX11 ]) ; nativeBuildInputs = [ pkgconfig gfortran # Listed here as well because it's outputs are split fftw fftwSinglePrec texinfo ] ++ (stdenv.lib.optional (sundials_2 != null) sundials_2) ++ (stdenv.lib.optional enableJIT llvm) ++ (stdenv.lib.optionals enableQt [ qtscript qttools ]) ; </ins> doCheck = !stdenv.isDarwin;

# See https://savannah.gnu.org/bugs/?50339 F77_INTEGER_8_FLAG = if openblas.blas64 then "-fdefault-integer-8" else ""; <del> configureFlags = [ "--enable-readline" "--enable-dl" "--with-blas=openblas" "--with-lapack=openblas" ] ++ stdenv.lib.optional openblas.blas64 "--enable-64" ++ stdenv.lib.optionals stdenv.isDarwin ["--with-x=no"] ; </del> <ins> configureFlags = [ "--enable-readline" "--with-blas=openblas" "--with-lapack=openblas" ] ++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ] ++ stdenv.lib.optionals enableQt [ "--with-qt=5" ] ++ stdenv.lib.optionals enableJIT [ "--enable-jit" ] ; </ins> # Keep a copy of the octave tests detailed results in the output # derivation, because someone may care

license = stdenv.lib.licenses.gpl3Plus; maintainers = with stdenv.lib.maintainers; [raskin]; description = "Scientific Pragramming Language"; <ins> # https://savannah.gnu.org/bugs/?func=detailitem&item_id=56425 is the best attempt to fix JIT broken = enableJIT; </ins> platforms = if overridePlatforms == null then (with stdenv.lib.platforms; linux ++ darwin) else overridePlatforms;

<ins> { stdenv , cmake , fetchurl , python # GNU Octave needs KLU for ODE solvers , suitesparse , liblapack , gfortran , lapackSupport ? true }: let liblapackShared = liblapack.override { shared = true; }; in stdenv.mkDerivation rec { pname = "sundials"; version = "2.7.0"; buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran suitesparse ]; nativeBuildInputs = [ cmake ]; src = fetchurl { url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz"; sha256 = "01513g0j7nr3rh7hqjld6mw0mcx5j9z9y87bwjc16w2x2z3wm7yk"; }; patches = [ (fetchurl { # https://github.com/LLNL/sundials/pull/19 url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; }) ]; cmakeFlags = [ "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" ] ++ stdenv.lib.optionals (lapackSupport) [ "-DSUNDIALS_INDEX_TYPE=int32_t" # GNU Octave needs KLU for ODE solvers "-DKLU_ENABLE=ON" "-DKLU_INCLUDE_DIR=${suitesparse}/include" "-DKLU_LIBRARY_DIR=${suitesparse}/lib" "-DLAPACK_ENABLE=ON" "-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; # flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3 doCheck = false; checkPhase = "make test"; meta = with stdenv.lib; { description = "Suite of nonlinear differential/algebraic equation solvers"; homepage    = https://computation.llnl.gov/projects/sundials; platforms   = platforms.all; maintainers = with maintainers; [ flokli idontgetoutmuch ]; license     = licenses.bsd3; }; } </ins>

git = gitMinimal; }; <ins> # Build summary for this flavor # - Build Octave Qt GUI:                  no (missing:QtCore QtGui QtNetwork QtHelp QtXml) # - JIT compiler for loops:               no # - Build Java interface:                 yes # - Build static libraries:               no # - Build shared libraries:               yes # - Dynamic Linking API:                  dlopen # - Include support for GNU readline:     yes # - 64-bit array dims and indexing:       yes # - 64-bit BLAS array dims and indexing:  yes # - OpenMP SMP multithreading:            yes # - Truncate intermediate FP results:     yes # - Build cross tools:                    no # - Build docs:                           yes </ins> octave = callPackage ../development/interpreters/octave { <del> qt = null; qscintilla = null; ghostscript = null; graphicsmagick = null; llvm = null; hdf5 = null; glpk = null; suitesparse = null; jdk = null; </del> <ins> python = python3; </ins> openblas = if stdenv.isDarwin then openblasCompat else openblas; }; <del> octaveFull = (lowPrio (octave.override { qt = qt4; inherit qscintilla; overridePlatforms = ["x86_64-linux" "x86_64-darwin"]; </del> <ins> # Build summary for this flavor # - Build Octave Qt GUI:                  no (missing:QtCore QtGui QtNetwork QtHelp QtXml) # - JIT compiler for loops:               yes # - Build Java interface:                 yes # - Build static libraries:               no # - Build shared libraries:               yes # - Dynamic Linking API:                  dlopen # - Include support for GNU readline:     yes # - 64-bit array dims and indexing:       yes # - 64-bit BLAS array dims and indexing:  yes # - OpenMP SMP multithreading:            yes # - Truncate intermediate FP results:     yes # - Build cross tools:                    no # - Build docs:                           yes octave-jit = callPackage ../development/interpreters/octave { python = python3; </ins> openblas = if stdenv.isDarwin then openblasCompat else openblas; <ins> enableJIT = true; }; # Build summary for this flavor # - Build Octave Qt GUI:                  yes # - JIT compiler for loops:               no # - Build Java interface:                 yes # - Build static libraries:               no # - Build shared libraries:               yes # - Dynamic Linking API:                  dlopen # - Include support for GNU readline:     yes # - 64-bit array dims and indexing:       yes # - 64-bit BLAS array dims and indexing:  yes # - OpenMP SMP multithreading:            yes # - Truncate intermediate FP results:     yes # - Build cross tools:                    no # - Build docs:                           yes # Build summary for this flavor octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave { python = python3; openblas = if stdenv.isDarwin then openblasCompat else openblas; enableQt = true; overridePlatforms = ["x86_64-linux" "x86_64-darwin"]; </ins> })); ocropus = callPackage ../applications/misc/ocropus { };

sundials = callPackage ../development/libraries/sundials { }; <ins> sundials_2 = callPackage ../development/libraries/sundials/2.x.nix { python = python3; }; </ins> sutils = callPackage ../tools/misc/sutils { }; svrcore = callPackage ../development/libraries/svrcore { };