From 0fc96fdb97a1c8a48edfff53675364f8df4b394d Mon Sep 17 00:00:00 2001 From: Karl Hallsby Date: Fri, 2 Oct 2026 16:35:33 -0500 Subject: [PATCH] octavePackages.optim: Fix build When fetching optim's release tarball, there are pre-generated configuration files in there. Previously, these would be used by our build system just fine. But, with Octave 11.1.0 and octavePackages.datatypes 1.5.0, there were compilation errors about incorrect names. To fix this, we discard the provided generated files and generate our own. --- .../octave-modules/optim/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/development/octave-modules/optim/default.nix b/pkgs/development/octave-modules/optim/default.nix index f9f587df1a75..1b1a1662e3e9 100644 --- a/pkgs/development/octave-modules/optim/default.nix +++ b/pkgs/development/octave-modules/optim/default.nix @@ -4,6 +4,7 @@ fetchurl, struct, statistics, + autoreconfHook, lapack, blas, }: @@ -17,6 +18,10 @@ buildOctavePackage rec { sha256 = "sha256-Wfs3caLSojE0R1MsWaLgAKanu3pnfz74GD+6qrVJOhQ="; }; + nativeBuildInputs = [ + autoreconfHook + ]; + buildInputs = [ lapack blas @@ -27,6 +32,19 @@ buildOctavePackage rec { statistics ]; + # autoreconfHook provides an autoreconfPhase that is run as a + # preconfigurePhase, which means it runs AFTER the source is un-tarred, and + # before buildOctavePackage's buildPhase re-tars it up into a format for later + # consumption by Octave's "pkg build" command. + preAutoreconf = '' + pushd src + # Remove any files upstream generated for distribution. + rm config.* + ''; + postAutoreconf = '' + popd + ''; + meta = { homepage = "https://gnu-octave.github.io/packages/optim/"; license = with lib.licenses; [