From fa9385a88cc74633bdeba1d0d6808577607236797b359f0887f1f61b44b871fb Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 7 May 2025 20:49:47 +0000 Subject: [PATCH 1/2] =?UTF-8?q?-=20Update=20to=204.0.1=20(bsc#1242704):=20?= =?UTF-8?q?=20=20-=20Add=20Cygwin=20support.=20=20=20-=20Update=20config.g?= =?UTF-8?q?uess=20and=20config.sub=20to=20the=20latest=20versions.=20=20?= =?UTF-8?q?=20-=20Fix=20pkg-config=20files=20for=20custom=20paths.=20=20?= =?UTF-8?q?=20-=20Set=20LD/LDXX=20unconditionally=20to=20CC/CXX,=20since?= =?UTF-8?q?=20LDFLAGS/LDXXFLAGS=20from=20./configure=20rely=20on=20it.=20-?= =?UTF-8?q?=20Update=20to=204.0.0:=20=20=20-=20sync=20soversion=20and=20ma?= =?UTF-8?q?jor=5Fversion=20=20=20-=20The=20added=20number=20formatting=20f?= =?UTF-8?q?eature=20requires=20an=20ABI=20change,=20=20=20=20=20hence=20th?= =?UTF-8?q?e=20increase=20to=20SOVERSION=3D4.=20=20=20-=20Packagers=20outs?= =?UTF-8?q?ide=20of=20the=20Linux=20distributions=20sometimes=20use=20=20?= =?UTF-8?q?=20=20=20the=20major=20version=20number=20as=20the=20equivalent?= =?UTF-8?q?=20of=20SOVERSION=20on=20=20=20=20=20their=20platforms=20and=20?= =?UTF-8?q?have=20an=20incorrect=20SOVERSION=20for=202.5.1,=20=20=20=20=20?= =?UTF-8?q?which=20requires=20SOVERSION=3D3.=20=20=20-=20While=20SOVERSION?= =?UTF-8?q?=20is=20not=20required=20to=20match=20the=20major=20=20=20=20?= =?UTF-8?q?=20version=20number=20(example:=20glibc),=20mpdecimal=20will=20?= =?UTF-8?q?from=20=20=20=20=20now=20on=20take=20the=20path=20of=20least=20?= =?UTF-8?q?resistance=20and=20always=20use=20=20=20=20=20SOVERSION=3DMPD?= =?UTF-8?q?=5FMAJOR=5FVERSION.=20=20=20-=20The=20jump=20to=204.0.0=20shoul?= =?UTF-8?q?d=20also=20remind=20users=20that=20a=20C++=20library=20=20=20?= =?UTF-8?q?=20=20is=20available.=20=20=20-=20Support=20for=20out-of-tree?= =?UTF-8?q?=20build.=20=20=20-=20Support=20for=20pkg-config.=20=20=20-=20U?= =?UTF-8?q?nix:=20support=20for=20Loongson.=20=20=20-=20Unix:=20support=20?= =?UTF-8?q?for=20CheriBSD.=20=20=20-=20Compilers:=20support=20for=20icx,?= =?UTF-8?q?=20icpx,=20ibm-clang=5Fr,=20ibm-clang++=5Fr,=20=20=20=20=20Comp?= =?UTF-8?q?Cert,=20clang-cl=20and=20emscripten.=20=20=20-=20Windows:=20sup?= =?UTF-8?q?port=20for=20MSYS2/MinGW.=20=20=20-=20MSVC:=20the=20build=20now?= =?UTF-8?q?=20uses=20/O2=20/DNDEBUG.=20=20=20-=20MSVC:=20new=20arm64/arm32?= =?UTF-8?q?=20cross=20build=20scripts.=20=20=20-=20AIX:=20the=20shared=20l?= =?UTF-8?q?ibraries=20are=20now=20installed=20as=20versioned=20=20=20=20?= =?UTF-8?q?=20objects,=20e.g.,=20shr4.o,=20shr4=5F64.o.=20=20=20-=20New=20?= =?UTF-8?q?./configure=20switches:=20=20=20-=20--enable-static:=20enable/d?= =?UTF-8?q?isable=20the=20build=20of=20the=20static=20=20=20=20=20librarie?= =?UTF-8?q?s=20(default:=20enabled).=20=20=20-=20--enable-pc:=20enable/dis?= =?UTF-8?q?able=20the=20install=20of=20the=20pkgconfig=20=20=20=20=20files?= =?UTF-8?q?=20(default:=20enabled).=20=20=20-=20--enable-doc:=20enable/dis?= =?UTF-8?q?able=20the=20install=20of=20the=20documentation=20=20=20=20=20(?= =?UTF-8?q?default:=20enabled).=20=20=20-=20New=20man=20pages=20direct=20u?= =?UTF-8?q?sers=20to=20the=20mpdecimal-doc=20package=20or=20=20=20=20=20th?= =?UTF-8?q?e=20online=20HTML=20documentation.=20=20=20-=20The=20prebuilt?= =?UTF-8?q?=20HTML=20documentation=20is=20now=20in=20the=20separate=20=20?= =?UTF-8?q?=20=20=20mpdecimal-doc=20package,=20which=20gives=20distributio?= =?UTF-8?q?ns=20that=20reject=20=20=20=20=20prebuilt=20documentation=20the?= =?UTF-8?q?=20option=20to=20disregard=20it=20and=20use=20the=20=20=20=20?= =?UTF-8?q?=20new=20man=20pages.=20=20=20-=20libmpdec:=20=20=20=20=20-=20A?= =?UTF-8?q?dd=20the=20=E2=80=9Cz=E2=80=9D=20format=20specifier=20(coerce?= =?UTF-8?q?=20negative=20zeros=20to=20=20=20=20=20=20=20positive).=20=20?= =?UTF-8?q?=20=20=20-=20In=20extremely=20rare=20cases=20the=20transcendent?= =?UTF-8?q?al=20functions=20(exp,=20=20=20=20=20=20=20ln,=20log10)=20did?= =?UTF-8?q?=20not=20set=20the=20Subnormal/Underflow=20flags.=20The=20=20?= =?UTF-8?q?=20=20=20=20=20reason=20is=20that=20in=20the=20case=20of=20an?= =?UTF-8?q?=20exponent=20boundary=20the=20Ziv=20=20=20=20=20=20=20correcti?= =?UTF-8?q?on=20loop=20for=20correct=20rounding=20requires=20very=20few=20?= =?UTF-8?q?=20=20=20=20=20=20iterations=20to=20arrive=20at=20the=20correct?= =?UTF-8?q?ly=20rounded=20result,=20but=20=20=20=20=20=20=20may=20need=20m?= =?UTF-8?q?any=20more=20iterations=20to=20arrive=20at=20the=20correct=20?= =?UTF-8?q?=20=20=20=20=20=20flags.=20=20=20=20=20-=20In=20these=20cases,?= =?UTF-8?q?=20Subnormal/Underflow=20is=20not=20very=20=20=20=20=20=20=20in?= =?UTF-8?q?formative,=20so=20the=20status=20quo=20was=20to=20skip=20the=20?= =?UTF-8?q?extra=20=20=20=20=20=20=20iterations.=20=20=20=20=20-=20Version?= =?UTF-8?q?=204.0.0=20now=20specializes=20exponent=20boundary=20cases=20?= =?UTF-8?q?=20=20=20=20=20=20and=20uses=20up=20to=20five=20additional=20it?= =?UTF-8?q?erations=20to=20set=20=20=20=20=20=20=20Subnormal/Underflow.=20?= =?UTF-8?q?The=20refactored=20code=20has=20no=20speed=20=20=20=20=20=20=20?= =?UTF-8?q?penalty=20on=20average;=20in=20fact,=20in=20the=20deccheck=20te?= =?UTF-8?q?sts=20(random=20=20=20=20=20=20=20tests=20with=20a=20bias=20tow?= =?UTF-8?q?ards=20corner=20cases)=20it=20is=20slightly=20=20=20=20=20=20?= =?UTF-8?q?=20faster.=20=20=20=20=20-=20No=20cases=20have=20been=20found?= =?UTF-8?q?=20where=20more=20than=20two=20additional=20=20=20=20=20=20=20i?= =?UTF-8?q?terations=20are=20required,=20but=20they=20may=20exist.=20=20?= =?UTF-8?q?=20=20=20-eability=20fixes=20=20=20=20=20-=20mpd=5Fqset=5Fstrin?= =?UTF-8?q?g=5Fexact(),=20mpd=5Fqset=5Fi64=5Fexact()=20and=20=20=20=20=20?= =?UTF-8?q?=20=20mpd=5Fqset=5Fu64=5Fexact()=20can=20now=20be=20called=20wi?= =?UTF-8?q?th=20a=20nonzero=20=20=20=20=20=20=20status.=20Previously,=20th?= =?UTF-8?q?e=20functions=20could=20return=20=20=20=20=20=20=20NaN/Invalid?= =?UTF-8?q?=5Foperation=20in=20that=20case.=20=20=20=20=20-=20This=20is=20?= =?UTF-8?q?listed=20under=20=E2=80=9Creliability=20fixes=E2=80=9D=20since?= =?UTF-8?q?=20there=20is=20=20=20=20=20=20=20no=20possible=20scenario=20un?= =?UTF-8?q?der=20which=20these=20functions=20would=20=20=20=20=20=20=20leg?= =?UTF-8?q?itimately=20be=20called=20with=20a=20nonzero=20status.=20=20=20?= =?UTF-8?q?-=20libmpdec++=20=20=20=20=20-=20Add=20input=20validation=20for?= =?UTF-8?q?=20Decimal.shiftl(),=20Decimal.shiftr()=20=20=20=20=20=20=20and?= =?UTF-8?q?=20Decimal::ln10().?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/science/mpdecimal?expand=0&rev=5 --- .gitattributes | 23 +++++++ .gitignore | 1 + _multibuild | 3 + baselibs.conf | 3 + dectest.zip | 3 + mpdecimal-2.5.1.tar.gz | 3 + mpdecimal-4.0.1.tar.gz | 3 + mpdecimal.changes | 90 ++++++++++++++++++++++++++ mpdecimal.spec | 144 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 273 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 baselibs.conf create mode 100644 dectest.zip create mode 100644 mpdecimal-2.5.1.tar.gz create mode 100644 mpdecimal-4.0.1.tar.gz create mode 100644 mpdecimal.changes create mode 100644 mpdecimal.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..52dfc66 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1,3 @@ +libmpdec++4 +libmpdec4 +mpdecimal-devel diff --git a/dectest.zip b/dectest.zip new file mode 100644 index 0000000..c32d2ae --- /dev/null +++ b/dectest.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70a224cd52e82b7a8150aedac5efa2d0cb3941696fd829bdbe674f9f65c3926 +size 791733 diff --git a/mpdecimal-2.5.1.tar.gz b/mpdecimal-2.5.1.tar.gz new file mode 100644 index 0000000..8f5f7a1 --- /dev/null +++ b/mpdecimal-2.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f +size 2584021 diff --git a/mpdecimal-4.0.1.tar.gz b/mpdecimal-4.0.1.tar.gz new file mode 100644 index 0000000..4817b42 --- /dev/null +++ b/mpdecimal-4.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96d33abb4bb0070c7be0fed4246cd38416188325f820468214471938545b1ac8 +size 316268 diff --git a/mpdecimal.changes b/mpdecimal.changes new file mode 100644 index 0000000..6d9daac --- /dev/null +++ b/mpdecimal.changes @@ -0,0 +1,90 @@ +------------------------------------------------------------------- +Wed May 7 12:09:23 UTC 2025 - Matej Cepl + +- Update to 4.0.1 (bsc#1242704): + - Add Cygwin support. + - Update config.guess and config.sub to the latest versions. + - Fix pkg-config files for custom paths. + - Set LD/LDXX unconditionally to CC/CXX, since LDFLAGS/LDXXFLAGS from ./configure rely on it. +- Update to 4.0.0: + - sync soversion and major_version + - The added number formatting feature requires an ABI change, + hence the increase to SOVERSION=4. + - Packagers outside of the Linux distributions sometimes use + the major version number as the equivalent of SOVERSION on + their platforms and have an incorrect SOVERSION for 2.5.1, + which requires SOVERSION=3. + - While SOVERSION is not required to match the major + version number (example: glibc), mpdecimal will from + now on take the path of least resistance and always use + SOVERSION=MPD_MAJOR_VERSION. + - The jump to 4.0.0 should also remind users that a C++ library + is available. + - Support for out-of-tree build. + - Support for pkg-config. + - Unix: support for Loongson. + - Unix: support for CheriBSD. + - Compilers: support for icx, icpx, ibm-clang_r, ibm-clang++_r, + CompCert, clang-cl and emscripten. + - Windows: support for MSYS2/MinGW. + - MSVC: the build now uses /O2 /DNDEBUG. + - MSVC: new arm64/arm32 cross build scripts. + - AIX: the shared libraries are now installed as versioned + objects, e.g., shr4.o, shr4_64.o. + - New ./configure switches: + - --enable-static: enable/disable the build of the static + libraries (default: enabled). + - --enable-pc: enable/disable the install of the pkgconfig + files (default: enabled). + - --enable-doc: enable/disable the install of the documentation + (default: enabled). + - New man pages direct users to the mpdecimal-doc package or + the online HTML documentation. + - The prebuilt HTML documentation is now in the separate + mpdecimal-doc package, which gives distributions that reject + prebuilt documentation the option to disregard it and use the + new man pages. + - libmpdec: + - Add the “z” format specifier (coerce negative zeros to + positive). + - In extremely rare cases the transcendental functions (exp, + ln, log10) did not set the Subnormal/Underflow flags. The + reason is that in the case of an exponent boundary the Ziv + correction loop for correct rounding requires very few + iterations to arrive at the correctly rounded result, but + may need many more iterations to arrive at the correct + flags. + - In these cases, Subnormal/Underflow is not very + informative, so the status quo was to skip the extra + iterations. + - Version 4.0.0 now specializes exponent boundary cases + and uses up to five additional iterations to set + Subnormal/Underflow. The refactored code has no speed + penalty on average; in fact, in the deccheck tests (random + tests with a bias towards corner cases) it is slightly + faster. + - No cases have been found where more than two additional + iterations are required, but they may exist. + -eability fixes + - mpd_qset_string_exact(), mpd_qset_i64_exact() and + mpd_qset_u64_exact() can now be called with a nonzero + status. Previously, the functions could return + NaN/Invalid_operation in that case. + - This is listed under “reliability fixes” since there is + no possible scenario under which these functions would + legitimately be called with a nonzero status. + - libmpdec++ + - Add input validation for Decimal.shiftl(), Decimal.shiftr() + and Decimal::ln10(). + +------------------------------------------------------------------- +Thu Sep 2 13:07:52 UTC 2021 - Matej Cepl + +- Switch on _multibuild with the separate test step (to minimize + dependencies). +- Add a basic baselibs.conf. + +------------------------------------------------------------------- +Tue Aug 10 00:04:52 UTC 2021 - Stefan Krah + +- Initial package diff --git a/mpdecimal.spec b/mpdecimal.spec new file mode 100644 index 0000000..9b69b5d --- /dev/null +++ b/mpdecimal.spec @@ -0,0 +1,144 @@ +# +# spec file for package mpdecimal +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: mpdecimal%{psuffix} +Version: 4.0.1 +Release: 0 +Summary: C/C++ libraries for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: Development/Libraries/C and C++ +URL: https://www.bytereef.org/mpdecimal/index.html +Source0: https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-%{version}.tar.gz +Source1: http://speleotrove.com/decimal/dectest.zip +Source99: baselibs.conf +BuildRequires: fdupes +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: make +%if %{with test} +BuildRequires: unzip +%endif + +%description +libmpdec is a C implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - +to the IEEE 754-2008 Standard for Floating-Point Arithmetic, +provided that the appropriate context parameters are set. libmpdec++ +has a thread local context for inline operators and other functions +that use the implicit context. + +%package -n libmpdec4 +Summary: C library for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: System/Libraries + +%description -n libmpdec4 +libmpdec is a C implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - to +the IEEE 754-2008 Standard for Floating-Point Arithmetic. + +%package -n libmpdec++4 +Summary: C++ library for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: System/Libraries +Requires: libmpdec4 >= %{version} + +%description -n libmpdec++4 +libmpdec++ is a C++ implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - to +the IEEE 754-2008 Standard for Floating-Point Arithmetic. + +%package devel +Summary: Development headers and documentation for mpdecimal +License: BSD-2-Clause +Group: Development/Libraries/C and C++ +Requires: libmpdec++4 = %{version}-%{release} +Requires: libmpdec4 = %{version}-%{release} + +%description devel +The package contains documentation and development headers for +libmpdec and libmpdec++. + +%prep +%autosetup -p1 -n mpdecimal-%{version} + +%if %{with test} +unzip -d tests/testdata %{SOURCE1} +%endif + +%build +# NOTE: without -ffat-lto-objects the inline assembly tests in ./configure +# have false positives on a variety of architectures. +export CFLAGS="%optflags -ffat-lto-objects" +export CXXFLAGS="$CFLAGS" +%configure --docdir="%{_defaultdocdir}/%{name}" +%make_build + +%install +%if !%{with test} +%make_install +rm -f "%{buildroot}/%{_libdir}"/*.a +%fdupes -s %{buildroot}/%{_docdir}/%{name} +%endif + +%check +%if %{with test} +%make_build check +%endif + +%if !%{with test} +%post -n libmpdec4 -p /sbin/ldconfig +%post -n libmpdec++4 -p /sbin/ldconfig +%postun -n libmpdec4 -p /sbin/ldconfig +%postun -n libmpdec++4 -p /sbin/ldconfig + +%files -n libmpdec4 +%license COPYRIGHT.txt +%{_libdir}/libmpdec.so.4 +%{_libdir}/libmpdec.so.%{version} + +%files -n libmpdec++4 +%{_libdir}/libmpdec++.so.4 +%{_libdir}/libmpdec++.so.%{version} + +%files devel +%license doc/COPYRIGHT.txt +%doc %{_docdir}/%{name} +%{_libdir}/libmpdec.so +%{_libdir}/libmpdec++.so +%{_includedir}/mpdecimal.h +%{_includedir}/decimal.hh +%{_libdir}/pkgconfig/libmpdec*.pc +%{_mandir}/man3/*mpdec*.3%{?ext_man} +%endif + +%changelog -- 2.51.1 From e349ff543f32d98df1b84b1628842694a69b2e4b6026d86d0309d28711355120 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 13 May 2025 20:39:35 +0000 Subject: [PATCH 2/2] - Fix LDXXFLAGS (thank you Stefan Krah for providing the patch) OBS-URL: https://build.opensuse.org/package/show/science/mpdecimal?expand=0&rev=7 --- .gitattributes | 23 +++++++ .gitignore | 1 + _multibuild | 3 + baselibs.conf | 3 + dectest.zip | 3 + mpdecimal-2.5.1.tar.gz | 3 + mpdecimal-4.0.1.tar.gz | 3 + mpdecimal.changes | 95 +++++++++++++++++++++++++++ mpdecimal.spec | 144 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 278 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 baselibs.conf create mode 100644 dectest.zip create mode 100644 mpdecimal-2.5.1.tar.gz create mode 100644 mpdecimal-4.0.1.tar.gz create mode 100644 mpdecimal.changes create mode 100644 mpdecimal.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..52dfc66 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1,3 @@ +libmpdec++4 +libmpdec4 +mpdecimal-devel diff --git a/dectest.zip b/dectest.zip new file mode 100644 index 0000000..c32d2ae --- /dev/null +++ b/dectest.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70a224cd52e82b7a8150aedac5efa2d0cb3941696fd829bdbe674f9f65c3926 +size 791733 diff --git a/mpdecimal-2.5.1.tar.gz b/mpdecimal-2.5.1.tar.gz new file mode 100644 index 0000000..8f5f7a1 --- /dev/null +++ b/mpdecimal-2.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f9cd4c041f99b5c49ffb7b59d9f12d95b683d88585608aa56a6307667b2b21f +size 2584021 diff --git a/mpdecimal-4.0.1.tar.gz b/mpdecimal-4.0.1.tar.gz new file mode 100644 index 0000000..4817b42 --- /dev/null +++ b/mpdecimal-4.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96d33abb4bb0070c7be0fed4246cd38416188325f820468214471938545b1ac8 +size 316268 diff --git a/mpdecimal.changes b/mpdecimal.changes new file mode 100644 index 0000000..2684873 --- /dev/null +++ b/mpdecimal.changes @@ -0,0 +1,95 @@ +------------------------------------------------------------------- +Tue May 13 20:38:48 UTC 2025 - Matej Cepl + +- Fix LDXXFLAGS (thank you Stefan Krah for providing the patch) + +------------------------------------------------------------------- +Wed May 7 12:09:23 UTC 2025 - Matej Cepl + +- Update to 4.0.1 (bsc#1242704): + - Add Cygwin support. + - Update config.guess and config.sub to the latest versions. + - Fix pkg-config files for custom paths. + - Set LD/LDXX unconditionally to CC/CXX, since LDFLAGS/LDXXFLAGS from ./configure rely on it. +- Update to 4.0.0: + - sync soversion and major_version + - The added number formatting feature requires an ABI change, + hence the increase to SOVERSION=4. + - Packagers outside of the Linux distributions sometimes use + the major version number as the equivalent of SOVERSION on + their platforms and have an incorrect SOVERSION for 2.5.1, + which requires SOVERSION=3. + - While SOVERSION is not required to match the major + version number (example: glibc), mpdecimal will from + now on take the path of least resistance and always use + SOVERSION=MPD_MAJOR_VERSION. + - The jump to 4.0.0 should also remind users that a C++ library + is available. + - Support for out-of-tree build. + - Support for pkg-config. + - Unix: support for Loongson. + - Unix: support for CheriBSD. + - Compilers: support for icx, icpx, ibm-clang_r, ibm-clang++_r, + CompCert, clang-cl and emscripten. + - Windows: support for MSYS2/MinGW. + - MSVC: the build now uses /O2 /DNDEBUG. + - MSVC: new arm64/arm32 cross build scripts. + - AIX: the shared libraries are now installed as versioned + objects, e.g., shr4.o, shr4_64.o. + - New ./configure switches: + - --enable-static: enable/disable the build of the static + libraries (default: enabled). + - --enable-pc: enable/disable the install of the pkgconfig + files (default: enabled). + - --enable-doc: enable/disable the install of the documentation + (default: enabled). + - New man pages direct users to the mpdecimal-doc package or + the online HTML documentation. + - The prebuilt HTML documentation is now in the separate + mpdecimal-doc package, which gives distributions that reject + prebuilt documentation the option to disregard it and use the + new man pages. + - libmpdec: + - Add the “z” format specifier (coerce negative zeros to + positive). + - In extremely rare cases the transcendental functions (exp, + ln, log10) did not set the Subnormal/Underflow flags. The + reason is that in the case of an exponent boundary the Ziv + correction loop for correct rounding requires very few + iterations to arrive at the correctly rounded result, but + may need many more iterations to arrive at the correct + flags. + - In these cases, Subnormal/Underflow is not very + informative, so the status quo was to skip the extra + iterations. + - Version 4.0.0 now specializes exponent boundary cases + and uses up to five additional iterations to set + Subnormal/Underflow. The refactored code has no speed + penalty on average; in fact, in the deccheck tests (random + tests with a bias towards corner cases) it is slightly + faster. + - No cases have been found where more than two additional + iterations are required, but they may exist. + -eability fixes + - mpd_qset_string_exact(), mpd_qset_i64_exact() and + mpd_qset_u64_exact() can now be called with a nonzero + status. Previously, the functions could return + NaN/Invalid_operation in that case. + - This is listed under “reliability fixes” since there is + no possible scenario under which these functions would + legitimately be called with a nonzero status. + - libmpdec++ + - Add input validation for Decimal.shiftl(), Decimal.shiftr() + and Decimal::ln10(). + +------------------------------------------------------------------- +Thu Sep 2 13:07:52 UTC 2021 - Matej Cepl + +- Switch on _multibuild with the separate test step (to minimize + dependencies). +- Add a basic baselibs.conf. + +------------------------------------------------------------------- +Tue Aug 10 00:04:52 UTC 2021 - Stefan Krah + +- Initial package diff --git a/mpdecimal.spec b/mpdecimal.spec new file mode 100644 index 0000000..506edf8 --- /dev/null +++ b/mpdecimal.spec @@ -0,0 +1,144 @@ +# +# spec file for package mpdecimal +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +Name: mpdecimal%{psuffix} +Version: 4.0.1 +Release: 0 +Summary: C/C++ libraries for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: Development/Libraries/C and C++ +URL: https://www.bytereef.org/mpdecimal/index.html +Source0: https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-%{version}.tar.gz +Source1: http://speleotrove.com/decimal/dectest.zip +Source99: baselibs.conf +BuildRequires: fdupes +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: make +%if %{with test} +BuildRequires: unzip +%endif + +%description +libmpdec is a C implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - +to the IEEE 754-2008 Standard for Floating-Point Arithmetic, +provided that the appropriate context parameters are set. libmpdec++ +has a thread local context for inline operators and other functions +that use the implicit context. + +%package -n libmpdec4 +Summary: C library for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: System/Libraries + +%description -n libmpdec4 +libmpdec is a C implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - to +the IEEE 754-2008 Standard for Floating-Point Arithmetic. + +%package -n libmpdec++4 +Summary: C++ library for arbitrary precision decimal floating point arithmetic +License: BSD-2-Clause +Group: System/Libraries +Requires: libmpdec4 >= %{version} + +%description -n libmpdec++4 +libmpdec++ is a C++ implementation of the General Decimal Arithmetic +Specification. The specification defines a general purpose arbitrary +precision data type together with rigorously specified functions and +rounding behavior. libmpdec conforms - with minor restrictions - to +the IEEE 754-2008 Standard for Floating-Point Arithmetic. + +%package devel +Summary: Development headers and documentation for mpdecimal +License: BSD-2-Clause +Group: Development/Libraries/C and C++ +Requires: libmpdec++4 = %{version}-%{release} +Requires: libmpdec4 = %{version}-%{release} + +%description devel +The package contains documentation and development headers for +libmpdec and libmpdec++. + +%prep +%autosetup -p1 -n mpdecimal-%{version} + +%if %{with test} +unzip -d tests/testdata %{SOURCE1} +%endif + +%build +# NOTE: without -ffat-lto-objects the inline assembly tests in ./configure +# have false positives on a variety of architectures. +export CFLAGS="%optflags -ffat-lto-objects" +export CXXFLAGS="$CFLAGS" +%configure LDXXFLAGS="%{build_ldflags}" --docdir="%{_defaultdocdir}/%{name}" +%make_build + +%install +%if !%{with test} +%make_install +rm -f "%{buildroot}/%{_libdir}"/*.a +%fdupes -s %{buildroot}/%{_docdir}/%{name} +%endif + +%check +%if %{with test} +%make_build check +%endif + +%if !%{with test} +%post -n libmpdec4 -p /sbin/ldconfig +%post -n libmpdec++4 -p /sbin/ldconfig +%postun -n libmpdec4 -p /sbin/ldconfig +%postun -n libmpdec++4 -p /sbin/ldconfig + +%files -n libmpdec4 +%license COPYRIGHT.txt +%{_libdir}/libmpdec.so.4 +%{_libdir}/libmpdec.so.%{version} + +%files -n libmpdec++4 +%{_libdir}/libmpdec++.so.4 +%{_libdir}/libmpdec++.so.%{version} + +%files devel +%license doc/COPYRIGHT.txt +%doc %{_docdir}/%{name} +%{_libdir}/libmpdec.so +%{_libdir}/libmpdec++.so +%{_includedir}/mpdecimal.h +%{_includedir}/decimal.hh +%{_libdir}/pkgconfig/libmpdec*.pc +%{_mandir}/man3/*mpdec*.3%{?ext_man} +%endif + +%changelog -- 2.51.1