pkg: package.yaml files cleanup, consistency

This commit is contained in:
Simon Michael 2025-09-29 18:56:44 -10:00
parent e51e6c4e3d
commit 525f3e76e3
4 changed files with 179 additions and 212 deletions

View File

@ -37,7 +37,7 @@ extra-source-files:
flags: flags:
debug: debug:
description: Build with GHC 9.10+'s stack traces enabled description: Build with GHC 9.10+ stack traces enabled
default: false default: false
manual: true manual: true
# ghcdebug: # ghcdebug:
@ -95,6 +95,8 @@ dependencies:
- extra >=1.7.11 - extra >=1.7.11
- Glob >= 0.9 - Glob >= 0.9
cpp-options: -DVERSION="1.50.99"
language: GHC2021 language: GHC2021
ghc-options: ghc-options:
@ -106,83 +108,83 @@ ghc-options:
- -Wno-unused-do-bind - -Wno-unused-do-bind
when: when:
- condition: (flag(debug)) - condition: (flag(debug))
cpp-options: -DDEBUG cpp-options: -DDEBUG
# - condition: (flag(ghcdebug)) # - condition: (flag(ghcdebug))
# cpp-options: -DGHCDEBUG # cpp-options: -DGHCDEBUG
# dependencies: # dependencies:
# - ghc-debug-stub >=0.6.0.0 && <0.7 # - ghc-debug-stub >=0.6.0.0 && <0.7
library: library:
exposed-modules: source-dirs: .
- Hledger # default: All modules in source-dirs less other-modules less modules mentioned in when
- Hledger.Data # exposed-modules:
- Hledger.Data.Account # - Hledger
- Hledger.Data.AccountName # - Hledger.Data
- Hledger.Data.Amount # - Hledger.Data.Account
- Hledger.Data.Balancing # - Hledger.Data.AccountName
- Hledger.Data.Currency # - Hledger.Data.Amount
- Hledger.Data.Dates # - Hledger.Data.BalanceData
- Hledger.Data.Errors # - Hledger.Data.Balancing
- Hledger.Data.Journal # - Hledger.Data.Currency
- Hledger.Data.JournalChecks # - Hledger.Data.Dates
- Hledger.Data.JournalChecks.Ordereddates # - Hledger.Data.Errors
- Hledger.Data.JournalChecks.Uniqueleafnames # - Hledger.Data.Journal
- Hledger.Data.Json # - Hledger.Data.JournalChecks
- Hledger.Data.Ledger # - Hledger.Data.JournalChecks.Ordereddates
- Hledger.Data.Period # - Hledger.Data.JournalChecks.Uniqueleafnames
- Hledger.Data.PeriodicTransaction # - Hledger.Data.Json
- Hledger.Data.StringFormat # - Hledger.Data.Ledger
- Hledger.Data.Posting # - Hledger.Data.Period
- Hledger.Data.RawOptions # - Hledger.Data.PeriodData
- Hledger.Data.Timeclock # - Hledger.Data.PeriodicTransaction
- Hledger.Data.Transaction # - Hledger.Data.Posting
- Hledger.Data.TransactionModifier # - Hledger.Data.RawOptions
- Hledger.Data.Types # - Hledger.Data.StringFormat
- Hledger.Data.Valuation # - Hledger.Data.Timeclock
- Hledger.Query # - Hledger.Data.Transaction
- Hledger.Read # - Hledger.Data.TransactionModifier
- Hledger.Read.Common # - Hledger.Data.Types
- Hledger.Read.CsvReader # - Hledger.Data.Valuation
- Hledger.Read.InputOptions # - Hledger.Query
- Hledger.Read.JournalReader # - Hledger.Read
- Hledger.Read.RulesReader # - Hledger.Read.Common
# - Hledger.Read.LedgerReader # - Hledger.Read.CsvReader
- Hledger.Read.TimedotReader # - Hledger.Read.InputOptions
- Hledger.Read.TimeclockReader # - Hledger.Read.JournalReader
- Hledger.Write.Beancount # - Hledger.Read.RulesReader
- Hledger.Write.Csv # - Hledger.Read.TimedotReader
- Hledger.Write.Ods # - Hledger.Read.TimeclockReader
- Hledger.Write.Html # - Hledger.Write.Beancount
- Hledger.Write.Html.Attribute # - Hledger.Write.Csv
- Hledger.Write.Html.Blaze # - Hledger.Write.Ods
- Hledger.Write.Html.Lucid # - Hledger.Write.Html
- Hledger.Write.Html.HtmlCommon # - Hledger.Write.Html.Attribute
- Hledger.Write.Spreadsheet # - Hledger.Write.Html.Blaze
- Hledger.Reports # - Hledger.Write.Html.Lucid
- Hledger.Reports.ReportOptions # - Hledger.Write.Html.HtmlCommon
- Hledger.Reports.ReportTypes # - Hledger.Write.Spreadsheet
- Hledger.Reports.AccountTransactionsReport # - Hledger.Reports
- Hledger.Reports.BalanceReport # - Hledger.Reports.ReportOptions
- Hledger.Reports.BudgetReport # - Hledger.Reports.ReportTypes
- Hledger.Reports.EntriesReport # - Hledger.Reports.AccountTransactionsReport
- Hledger.Reports.MultiBalanceReport # - Hledger.Reports.BalanceReport
- Hledger.Reports.PostingsReport # - Hledger.Reports.BudgetReport
- Hledger.Utils # - Hledger.Reports.EntriesReport
- Hledger.Utils.Debug # - Hledger.Reports.MultiBalanceReport
- Hledger.Utils.IO # - Hledger.Reports.PostingsReport
- Hledger.Utils.Parse # - Hledger.Utils
- Hledger.Utils.Regex # - Hledger.Utils.Debug
- Hledger.Utils.String # - Hledger.Utils.IO
- Hledger.Utils.Test # - Hledger.Utils.Parse
- Hledger.Utils.Text # - Hledger.Utils.Regex
- Text.Tabular.AsciiWide # - Hledger.Utils.String
- Text.WideString # - Hledger.Utils.Test
# other-modules: # - Hledger.Utils.Text
# - Ledger.Parser.Text # - Text.Tabular.AsciiWide
source-dirs: # - Text.WideString
#- other/ledger-parse
- .
# "cabal test hledger-lib" currently fails, see doctest suite below # "cabal test hledger-lib" currently fails, see doctest suite below
@ -196,30 +198,12 @@ tests:
dependencies: dependencies:
- hledger-lib - hledger-lib
# Note when run by cabal, doctest requires a ghc environment file, # cabal users: when run by cabal, doctest requires a ghc environment file, so cabal.project ensures that
# so we ensure this is generated, see cabal.project.
# https://github.com/simonmichael/hledger/issues/1139 # https://github.com/simonmichael/hledger/issues/1139
doctest: doctest:
source-dirs: test source-dirs: test
main: doctests.hs # can't call it doctest.hs ("File name does not match module name") main: doctests.hs # can't call it doctest.hs ("File name does not match module name")
other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188 other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188
dependencies: dependencies:
# prefer the latest doctest
- doctest >=0.18.1 - doctest >=0.18.1
- Glob >=0.7 - Glob >=0.7
when:
# disable doctest with GHC 9.0, https://github.com/sol/doctest/issues/301
- condition: impl(ghc >= 9.0) && impl(ghc < 9.2)
buildable: false
# ghc 8.4+ on mac needs this workaround. See
# https://github.com/sol/doctest/issues/199
# https://ghc.haskell.org/trac/ghc/ticket/15105#comment:10 :
# ~$ locate HSinteger-gmp-1.0.2.0.o
# /Users/simon/.stack/programs/x86_64-osx/ghc-8.4.3/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o
# ~$ mv /Users/simon/.stack/programs/x86_64-osx/ghc-8.4.3/lib/ghc-8.4.2/integer-gmp-1.0.2.0/HSinteger-gmp-1.0.2.0.o{,_DISABLE_GHC_ISSUE_15105}
# Should probably disable it by default:
#when:
# - condition: os(darwin) && impl(ghc >= 8.4)
# buildable: false

View File

@ -29,32 +29,21 @@ extra-source-files:
- hledger-ui.info - hledger-ui.info
flags: flags:
debug:
description: Build with GHC 9.10+'s stack traces enabled
default: false
manual: true
threaded: threaded:
description: Build with support for multithreaded execution description: Build with support for multithreaded execution
default: true default: true
manual: false manual: false
debug:
description: Build with GHC 9.10+ stack traces enabled
default: false
manual: true
# ghcdebug: # ghcdebug:
# description: Build with support for attaching a ghc-debug client # description: Build with support for attaching a ghc-debug client
# default: false # default: false
# manual: true # manual: true
# curses is required to build terminfo for vty for hledger-ui. dependencies:
# On POSIX systems it might be not present. - base >=4.18 && <4.22
# On windows it's very likely not present, but possibly it could be.
# Ideally we'd like to
# on POSIX: give a clear error ("install your system libcurses-dev package") if not present
# on windows: quietly skip building if not present, build if it is present
# curses
# default: True
# description:
#
# note on windows: the vty-windows (and hence hledger-ui) will reliably work only on the newer backends
# like Windows Terminal.
# mintty-based backends (default for cygwin/gitbash/msys2) are not supported (yet)
cpp-options: -DVERSION="1.50.99" cpp-options: -DVERSION="1.50.99"
@ -69,24 +58,19 @@ ghc-options:
- -Wno-unused-do-bind - -Wno-unused-do-bind
when: when:
- condition: (flag(debug)) - condition: (flag(debug))
cpp-options: -DDEBUG cpp-options: -DDEBUG
# - condition: (flag(ghcdebug)) # - condition: (flag(ghcdebug))
# cpp-options: -DGHCDEBUG # cpp-options: -DGHCDEBUG
# dependencies: # dependencies:
# - ghc-debug-stub >=0.6.0.0 && <0.7 # - ghc-debug-stub >=0.6.0.0 && <0.7
dependencies:
- base >=4.18 && <4.22
library: library:
source-dirs: . source-dirs: .
cpp-options: -DVERSION="1.50.99" # default: All modules in source-dirs less other-modules less modules mentioned in when
exposed-modules: # exposed-modules:
- Hledger.UI
- Hledger.UI.Main
- Hledger.UI.Theme
- Hledger.UI.UIOptions
dependencies: dependencies:
- hledger-lib >=1.50.99 && <1.51 - hledger-lib >=1.50.99 && <1.51
- hledger >=1.50.99 && <1.51 - hledger >=1.50.99 && <1.51
@ -128,9 +112,8 @@ executables:
hledger-ui: hledger-ui:
source-dirs: app source-dirs: app
main: hledger-ui.hs main: hledger-ui.hs
dependencies:
- hledger-ui
ghc-options: -with-rtsopts=-T # for stats command
when: when:
- condition: flag(threaded) - condition: flag(threaded)
ghc-options: -threaded ghc-options: -threaded
dependencies:
- hledger-ui

View File

@ -60,7 +60,7 @@ flags:
default: true default: true
manual: false manual: false
debug: debug:
description: Build with GHC 9.10+'s stack traces enabled # ' description: Build with GHC 9.10+ stack traces enabled # '
default: false default: false
manual: true manual: true
# ghcdebug: # ghcdebug:
@ -68,26 +68,35 @@ flags:
# default: false # default: false
# manual: true # manual: true
dependencies:
- base >=4.18 && <4.22
cpp-options: -DVERSION="1.50.99"
language: GHC2021 language: GHC2021
ghc-options: ghc-options:
- -Wall - -Wall
# not included in -Wall: - -Wno-incomplete-uni-patterns
- -Wredundant-constraints - -Wno-missing-signatures
# not included in -Wall by older GHC versions: - -Wno-orphans
- -Wincomplete-record-updates - -Wno-type-defaults
- -Wincomplete-uni-patterns - -Wno-unused-do-bind
when: when:
- condition: flag(threaded) - condition: flag(threaded)
ghc-options: -threaded ghc-options: -threaded
- condition: (flag(dev)) || (flag(library-only)) - condition: (flag(dev)) || (flag(library-only))
cpp-options: -DDEVELOPMENT cpp-options: -DDEVELOPMENT
# This causes a warning when uploading to hackage: # This causes a warning when uploading to hackage:
#Package check reported the following warnings: #Package check reported the following warnings:
# 'ghc-options: -O0' is not needed. Use the --disable-optimization configure flag. # 'ghc-options: -O0' is not needed. Use the --disable-optimization configure flag.
- condition: flag(dev) - condition: flag(dev)
ghc-options: -O0 ghc-options: -O0
- condition: (flag(debug)) - condition: (flag(debug))
cpp-options: -DDEBUG cpp-options: -DDEBUG
# - condition: (flag(ghcdebug)) # - condition: (flag(ghcdebug))
@ -95,19 +104,10 @@ when:
# dependencies: # dependencies:
# - ghc-debug-stub >=0.6.0.0 && <0.7 # - ghc-debug-stub >=0.6.0.0 && <0.7
dependencies:
- base >=4.18 && <4.22
library: library:
source-dirs: . source-dirs: .
cpp-options: -DVERSION="1.50.99" # default: All modules in source-dirs less other-modules less modules mentioned in when
exposed-modules: # exposed-modules:
- Hledger.Web
- Hledger.Web.Main
- Hledger.Web.WebOptions
- Hledger.Web.Application
- Hledger.Web.Import
- Hledger.Web.Test
dependencies: dependencies:
- hledger-lib >=1.50.99 && <1.51 - hledger-lib >=1.50.99 && <1.51
- hledger >=1.50.99 && <1.51 - hledger >=1.50.99 && <1.51
@ -162,20 +162,17 @@ executables:
hledger-web: hledger-web:
source-dirs: app source-dirs: app
main: main.hs main: main.hs
cpp-options: -DVERSION="1.50.99"
ghc-options: -with-rtsopts=-T # for stats command
dependencies:
- hledger-web
when: when:
- condition: flag(library-only) - condition: flag(library-only)
buildable: false buildable: false
dependencies:
- hledger-web
tests: tests:
test: apptest:
source-dirs: test source-dirs: test
main: test.hs main: test.hs
other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188 other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188
cpp-options: -DVERSION="1.50.99"
dependencies: dependencies:
- hledger-web - hledger-web
# - hspec # - hspec

View File

@ -96,7 +96,7 @@ flags:
default: true default: true
manual: false manual: false
debug: debug:
description: Build with GHC 9.10+'s stack traces enabled description: Build with GHC 9.10+ stack traces enabled
default: false default: false
manual: true manual: true
# ghcdebug: # ghcdebug:
@ -104,26 +104,6 @@ flags:
# default: false # default: false
# manual: true # manual: true
language: GHC2021
ghc-options:
- -Wall
- -Wno-incomplete-uni-patterns
- -Wno-missing-signatures
- -Wno-orphans
- -Wno-type-defaults
- -Wno-unused-do-bind
# avoid stack's "non-portable path" warning/error on mac, https://github.com/commercialhaskell/stack/issues/3918
- -optP-Wno-nonportable-include-path
when:
- condition: (flag(debug))
cpp-options: -DDEBUG
# - condition: (flag(ghcdebug))
# cpp-options: -DGHCDEBUG
# dependencies:
# - ghc-debug-stub >=0.6.0.0 && <0.7
dependencies: dependencies:
- base >=4.18 && <4.22 - base >=4.18 && <4.22
- hledger-lib >=1.50.99 && <1.51 - hledger-lib >=1.50.99 && <1.51
@ -164,50 +144,75 @@ dependencies:
- utility-ht >=0.0.13 - utility-ht >=0.0.13
- wizards >=1.0 - wizards >=1.0
library:
cpp-options: -DVERSION="1.50.99" cpp-options: -DVERSION="1.50.99"
exposed-modules:
- Hledger.Cli language: GHC2021
- Hledger.Cli.Anchor
- Hledger.Cli.Anon ghc-options:
- Hledger.Cli.CliOptions - -Wall
- Hledger.Cli.Commands - -Wno-incomplete-uni-patterns
- Hledger.Cli.Commands.Accounts - -Wno-missing-signatures
- Hledger.Cli.Commands.Activity - -Wno-orphans
- Hledger.Cli.Commands.Add - -Wno-type-defaults
- Hledger.Cli.Commands.Aregister - -Wno-unused-do-bind
- Hledger.Cli.Commands.Balance # avoid stack's "non-portable path" warning/error on mac, https://github.com/commercialhaskell/stack/issues/3918
- Hledger.Cli.Commands.Balancesheet - -optP-Wno-nonportable-include-path
- Hledger.Cli.Commands.Balancesheetequity
- Hledger.Cli.Commands.Cashflow when:
- Hledger.Cli.Commands.Check
- Hledger.Cli.Commands.Close - condition: (flag(debug))
- Hledger.Cli.Commands.Codes cpp-options: -DDEBUG
- Hledger.Cli.Commands.Commodities
- Hledger.Cli.Commands.Demo # - condition: (flag(ghcdebug))
- Hledger.Cli.Commands.Descriptions # cpp-options: -DGHCDEBUG
- Hledger.Cli.Commands.Diff # dependencies:
- Hledger.Cli.Commands.Help # - ghc-debug-stub >=0.6.0.0 && <0.7
- Hledger.Cli.Commands.Files
- Hledger.Cli.Commands.Import library:
- Hledger.Cli.Commands.Incomestatement source-dirs: .
- Hledger.Cli.Commands.Notes # default: All modules in source-dirs less other-modules less modules mentioned in when
- Hledger.Cli.Commands.Payees # exposed-modules:
- Hledger.Cli.Commands.Prices # - Hledger.Cli
- Hledger.Cli.Commands.Print # - Hledger.Cli.Anchor
- Hledger.Cli.Commands.Register # - Hledger.Cli.Anon
- Hledger.Cli.Commands.Rewrite # - Hledger.Cli.CliOptions
- Hledger.Cli.Commands.Roi # - Hledger.Cli.Commands
- Hledger.Cli.Commands.Run # - Hledger.Cli.Commands.Accounts
- Hledger.Cli.Commands.Setup # - Hledger.Cli.Commands.Activity
- Hledger.Cli.Commands.Stats # - Hledger.Cli.Commands.Add
- Hledger.Cli.Commands.Tags # - Hledger.Cli.Commands.Aregister
- Hledger.Cli.CompoundBalanceCommand # - Hledger.Cli.Commands.Balance
- Hledger.Cli.Conf # - Hledger.Cli.Commands.Balancesheet
- Hledger.Cli.DocFiles # - Hledger.Cli.Commands.Balancesheetequity
- Hledger.Cli.Script # - Hledger.Cli.Commands.Cashflow
- Hledger.Cli.Utils # - Hledger.Cli.Commands.Check
- Hledger.Cli.Version # - Hledger.Cli.Commands.Close
# - Hledger.Cli.Commands.Codes
# - Hledger.Cli.Commands.Commodities
# - Hledger.Cli.Commands.Demo
# - Hledger.Cli.Commands.Descriptions
# - Hledger.Cli.Commands.Diff
# - Hledger.Cli.Commands.Help
# - Hledger.Cli.Commands.Files
# - Hledger.Cli.Commands.Import
# - Hledger.Cli.Commands.Incomestatement
# - Hledger.Cli.Commands.Notes
# - Hledger.Cli.Commands.Payees
# - Hledger.Cli.Commands.Prices
# - Hledger.Cli.Commands.Print
# - Hledger.Cli.Commands.Register
# - Hledger.Cli.Commands.Rewrite
# - Hledger.Cli.Commands.Roi
# - Hledger.Cli.Commands.Run
# - Hledger.Cli.Commands.Setup
# - Hledger.Cli.Commands.Stats
# - Hledger.Cli.Commands.Tags
# - Hledger.Cli.CompoundBalanceCommand
# - Hledger.Cli.Conf
# - Hledger.Cli.DocFiles
# - Hledger.Cli.Script
# - Hledger.Cli.Utils
# - Hledger.Cli.Version
dependencies: dependencies:
- Diff >=0.2 - Diff >=0.2
- hashable >=1.2.4 - hashable >=1.2.4
@ -218,7 +223,6 @@ executables:
hledger: hledger:
source-dirs: app source-dirs: app
main: hledger-cli.hs main: hledger-cli.hs
cpp-options: -DVERSION="1.50.99"
ghc-options: -with-rtsopts=-T # for stats command ghc-options: -with-rtsopts=-T # for stats command
when: when:
- condition: flag(threaded) - condition: flag(threaded)
@ -231,7 +235,6 @@ tests:
source-dirs: test source-dirs: test
main: unittest.hs main: unittest.hs
other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188 other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188
cpp-options: -DVERSION="1.50.99"
dependencies: dependencies:
- hledger - hledger