From 118b3803909461a377095c98a9723ea0507d752b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 11:52:33 +0300 Subject: [PATCH 1/6] octave: remove unused arguments --- pkgs/development/interpreters/octave/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index aac3d80afcfe..d14246ef6df8 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -53,8 +53,6 @@ # - Packages required for building extra packages. newScope, callPackage, - makeSetupHook, - makeWrapper, # - Build Octave Qt GUI: enableQt ? false, libsForQt5, From a69a2642664b72ac87ebe7869a5d5f1909957717 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 11:47:17 +0300 Subject: [PATCH 2/6] octaveFull: upgrade to Qt6 --- .../interpreters/octave/default.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index d14246ef6df8..ead5284f6bde 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -55,7 +55,7 @@ callPackage, # - Build Octave Qt GUI: enableQt ? false, - libsForQt5, + qt6Packages, libiconv, }: @@ -140,9 +140,10 @@ stdenv.mkDerivation (finalAttrs: { python3 ] ++ lib.optionals enableQt [ - libsForQt5.qtbase - libsForQt5.qtsvg - libsForQt5.qscintilla + qt6Packages.qtbase + qt6Packages.qtsvg + qt6Packages.qt5compat + qt6Packages.qscintilla ] ++ lib.optionals enableJava [ jdk @@ -165,9 +166,8 @@ stdenv.mkDerivation (finalAttrs: { texinfo ] ++ lib.optionals enableQt [ - libsForQt5.wrapQtAppsHook - libsForQt5.qtscript - libsForQt5.qttools + qt6Packages.wrapQtAppsHook + qt6Packages.qttools ]; doCheck = !stdenv.hostPlatform.isDarwin; @@ -186,6 +186,12 @@ stdenv.mkDerivation (finalAttrs: { F77_INTEGER_8_FLAG = "-fdefault-integer-8"; }; + # Otherwise `qhelpgenerator` executable is not detected, and Qt support is + # not enabled. + preConfigure = '' + export PATH="$PATH:${qt6Packages.qttools}/libexec" + ''; + configureFlags = [ "--with-blas=blas" "--with-lapack=lapack" @@ -193,7 +199,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals enableReadline [ "--enable-readline" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ] - ++ lib.optionals enableQt [ "--with-qt=5" ]; + ++ lib.optionals enableQt [ "--with-qt=6" ]; # Keep a copy of the octave tests detailed results in the output # derivation, because someone may care From 76657f9584364e55f1bf07d46a282995ad0925c4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 11:51:30 +0300 Subject: [PATCH 3/6] octave: use lib functions for configureFlags --- pkgs/development/interpreters/octave/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index ead5284f6bde..4a1ceb403973 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -193,13 +193,13 @@ stdenv.mkDerivation (finalAttrs: { ''; configureFlags = [ - "--with-blas=blas" - "--with-lapack=lapack" - (if use64BitIdx then "--enable-64" else "--disable-64") + (lib.withFeatureAs true "blas" "blas") + (lib.withFeatureAs true "lapack" "lapack") + (lib.enableFeature use64BitIdx "64") + (lib.enableFeature enableReadline "readline") + (lib.withFeatureAs enableQt "qt" (lib.versions.major qt6Packages.qtbase.version)) ] - ++ lib.optionals enableReadline [ "--enable-readline" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ] - ++ lib.optionals enableQt [ "--with-qt=6" ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ]; # Keep a copy of the octave tests detailed results in the output # derivation, because someone may care From 541264e6b4ac3dca39284fea267d92c49ed694ff Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 13:32:36 +0300 Subject: [PATCH 4/6] octave: Explain why --with-x=no id added for Darwin --- pkgs/development/interpreters/octave/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index 4a1ceb403973..d23f0e0c43e6 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -199,6 +199,22 @@ stdenv.mkDerivation (finalAttrs: { (lib.enableFeature enableReadline "readline") (lib.withFeatureAs enableQt "qt" (lib.versions.major qt6Packages.qtbase.version)) ] + # Ideally octave would have realized by itself that x is irrelevant for + # darwin, but from some reason without this flag the build fails with a + # compilation error: + # + # In file included from libinterp/dldfcn/__init_fltk__.cc:74: + # In file included from /nix/store/3r8msa1x0x08rgf075vig01w1i2lkbhm-fltk-1.3.11/include/FL/fl_draw.H:27: + # In file included from /nix/store/3r8msa1x0x08rgf075vig01w1i2lkbhm-fltk-1.3.11/include/FL/x.H:30: + # /nix/store/3r8msa1x0x08rgf075vig01w1i2lkbhm-fltk-1.3.11/include/FL/mac.H:32:25: error: typedef redefinition with different types ('class FLWindow *' vs 'XID' (aka 'unsigned long')) + # 32 | typedef class FLWindow *Window; // pointer to the FLWindow objective-c class + # | ^ + # /nix/store/mqyaq13d0h4c8hia4bjgpn02by26nb8q-xorgproto-2025.1/include/X11/X.h:96:13: note: previous definition is here + # 96 | typedef XID Window; + # | ^ + # CXX libinterp/dldfcn/__init_gnuplot___la-__init_gnuplot__.lo + # 1 error generated. + # ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--with-x=no" ]; # Keep a copy of the octave tests detailed results in the output From 7b081457ee7f6e7250af063a70b806986821edcf Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 13:09:56 +0300 Subject: [PATCH 5/6] octaveFull: spare a few homeshelter warnings from checkPhase --- .../interpreters/octave/default.nix | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index d23f0e0c43e6..a34c92e68320 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -57,6 +57,10 @@ enableQt ? false, qt6Packages, libiconv, + + # tests + writableTmpDirAsHomeHook, + makeFontsConf, }: let @@ -172,19 +176,34 @@ stdenv.mkDerivation (finalAttrs: { doCheck = !stdenv.hostPlatform.isDarwin; + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ]; + enableParallelBuilding = true; - env = - lib.optionalAttrs stdenv.hostPlatform.isDarwin { - # Fix linker error on Darwin (see https://trac.macports.org/ticket/61865) - NIX_LDFLAGS = "-lobjc"; - # https://savannah.gnu.org/bugs/index.php?68042 - NIX_CFLAGS_COMPILE = "-Wno-format-security"; - } - // lib.optionalAttrs use64BitIdx { - # See https://savannah.gnu.org/bugs/?50339 - F77_INTEGER_8_FLAG = "-fdefault-integer-8"; - }; + env = { + # gnuplot (invoked by the test suite) requires a fontconfig config + # file to exist, or else it errors with "Fontconfig error: Cannot + # load default config file: File not found". No fonts are actually + # needed to avoid this. + FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; }; + # gnuplot's degree sign handling requires a UTF-8 locale, or else it + # errors with "warning: iconv failed to convert degree sign". + # C.UTF-8 is built into glibc itself, so no extra locale-archive + # dependency is needed. + LC_ALL = "C.UTF-8"; + } + // lib.optionalAttrs stdenv.hostPlatform.isDarwin { + # Fix linker error on Darwin (see https://trac.macports.org/ticket/61865) + NIX_LDFLAGS = "-lobjc"; + # https://savannah.gnu.org/bugs/index.php?68042 + NIX_CFLAGS_COMPILE = "-Wno-format-security"; + } + // lib.optionalAttrs use64BitIdx { + # See https://savannah.gnu.org/bugs/?50339 + F77_INTEGER_8_FLAG = "-fdefault-integer-8"; + }; # Otherwise `qhelpgenerator` executable is not detected, and Qt support is # not enabled. From 129491e117a452a538b67eae6cb77fe60a5d159a Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 17 Sep 2026 14:25:46 +0300 Subject: [PATCH 6/6] octaveFull: avoid a XDG_RUNTIME_DIR check phase warning --- pkgs/development/interpreters/octave/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index a34c92e68320..2193523fcd22 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -180,6 +180,14 @@ stdenv.mkDerivation (finalAttrs: { writableTmpDirAsHomeHook ]; + # When built with Qt support, Qt's platform integration probes Wayland at + # startup, which gives a harmless, but slightly spamming error: + # + # XDG_RUNTIME_DIR is invalid or not set in the environment + preCheck = lib.optionalString enableQt '' + export XDG_RUNTIME_DIR=$TMPDIR + ''; + enableParallelBuilding = true; env = {