From a7a4519feed5d56fd2be25de4b9af382fb33fcfe Mon Sep 17 00:00:00 2001 From: hololeap Date: Fri, 23 Jan 2026 22:16:16 -0700 Subject: [PATCH] dev-haskell/mwc-random: add 0.15.3.0 Signed-off-by: hololeap Signed-off-by: Mark Wright --- dev-haskell/mwc-random/Manifest | 1 + .../mwc-random-0.15.3.0-cabal-doctest.patch | 87 +++++++++++++++++++ dev-haskell/mwc-random/metadata.xml | 4 + .../mwc-random/mwc-random-0.15.3.0.ebuild | 50 +++++++++++ 4 files changed, 142 insertions(+) create mode 100644 dev-haskell/mwc-random/files/mwc-random-0.15.3.0-cabal-doctest.patch create mode 100644 dev-haskell/mwc-random/mwc-random-0.15.3.0.ebuild diff --git a/dev-haskell/mwc-random/Manifest b/dev-haskell/mwc-random/Manifest index dc55022b9c51f..3f57c428f582c 100644 --- a/dev-haskell/mwc-random/Manifest +++ b/dev-haskell/mwc-random/Manifest @@ -1,3 +1,4 @@ DIST mwc-random-0.14.0.0.tar.gz 19674 BLAKE2B 3410f8d237c8e4a0f079c13567082273fc79d287c8de2b9ea0c1f396271ba7571caf890d6065ae7f0e5aae41f66575d90df178b981db24c9792213facf1d9c3d SHA512 bb262d6f4a37d91e4c0667ec5140894ed36bf3ef4b90e487f4d689a6bc4eddd09dcdc3c8b75013124908ca1642e990c3e074fb728acc1b36f63b3db66528301d DIST mwc-random-0.15.0.2-rev1.cabal 3372 BLAKE2B 1e565e2028fe1cba958684ebfef4c3c248776402c8310e389c553084cae82c2451c19bd78567df9aa58fb926a8b10bf5e8fbec211c9bd0a33c3d0ac15b4f16e3 SHA512 7b3f2bb05148fc85ed4f85bbd96fbe6e836857a117c839cb2ceb51c4b17aa4ebc03b8989970cbf9b51aadfc6a9507a6af4dd864ec65b8b421456f46eee0974ed DIST mwc-random-0.15.0.2.tar.gz 26591 BLAKE2B 8320eaa28e5bc302104c8e9617e8e50728934d7143ea5a243570aed28cec5c98bb17d128460aed27dcbf5b3b71570a39f6247a3868cb18eb3f3c0325c20fed67 SHA512 7e30a4584bca7f5e5147388dc9c081ac417d3aff1e9bd431535eac695db0779b4d20c6b3bedbda06a4780d9d57ab1f7880743f7bad20e4f5d2b7d32ce7f373bd +DIST mwc-random-0.15.3.0.tar.gz 44850 BLAKE2B 071f664e0db8381e167b5a820f349d9d6841f3c0a788a42e2ed786c7d6d516ee5ad697a0a20839235bcd671da34e1b38be3dfedb0977101564bcc1492e1608aa SHA512 1b15c47a7ce4bd5e0ff7d608992f379d0494ff31e3ff824e65860980b96c7eb9825f2dd79f36d2d5b1679b1a3fda6aaac97aec51666a80ca67ee5d68d07d0a42 diff --git a/dev-haskell/mwc-random/files/mwc-random-0.15.3.0-cabal-doctest.patch b/dev-haskell/mwc-random/files/mwc-random-0.15.3.0-cabal-doctest.patch new file mode 100644 index 0000000000000..d376ff5d76f9d --- /dev/null +++ b/dev-haskell/mwc-random/files/mwc-random-0.15.3.0-cabal-doctest.patch @@ -0,0 +1,87 @@ +From 5f36de89409574c5f3f2ea5125cfab331976aa06 Mon Sep 17 00:00:00 2001 +From: hololeap +Date: Wed, 21 Jan 2026 01:34:01 -0700 +Subject: [PATCH 1/1] Migrate to cabal-doctest + +doctest pulls in the out-of-scope packages if they are installed on the +system. The best workaround is to use migrate to cabal-doctest. + +Bug: https://github.com/gentoo-haskell/gentoo-haskell/issues/1231 +Signed-off-by: hololeap +--- /dev/null ++++ b/Setup.hs +@@ -0,0 +1,23 @@ ++{-# LANGUAGE CPP #-} ++ ++module Main (main) where ++ ++#ifndef MIN_VERSION_cabal_doctest ++#define MIN_VERSION_cabal_doctest(x,y,z) 0 ++#endif ++ ++#if MIN_VERSION_cabal_doctest(1,0,0) ++ ++import Distribution.Extra.Doctest ( defaultMainWithDoctests ) ++ ++main :: IO () ++main = defaultMainWithDoctests "mwc-doctests" ++ ++#else ++ ++import Distribution.Simple ++ ++main :: IO () ++main = defaultMain ++ ++#endif +--- a/Setup.lhs ++++ /dev/null +@@ -1,3 +0,0 @@ +-#!/usr/bin/env runhaskell +-> import Distribution.Simple +-> main = defaultMain +--- a/mwc-random.cabal ++++ b/mwc-random.cabal +@@ -1,5 +1,5 @@ + cabal-version: 3.0 +-build-type: Simple ++build-type: Custom + name: mwc-random + version: 0.15.3.0 + license: BSD-2-Clause +@@ -61,6 +61,11 @@ flag BenchPAPI + Default: False + Manual: True + ++custom-setup ++ setup-depends: ++ base ++ , cabal-doctest >=1.0.9 && <1.1 ++ + library + default-language: Haskell2010 + exposed-modules: System.Random.MWC +@@ -141,7 +146,6 @@ test-suite mwc-doctests + buildable: False + build-depends: + base -any +- , mwc-random -any + , doctest >=0.15 && <0.24 + -- + , bytestring +--- a/tests/doctests.hs ++++ b/tests/doctests.hs +@@ -1,4 +1,9 @@ ++import Build_doctests (flags, pkgs, module_sources) + import Test.DocTest (doctest) ++import GHC.IO.Encoding (setLocaleEncoding) ++import System.IO (utf8) + + main :: IO () +-main = doctest ["-fobject-code", "System/Random/MWC.hs"] ++main = do ++ setLocaleEncoding utf8 ++ doctest $ flags ++ pkgs ++ module_sources +-- +2.52.0 + diff --git a/dev-haskell/mwc-random/metadata.xml b/dev-haskell/mwc-random/metadata.xml index c6a1cbc7566e1..813537ca45167 100644 --- a/dev-haskell/mwc-random/metadata.xml +++ b/dev-haskell/mwc-random/metadata.xml @@ -5,6 +5,10 @@ haskell@gentoo.org Gentoo Haskell + + Enable building of benchmarks which use instruction counters. +It requires libpapi and only works on Linux so it's protected by flag + mwc-random bos/mwc-random diff --git a/dev-haskell/mwc-random/mwc-random-0.15.3.0.ebuild b/dev-haskell/mwc-random/mwc-random-0.15.3.0.ebuild new file mode 100644 index 0000000000000..49fb5384a7b26 --- /dev/null +++ b/dev-haskell/mwc-random/mwc-random-0.15.3.0.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# ebuild generated by hackport 0.9.1.0.9999 + +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" +inherit haskell-cabal + +DESCRIPTION="Fast, high quality pseudo random number generation" +HOMEPAGE="https://github.com/haskell/mwc-random" + +LICENSE="BSD-2" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" +IUSE="benchpapi" + +CABAL_CHDEPS=( + 'doctest >=0.15 && <0.24' 'doctest >=0.15' +) + +PATCHES=( + "${FILESDIR}/${PN}-0.15.3.0-cabal-doctest.patch" +) + +RDEPEND=">=dev-haskell/math-functions-0.2.1.0:=[profile?] + >=dev-haskell/primitive-0.6.2:=[profile?] + >=dev-haskell/random-1.2:=[profile?] + >=dev-haskell/vector-0.7:=[profile?] + >=dev-lang/ghc-9.0.2:= +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-3.4.1.0 + test? ( >=dev-haskell/doctest-0.15 + >=dev-haskell/cabal-doctest-1.0.9 + >=dev-haskell/math-functions-0.3.4 + >=dev-haskell/quickcheck-2.2 + >=dev-haskell/tasty-1.3.1 + dev-haskell/tasty-hunit + >=dev-haskell/tasty-quickcheck-0.10.2 + >=dev-haskell/vector-0.12.1 ) +" + +src_configure() { + use test && export GHC_BOOTSTRAP_PACKAGES+=( cabal-doctest ) + + haskell-cabal_src_configure \ + $(cabal_flag benchpapi benchpapi) +}