diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml index a7e78c7ca..9fef76abb 100644 --- a/hledger-lib/package.yaml +++ b/hledger-lib/package.yaml @@ -37,7 +37,7 @@ extra-source-files: flags: debug: - description: Build with GHC 9.10+'s stack traces enabled + description: Build with GHC 9.10+ stack traces enabled default: false manual: true # ghcdebug: @@ -95,6 +95,8 @@ dependencies: - extra >=1.7.11 - Glob >= 0.9 +cpp-options: -DVERSION="1.50.99" + language: GHC2021 ghc-options: @@ -106,83 +108,83 @@ ghc-options: - -Wno-unused-do-bind when: + - condition: (flag(debug)) cpp-options: -DDEBUG + # - condition: (flag(ghcdebug)) # cpp-options: -DGHCDEBUG # dependencies: # - ghc-debug-stub >=0.6.0.0 && <0.7 library: - exposed-modules: - - Hledger - - Hledger.Data - - Hledger.Data.Account - - Hledger.Data.AccountName - - Hledger.Data.Amount - - Hledger.Data.Balancing - - Hledger.Data.Currency - - Hledger.Data.Dates - - Hledger.Data.Errors - - Hledger.Data.Journal - - Hledger.Data.JournalChecks - - Hledger.Data.JournalChecks.Ordereddates - - Hledger.Data.JournalChecks.Uniqueleafnames - - Hledger.Data.Json - - Hledger.Data.Ledger - - Hledger.Data.Period - - Hledger.Data.PeriodicTransaction - - Hledger.Data.StringFormat - - Hledger.Data.Posting - - Hledger.Data.RawOptions - - Hledger.Data.Timeclock - - Hledger.Data.Transaction - - Hledger.Data.TransactionModifier - - Hledger.Data.Types - - Hledger.Data.Valuation - - Hledger.Query - - Hledger.Read - - Hledger.Read.Common - - Hledger.Read.CsvReader - - Hledger.Read.InputOptions - - Hledger.Read.JournalReader - - Hledger.Read.RulesReader -# - Hledger.Read.LedgerReader - - Hledger.Read.TimedotReader - - Hledger.Read.TimeclockReader - - Hledger.Write.Beancount - - Hledger.Write.Csv - - Hledger.Write.Ods - - Hledger.Write.Html - - Hledger.Write.Html.Attribute - - Hledger.Write.Html.Blaze - - Hledger.Write.Html.Lucid - - Hledger.Write.Html.HtmlCommon - - Hledger.Write.Spreadsheet - - Hledger.Reports - - Hledger.Reports.ReportOptions - - Hledger.Reports.ReportTypes - - Hledger.Reports.AccountTransactionsReport - - Hledger.Reports.BalanceReport - - Hledger.Reports.BudgetReport - - Hledger.Reports.EntriesReport - - Hledger.Reports.MultiBalanceReport - - Hledger.Reports.PostingsReport - - Hledger.Utils - - Hledger.Utils.Debug - - Hledger.Utils.IO - - Hledger.Utils.Parse - - Hledger.Utils.Regex - - Hledger.Utils.String - - Hledger.Utils.Test - - Hledger.Utils.Text - - Text.Tabular.AsciiWide - - Text.WideString -# other-modules: -# - Ledger.Parser.Text - source-dirs: - #- other/ledger-parse - - . + source-dirs: . + # default: All modules in source-dirs less other-modules less modules mentioned in when + # exposed-modules: + # - Hledger + # - Hledger.Data + # - Hledger.Data.Account + # - Hledger.Data.AccountName + # - Hledger.Data.Amount + # - Hledger.Data.BalanceData + # - Hledger.Data.Balancing + # - Hledger.Data.Currency + # - Hledger.Data.Dates + # - Hledger.Data.Errors + # - Hledger.Data.Journal + # - Hledger.Data.JournalChecks + # - Hledger.Data.JournalChecks.Ordereddates + # - Hledger.Data.JournalChecks.Uniqueleafnames + # - Hledger.Data.Json + # - Hledger.Data.Ledger + # - Hledger.Data.Period + # - Hledger.Data.PeriodData + # - Hledger.Data.PeriodicTransaction + # - Hledger.Data.Posting + # - Hledger.Data.RawOptions + # - Hledger.Data.StringFormat + # - Hledger.Data.Timeclock + # - Hledger.Data.Transaction + # - Hledger.Data.TransactionModifier + # - Hledger.Data.Types + # - Hledger.Data.Valuation + # - Hledger.Query + # - Hledger.Read + # - Hledger.Read.Common + # - Hledger.Read.CsvReader + # - Hledger.Read.InputOptions + # - Hledger.Read.JournalReader + # - Hledger.Read.RulesReader + # - Hledger.Read.TimedotReader + # - Hledger.Read.TimeclockReader + # - Hledger.Write.Beancount + # - Hledger.Write.Csv + # - Hledger.Write.Ods + # - Hledger.Write.Html + # - Hledger.Write.Html.Attribute + # - Hledger.Write.Html.Blaze + # - Hledger.Write.Html.Lucid + # - Hledger.Write.Html.HtmlCommon + # - Hledger.Write.Spreadsheet + # - Hledger.Reports + # - Hledger.Reports.ReportOptions + # - Hledger.Reports.ReportTypes + # - Hledger.Reports.AccountTransactionsReport + # - Hledger.Reports.BalanceReport + # - Hledger.Reports.BudgetReport + # - Hledger.Reports.EntriesReport + # - Hledger.Reports.MultiBalanceReport + # - Hledger.Reports.PostingsReport + # - Hledger.Utils + # - Hledger.Utils.Debug + # - Hledger.Utils.IO + # - Hledger.Utils.Parse + # - Hledger.Utils.Regex + # - Hledger.Utils.String + # - Hledger.Utils.Test + # - Hledger.Utils.Text + # - Text.Tabular.AsciiWide + # - Text.WideString # "cabal test hledger-lib" currently fails, see doctest suite below @@ -196,30 +198,12 @@ tests: dependencies: - hledger-lib - # Note when run by cabal, doctest requires a ghc environment file, - # so we ensure this is generated, see cabal.project. + # cabal users: when run by cabal, doctest requires a ghc environment file, so cabal.project ensures that # https://github.com/simonmichael/hledger/issues/1139 doctest: source-dirs: test 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 dependencies: - # prefer the latest doctest - doctest >=0.18.1 - 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 diff --git a/hledger-ui/package.yaml b/hledger-ui/package.yaml index d8cb43592..b7ba9212f 100644 --- a/hledger-ui/package.yaml +++ b/hledger-ui/package.yaml @@ -22,39 +22,28 @@ description: | extra-source-files: - - CHANGES.md - - README.md - - hledger-ui.1 - - hledger-ui.txt - - hledger-ui.info +- CHANGES.md +- README.md +- hledger-ui.1 +- hledger-ui.txt +- hledger-ui.info flags: - debug: - description: Build with GHC 9.10+'s stack traces enabled - default: false - manual: true threaded: description: Build with support for multithreaded execution default: true manual: false + debug: + description: Build with GHC 9.10+ stack traces enabled + default: false + manual: true # ghcdebug: # description: Build with support for attaching a ghc-debug client # default: false # manual: true - # curses is required to build terminfo for vty for hledger-ui. - # On POSIX systems it might be not present. - # 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) +dependencies: +- base >=4.18 && <4.22 cpp-options: -DVERSION="1.50.99" @@ -69,24 +58,19 @@ ghc-options: - -Wno-unused-do-bind when: + - condition: (flag(debug)) cpp-options: -DDEBUG + # - condition: (flag(ghcdebug)) # cpp-options: -DGHCDEBUG # dependencies: # - ghc-debug-stub >=0.6.0.0 && <0.7 -dependencies: -- base >=4.18 && <4.22 - library: source-dirs: . - cpp-options: -DVERSION="1.50.99" - exposed-modules: - - Hledger.UI - - Hledger.UI.Main - - Hledger.UI.Theme - - Hledger.UI.UIOptions + # default: All modules in source-dirs less other-modules less modules mentioned in when + # exposed-modules: dependencies: - hledger-lib >=1.50.99 && <1.51 - hledger >=1.50.99 && <1.51 @@ -128,9 +112,8 @@ executables: hledger-ui: source-dirs: app main: hledger-ui.hs - dependencies: - - hledger-ui - ghc-options: -with-rtsopts=-T # for stats command when: - condition: flag(threaded) ghc-options: -threaded + dependencies: + - hledger-ui diff --git a/hledger-web/package.yaml b/hledger-web/package.yaml index b7d5c0321..b8813f246 100644 --- a/hledger-web/package.yaml +++ b/hledger-web/package.yaml @@ -60,7 +60,7 @@ flags: default: true manual: false debug: - description: Build with GHC 9.10+'s stack traces enabled # ' + description: Build with GHC 9.10+ stack traces enabled # ' default: false manual: true # ghcdebug: @@ -68,26 +68,35 @@ flags: # default: false # manual: true +dependencies: +- base >=4.18 && <4.22 + +cpp-options: -DVERSION="1.50.99" + language: GHC2021 ghc-options: - -Wall -# not included in -Wall: -- -Wredundant-constraints -# not included in -Wall by older GHC versions: -- -Wincomplete-record-updates -- -Wincomplete-uni-patterns +- -Wno-incomplete-uni-patterns +- -Wno-missing-signatures +- -Wno-orphans +- -Wno-type-defaults +- -Wno-unused-do-bind when: + - condition: flag(threaded) ghc-options: -threaded + - condition: (flag(dev)) || (flag(library-only)) cpp-options: -DDEVELOPMENT + # This causes a warning when uploading to hackage: #Package check reported the following warnings: # 'ghc-options: -O0' is not needed. Use the --disable-optimization configure flag. - condition: flag(dev) ghc-options: -O0 + - condition: (flag(debug)) cpp-options: -DDEBUG # - condition: (flag(ghcdebug)) @@ -95,19 +104,10 @@ when: # dependencies: # - ghc-debug-stub >=0.6.0.0 && <0.7 -dependencies: -- base >=4.18 && <4.22 - library: source-dirs: . - cpp-options: -DVERSION="1.50.99" - exposed-modules: - - Hledger.Web - - Hledger.Web.Main - - Hledger.Web.WebOptions - - Hledger.Web.Application - - Hledger.Web.Import - - Hledger.Web.Test + # default: All modules in source-dirs less other-modules less modules mentioned in when + # exposed-modules: dependencies: - hledger-lib >=1.50.99 && <1.51 - hledger >=1.50.99 && <1.51 @@ -162,20 +162,17 @@ executables: hledger-web: source-dirs: app main: main.hs - cpp-options: -DVERSION="1.50.99" - ghc-options: -with-rtsopts=-T # for stats command - dependencies: - - hledger-web when: - condition: flag(library-only) buildable: false + dependencies: + - hledger-web tests: - test: + apptest: source-dirs: test main: test.hs other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188 - cpp-options: -DVERSION="1.50.99" dependencies: - hledger-web # - hspec diff --git a/hledger/package.yaml b/hledger/package.yaml index 120d2bbe7..0f912a334 100644 --- a/hledger/package.yaml +++ b/hledger/package.yaml @@ -96,7 +96,7 @@ flags: default: true manual: false debug: - description: Build with GHC 9.10+'s stack traces enabled + description: Build with GHC 9.10+ stack traces enabled default: false manual: true # ghcdebug: @@ -104,26 +104,6 @@ flags: # default: false # 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: - base >=4.18 && <4.22 - hledger-lib >=1.50.99 && <1.51 @@ -164,50 +144,75 @@ dependencies: - utility-ht >=0.0.13 - wizards >=1.0 +cpp-options: -DVERSION="1.50.99" + +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 + library: - cpp-options: -DVERSION="1.50.99" - exposed-modules: - - Hledger.Cli - - Hledger.Cli.Anchor - - Hledger.Cli.Anon - - Hledger.Cli.CliOptions - - Hledger.Cli.Commands - - Hledger.Cli.Commands.Accounts - - Hledger.Cli.Commands.Activity - - Hledger.Cli.Commands.Add - - Hledger.Cli.Commands.Aregister - - Hledger.Cli.Commands.Balance - - Hledger.Cli.Commands.Balancesheet - - Hledger.Cli.Commands.Balancesheetequity - - Hledger.Cli.Commands.Cashflow - - Hledger.Cli.Commands.Check - - 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 + source-dirs: . + # default: All modules in source-dirs less other-modules less modules mentioned in when + # exposed-modules: + # - Hledger.Cli + # - Hledger.Cli.Anchor + # - Hledger.Cli.Anon + # - Hledger.Cli.CliOptions + # - Hledger.Cli.Commands + # - Hledger.Cli.Commands.Accounts + # - Hledger.Cli.Commands.Activity + # - Hledger.Cli.Commands.Add + # - Hledger.Cli.Commands.Aregister + # - Hledger.Cli.Commands.Balance + # - Hledger.Cli.Commands.Balancesheet + # - Hledger.Cli.Commands.Balancesheetequity + # - Hledger.Cli.Commands.Cashflow + # - Hledger.Cli.Commands.Check + # - 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: - Diff >=0.2 - hashable >=1.2.4 @@ -218,7 +223,6 @@ executables: hledger: source-dirs: app main: hledger-cli.hs - cpp-options: -DVERSION="1.50.99" ghc-options: -with-rtsopts=-T # for stats command when: - condition: flag(threaded) @@ -231,7 +235,6 @@ tests: source-dirs: test main: unittest.hs other-modules: [] # prevent double compilation, https://github.com/sol/hpack/issues/188 - cpp-options: -DVERSION="1.50.99" dependencies: - hledger