Skip to content

Commit de736b4

Browse files
committed
Guard all references to profiling packages in "%if %{with ghc_prof}".
This allows the package to still build successfully when profiling builds have been disabled.
1 parent 3335303 commit de736b4

File tree

356 files changed

+4467
-2356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+4467
-2356
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20250722
11+
# version: 0.19.20260104
1212
#
13-
# REGENDATA ("0.19.20250722",["--doctest","--doctest-version=^>= 0.23","--installed=+all -Cabal -Cabal-syntax","github","cabal2spec.cabal"])
13+
# REGENDATA ("0.19.20260104",["--doctest","--doctest-version=^>= 0.23","--installed=+all -Cabal -Cabal-syntax","github","cabal2spec.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
1717
- push
1818
- pull_request
19+
- merge_group
1920
jobs:
2021
linux:
2122
name: Haskell-CI - Linux - ${{ matrix.compiler }}
@@ -28,14 +29,19 @@ jobs:
2829
strategy:
2930
matrix:
3031
include:
32+
- compiler: ghc-9.14.1
33+
compilerKind: ghc
34+
compilerVersion: 9.14.1
35+
setup-method: ghcup
36+
allow-failure: false
3137
- compiler: ghc-9.12.2
3238
compilerKind: ghc
3339
compilerVersion: 9.12.2
3440
setup-method: ghcup
3541
allow-failure: false
36-
- compiler: ghc-9.10.2
42+
- compiler: ghc-9.10.3
3743
compilerKind: ghc
38-
compilerVersion: 9.10.2
44+
compilerVersion: 9.10.3
3945
setup-method: ghcup
4046
allow-failure: false
4147
- compiler: ghc-9.8.4
@@ -71,8 +77,8 @@ jobs:
7177
chmod a+x "$HOME/.ghcup/bin/ghcup"
7278
- name: Install cabal-install
7379
run: |
74-
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
75-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
80+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
81+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
7682
- name: Install GHC (GHCup)
7783
if: matrix.setup-method == 'ghcup'
7884
run: |
@@ -163,7 +169,7 @@ jobs:
163169
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-756ded72
164170
path: ~/.haskell-ci-tools
165171
- name: checkout
166-
uses: actions/checkout@v4
172+
uses: actions/checkout@v5
167173
with:
168174
path: source
169175
- name: initial cabal.project for sdist

cabal2spec.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: cabal2spec
2-
version: 2.8.0
2+
version: 2.9.0
33
synopsis: Convert Cabal files into rpm spec files
44
description: Convert
55
Cabal files into a

src/Cabal2Spec.hs

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ mkTools tools' = filter excludedTools $ nub $ map mapTools tools'
5151

5252
createSpecFile :: FilePath -> PackageDescription -> ForceBinary -> RunTests -> FlagAssignment -> Maybe CopyrightYear -> IO ()
5353
createSpecFile specFile pkgDesc forceBinary runTests flagAssignment copyrightYear = do
54-
let deps :: [String]
55-
deps = map showDevelDep deps' ++ map showProfDep deps'
54+
let develDeps, profDeps :: [String]
55+
develDeps = map showDevelDep deps'
56+
profDeps = map showProfDep deps'
5657
deps' :: [String]
5758
selfdep :: Bool
5859
(deps', selfdep) = buildDependencies pkgDesc name
@@ -153,14 +154,18 @@ createSpecFile specFile pkgDesc forceBinary runTests flagAssignment copyrightYea
153154
putHdr "ExcludeArch" "%{ix86}"
154155

155156
let fixedDeps = ["ghc-Cabal-devel", "ghc-rpm-macros"]
156-
let alldeps = sort $ nub $ fixedDeps ++ deps ++ tools ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
157-
let extraTestDeps = sort $ testsuiteDeps \\ deps
158-
unless (null $ alldeps ++ extraTestDeps) $ do
159-
mapM_ (putHdr "BuildRequires") alldeps
160-
unless (null extraTestDeps) $ do
161-
put "%if %{with tests}"
162-
mapM_ (putHdr "BuildRequires") extraTestDeps
163-
put "%endif"
157+
let unconditialDeps = sort $ nub $ fixedDeps ++ develDeps ++ tools ++ clibs ++ pkgcfgs ++ ["pkgconfig" | not (null pkgcfgs)]
158+
let extraTestDeps = sort $ testsuiteDeps \\ (develDeps ++ profDeps)
159+
160+
mapM_ (putHdr "BuildRequires") unconditialDeps
161+
unless (null profDeps) $ do
162+
put "%if %{with ghc_prof}"
163+
mapM_ (putHdr "BuildRequires") profDeps
164+
put "%endif"
165+
unless (null extraTestDeps) $ do
166+
put "%if %{with tests}"
167+
mapM_ (putHdr "BuildRequires") extraTestDeps
168+
put "%endif"
164169

165170
putNewline
166171

@@ -197,13 +202,15 @@ createSpecFile specFile pkgDesc forceBinary runTests flagAssignment copyrightYea
197202
, "This package provides the Haskell %{pkg_name} library documentation."
198203
, ""
199204
, ""
205+
, "%if %{with ghc_prof}"
200206
, "%package -n ghc-%{pkg_name}-prof"
201207
, "Summary: Haskell %{pkg_name} profiling library"
202208
, "Requires: ghc-%{pkg_name}-devel = %{version}-%{release}"
203209
, "Supplements: (ghc-%{pkg_name}-devel and ghc-prof)"
204210
, ""
205211
, "%description -n ghc-%{pkg_name}-prof"
206212
, "This package provides the Haskell %{pkg_name} profiling library."
213+
, "%endif"
207214
, ""
208215
]
209216

@@ -293,7 +300,9 @@ createSpecFile specFile pkgDesc forceBinary runTests flagAssignment copyrightYea
293300
put "%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files"
294301
mapM_ (\ l -> put $ license_macro +-+ l) licensefiles
295302
putNewline
303+
put "%if %{with ghc_prof}"
296304
put "%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files"
305+
put "%endif"
297306
putNewline
298307

299308
put "%changelog"

test/golden-test-cases/ChasingBottoms.spec.golden

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%
3030
ExcludeArch: %{ix86}
3131
BuildRequires: ghc-Cabal-devel
3232
BuildRequires: ghc-QuickCheck-devel
33-
BuildRequires: ghc-QuickCheck-prof
3433
BuildRequires: ghc-base-devel
35-
BuildRequires: ghc-base-prof
3634
BuildRequires: ghc-containers-devel
37-
BuildRequires: ghc-containers-prof
3835
BuildRequires: ghc-mtl-devel
39-
BuildRequires: ghc-mtl-prof
4036
BuildRequires: ghc-random-devel
41-
BuildRequires: ghc-random-prof
4237
BuildRequires: ghc-rpm-macros
4338
BuildRequires: ghc-syb-devel
39+
%if %{with ghc_prof}
40+
BuildRequires: ghc-QuickCheck-prof
41+
BuildRequires: ghc-base-prof
42+
BuildRequires: ghc-containers-prof
43+
BuildRequires: ghc-mtl-prof
44+
BuildRequires: ghc-random-prof
4445
BuildRequires: ghc-syb-prof
46+
%endif
4547
%if %{with tests}
4648
BuildRequires: ghc-array-devel
4749
BuildRequires: ghc-array-prof
@@ -155,13 +157,15 @@ Requires: ghc-filesystem
155157
This package provides the Haskell %{pkg_name} library documentation.
156158

157159

160+
%if %{with ghc_prof}
158161
%package -n ghc-%{pkg_name}-prof
159162
Summary: Haskell %{pkg_name} profiling library
160163
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
161164
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
162165

163166
%description -n ghc-%{pkg_name}-prof
164167
This package provides the Haskell %{pkg_name} profiling library.
168+
%endif
165169

166170

167171
%prep
@@ -193,6 +197,8 @@ This package provides the Haskell %{pkg_name} profiling library.
193197
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
194198
%license LICENCE
195199

200+
%if %{with ghc_prof}
196201
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
202+
%endif
197203

198204
%changelog

test/golden-test-cases/Clipboard.spec.golden

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%
2929
ExcludeArch: %{ix86}
3030
BuildRequires: ghc-Cabal-devel
3131
BuildRequires: ghc-X11-devel
32-
BuildRequires: ghc-X11-prof
3332
BuildRequires: ghc-base-devel
34-
BuildRequires: ghc-base-prof
3533
BuildRequires: ghc-directory-devel
36-
BuildRequires: ghc-directory-prof
3734
BuildRequires: ghc-rpm-macros
3835
BuildRequires: ghc-unix-devel
39-
BuildRequires: ghc-unix-prof
4036
BuildRequires: ghc-utf8-string-devel
37+
%if %{with ghc_prof}
38+
BuildRequires: ghc-X11-prof
39+
BuildRequires: ghc-base-prof
40+
BuildRequires: ghc-directory-prof
41+
BuildRequires: ghc-unix-prof
4142
BuildRequires: ghc-utf8-string-prof
43+
%endif
4244

4345
%description
4446
/Clipboard/ is a library for easily interfacing with the system clipboard with
@@ -88,13 +90,15 @@ Requires: ghc-filesystem
8890
This package provides the Haskell %{pkg_name} library documentation.
8991

9092

93+
%if %{with ghc_prof}
9194
%package -n ghc-%{pkg_name}-prof
9295
Summary: Haskell %{pkg_name} profiling library
9396
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
9497
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
9598

9699
%description -n ghc-%{pkg_name}-prof
97100
This package provides the Haskell %{pkg_name} profiling library.
101+
%endif
98102

99103

100104
%prep
@@ -125,6 +129,8 @@ This package provides the Haskell %{pkg_name} profiling library.
125129
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
126130
%license license
127131

132+
%if %{with ghc_prof}
128133
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
134+
%endif
129135

130136
%changelog

test/golden-test-cases/FenwickTree.spec.golden

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%
3030
ExcludeArch: %{ix86}
3131
BuildRequires: ghc-Cabal-devel
3232
BuildRequires: ghc-QuickCheck-devel
33-
BuildRequires: ghc-QuickCheck-prof
3433
BuildRequires: ghc-base-devel
35-
BuildRequires: ghc-base-prof
3634
BuildRequires: ghc-rpm-macros
3735
BuildRequires: ghc-template-haskell-devel
36+
%if %{with ghc_prof}
37+
BuildRequires: ghc-QuickCheck-prof
38+
BuildRequires: ghc-base-prof
3839
BuildRequires: ghc-template-haskell-prof
40+
%endif
3941

4042
%description
4143
Fenwick trees are a O(log N) data structure for updating cumulative sums.
@@ -68,13 +70,15 @@ Requires: ghc-filesystem
6870
This package provides the Haskell %{pkg_name} library documentation.
6971

7072

73+
%if %{with ghc_prof}
7174
%package -n ghc-%{pkg_name}-prof
7275
Summary: Haskell %{pkg_name} profiling library
7376
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
7477
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
7578

7679
%description -n ghc-%{pkg_name}-prof
7780
This package provides the Haskell %{pkg_name} profiling library.
81+
%endif
7882

7983

8084
%prep
@@ -109,6 +113,8 @@ This package provides the Haskell %{pkg_name} profiling library.
109113
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
110114
%license LICENSE
111115

116+
%if %{with ghc_prof}
112117
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
118+
%endif
113119

114120
%changelog

test/golden-test-cases/GPipe-GLFW.spec.golden

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@ Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%
2929
ExcludeArch: %{ix86}
3030
BuildRequires: ghc-Cabal-devel
3131
BuildRequires: ghc-GLFW-b-devel
32-
BuildRequires: ghc-GLFW-b-prof
3332
BuildRequires: ghc-GPipe-devel
34-
BuildRequires: ghc-GPipe-prof
3533
BuildRequires: ghc-async-devel
36-
BuildRequires: ghc-async-prof
3734
BuildRequires: ghc-base-devel
38-
BuildRequires: ghc-base-prof
3935
BuildRequires: ghc-containers-devel
40-
BuildRequires: ghc-containers-prof
4136
BuildRequires: ghc-rpm-macros
4237
BuildRequires: ghc-stm-devel
38+
%if %{with ghc_prof}
39+
BuildRequires: ghc-GLFW-b-prof
40+
BuildRequires: ghc-GPipe-prof
41+
BuildRequires: ghc-async-prof
42+
BuildRequires: ghc-base-prof
43+
BuildRequires: ghc-containers-prof
4344
BuildRequires: ghc-stm-prof
45+
%endif
4446

4547
%description
4648
GPipe-GLFW is a utility library to enable the use of GLFW as the OpenGL window
@@ -72,13 +74,15 @@ Requires: ghc-filesystem
7274
This package provides the Haskell %{pkg_name} library documentation.
7375

7476

77+
%if %{with ghc_prof}
7578
%package -n ghc-%{pkg_name}-prof
7679
Summary: Haskell %{pkg_name} profiling library
7780
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
7881
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
7982

8083
%description -n ghc-%{pkg_name}-prof
8184
This package provides the Haskell %{pkg_name} profiling library.
85+
%endif
8286

8387

8488
%prep
@@ -109,6 +113,8 @@ This package provides the Haskell %{pkg_name} profiling library.
109113
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
110114
%license LICENSE
111115

116+
%if %{with ghc_prof}
112117
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
118+
%endif
113119

114120
%changelog

test/golden-test-cases/GenericPretty.spec.golden

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%
2929
ExcludeArch: %{ix86}
3030
BuildRequires: ghc-Cabal-devel
3131
BuildRequires: ghc-base-devel
32-
BuildRequires: ghc-base-prof
3332
BuildRequires: ghc-pretty-devel
34-
BuildRequires: ghc-pretty-prof
3533
BuildRequires: ghc-rpm-macros
34+
%if %{with ghc_prof}
35+
BuildRequires: ghc-base-prof
36+
BuildRequires: ghc-pretty-prof
37+
%endif
3638

3739
%description
3840
GenericPretty is a Haskell library that supports automatic derivation of pretty
@@ -91,13 +93,15 @@ Requires: ghc-filesystem
9193
This package provides the Haskell %{pkg_name} library documentation.
9294

9395

96+
%if %{with ghc_prof}
9497
%package -n ghc-%{pkg_name}-prof
9598
Summary: Haskell %{pkg_name} profiling library
9699
Requires: ghc-%{pkg_name}-devel = %{version}-%{release}
97100
Supplements: (ghc-%{pkg_name}-devel and ghc-prof)
98101

99102
%description -n ghc-%{pkg_name}-prof
100103
This package provides the Haskell %{pkg_name} profiling library.
104+
%endif
101105

102106

103107
%prep
@@ -128,6 +132,8 @@ This package provides the Haskell %{pkg_name} profiling library.
128132
%files -n ghc-%{pkg_name}-doc -f ghc-%{pkg_name}-doc.files
129133
%license LICENSE
130134

135+
%if %{with ghc_prof}
131136
%files -n ghc-%{pkg_name}-prof -f ghc-%{pkg_name}-prof.files
137+
%endif
132138

133139
%changelog

0 commit comments

Comments
 (0)