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.
This commit is contained in:
Karl Hallsby
2026-10-02 16:35:33 -05:00
parent 850809813a
commit 0fc96fdb97

View File

@@ -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; [