Skip to content

Commit

Permalink
[Octave] Update to 9.4.0 (#10564)
Browse files Browse the repository at this point in the history
* [Octave] 9.4.0

Add FreeBSD support. We have to expand platforms for libgfortran, however due to the use of gcc 10, only libgfortran5 builds are possible.

---------

Co-authored-by: Mosè Giordano <[email protected]>
Co-authored-by: Viral B. Shah <[email protected]>
Co-authored-by: Viral Shah <[email protected]>
  • Loading branch information
4 people authored Feb 23, 2025
1 parent d35b0a7 commit 9827424
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
28 changes: 15 additions & 13 deletions O/Octave/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
using BinaryBuilder, Pkg

name = "Octave"
version = v"9.3.0"
bb_ver = v"9.3.1" # Bump patch level to have a new version for Ygg compat
version = v"9.4.0"

# Collection of sources required to build Octave
sources = [
ArchiveSource("https://ftpmirror.gnu.org/octave/octave-$(version).tar.gz",
"809fa39a7acc84815bf4dc4d2d7e6b228ce75a07f3b2413f3313aa8e0aaa3287"),
ArchiveSource("https://ftpmirror.gnu.org/octave/octave-$(version).tar.gz",
"da9481205bfa717660b7d4a16732d8b2d58aadceab4993d41242a8e2848ea6c1"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/octave*
atomic_patch -p0 ../patches/freebsd_sig_atomic_t.patch
apk add texinfo
export CPPFLAGS="-I${includedir}"
Expand Down Expand Up @@ -42,11 +44,13 @@ make -j${nproc}
make install
"""

# build on all supported platforms
platforms = supported_platforms()
filter!(!Sys.isfreebsd, platforms)
# Disable RISC-V
filter!(p -> arch(p) != "riscv64", platforms)
platforms = expand_cxxstring_abis(platforms)
platforms = expand_gfortran_versions(platforms)
# Disable old libgfortran builds - only use libgfortran5
filter!(p -> !(any(libgfortran_version(p) .== (v"4.0.0", v"3.0.0"))), platforms)

# The products that we will ensure are always built
products = [
Expand All @@ -58,10 +62,9 @@ products = [
dependencies = [
HostBuildDependency("flex_jll"),
HostBuildDependency("Bison_jll"),
HostBuildDependency("gperf_jll"),
Dependency("CompilerSupportLibraries_jll"),
Dependency(PackageSpec(name="libblastrampoline_jll", uuid="8e850b90-86db-534c-a0d3-1478176c7d93"),
v"5.12.0"; # build version
compat="5.8.0"),
Dependency("libblastrampoline_jll"; compat="5.11.0"),
Dependency("OpenBLAS32_jll"),
Dependency("SuiteSparse32_jll"),
Dependency("Arpack32_jll"),
Expand All @@ -81,10 +84,9 @@ dependencies = [
Dependency("HDF5_jll"),
Dependency("rapidjson_jll"),
Dependency("libsndfile_jll"),
# Dependency("GraphicsMagick_jll"),

Dependency("GraphicsMagick_jll"),
]

# Build the tarballs.
build_tarballs(ARGS, name, bb_ver, sources, script, platforms, products, dependencies;
julia_compat="1.8", clang_use_lld=false, preferred_gcc_version=v"10")
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.10", clang_use_lld=false, preferred_gcc_version=v"10")
11 changes: 11 additions & 0 deletions O/Octave/bundled/patches/freebsd_sig_atomic_t.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- liboctave/util/quit.h.orig 2025-02-22 05:49:55.536960056 +0000
+++ liboctave/util/quit.h 2025-02-22 05:53:11.370493713 +0000
@@ -224,7 +224,7 @@

#if defined (__cplusplus)

-extern OCTAVE_API std::atomic<int> octave_interrupt_state;
+extern OCTAVE_API std::atomic<sig_atomic_t> octave_interrupt_state;

extern OCTAVE_API volatile std::atomic<bool> octave_signal_caught;

11 changes: 11 additions & 0 deletions O/Octave/bundled/patches/freebsd_sig_atomic_t.patch~
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/liboctave/util/quit.h
+++ b/liboctave/util/quit.h
@@ -224,7 +224,7 @@ namespace octave
// Signal handlers and the like need access to this
OCTAVE_API extern quit_debug* get_quit_debug (void);

- extern OCTAVE_API std::atomic<int> octave_interrupt_state;
+ extern OCTAVE_API std::atomic<sig_atomic_t> octave_interrupt_state;

// Called from octave_quit () to run all the octave_exit functions like
// atexit ()

0 comments on commit 9827424

Please sign in to comment.