ghc-double-conversion/ghc-double-conversion.spec

151 lines
3.9 KiB
RPMSpec
Raw Permalink Normal View History

# generated by cabal-rpm-2.1.0
2022-03-24 06:31:24 +00:00
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Haskell/
%global pkg_name double-conversion
%global pkgver %{pkg_name}-%{version}
# testsuite missing deps: test-framework test-framework-hunit test-framework-quickcheck2
Name: ghc-%{pkg_name}
2023-01-22 15:30:09 +00:00
Version: 2.0.4.2
Release: %autorelease
2023-01-22 15:30:09 +00:00
Summary: Fast conversion between single and double precision floating point and text
2022-03-24 06:31:24 +00:00
License: BSD-2-Clause
2022-03-24 06:31:24 +00:00
Url: https://hackage.haskell.org/package/%{pkg_name}
# Begin cabal-rpm sources:
Source0: https://hackage.haskell.org/package/%{pkgver}/%{pkgver}.tar.gz
Source1: https://hackage.haskell.org/package/%{pkgver}/%{pkg_name}.cabal#/%{pkgver}.cabal
# End cabal-rpm sources
# tweaked https://salsa.debian.org/haskell-team/DHG_packages/-/raw/master/p/haskell-double-conversion/debian/patches/
Patch0: use-system-lib.diff
# Begin cabal-rpm deps:
BuildRequires: dos2unix
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-base-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-text-devel
%if %{with ghc_prof}
2022-03-24 06:31:24 +00:00
BuildRequires: ghc-base-prof
BuildRequires: ghc-bytestring-prof
BuildRequires: ghc-text-prof
%endif
2022-03-24 06:31:24 +00:00
BuildRequires: double-conversion-devel
BuildRequires: gcc-c++
# End cabal-rpm deps
%description
2023-01-22 15:30:09 +00:00
A library that performs fast, accurate conversion between floating point and
text.
2022-03-24 06:31:24 +00:00
This library is implemented as bindings to the C++ 'double-conversion' library
written by Florian Loitsch at Google:
<https://github.com/floitsch/double-conversion>.
2023-01-22 15:30:09 +00:00
Now it can convert single precision numbers, and also it can create Builder,
instead of bytestring or text.
2022-03-24 06:31:24 +00:00
The 'Text' versions of these functions are about 30 times faster than the
default 'show' implementation for the 'Double' type.
2023-01-22 15:30:09 +00:00
The 'ByteString' versions are have very close speed to the 'Text' versions;
Builder versions (both for Text and Bytestring) are slower on single value, but
they are much faster on large number of values (up to 20x faster on list with
20000 doubles).
2022-03-24 06:31:24 +00:00
As a final note, be aware that the 'bytestring-show' package is about 50%
slower than simply using 'show'.
%package devel
Summary: Haskell %{pkg_name} library development files
Provides: %{name}-static = %{version}-%{release}
Provides: %{name}-static%{?_isa} = %{version}-%{release}
%if %{defined ghc_version}
Requires: ghc-compiler = %{ghc_version}
%endif
Requires: %{name}%{?_isa} = %{version}-%{release}
# Begin cabal-rpm deps:
Requires: double-conversion-devel%{?_isa}
# End cabal-rpm deps
# missing from double-conversion-devel (#2068103)
Requires: gcc-c++
2022-03-24 06:31:24 +00:00
%description devel
This package provides the Haskell %{pkg_name} library development
files.
%if %{with haddock}
%package doc
Summary: Haskell %{pkg_name} library documentation
BuildArch: noarch
Requires: ghc-filesystem
%description doc
This package provides the Haskell %{pkg_name} library documentation.
%endif
%if %{with ghc_prof}
%package prof
Summary: Haskell %{pkg_name} profiling library
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
Supplements: (%{name}-devel and ghc-prof)
%description prof
This package provides the Haskell %{pkg_name} profiling library.
%endif
%prep
# Begin cabal-rpm setup:
%setup -q -n %{pkgver}
dos2unix -k -n %{SOURCE1} %{pkg_name}.cabal
# End cabal-rpm setup
2023-01-22 15:30:09 +00:00
cabal-tweak-flag embedded_double_conversion False
2022-03-24 06:31:24 +00:00
%patch0 -p1 -b .orig
# remove bundled library
rm -r double-conversion
%build
# Begin cabal-rpm build:
%ghc_lib_build
# End cabal-rpm build
%install
# Begin cabal-rpm install
%ghc_lib_install
# End cabal-rpm install
%files -f %{name}.files
# Begin cabal-rpm files:
%license LICENSE
# End cabal-rpm files
%files devel -f %{name}-devel.files
%doc README.markdown
%if %{with haddock}
%files doc -f %{name}-doc.files
%license LICENSE
%endif
%if %{with ghc_prof}
%files prof -f %{name}-prof.files
%endif
%changelog
%autochangelog