osc copypac from project:devel:languages:haskell:ghc-9.10.x package:ghc-random revision:3, using keep-link

OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc-random?expand=0&rev=72
This commit is contained in:
Peter Simons 2024-12-17 22:01:01 +00:00 committed by Git OBS Bridge
commit 80d58ddc55
6 changed files with 455 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

262
ghc-random.changes Normal file
View File

@ -0,0 +1,262 @@
-------------------------------------------------------------------
Sat Dec 14 20:31:28 UTC 2024 - Peter Simons <psimons@suse.com>
- Update random to version 1.2.1.3.
Upstream has not updated the file "CHANGELOG.md" since the last
release.
-------------------------------------------------------------------
Sun Feb 4 16:26:32 UTC 2024 - Peter Simons <psimons@suse.com>
- Update random to version 1.2.1.2.
Upstream has not updated the file "CHANGELOG.md" since the last
release.
-------------------------------------------------------------------
Sat Sep 30 20:57:11 UTC 2023 - Peter Simons <psimons@suse.com>
- Update random to version 1.2.1.1 revision 1.
Upstream has revised the Cabal build instructions on Hackage.
-------------------------------------------------------------------
Thu Mar 30 17:08:00 UTC 2023 - Peter Simons <psimons@suse.com>
- Updated spec file to conform with ghc-rpm-macros-2.5.2.
-------------------------------------------------------------------
Mon May 9 02:32:03 UTC 2022 - Peter Simons <psimons@suse.com>
- Update random to version 1.2.1.1.
Upstream has not updated the file "CHANGELOG.md" since the last
release.
-------------------------------------------------------------------
Mon Sep 20 07:13:14 UTC 2021 - psimons@suse.com
- Update random to version 1.2.1.
# 1.2.1
* Fix support for ghc-9.2 [#99](https://github.com/haskell/random/pull/99)
* Fix performance regression for ghc-9.0 [#101](https://github.com/haskell/random/pull/101)
* Add `uniformEnumM` and `uniformEnumRM`
* Add `initStdGen` [#103](https://github.com/haskell/random/pull/103)
* Add `globalStdGen` [#117](https://github.com/haskell/random/pull/117)
* Add `runStateGenST_`
* Ensure that default implementation of `ShortByteString` generation uses
unpinned memory. [#116](https://github.com/haskell/random/pull/116)
* Fix [#54](https://github.com/haskell/random/issues/54) with
[#68](https://github.com/haskell/random/pull/68) - if exactly one value in the
range of floating point is infinite, then `uniformRM`/`randomR` returns that
value.
* Add default implementation of `uniformM` that uses `Generic`
[#70](https://github.com/haskell/random/pull/70)
* `Random` instance for `CBool` [#77](https://github.com/haskell/random/pull/77)
* Addition of `TGen` and `TGenM` [#95](https://github.com/haskell/random/pull/95)
* Addition of tuple instances for `Random` up to 7-tuple
[#72](https://github.com/haskell/random/pull/72)
-------------------------------------------------------------------
Thu Jul 15 16:15:27 UTC 2021 - psimons@suse.com
- Update random to version 1.2.0 revision 6.
Upstream has revised the Cabal build instructions on Hackage.
-------------------------------------------------------------------
Sat Jul 10 14:07:02 UTC 2021 - psimons@suse.com
- Update random to version 1.2.0 revision 5.
# 1.2.0
1. Breaking change which mostly maintains backwards compatibility, see
"Breaking Changes" below.
2. Support for monadic generators e.g. [mwc-random](https://hackage.haskell.org/package/mwc-random).
3. Monadic adapters for pure generators (providing a uniform monadic
interface to pure and monadic generators).
4. Faster in all cases except one by more than x18 (N.B. x18 not 18%) and
some cases (depending on the type) faster by more than x1000 - see
below for benchmarks.
5. Passes a large number of random number test suites:
* [dieharder](http://webhome.phy.duke.edu/~rgb/General/dieharder.php "venerable")
* [TestU01 (SmallCrush, Crush, BigCrush)](http://simul.iro.umontreal.ca/testu01/tu01.html "venerable")
* [PractRand](http://pracrand.sourceforge.net/ "active")
* [gjrand](http://gjrand.sourceforge.net/ "active")
* See [random-quality](https://github.com/tweag/random-quality)
for details on how to do this yourself.
6. Better quality split as judged by these
[tests](https://www.cambridge.org/core/journals/journal-of-functional-programming/article/evaluation-of-splittable-pseudorandom-generators/3EBAA9F14939C5BB5560E32D1A132637). Again
see [random-quality](https://github.com/tweag/random-quality) for
details on how to do this yourself.
7. Unbiased generation of ranges.
8. Updated tests and benchmarks.
9. [Continuous integration](https://travis-ci.org/github/haskell/random).
### Breaking Changes
Version 1.2.0 introduces these breaking changes:
* requires `base >= 4.8` (GHC-7.10)
* `StdGen` is no longer an instance of `Read`
* `randomIO` and `randomRIO` were extracted from the `Random` class into
separate functions
In addition, there may be import clashes with new functions, e.g. `uniform` and
`uniformR`.
### Deprecations
Version 1.2.0 introduces `genWord64`, `genWord32` and similar methods to the
`RandomGen` class. The significantly slower method `next` and its companion
`genRange` are now deprecated.
### Issues Addressed
Issue Number | Description | Comment
--------------|-------------|--------
[25](https://github.com/haskell/random/issues/25) | The seeds generated by split are not independent | Fixed: changed algorithm to SplitMix, which provides a robust split operation
[26](https://github.com/haskell/random/issues/26) | Add Random instances for tuples | Addressed: added `Uniform` instances for up to 6-tuples
[44](https://github.com/haskell/random/issues/44) | Add Random instance for Natural | Addressed: added UniformRange instance for Natural
[51](https://github.com/haskell/random/issues/51) | Very low throughput | Fixed: see benchmarks below
[53](https://github.com/haskell/random/issues/53) | incorrect distribution of randomR for floating-point numbers | (\*)
[55](https://github.com/haskell/random/issues/55) | System/Random.hs:43:1: warning: [-Wtabs] | Fixed: No more tabs
[58](https://github.com/haskell/random/issues/58) | Why does random for Float and Double produce exactly 24 or 53 bits? | (\*)
[59](https://github.com/haskell/random/issues/59) | read :: StdGen fails for strings longer than 6 | Addressed: StdGen is no longer an instance of Read
#### Comments
(\*) 1.2 samples more bits but does not sample every `Float` or
`Double`. There are methods to do this but they have some downsides;
see [here](https://github.com/idontgetoutmuch/random/issues/105) for a
fuller discussion.
## Benchmarks
Here are some benchmarks run on a 3.1 GHz Intel Core i7. The full
benchmarks can be run using e.g. `stack bench`. The benchmarks are
measured in milliseconds per 100,000 generations. In some cases, the
performance is over x1000 times better; the minimum performance
increase for the types listed below is more than x36.
Name | 1.1 Mean | 1.2 Mean
------------|----------|----------
Float | 27.819 | 0.305
Double | 50.644 | 0.328
Integer | 42.332 | 0.332
Word | 40.739 | 0.027
Int | 43.847 | 0.028
Char | 17.009 | 0.462
Bool | 17.542 | 0.027
-------------------------------------------------------------------
Thu Dec 17 12:20:00 UTC 2020 - Ondřej Súkup <mimi.vx@gmail.com>
- disable %{ix86} build
-------------------------------------------------------------------
Mon Aug 31 09:34:32 UTC 2020 - psimons@suse.com
- Update random to version 1.1 revision 1.
Upstream has revised the Cabal build instructions on Hackage.
-------------------------------------------------------------------
Tue Aug 18 10:45:49 UTC 2020 - Peter Simons <psimons@suse.com>
- Replace %setup -q with the more modern %autosetup macro.
-------------------------------------------------------------------
Tue Jun 16 11:14:30 UTC 2020 - Peter Simons <psimons@suse.com>
- Re-generate file with latest version of spec-cleaner.
-------------------------------------------------------------------
Fri Nov 8 16:14:30 UTC 2019 - Peter Simons <psimons@suse.com>
- Drop obsolete group attributes.
-------------------------------------------------------------------
Sat Oct 20 11:31:54 UTC 2018 - Peter Simons <psimons@suse.com>
- Use https URL to refer to bugs.opensuse.org.
-------------------------------------------------------------------
Wed Jul 18 14:26:37 UTC 2018 - psimons@suse.com
- Cosmetic: replace tabs with blanks, strip trailing white space,
and update copyright headers with spec-cleaner.
-------------------------------------------------------------------
Wed May 16 14:36:27 UTC 2018 - psimons@suse.com
- Prefer the new %license attribute over %doc.
-------------------------------------------------------------------
Thu Aug 3 15:38:38 UTC 2017 - psimons@suse.com
- Updated with latest spec-cleaner version 0.9.8-8-geadfbbf.
-------------------------------------------------------------------
Thu Jan 26 16:20:16 UTC 2017 - psimons@suse.com
- Update to version 1.1 revision 1 with cabal2obs.
-------------------------------------------------------------------
Sun Jul 10 17:13:32 UTC 2016 - psimons@suse.com
- Update to version 1.1 revision 0 with cabal2obs.
-------------------------------------------------------------------
Thu Apr 9 17:25:19 UTC 2015 - mimi.vx@gmail.com
- update to 1.1
* breaking change to `randomIValInteger` to improve RNG quality and performance
* correct documentation about generated range of Int32 sized values of type Int
* fix memory leaks by using strict fields and strict atomicModifyIORef'
* support for base < 4.6 (which doesnt provide strict atomicModifyIORef')
* fix C type in test suite https://github.com/haskell/random/pull/9
-------------------------------------------------------------------
Tue Sep 2 09:53:08 UTC 2014 - peter.trommler@ohm-hochschule.de
- regenerate spec file
-------------------------------------------------------------------
Sat Aug 23 00:18:32 UTC 2014 - peter.trommler@ohm-hochschule.de
- enable PowerPC builds
-------------------------------------------------------------------
Mon May 6 09:35:42 UTC 2013 - peter.trommler@ohm-hochschule.de
- more transparent packaging (fewer macros)
-------------------------------------------------------------------
Sun Dec 30 18:34:01 UTC 2012 - peter.trommler@ohm-hochschule.de
- expand macro in name tag to help source validator
-------------------------------------------------------------------
Sat Nov 17 14:38:03 UTC 2012 - peter.trommler@ohm-hochschule.de
- make service localonly for Factory submission
-------------------------------------------------------------------
Sun May 6 08:01:59 UTC 2012 - peter.trommler@ohm-hochschule.de
- spec file template generated by cabal2spec-0.25.5
- added copyright notice to spec file
- added summary and description to spec file
-------------------------------------------------------------------
Fri Jan 6 15:18:40 UTC 2012 - peter.trommler@ohm-hochschule.de
- Upgrade to 1.0.1.1 from upstream
- Enable hscolour
-------------------------------------------------------------------
Mon Dec 5 15:08:48 UTC 2011 - peter.trommler@ohm-hochschule.de
- Add exclusive archs.
-------------------------------------------------------------------
Mon Dec 5 15:06:42 UTC 2011 - peter.trommler@ohm-hochschule.de
- Initial packaging.

163
ghc-random.spec Normal file
View File

@ -0,0 +1,163 @@
#
# spec file for package ghc-random
#
# Copyright (c) 2024 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 pkg_name random
%global pkgver %{pkg_name}-%{version}
%bcond_with tests
Name: ghc-%{pkg_name}
Version: 1.2.1.3
Release: 0
Summary: Pseudo-random number generation
License: BSD-3-Clause
URL: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-base-devel
BuildRequires: ghc-base-prof
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-bytestring-prof
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-deepseq-prof
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-mtl-prof
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-splitmix-devel
BuildRequires: ghc-splitmix-prof
ExcludeArch: %{ix86}
%if %{with tests}
BuildRequires: ghc-containers-devel
BuildRequires: ghc-containers-prof
BuildRequires: ghc-smallcheck-devel
BuildRequires: ghc-smallcheck-prof
BuildRequires: ghc-stm-devel
BuildRequires: ghc-stm-prof
BuildRequires: ghc-tasty-devel
BuildRequires: ghc-tasty-hunit-devel
BuildRequires: ghc-tasty-hunit-prof
BuildRequires: ghc-tasty-inspection-testing-devel
BuildRequires: ghc-tasty-inspection-testing-prof
BuildRequires: ghc-tasty-prof
BuildRequires: ghc-tasty-smallcheck-devel
BuildRequires: ghc-tasty-smallcheck-prof
BuildRequires: ghc-transformers-devel
BuildRequires: ghc-transformers-prof
%endif
%description
This package provides basic pseudo-random number generation, including the
ability to split random number generators.
== "System.Random": pure pseudo-random number interface
In pure code, use 'System.Random.uniform' and 'System.Random.uniformR' from
"System.Random" to generate pseudo-random numbers with a pure pseudo-random
number generator like 'System.Random.StdGen'.
As an example, here is how you can simulate rolls of a six-sided die using
'System.Random.uniformR':
>>> let roll = uniformR (1, 6) :: RandomGen g => g -> (Word, g) >>> let rolls =
unfoldr (Just . roll) :: RandomGen g => g -> [Word] >>> let pureGen = mkStdGen
42 >>> take 10 (rolls pureGen) :: [Word] [1,1,3,2,4,5,3,4,6,2]
See "System.Random" for more details.
== "System.Random.Stateful": monadic pseudo-random number interface
In monadic code, use 'System.Random.Stateful.uniformM' and
'System.Random.Stateful.uniformRM' from "System.Random.Stateful" to generate
pseudo-random numbers with a monadic pseudo-random number generator, or using a
monadic adapter.
As an example, here is how you can simulate rolls of a six-sided die using
'System.Random.Stateful.uniformRM':
>>> let rollM = uniformRM (1, 6) :: StatefulGen g m => g -> m Word >>> let
pureGen = mkStdGen 42 >>> runStateGen_ pureGen (replicateM 10 . rollM) ::
[Word] [1,1,3,2,4,5,3,4,6,2]
The monadic adapter 'System.Random.Stateful.runStateGen_' is used here to lift
the pure pseudo-random number generator 'pureGen' into the
'System.Random.Stateful.StatefulGen' context.
The monadic interface can also be used with existing monadic pseudo-random
number generators. In this example, we use the one provided in the
<https://hackage.haskell.org/package/mwc-random mwc-random> package:
>>> import System.Random.MWC as MWC >>> let rollM = uniformRM (1, 6) ::
StatefulGen g m => g -> m Word >>> monadicGen <- MWC.create >>> replicateM 10
(rollM monadicGen) :: IO [Word] [2,3,6,6,4,4,3,1,5,4]
See "System.Random.Stateful" for more details.
%package devel
Summary: Haskell %{pkg_name} library development files
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}
%description devel
This package provides the Haskell %{pkg_name} library development files.
%package -n ghc-%{pkg_name}-doc
Summary: Haskell %{pkg_name} library documentation
Requires: ghc-filesystem
BuildArch: noarch
%description -n ghc-%{pkg_name}-doc
This package provides the Haskell %{pkg_name} library documentation.
%package -n ghc-%{pkg_name}-prof
Summary: Haskell %{pkg_name} profiling library
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
%description -n ghc-%{pkg_name}-prof
This package provides the Haskell %{pkg_name} profiling library.
%prep
%autosetup -n %{pkg_name}-%{version}
%build
%ghc_lib_build
%install
%ghc_lib_install
%check
%cabal_test
%post devel
%ghc_pkg_recache
%postun devel
%ghc_pkg_recache
%files -f %{name}.files
%license LICENSE
%files devel -f %{name}-devel.files
%doc CHANGELOG.md README.md
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
%license LICENSE
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
%changelog

3
random-1.2.1.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:790f4dc2d2327c453ff6aac7bf15399fd123d55e927935f68f84b5df42d9a4b4
size 47229

3
random-1.2.1.3.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e9c81926a7d1e40328f645f73592b31efc9c631589669a7f130687b9cc3051dc
size 47117