diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..bb88e0f374ff5eb5162d4928c2facb1cdd537864 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.lz filter=lfs diff=lfs merge=lfs -text diff --git a/.lfsconfig b/.lfsconfig new file mode 100644 index 0000000000000000000000000000000000000000..be1e887cdf7438032518248ba03e5b0f00b3b573 --- /dev/null +++ b/.lfsconfig @@ -0,0 +1,2 @@ +[lfs] + url = https://artlfs.openeuler.openatom.cn/src-openEuler/octave diff --git a/fix-build-error-streampos-is-member-of-std.patch b/fix-build-error-streampos-is-member-of-std.patch deleted file mode 100644 index e18dcaaab81271baefe3fe3de8febc1af1a41cd2..0000000000000000000000000000000000000000 --- a/fix-build-error-streampos-is-member-of-std.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 05a915983f723e26d1c6fb30605b05e60cb62f6c Mon Sep 17 00:00:00 2001 -From: zhangxianting -Date: Fri, 16 Aug 2024 17:46:58 +0800 -Subject: [PATCH] fix build error, streampos is a member of 'std', not 'std::ios' - ---- - liboctave/util/lo-utils.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/liboctave/util/lo-utils.cc b/liboctave/util/lo-utils.cc -index 0807fed..b287f77 100644 ---- a/liboctave/util/lo-utils.cc -+++ b/liboctave/util/lo-utils.cc -@@ -250,7 +250,7 @@ octave_read_fp_value (std::istream& is) - - // FIXME: resetting stream position is likely to fail unless we are - // reading from a file. -- std::ios::streampos pos = is.tellg (); -+ std::streampos pos = is.tellg (); - - char c1 = ' '; - --- -2.43.0 - diff --git a/macros.octave b/macros.octave new file mode 100644 index 0000000000000000000000000000000000000000..8c56a988ac458bbf9e919c4af5dd366d1bf96f5c --- /dev/null +++ b/macros.octave @@ -0,0 +1,83 @@ +# Octave packaging macros + +# Octave binary API provided +%octave_api %(octave-config -p API_VERSION || echo 0) + +# Octave Package Directories +%octshareprefix %{_datadir}/octave +%octprefix %{octshareprefix}/packages +%octarchprefix %{_libdir}/octave/packages +%octpkgdir %{octprefix}/%{octpkg}-%{version} +%octpkglibdir %{octarchprefix}/%{octpkg}-%{version} + +# Run an octave command - quietly with no startup files +%octave_cmd() octave -H -q --no-window-system --no-site-file --eval '%*'; + +# For compiled tarfile name +%octave_host %(octave-config -p CANONICAL_HOST_TYPE || echo 0) + +# Build unpacked source directory into a package tar file in a temporary location +# Pass -T to use source tarball +%octave_pkg_build(T) %{lua: + if (rpm.expand("%{-T}") == "-T") then + octpkg_tarfile = rpm.expand("%{SOURCE0}") + else + octpkg_tarfile = rpm .expand("%{_tmppath}/%{octpkg}-%{version}.tar.gz") + print("tar czf "..octpkg_tarfile.." -C "..rpm.expand("%{_builddir} %{buildsubdir}").."\\n") + end + -- Avoid a warning from pkg build about making the build directory + -- and use a clean directory as octave pkg build will delete contents + print(rpm.expand("mkdir -p %{_builddir}/%{buildsubdir}/build\\n")) + -- This fails to keep the arguments to %octave_cmd for some reason + -- print(rpm.expand("%octave_cmd pkg build -verbose -nodeps %{_builddir}/%{buildsubdir} "..octpkg_tarfile).."\\n") + print(rpm.expand("octave -H -q --no-window-system --no-site-file --eval 'pkg build -verbose -nodeps %{_builddir}/%{buildsubdir}/build "..octpkg_tarfile).."'\\n") + -- Extract the source tarball for debuginfo generation + print(rpm.expand("tar xf "..octpkg_tarfile.." -C %{_builddir}/%{buildsubdir}/build\\n")) +} + +# Install a package. We use the octave pkg install command to install the +# built package into the buildroot. We also put a note to prevent the root +# user from removing the package with the octave pkg uninstall command +# We call unlink to remove the 'octave_packages' file which contains the +# buildroot string and needs to be generated at package install time. +%octave_pkg_install \ +mkdir -p %{buildroot}%{octprefix} \ +mkdir -p %{buildroot}%{octarchprefix} \ +%octave_cmd pkg("prefix","%{buildroot}%{octprefix}","%{buildroot}%{octarchprefix}");pkg("global_list",fullfile("%{buildroot}%{octshareprefix}","octave_packages"));pkg("install","-nodeps","-verbose",glob("%{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}-*.tar.gz"){1,1});unlink(pkg("global_list")); \ +if [ -e %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m ] \ +then \ + mv %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m.orig \ +fi \ +echo "function on_uninstall (desc)" > %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \ +echo " error ('Can not uninstall %s installed by the redhat package manager', desc.name);" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \ +echo "endfunction" >> %{buildroot}%{octpkgdir}/packinfo/on_uninstall.m \ +if [ -e %{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}/*.metainfo.xml ] \ +then \ + echo "Found .metainfo.xml appdata file" \ + mkdir -p %{buildroot}/%{_metainfodir} \ + cp -p %{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}/*.metainfo.xml %{buildroot}/%{_metainfodir}/ \ + appstream-util validate-relax --nonet %{buildroot}/%{_metainfodir}/*.metainfo.xml \ +else \ + echo "Did not find a .metainfo.xml appdata file" \ +fi \ +%{nil} + +# Run pkg tests - We need to reinstall to recreate 'octave_packages' so that +# octave can find the package, then remove 'octave_packages' again, and re-strip +# any shared objects. +%octave_pkg_check \ +%octave_cmd pkg("prefix","%{buildroot}%{octprefix}","%{buildroot}%{octarchprefix}");pkg("local_list",fullfile("%{buildroot}%{octshareprefix}","octave_packages"));pkg("list");pkg("install","-verbose",glob("%{_builddir}/%{buildsubdir}/build/%{octpkg}-%{version}-*.tar.gz"){1,1});pkg("load","%{octpkg}");pkg("list");oruntests("%{buildroot}%{octpkgdir}");unlink(pkg("local_list")); \ +/usr/lib/rpm/brp-strip %{__strip} \ +%{nil} + +# preun script - we need to remove our uninstall protection and perhaps +# run the package's own uninstall script. +%octave_pkg_preun \ +if [ -e %{octpkgdir}/packinfo/on_uninstall.m.orig ]; then \ + mv %{octpkgdir}/packinfo/on_uninstall.m.orig %{octpkgdir}/packinfo/on_uninstall.m \ + cd %{octpkgdir}/packinfo \ + %octave_cmd l=pkg("list");on_uninstall(l{cellfun(@(x)strcmp(x.name,"%{octpkg}"),l)}); \ +else \ + echo > %{octpkgdir}/packinfo/on_uninstall.m \ +fi \ +%{nil} diff --git a/octave-10.3.0.tar.lz b/octave-10.3.0.tar.lz new file mode 100644 index 0000000000000000000000000000000000000000..734bb89befedf25ea6a73820dce804376507450d --- /dev/null +++ b/octave-10.3.0.tar.lz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68bc82885a3ae67a806debb14eb229506d2fe398c969dd42e2e38cc1c35f2aff +size 24319708 diff --git a/octave-5.1.0-docs.tar.lz b/octave-5.1.0-docs.tar.lz deleted file mode 100644 index 6f0de901ef972b91748ead6c04ea33948560f838..0000000000000000000000000000000000000000 Binary files a/octave-5.1.0-docs.tar.lz and /dev/null differ diff --git a/octave-5.1.0.tar.lz b/octave-5.1.0.tar.lz deleted file mode 100644 index 71e8a4c6fad51f625d033ff4f5896f1e82b5a121..0000000000000000000000000000000000000000 Binary files a/octave-5.1.0.tar.lz and /dev/null differ diff --git a/octave-clear-the-eof-condition.patch b/octave-clear-the-eof-condition.patch deleted file mode 100644 index f2c90bb49d0a4287e30dcd18b743e346b9be050e..0000000000000000000000000000000000000000 --- a/octave-clear-the-eof-condition.patch +++ /dev/null @@ -1,28 +0,0 @@ - -# HG changeset patch -# User Mike Miller -# Date 1554238576 25200 -# Node ID c3716220d5b93c49e1c7cc8ebe0b76dd961f4ec7 -# Parent fc73dafece570f201c18a4eb4a8729a654cfcfbb -fix pause and kbhit with glibc 2.28 end-of-file state behavior (bug #55029) - -* sysdep.cc (octave::kbhit): Call "clearerr (stdin)" on end-of-file condition -in addition to "std::cin.clear ()". In glibc 2.28, end-of-file is persistent -and must be cleared by the application. - -diff --git a/libinterp/corefcn/sysdep.cc b/libinterp/corefcn/sysdep.cc ---- a/libinterp/corefcn/sysdep.cc -+++ b/libinterp/corefcn/sysdep.cc -@@ -566,7 +566,10 @@ - int c = std::cin.get (); - - if (std::cin.fail () || std::cin.eof ()) -- std::cin.clear (); -+ { -+ std::cin.clear (); -+ clearerr (stdin); -+ } - - // Restore it, enabling system call restarts (if possible). - octave::set_interrupt_handler (saved_interrupt_handler, true); - diff --git a/octave-time.patch b/octave-time.patch new file mode 100644 index 0000000000000000000000000000000000000000..52fb950d4aba5c6cb176b07414740378a69b5cba --- /dev/null +++ b/octave-time.patch @@ -0,0 +1,11 @@ +diff -up octave-7.1.0/liboctave/numeric/randmtzig.cc.time octave-7.1.0/liboctave/numeric/randmtzig.cc +--- octave-7.1.0/liboctave/numeric/randmtzig.cc.time 2022-04-06 08:05:12.000000000 -0600 ++++ octave-7.1.0/liboctave/numeric/randmtzig.cc 2022-07-09 23:03:37.970793323 -0600 +@@ -163,6 +163,7 @@ + + #include + #include ++#include + + #include "oct-syscalls.h" + #include "oct-time.h" diff --git a/octave.spec b/octave.spec index fa83cb155a01e2f9d87fe9dd67fb7eada2e10cb4..1860852c670f65975fb9ba7cc4c3932332fcae5a 100644 --- a/octave.spec +++ b/octave.spec @@ -1,19 +1,18 @@ -%global octave_api api-v53 +%global octave_api api-v60 %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) %global builddocs 1 %bcond_without qt5 Name: octave Epoch: 6 -Version: 5.1.0 -Release: 3 +Version: 10.3.0 +Release: 1 Summary: A high-level language for numerical computations -License: GPLv3+ +License: GPL-3.0-or-later URL: http://www.octave.org Source0: https://ftp.gnu.org/gnu/octave/octave-%{version}.tar.lz +Source1: macros.octave Source2: xorg.conf -Source3: octave-5.1.0-docs.tar.lz -Patch0: octave-clear-the-eof-condition.patch -Patch1: fix-build-error-streampos-is-member-of-std.patch +Patch0: octave-time.patch Provides: octave(api) = %{octave_api} Provides: bundled(gnulib) Provides: bundled(qterminal) @@ -36,11 +35,11 @@ BuildRequires: arpack-devel openblas-devel bison bzip2-devel curl-devel ff BuildRequires: fltk-devel ftgl-devel gcc-c++ gcc-gfortran ghostscript gl2ps-devel glpk-devel BuildRequires: gperf GraphicsMagick-c++-devel hdf5-devel java-devel less BuildRequires: libsndfile-devel libX11-devel llvm-devel mesa-libGL-devel mesa-libGLU-devel -BuildRequires: mesa-libOSMesa-devel ncurses-devel pcre-devel portaudio-devel qhull-devel +BuildRequires: mesa-libOSMesa-devel ncurses-devel pcre2-devel portaudio-devel qhull-devel BuildRequires: qrupdate-devel qscintilla-qt5-devel qt5-linguist qt5-qttools-devel BuildRequires: readline-devel suitesparse-devel sundials-devel tex(dvips) texinfo texinfo-tex BuildRequires: texlive-collection-fontsrecommended texlive-ec texlive-metapost zlib-devel -BuildRequires: mesa-dri-drivers xorg-x11-apps +BuildRequires: mesa-dri-drivers BuildRequires: zip BuildRequires: libXcursor-devel libXfixes-devel libXext-devel libXinerama-devel Requires: epstool hdf5 hicolor-icon-theme java-headless less info @@ -114,16 +113,16 @@ make install-data install-html install-info install-pdf DESTDIR=%{buildroot} mkdir -p %{buildroot}%{_pkgdocdir} cp -ar AUTHORS BUGS ChangeLog examples NEWS README %{buildroot}%{_pkgdocdir}/ cp -a doc/refcard/*.pdf %{buildroot}%{_pkgdocdir}/ +find %{buildroot}%{_libdir} -name \*.la -delete rm -f %{buildroot}%{_infodir}/dir -tar xvf %SOURCE3 -C %{buildroot} mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d echo "%{_libdir}/octave/%{version}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/octave-%{_arch}.conf perl -pi -e "s,%{buildroot},," %{buildroot}%{_libdir}/%{name}/ls-R perl -pi -e "s,%{buildroot},," %{buildroot}%{_datadir}/%{name}/ls-R touch %{buildroot}%{_datadir}/%{name}/ls-R desktop-file-validate %{buildroot}%{_datadir}/applications/org.octave.Octave.desktop -sed -i -e /project_group/d %{buildroot}/%{_datadir}/metainfo/org.octave.Octave.appdata.xml -appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/org.octave.Octave.appdata.xml +sed -i -e '/url type=/d' %{buildroot}/%{_datadir}/metainfo/org.octave.Octave.metainfo.xml +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/org.octave.Octave.metainfo.xml HOST_TYPE=`%{buildroot}%{_bindir}/octave-config -p CANONICAL_HOST_TYPE` mkdir -p %{buildroot}%{_libdir}/%{name}/site/oct/%{octave_api}/$HOST_TYPE mkdir -p %{buildroot}%{_libdir}/%{name}/site/oct/$HOST_TYPE @@ -170,8 +169,8 @@ sed -i -e '/^# Created by Octave/d' %{buildroot}%{_datadir}/%{name}/%{version}/e %else cp -p doc/interpreter/macros.texi %{buildroot}%{_datadir}/%{name}/%{version}/etc/macros.texi %endif -#mkdir -p %{buildroot}%{macrosdir} -#cp -p %SOURCE1 %{buildroot}%{macrosdir} +mkdir -p %{buildroot}%{macrosdir} +cp -p %SOURCE1 %{buildroot}%{macrosdir} %check cp %SOURCE2 . @@ -203,7 +202,7 @@ make check %{_datadir}/applications/org.octave.Octave.desktop %{_datadir}/icons/hicolor/*/apps/octave.png %{_datadir}/icons/hicolor/scalable/apps/octave.svg -%{_datadir}/metainfo/org.octave.Octave.appdata.xml +%{_datadir}/metainfo/org.octave.Octave.metainfo.xml %dir %{_datadir}/octave %{_datadir}/octave/%{version}/ %{_datadir}/octave/ls-R @@ -212,20 +211,20 @@ make check %{_datadir}/octave/site/ %files devel +%{macrosdir}/macros.octave %{_bindir}/mkoctfile %{_bindir}/mkoctfile-%{version} %{_includedir}/octave-%{version}/ +%{_libdir}/octave/%{version}/liboctave.so +%{_libdir}/octave/%{version}/liboctgui.so +%{_libdir}/octave/%{version}/liboctinterp.so +%{_libdir}/octave/%{version}/liboctmex.so %{_libdir}/pkgconfig/octave.pc %{_libdir}/pkgconfig/octinterp.pc +%{_libdir}/pkgconfig/octmex.pc %{_mandir}/man1/mkoctfile.1.* %files doc -%{_pkgdocdir}-%{version}/examples/ -%{_pkgdocdir}-%{version}/liboctave.html/ -%{_pkgdocdir}-%{version}/liboctave.pdf -%{_pkgdocdir}-%{version}/octave.html -%{_pkgdocdir}-%{version}/octave.pdf -%{_pkgdocdir}-%{version}/refcard*.pdf %{_pkgdocdir}/examples/ %{_pkgdocdir}/liboctave.html/ %{_pkgdocdir}/liboctave.pdf @@ -234,6 +233,9 @@ make check %{_pkgdocdir}/refcard*.pdf %changelog +* Thu Oct 23 2025 yaoxin <1024769339@qq.com> - 6:10.3.0-1 +- Update to 10.3.0 for fix build failure + * Wed Sep 11 2024 wangkai <13474090681@163.com> - 6:5.1.0-3 - Delete requires gnuplot because the package license is not allow