Markus Mützel d5be489e99
octave: update to 10.3.0 (#25824)
* octave: update to 10.3.0

* octave: use GNU mirrors to download tarball

The GNU servers are intermittently unavailable or extremely slow in recent
months. Download the source tarball from one of the mirrors instead.
2025-10-06 20:13:52 +02:00

143 lines
5.3 KiB
Bash

# Maintainer: Markus Mützel <markus.muetzel@gmx.de>
_realname=octave
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=10.3.0
pkgrel=1
pkgdesc="GNU Octave: Interactive programming environment for numerical computations (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.octave.org"
msys2_repository_url="https://github.com/gnu-octave/octave"
msys2_references=(
'archlinux: octave'
)
license=('spdx:GPL-3.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs"
$([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")
"${MINGW_PACKAGE_PREFIX}-arpack"
"${MINGW_PACKAGE_PREFIX}-curl"
"${MINGW_PACKAGE_PREFIX}-fftw"
"${MINGW_PACKAGE_PREFIX}-fontconfig"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-ghostscript"
"${MINGW_PACKAGE_PREFIX}-gl2ps"
"${MINGW_PACKAGE_PREFIX}-glpk"
"${MINGW_PACKAGE_PREFIX}-graphicsmagick"
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-libiconv"
"${MINGW_PACKAGE_PREFIX}-libsndfile"
"${MINGW_PACKAGE_PREFIX}-omp"
"${MINGW_PACKAGE_PREFIX}-openblas"
"${MINGW_PACKAGE_PREFIX}-pcre2"
"${MINGW_PACKAGE_PREFIX}-qhull"
"${MINGW_PACKAGE_PREFIX}-qrupdate"
$([[ ${CARCH} == i686 ]] && echo \
"${MINGW_PACKAGE_PREFIX}-qscintilla-qt5" \
"${MINGW_PACKAGE_PREFIX}-qt5-base" \
"${MINGW_PACKAGE_PREFIX}-qt5-tools" || echo \
"${MINGW_PACKAGE_PREFIX}-qscintilla-qt6" \
"${MINGW_PACKAGE_PREFIX}-qt6-base" \
"${MINGW_PACKAGE_PREFIX}-qt6-tools")
"${MINGW_PACKAGE_PREFIX}-readline"
"${MINGW_PACKAGE_PREFIX}-suitesparse"
"${MINGW_PACKAGE_PREFIX}-sundials"
"texinfo"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-fc"
"${MINGW_PACKAGE_PREFIX}-gnuplot"
"${MINGW_PACKAGE_PREFIX}-gperf"
"${MINGW_PACKAGE_PREFIX}-fltk"
"${MINGW_PACKAGE_PREFIX}-portaudio"
"${MINGW_PACKAGE_PREFIX}-rapidjson")
checkdepends=("unzip"
"zip")
optdepends=("unzip: for decompressing .zip archives"
"zip: for compressing .zip archives"
"${MINGW_PACKAGE_PREFIX}-epstool: eps output with tight bounding box"
"${MINGW_PACKAGE_PREFIX}-fltk: alternative plotting and dialogs"
"${MINGW_PACKAGE_PREFIX}-gnuplot: alternative plotting"
"${MINGW_PACKAGE_PREFIX}-portaudio: audio support")
source=(https://ftpmirror.gnu.org/gnu/octave/octave-$pkgver.tar.xz{,.sig}
"0003-no-community-support.patch"
"0005-makeinfo-perl.patch")
validpgpkeys=('DBD9C84E39FE1AAE99F04446B05F05B75D36644B') # John W. Eaton
sha256sums=('92ae9bf2edcd288bd2df9fd0b4f7aa719b49d3940fceb154c5fdcd846f254da1'
'SKIP'
'e53af21ad087e10a2906506589aab89ab8b43f4e3e4994b4c28e4d8ae83639ad'
'2df9666d75bb8dd4f549ec857c75aa3ec64b21fd3c9aa25a0d4127b284ec6822')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Np1 -i "${srcdir}/$_patch"
done
}
prepare() {
cd "${_realname}-${pkgver}"
apply_patch_with_msg \
0005-makeinfo-perl.patch
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
apply_patch_with_msg \
0003-no-community-support.patch
fi
autoreconf -fiv
}
build() {
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
declare -a _extra_config
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
# Clang seems to require a different set of dllexport attributes than GCC.
_extra_config+=("F77=${MINGW_PREFIX}/bin/flang"
"--disable-lib-visibility-flags")
# The headers from some dependent libraries (graphicsmagick++?) cause a
# torrent of warnings about deprecated declarations. Sometimes to the
# point where the build crashes with garbled characters in the terminal
# output for some reason. Same issue with dllimport attributes at
# inlined functions and implicit conversion from 'const char16_t' to
# 'char32_t' in Qt6 headers. Just calling `make all -j2` again in the build
# tree lets the compilation finish successfully.
# Disable those warnings as a work-around.
CXXFLAGS+=" -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-character-conversion"
fi
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--enable-shared \
--disable-static \
--enable-relocate-all \
"${_extra_config[@]}" \
octave_cv_fftw3_threads_lib="-lfftw3_omp" \
octave_cv_fftw3f_threads_lib="-lfftw3f_omp" \
JAVA_HOME=""
PERL5SHELL="bash -l -c" make all
}
check() {
cd "${srcdir}"/build-${MSYSTEM}
make check || true
}
package() {
make -C "build-${MSYSTEM}" DESTDIR="${pkgdir}" install
install -D -m644 "${srcdir}"/${_realname}-${pkgver}/COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
# Remove full path reference
local _PREFIX_WIN="$(cygpath -wm ${MINGW_PREFIX})"
for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do
sed -s "s|${_PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pcfile}"
done
}