diff --git a/packages/ghostscript/build.sh b/packages/ghostscript/build.sh index 19f5fc2d13b393..22660ae121e82e 100644 --- a/packages/ghostscript/build.sh +++ b/packages/ghostscript/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF" TERMUX_PKG_LICENSE="AGPL-V3" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="10.03.1" -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=8ea9dd8768b64576bc4ee2d79611450c9e1edeb686f7824f3bf94b92457b882a TERMUX_PKG_AUTO_UPDATE=false @@ -29,7 +29,10 @@ termux_step_post_get_source() { } termux_step_pre_configure() { - CPPFLAGS+=" -I${TERMUX_STANDALONE_TOOLCHAIN}/sysroot/usr/include/c++/v1" + if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then + export PKGCONFIG="$PKG_CONFIG" + export LDFLAGS+=" -liconv" + fi if [[ "${TERMUX_ARCH}" == "aarch64" ]]; then # https://github.com/llvm/llvm-project/issues/74361 diff --git a/packages/octave/build.sh b/packages/octave/build.sh index 33f67c50daec1f..a956a67179cd36 100644 --- a/packages/octave/build.sh +++ b/packages/octave/build.sh @@ -3,9 +3,10 @@ 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="9.4.0" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://ftpmirror.gnu.org/octave/octave-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=fff911909ef79f95ba244dab5b8c1cb8c693a6c447d31deabb53994f17cb7b3d -TERMUX_PKG_DEPENDS="libandroid-complex-math, arpack-ng, bzip2, fftw, fontconfig, freetype, glpk, graphicsmagick, libcurl, libhdf5, libiconv, libopenblas, libsndfile, openssl, pcre2, portaudio, qhull, qrupdate-ng, rapidjson, readline, suitesparse, sundials, zlib" +TERMUX_PKG_DEPENDS="libandroid-complex-math, arpack-ng, clang, bzip2, fftw, fontconfig, freetype, glpk, graphicsmagick, libcurl, libhdf5, libiconv, libopenblas, libsndfile, make, openssl, pcre2, portaudio, qhull, qrupdate-ng, rapidjson, readline, suitesparse, sundials, zlib" TERMUX_PKG_BUILD_DEPENDS="gnuplot, less" TERMUX_PKG_RECOMMENDS="gnuplot, less" TERMUX_PKG_CONFLICTS="octave-x" @@ -52,9 +53,15 @@ termux_step_pre_configure() { local flang_libs_dir="$flang_toolchain_dir/sysroot/usr/lib/$TERMUX_HOST_PLATFORM" export F77="$FC" - export ac_cv_f77_libs=" $flang_libs_dir/libFortranRuntime.a $flang_libs_dir/libFortranDecimal.a" + mkdir -p $TERMUX_PKG_TMPDIR/_deps + ln -sf $flang_libs_dir/libFortranRuntime.a $TERMUX_PKG_TMPDIR/_deps/ + ln -sf $flang_libs_dir/libFortranDecimal.a $TERMUX_PKG_TMPDIR/_deps/ + export ac_cv_f77_libs="-L$TERMUX_PKG_TMPDIR/_deps -l:libFortranRuntime.a -l:libFortranDecimal.a" LDFLAGS+=" -Wl,-rpath,$TERMUX_PREFIX/lib/octave/$TERMUX_PKG_VERSION" - LDFLAGS+=" $($CC -print-libgcc-file-name)" - export LIBS="-landroid-complex-math" + local _libgcc_file="$($CC -print-libgcc-file-name)" + local _libgcc_path="$(dirname $_libgcc_file)" + local _libgcc_name="$(basename $_libgcc_file)" + # put -l:$_libgcc_name only in $LIBS instead of $LDFLAGS + export LIBS="-landroid-complex-math -L$_libgcc_path -l:$_libgcc_name" } diff --git a/scripts/build/toolchain/termux_setup_toolchain_23c.sh b/scripts/build/toolchain/termux_setup_toolchain_23c.sh index 6ee3b5c99685ad..9a35d524de474b 100644 --- a/scripts/build/toolchain/termux_setup_toolchain_23c.sh +++ b/scripts/build/toolchain/termux_setup_toolchain_23c.sh @@ -82,7 +82,9 @@ termux_setup_toolchain_23c() { fi export CXXFLAGS="$CFLAGS" - export CPPFLAGS+=" -isystem${TERMUX_PREFIX}/include" + # set the proper header include order - first package includes, then prefix includes + # -isystem${TERMUX_PREFIX}/include/c++/v1 is needed here for on-device building to work correctly + export CPPFLAGS+=" -isystem${TERMUX_PREFIX}/include/c++/v1 -isystem${TERMUX_PREFIX}/include" # If libandroid-support is declared as a dependency, link to it explicitly: if [ "$TERMUX_PKG_DEPENDS" != "${TERMUX_PKG_DEPENDS/libandroid-support/}" ]; then diff --git a/scripts/build/toolchain/termux_setup_toolchain_27c.sh b/scripts/build/toolchain/termux_setup_toolchain_27c.sh index c4c276e0db0c1a..02c3df1fc3afe1 100644 --- a/scripts/build/toolchain/termux_setup_toolchain_27c.sh +++ b/scripts/build/toolchain/termux_setup_toolchain_27c.sh @@ -82,7 +82,9 @@ termux_setup_toolchain_27c() { fi export CXXFLAGS="$CFLAGS" - export CPPFLAGS+=" -isystem${TERMUX_PREFIX}/include" + # set the proper header include order - first package includes, then prefix includes + # -isystem${TERMUX_PREFIX}/include/c++/v1 is needed here for on-device building to work correctly + export CPPFLAGS+=" -isystem${TERMUX_PREFIX}/include/c++/v1 -isystem${TERMUX_PREFIX}/include" # If libandroid-support is declared as a dependency, link to it explicitly: if [ "$TERMUX_PKG_DEPENDS" != "${TERMUX_PKG_DEPENDS/libandroid-support/}" ]; then diff --git a/x11-packages/octave-x/0001-fix-hardcoded-paths.patch b/x11-packages/octave-x/0001-fix-hardcoded-paths.patch deleted file mode 100644 index 7de33c4df37771..00000000000000 --- a/x11-packages/octave-x/0001-fix-hardcoded-paths.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/libinterp/corefcn/sysdep.cc -+++ b/libinterp/corefcn/sysdep.cc -@@ -796,7 +796,7 @@ - - #else - -- return "/tmp"; -+ return "@TERMUX_PREFIX@/tmp"; - - #endif - } ---- a/liboctave/system/oct-env.cc -+++ b/liboctave/system/oct-env.cc -@@ -237,7 +237,7 @@ - tempd = P_tmpdir; - #else - if (tempd.empty ()) -- tempd = "/tmp"; -+ tempd = "@TERMUX_PREFIX@/tmp"; - #endif - - #endif ---- a/src/mkoctfile.in.cc -+++ b/src/mkoctfile.in.cc -@@ -639,7 +639,7 @@ - tempd = P_tmpdir; - #else - if (tempd.empty ()) -- tempd = "/tmp"; -+ tempd = "@TERMUX_PREFIX@/tmp"; - #endif - - #endif ---- a/run-octave.in -+++ b/run-octave.in -@@ -127,7 +127,7 @@ - ## Is there a better way to do this so that we don't fill /tmp - ## with junk files? Using /dev/null won't work because asan - ## appends the process ID to the file name. -- ASAN_OPTIONS="leak_check_at_exit=0:log_path=/tmp/oct-asan-log:verbosity=0" -+ ASAN_OPTIONS="leak_check_at_exit=0:log_path=@TERMUX_PREFIX@/tmp/oct-asan-log:verbosity=0" - else - ASAN_OPTIONS="$ADDRESS_SANITIZER_OPTIONS" - fi diff --git a/x11-packages/octave-x/0001-fix-hardcoded-paths.patch b/x11-packages/octave-x/0001-fix-hardcoded-paths.patch new file mode 120000 index 00000000000000..938eaaea854ec5 --- /dev/null +++ b/x11-packages/octave-x/0001-fix-hardcoded-paths.patch @@ -0,0 +1 @@ +../../packages/octave/0001-fix-hardcoded-paths.patch \ No newline at end of file diff --git a/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch b/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch deleted file mode 100644 index 3102186c1428e6..00000000000000 --- a/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/libinterp/octinterp.in.pc -+++ b/libinterp/octinterp.in.pc -@@ -4,6 +4,6 @@ - Version: @PACKAGE_VERSION@ - Requires: octave = @PACKAGE_VERSION@ - Requires.private: --Libs: -L@octlibdir@ @LIBOCTINTERP@ -+Libs: -L@octlibdir@ -Wl,-rpath,@octlibdir@ @LIBOCTINTERP@ - Libs.private: - Cflags: -I@octincludedir@/.. ---- a/liboctave/octave.in.pc -+++ b/liboctave/octave.in.pc -@@ -4,6 +4,6 @@ - Version: @PACKAGE_VERSION@ - Requires: - Requires.private: --Libs: -L@octlibdir@ @LIBOCTAVE@ -+Libs: -L@octlibdir@ -Wl,-rpath,@octlibdir@ @LIBOCTAVE@ - Libs.private: @LIBOCTAVE_LINK_DEPS@ - Cflags: -I@octincludedir@/.. diff --git a/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch b/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch new file mode 120000 index 00000000000000..0c688132b6d45d --- /dev/null +++ b/x11-packages/octave-x/0002-append-rpath-flag-to-pkg-config-files.patch @@ -0,0 +1 @@ +../../packages/octave/0002-append-rpath-flag-to-pkg-config-files.patch \ No newline at end of file diff --git a/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch b/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch deleted file mode 100644 index 1db6c7ccd9fbc0..00000000000000 --- a/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch +++ /dev/null @@ -1,17 +0,0 @@ -+++ ./liboctave/wrappers/pwd-wrappers.c -@@ -32,6 +32,15 @@ - - #if defined (HAVE_PWD_H) - # include -+# ifdef getpwnam -+# undef getpwnam -+# endif -+# ifdef getpwuid -+# undef getpwuid -+# endif -+# ifdef getpwuid_r -+# undef getpwuid_r -+# endif - #endif - - #include "pwd-wrappers.h" diff --git a/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch b/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch new file mode 120000 index 00000000000000..3aa65606f3772b --- /dev/null +++ b/x11-packages/octave-x/0003-undefine-the-macro-in-pwd.h.patch @@ -0,0 +1 @@ +../../packages/octave/0003-undefine-the-macro-in-pwd.h.patch \ No newline at end of file diff --git a/x11-packages/octave-x/build.sh b/x11-packages/octave-x/build.sh index d91a83cd9375f7..04f1817c55c2a1 100644 --- a/x11-packages/octave-x/build.sh +++ b/x11-packages/octave-x/build.sh @@ -3,9 +3,10 @@ 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="9.4.0" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://ftpmirror.gnu.org/octave/octave-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=fff911909ef79f95ba244dab5b8c1cb8c693a6c447d31deabb53994f17cb7b3d -TERMUX_PKG_DEPENDS="arpack-ng, fftw, fltk, fontconfig, freetype, glpk, glu, graphicsmagick, libandroid-complex-math, libbz2, libc++, libcurl, libhdf5, libiconv, libopenblas, libsndfile, libx11, libxcursor, libxext, libxfixes, libxft, libxinerama, libxrender, opengl, openssl, pcre2, portaudio, qhull, qrupdate-ng, qt6-qt5compat, qt6-qtbase, qt6-qttools, readline, suitesparse, sundials, zlib" +TERMUX_PKG_DEPENDS="arpack-ng, clang, fftw, fltk, fontconfig, freetype, glpk, glu, graphicsmagick, libandroid-complex-math, libbz2, libc++, libcurl, libhdf5, libiconv, libopenblas, libsndfile, libx11, libxcursor, libxext, libxfixes, libxft, libxinerama, libxrender, make, opengl, openssl, pcre2, portaudio, qhull, qrupdate-ng, qt6-qt5compat, qt6-qtbase, qt6-qttools, readline, suitesparse, sundials, zlib" TERMUX_PKG_BUILD_DEPENDS="gnuplot, less, rapidjson, qt6-qtbase-cross-tools, qt6-qttools-cross-tools" TERMUX_PKG_RECOMMENDS="gnuplot, less" TERMUX_PKG_CONFLICTS="octave-x" @@ -53,15 +54,17 @@ termux_step_pre_configure() { local flang_libs_dir="$flang_toolchain_dir/sysroot/usr/lib/$TERMUX_HOST_PLATFORM" export F77="$FC" - export ac_cv_f77_libs=" $flang_libs_dir/libFortranRuntime.a $flang_libs_dir/libFortranDecimal.a" + mkdir -p $TERMUX_PKG_TMPDIR/_deps + ln -sf $flang_libs_dir/libFortranRuntime.a $TERMUX_PKG_TMPDIR/_deps/ + ln -sf $flang_libs_dir/libFortranDecimal.a $TERMUX_PKG_TMPDIR/_deps/ + export ac_cv_f77_libs="-L$TERMUX_PKG_TMPDIR/_deps -l:libFortranRuntime.a -l:libFortranDecimal.a" LDFLAGS+=" -Wl,-rpath,$TERMUX_PREFIX/lib/octave/$TERMUX_PKG_VERSION" - local _libgcc_file="$($CC -print-libgcc-file-name)" local _libgcc_path="$(dirname $_libgcc_file)" local _libgcc_name="$(basename $_libgcc_file)" - LDFLAGS+=" -L$_libgcc_path -l:$_libgcc_name" - export LIBS="-landroid-complex-math" + # put -l:$_libgcc_name only in $LIBS instead of $LDFLAGS + export LIBS="-landroid-complex-math -L$_libgcc_path -l:$_libgcc_name" export PATH="$TERMUX_PREFIX/opt/qt6/cross/bin:$PATH" }