From 2c3d2e581a3308a7a3d33687f72f2561f919d0b9 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 21 Feb 2026 12:49:06 +0000 Subject: [PATCH] octave: 10.3.0 -> 11.1.0 octavePackages: Ensure Octave's "pkg install" sees a real file path. Octave 11's "pkg install" command supports more usage methods than previous versions did, including local files, URLs, and unqualified package names. We/Nix pass a path that both is a local file and does not look like a URL. Despite us giving local paths in the shell script, the file path we pass in is not glob-expanded by the shell running the `postBuild` script from `build-env.nix`. This happens Because Bash expansion and globbing do not fire for multiple "rounds" inside of a string. So "$path/*.tar.gz" is given to Octave as `/nix/store/...-octave-...-pkg-.../*.tar.gz`, which is NOT a file we/Nix created. We always need the octave-cli commands to be wrapped up into strings so that Bash does not try to do anything with them. By doing the expansion into a Bash variable before the string expansion, we get the right thing: /nix/store/...-octave-...-pkg-.../pkg-version-arch.tar.gz Co-Authored-By: Karl Hallsby Co-Authored-By: Doron Behar --- pkgs/development/interpreters/octave/build-env.nix | 6 +++++- pkgs/development/interpreters/octave/default.nix | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/octave/build-env.nix b/pkgs/development/interpreters/octave/build-env.nix index 373567d92cc5..a56dcd7dd4df 100644 --- a/pkgs/development/interpreters/octave/build-env.nix +++ b/pkgs/development/interpreters/octave/build-env.nix @@ -69,10 +69,14 @@ buildEnv { touch $out/.octave_packages for path in ${lib.concatStringsSep " " packages}; do if [ -e $path/*.tar.gz ]; then + # Glob-match here so that we grab the paths of all tarballs produced + # by "octave build" in buildOctavePackage's buildPhase. We can then + # Use this list later. + pkg_tarballs=($path/*.tar.gz) $out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \ pkg prefix $out/${octave.octPkgsPath} $out/${octave.octPkgsPath}; \ pfx = pkg (\"prefix\"); \ - pkg install -nodeps -local $path/*.tar.gz" + pkg install -nodeps -local $pkg_tarballs" fi done diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix index 987a08f478ef..3d5a697f35d3 100644 --- a/pkgs/development/interpreters/octave/default.nix +++ b/pkgs/development/interpreters/octave/default.nix @@ -23,6 +23,7 @@ # Both are needed for discrete Fourier transform fftw, fftwSinglePrec, + fast-float, zlib, curl, rapidjson, @@ -99,12 +100,12 @@ let allPkgs = pkgs; in stdenv.mkDerivation (finalAttrs: { - version = "10.3.0"; + version = "11.1.0"; pname = "octave"; src = fetchurl { url = "mirror://gnu/octave/octave-${finalAttrs.version}.tar.gz"; - sha256 = "sha256-L8s43AYuRA8eBsBpu8qEDtRtzI+YPkc+FVj8w4OE7ms="; + sha256 = "sha256-wOfiyRvFcyVkMbLMmJKQub0ThR263VnQrHRxTxM0sOY="; }; postPatch = '' @@ -155,6 +156,9 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fast-float ]; nativeBuildInputs = [ perl @@ -176,6 +180,8 @@ stdenv.mkDerivation (finalAttrs: { 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