Skip to content

Commit

Permalink
bump(main/suitesparse): 7.8.3, revbump(main/sundials), fix({main,x11}…
Browse files Browse the repository at this point in the history
…/octave{,-x}): symbols

related to #21130
  • Loading branch information
twaik committed Oct 23, 2024
1 parent 1c872b3 commit 337ead4
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 6 deletions.
6 changes: 5 additions & 1 deletion packages/octave/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="GNU Octave is a high-level language, primarily intended
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=8.4.0
TERMUX_PKG_REVISION=5
TERMUX_PKG_REVISION=6
TERMUX_PKG_SRCURL=https://ftpmirror.gnu.org/octave/octave-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=6f9ad73a3ee4291b6341d6c0f5e5c85d6e0310376e4991b959a6d340b3ffa8a8
TERMUX_PKG_DEPENDS="arpack-ng, bzip2, fftw, fontconfig, freetype, glpk, graphicsmagick, libcurl, libhdf5, libiconv, libopenblas, libsndfile, openssl, pcre2, portaudio, qhull, qrupdate-ng, rapidjson, readline, suitesparse, sundials, zlib"
Expand Down Expand Up @@ -48,6 +48,9 @@ termux_step_post_get_source() {

termux_step_pre_configure() {
termux_setup_flang

$CC "$TERMUX_PKG_BUILDER_DIR/clogf.c" -o "$TERMUX_PKG_BUILDDIR/clogf.o" -c
ar rcu "$TERMUX_PKG_BUILDDIR/clogf.a" "$TERMUX_PKG_BUILDDIR/clogf.o"

local flang_toolchain_dir="$(dirname $(dirname $(command -v flang-new)))"
local flang_libs_dir="$flang_toolchain_dir/sysroot/usr/lib/$TERMUX_HOST_PLATFORM"
Expand All @@ -57,4 +60,5 @@ termux_step_pre_configure() {

LDFLAGS+=" -Wl,-rpath,$TERMUX_PREFIX/lib/octave/$TERMUX_PKG_VERSION"
LDFLAGS+=" $($CC -print-libgcc-file-name)"
export LIBS="$TERMUX_PKG_BUILDDIR/clogf.a"
}
20 changes: 20 additions & 0 deletions packages/octave/clogf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <complex.h>
#include <math.h>

// https://git.musl-libc.org/cgit/musl/tree/src/complex/clogf.c

// Fix for

// ld.lld: error: undefined reference due to --no-allow-shlib-undefined: clogf
// >>> referenced by liboctave/.libs/liboctave.so
// clang++: error: linker command failed with exit code 1 (use -v to see invocation)

// This symbol appeared in API 29 so we should define it as weak to avoid interference with system version

float complex __attribute__((weak)) clogf(float complex z) {
float r, phi;

r = cabsf(z);
phi = cargf(z);
return CMPLXF(logf(r), phi);
};
7 changes: 4 additions & 3 deletions packages/suitesparse/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ TERMUX_PKG_DESCRIPTION="A Suite of Sparse matrix packages."
TERMUX_PKG_GROUPS="science"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="7.8.2"
TERMUX_PKG_VERSION="7.8.3"
TERMUX_PKG_SRCURL=https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=996c48c87baaeb5fc04bd85c7e66d3651a56fe749c531c60926d75b4db5d2181
TERMUX_PKG_SHA256=ce39b28d4038a09c14f21e02c664401be73c0cb96a9198418d6a98a7db73a259
TERMUX_PKG_DEPENDS="libandroid-complex-math, libgmp, libmpfr, libopenblas"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_FORCE_CMAKE=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BREAKS="sundials (<< 7.1.1-2), octave (<< 8.4.0-6), octave-x (<< 8.4.0-5)"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DCMAKE_SYSTEM_NAME=Linux
-DBLA_VENDOR=OpenBLAS
Expand Down Expand Up @@ -96,7 +97,7 @@ lib/libklu_cholmod.so.2
lib/liblagraph.so.1
lib/liblagraphx.so.1
lib/libldl.so.3
lib/libparu.so.0
lib/libparu.so.1
lib/librbio.so.4
lib/libspex.so.3
lib/libspexpython.so.3
Expand Down
2 changes: 1 addition & 1 deletion packages/sundials/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="SUite of Nonlinear and DIfferential/ALgebraic equation S
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION="7.1.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/LLNL/sundials/releases/download/v${TERMUX_PKG_VERSION}/sundials-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=ea7d6edfb52448ddfdc1ec48f89a721fe6c0a259c10f8ef56f60fcded87a94bb
TERMUX_PKG_AUTO_UPDATE=true
Expand Down
6 changes: 5 additions & 1 deletion x11-packages/octave-x/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="GNU Octave is a high-level language, primarily intended
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=8.4.0
TERMUX_PKG_REVISION=4
TERMUX_PKG_REVISION=5
TERMUX_PKG_SRCURL=https://ftpmirror.gnu.org/octave/octave-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=6f9ad73a3ee4291b6341d6c0f5e5c85d6e0310376e4991b959a6d340b3ffa8a8
TERMUX_PKG_DEPENDS="arpack-ng, bzip2, fftw, fltk, fontconfig, freetype, glpk, glu, graphicsmagick, libcurl, libhdf5, libiconv, libopenblas, libsndfile, opengl, openssl, pcre, portaudio, qhull, qrupdate-ng, rapidjson, readline, suitesparse, sundials, zlib"
Expand Down Expand Up @@ -48,6 +48,9 @@ termux_step_post_get_source() {

termux_step_pre_configure() {
termux_setup_flang

$CC "$TERMUX_PKG_BUILDER_DIR/clogf.c" -o "$TERMUX_PKG_BUILDDIR/clogf.o" -c
ar rcu "$TERMUX_PKG_BUILDDIR/clogf.a" "$TERMUX_PKG_BUILDDIR/clogf.o"

local flang_toolchain_dir="$(dirname $(dirname $(command -v flang-new)))"
local flang_libs_dir="$flang_toolchain_dir/sysroot/usr/lib/$TERMUX_HOST_PLATFORM"
Expand All @@ -57,4 +60,5 @@ termux_step_pre_configure() {

LDFLAGS+=" -Wl,-rpath,$TERMUX_PREFIX/lib/octave/$TERMUX_PKG_VERSION"
LDFLAGS+=" $($CC -print-libgcc-file-name)"
export LIBS="$TERMUX_PKG_BUILDDIR/clogf.a"
}
20 changes: 20 additions & 0 deletions x11-packages/octave-x/clogf.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <complex.h>
#include <math.h>

// https://git.musl-libc.org/cgit/musl/tree/src/complex/clogf.c

// Fix for

// ld.lld: error: undefined reference due to --no-allow-shlib-undefined: clogf
// >>> referenced by liboctave/.libs/liboctave.so
// clang++: error: linker command failed with exit code 1 (use -v to see invocation)

// This symbol appeared in API 29 so we should define it as weak to avoid interference with system version

float complex __attribute__((weak)) clogf(float complex z) {
float r, phi;

r = cabsf(z);
phi = cargf(z);
return CMPLXF(logf(r), phi);
};

0 comments on commit 337ead4

Please sign in to comment.