Skip to content

Commit 57d7f28

Browse files
committed
Adds options; renames sSoruces to asmSources
1 parent f6b2394 commit 57d7f28

File tree

10 files changed

+72
-19
lines changed

10 files changed

+72
-19
lines changed

Cabal/Distribution/PackageDescription/Check.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,10 +1029,10 @@ checkPaths pkg =
10291029
++ [ (path, "data-dir") | path <- [dataDir pkg]]
10301030
++ [ (path, "license-file") | path <- licenseFiles pkg ]
10311031
++ concat
1032-
[ [ (path, "c-sources") | path <- cSources bi ]
1033-
++ [ (path, "cxx-sources") | path <- cxxSources bi ]
1034-
++ [ (path, "s-sources") | path <- sSources bi ]
1032+
[ [ (path, "asm-sources") | path <- asmSources bi ]
10351033
++ [ (path, "cmm-sources") | path <- cmmSources bi ]
1034+
++ [ (path, "c-sources") | path <- cSources bi ]
1035+
++ [ (path, "cxx-sources") | path <- cxxSources bi ]
10361036
++ [ (path, "js-sources") | path <- jsSources bi ]
10371037
++ [ (path, "install-includes") | path <- installIncludes bi ]
10381038
++ [ (path, "hs-source-dirs") | path <- hsSourceDirs bi ]

Cabal/Distribution/PackageDescription/FieldGrammar.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,16 @@ buildInfoFieldGrammar = BuildInfo
360360
<*> monoidalFieldAla "build-tool-depends" (alaList CommaFSep) L.buildToolDepends
361361
^^^ availableSince [2,0]
362362
<*> monoidalFieldAla "cpp-options" (alaList' NoCommaFSep Token') L.cppOptions
363+
<*> monoidalFieldAla "asm-options" (alaList' NoCommaFSep Token') L.asmOptions
364+
<*> monoidalFieldAla "cmm-options" (alaList' NoCommaFSep Token') L.cmmOptions
363365
<*> monoidalFieldAla "cc-options" (alaList' NoCommaFSep Token') L.ccOptions
364366
<*> monoidalFieldAla "cxx-options" (alaList' NoCommaFSep Token') L.cxxOptions
365367
<*> monoidalFieldAla "ld-options" (alaList' NoCommaFSep Token') L.ldOptions
366368
<*> monoidalFieldAla "pkgconfig-depends" (alaList CommaFSep) L.pkgconfigDepends
367369
<*> monoidalFieldAla "frameworks" (alaList' FSep Token) L.frameworks
368370
<*> monoidalFieldAla "extra-framework-dirs" (alaList' FSep FilePathNT) L.extraFrameworkDirs
371+
<*> monoidalFieldAla "asm-sources" (alaList' VCat FilePathNT) L.asmSources
372+
<*> monoidalFieldAla "cmm-sources" (alaList' VCat FilePathNT) L.cmmSources
369373
<*> monoidalFieldAla "c-sources" (alaList' VCat FilePathNT) L.cSources
370374
<*> monoidalFieldAla "cxx-sources" (alaList' VCat FilePathNT) L.cxxSources
371375
<*> monoidalFieldAla "js-sources" (alaList' VCat FilePathNT) L.jsSources
@@ -380,6 +384,7 @@ buildInfoFieldGrammar = BuildInfo
380384
^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
381385
<*> monoidalFieldAla "extra-libraries" (alaList' VCat Token) L.extraLibs
382386
<*> monoidalFieldAla "extra-ghci-libraries" (alaList' VCat Token) L.extraGHCiLibs
387+
<*> monoidalFieldAla "extra-bundled-libraries" (alaList' VCat Token) L.extraBundledLibs
383388
<*> monoidalFieldAla "extra-lib-dirs" (alaList' FSep FilePathNT) L.extraLibDirs
384389
<*> monoidalFieldAla "include-dirs" (alaList' FSep FilePathNT) L.includeDirs
385390
<*> monoidalFieldAla "includes" (alaList' FSep FilePathNT) L.includes

Cabal/Distribution/PackageDescription/Parse.hs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,20 @@ binfoFieldDescrs =
430430
disp parse
431431
buildToolDepends (\xs binfo -> binfo{buildToolDepends=xs})
432432
, commaListFieldWithSep vcat "build-depends"
433-
disp parse
433+
disp parse
434434
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})
435435
, commaListFieldWithSep vcat "mixins"
436-
disp parse
437-
mixins (\xs binfo -> binfo{mixins=xs})
436+
disp parse
437+
mixins (\xs binfo -> binfo{mixins=xs})
438438
, spaceListField "cpp-options"
439439
showToken parseTokenQ'
440-
cppOptions (\val binfo -> binfo{cppOptions=val})
440+
cppOptions (\val binfo -> binfo{cppOptions=val})
441+
, spaceListField "asm-options"
442+
showToken parseTokenQ'
443+
asmOptions (\val binfo -> binfo{asmOptions=val})
444+
, spaceListField "cmm-options"
445+
showToken parseTokenQ'
446+
cmmOptions (\val binfo -> binfo{cmmOptions=val})
441447
, spaceListField "cc-options"
442448
showToken parseTokenQ'
443449
ccOptions (\val binfo -> binfo{ccOptions=val})
@@ -456,9 +462,9 @@ binfoFieldDescrs =
456462
, listField "extra-framework-dirs"
457463
showToken parseFilePathQ
458464
extraFrameworkDirs (\val binfo -> binfo{extraFrameworkDirs=val})
459-
, listFieldWithSep vcat "s-sources"
465+
, listFieldWithSep vcat "asm-sources"
460466
showFilePath parseFilePathQ
461-
sSources (\paths binfo -> binfo{sSources=paths})
467+
asmSources (\paths binfo -> binfo{asmSources=paths})
462468
, listFieldWithSep vcat "cmm-sources"
463469
showFilePath parseFilePathQ
464470
cmmSources (\paths binfo -> binfo{cmmSources=paths})

Cabal/Distribution/ParseUtils.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ ppField name fielddoc
285285
, "extra-source-files"
286286
, "extra-tmp-files"
287287
, "exposed-modules"
288-
, "s-sources"
288+
, "asm-sources"
289289
, "cmm-sources"
290290
, "c-sources"
291291
, "js-sources"

Cabal/Distribution/Simple/BuildTarget.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ data ComponentInfo = ComponentInfo {
450450
cinfoSrcDirs :: [FilePath],
451451
cinfoModules :: [ModuleName],
452452
cinfoHsFiles :: [FilePath], -- other hs files (like main.hs)
453-
cinfoSFiles :: [FilePath],
453+
cinfoAsmFiles:: [FilePath],
454454
cinfoCmmFiles:: [FilePath],
455455
cinfoCFiles :: [FilePath],
456456
cinfoJsFiles :: [FilePath]
@@ -466,7 +466,7 @@ pkgComponentInfo pkg =
466466
cinfoSrcDirs = hsSourceDirs bi,
467467
cinfoModules = componentModules c,
468468
cinfoHsFiles = componentHsFiles c,
469-
cinfoSFiles = sSources bi,
469+
cinfoAsmFiles= asmSources bi,
470470
cinfoCmmFiles= cmmSources bi,
471471
cinfoCFiles = cSources bi,
472472
cinfoJsFiles = jsSources bi

Cabal/Distribution/Simple/Register.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,9 @@ generalInstalledPackageInfo adjustRelIncDirs pkg abi_hash lib lbi clbi installDi
463463
hasModules = not $ null (allLibModules lib clbi)
464464
comp = compiler lbi
465465
hasLibrary = (hasModules || not (null (cSources bi))
466-
|| not (null (sSources bi))
466+
|| not (null (asmSources bi))
467467
|| not (null (cmmSources bi))
468+
|| not (null (cxxSources bi))
468469
|| (not (null (jsSources bi)) &&
469470
compilerFlavor comp == GHCJS))
470471
&& not (componentIsIndefinite clbi)

Cabal/Distribution/Types/BuildInfo.hs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ data BuildInfo = BuildInfo {
5151
-- field directly.
5252
buildToolDepends :: [ExeDependency],
5353
cppOptions :: [String], -- ^ options for pre-processing Haskell code
54+
asmOptions :: [String], -- ^ options for assmebler
55+
cmmOptions :: [String], -- ^ options for C-- compiler
5456
ccOptions :: [String], -- ^ options for C compiler
5557
cxxOptions :: [String], -- ^ options for C++ compiler
5658
ldOptions :: [String], -- ^ options for linker
5759
pkgconfigDepends :: [PkgconfigDependency], -- ^ pkg-config packages that are used
5860
frameworks :: [String], -- ^support frameworks for Mac OS X
5961
extraFrameworkDirs:: [String], -- ^ extra locations to find frameworks.
60-
sSources :: [FilePath], -- ^ Assembly files.
61-
cmmSources :: [FilePath], -- ^ CMM files.
62+
asmSources :: [FilePath], -- ^ Assembly files.
63+
cmmSources :: [FilePath], -- ^ C-- files.
6264
cSources :: [FilePath],
6365
cxxSources :: [FilePath],
6466
jsSources :: [FilePath],
@@ -105,13 +107,15 @@ instance Monoid BuildInfo where
105107
buildTools = [],
106108
buildToolDepends = [],
107109
cppOptions = [],
110+
asmOptions = [],
111+
cmmOptions = [],
108112
ccOptions = [],
109113
cxxOptions = [],
110114
ldOptions = [],
111115
pkgconfigDepends = [],
112116
frameworks = [],
113117
extraFrameworkDirs = [],
114-
sSources = [],
118+
asmSources = [],
115119
cmmSources = [],
116120
cSources = [],
117121
cxxSources = [],
@@ -147,13 +151,15 @@ instance Semigroup BuildInfo where
147151
buildTools = combine buildTools,
148152
buildToolDepends = combine buildToolDepends,
149153
cppOptions = combine cppOptions,
154+
asmOptions = combine asmOptions,
155+
cmmOptions = combine cmmOptions,
150156
ccOptions = combine ccOptions,
151157
cxxOptions = combine cxxOptions,
152158
ldOptions = combine ldOptions,
153159
pkgconfigDepends = combine pkgconfigDepends,
154160
frameworks = combineNub frameworks,
155161
extraFrameworkDirs = combineNub extraFrameworkDirs,
156-
sSources = combineNub sSources,
162+
asmSources = combineNub asmSources,
157163
cmmSources = combineNub cmmSources,
158164
cSources = combineNub cSources,
159165
cxxSources = combineNub cxxSources,

Cabal/Distribution/Types/BuildInfo/Lens.hs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ class HasBuildInfo a where
3939
cppOptions = buildInfo . cppOptions
4040
{-# INLINE cppOptions #-}
4141

42+
asmOptions :: Lens' a [String]
43+
asmOptions = buildInfo . asmOptions
44+
{-# INLINE asmOptions #-}
45+
46+
cmmOptions :: Lens' a [String]
47+
cmmOptions = buildInfo . cmmOptions
48+
{-# INLINE cmmOptions #-}
49+
4250
ccOptions :: Lens' a [String]
4351
ccOptions = buildInfo . ccOptions
4452
{-# INLINE ccOptions #-}
@@ -63,6 +71,14 @@ class HasBuildInfo a where
6371
extraFrameworkDirs = buildInfo . extraFrameworkDirs
6472
{-# INLINE extraFrameworkDirs #-}
6573

74+
asmSources :: Lens' a [FilePath]
75+
asmSources = buildInfo . asmSources
76+
{-# INLINE asmSources #-}
77+
78+
cmmSources :: Lens' a [FilePath]
79+
cmmSources = buildInfo . cmmSources
80+
{-# INLINE cmmSources #-}
81+
6682
cSources :: Lens' a [FilePath]
6783
cSources = buildInfo . cSources
6884
{-# INLINE cSources #-}
@@ -115,6 +131,10 @@ class HasBuildInfo a where
115131
extraGHCiLibs = buildInfo . extraGHCiLibs
116132
{-# INLINE extraGHCiLibs #-}
117133

134+
extraBundledLibs :: Lens' a [String]
135+
extraBundledLibs = buildInfo . extraBundledLibs
136+
{-# INLINE extraBundledLibs #-}
137+
118138
extraLibDirs :: Lens' a [String]
119139
extraLibDirs = buildInfo . extraLibDirs
120140
{-# INLINE extraLibDirs #-}
@@ -176,6 +196,12 @@ instance HasBuildInfo BuildInfo where
176196
cppOptions f s = fmap (\x -> s { T.cppOptions = x }) (f (T.cppOptions s))
177197
{-# INLINE cppOptions #-}
178198

199+
asmOptions f s = fmap (\x -> s { T.asmOptions = x }) (f (T.asmOptions s))
200+
{-# INLINE asmOptions #-}
201+
202+
cmmOptions f s = fmap (\x -> s { T.cmmOptions = x }) (f (T.cmmOptions s))
203+
{-# INLINE cmmOptions #-}
204+
179205
ccOptions f s = fmap (\x -> s { T.ccOptions = x }) (f (T.ccOptions s))
180206
{-# INLINE ccOptions #-}
181207

@@ -194,6 +220,12 @@ instance HasBuildInfo BuildInfo where
194220
extraFrameworkDirs f s = fmap (\x -> s { T.extraFrameworkDirs = x }) (f (T.extraFrameworkDirs s))
195221
{-# INLINE extraFrameworkDirs #-}
196222

223+
asmSources f s = fmap (\x -> s { T.asmSources = x }) (f (T.asmSources s))
224+
{-# INLINE asmSources #-}
225+
226+
cmmSources f s = fmap (\x -> s { T.cmmSources = x }) (f (T.cmmSources s))
227+
{-# INLINE cmmSources #-}
228+
197229
cSources f s = fmap (\x -> s { T.cSources = x }) (f (T.cSources s))
198230
{-# INLINE cSources #-}
199231

@@ -233,6 +265,9 @@ instance HasBuildInfo BuildInfo where
233265
extraGHCiLibs f s = fmap (\x -> s { T.extraGHCiLibs = x }) (f (T.extraGHCiLibs s))
234266
{-# INLINE extraGHCiLibs #-}
235267

268+
extraBundledLibs f s = fmap (\x -> s { T.extraBundledLibs = x }) (f (T.extraBundledLibs s))
269+
{-# INLINE extraBundledLibs #-}
270+
236271
extraLibDirs f s = fmap (\x -> s { T.extraLibDirs = x }) (f (T.extraLibDirs s))
237272
{-# INLINE extraLibDirs #-}
238273

Cabal/doc/developing-packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ system-dependent values for these fields.
20402040
:pkg-field:`c-sources` field and vice-versa. The object files will be linked
20412041
appropriately.
20422042

2043-
.. pkg-field:: s-sources: filename list
2043+
.. pkg-field:: asm-sources: filename list
20442044

20452045
A list of assembly source files to be compiled and linked with the
20462046
Haskell files.

Cabal/doc/installing-packages.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ this section will be available.
17071707
The files placed in this distribution are the package description file,
17081708
the setup script, the sources of the modules named in the package
17091709
description file, and files named in the ``license-file``, ``main-is``,
1710-
``c-sources``, ``s-sources``, ``cmm-sources``, ``js-sources``,
1710+
``c-sources``, ``asm-sources``, ``cmm-sources``, ``js-sources``,
17111711
``data-files``, ``extra-source-files`` and ``extra-doc-files`` fields.
17121712

17131713
This command takes the following option:

0 commit comments

Comments
 (0)