diff --git a/Makefile b/Makefile index 61da36063..581e3d8c5 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ # Every user-relevant rule in this makefile should use def-help to define # a help string. Use "make help" to see the available rules. # -# Supplementary tools: +# Supplementary tools used: # # - stack, installs dependencies and drives cabal & ghc # - shelltestrunner (latest version from hackage or possibly git), runs functional tests @@ -17,6 +17,7 @@ # - profiteur, renders profiles as interactive html # - hpack, generates cabal files from package.yaml files # - hakyll-std, my generic site-building hakyll script +# - perl, currently used by a few rules (setversion) # # Kinds of hledger builds: # @@ -114,8 +115,6 @@ SOURCEFILES:= \ CABALFILES:= \ hledger/hledger.cabal \ hledger-*/*.cabal \ - -CABALFILESFROMHPACK:= \ doc/site/hakyll-std.cabal WEBFILES:= \ @@ -1082,18 +1081,20 @@ setversionforce:\ $(call def-help,setversionforce, update all version strings even if $(VERSIONFILE) seems unchanged) touch $(VERSIONFILE); make setversion -hledger-lib/hledger-lib.cabal: $(VERSIONFILE) \ - $(call def-help-hide,hledger-lib/hledger-lib.cabal, update the version in this file ) +# XXX may need fixing: + +hledger-lib/package.yaml: $(VERSIONFILE) \ + $(call def-help-hide,hledger-lib/package.yaml, update the version in this file ) perl -p -e "s/(^ *version:) *.*/\1 $(VERSION)/" -i $@ -hledger/hledger.cabal: $(VERSIONFILE) \ - $(call def-help-hide,hledger/hledger.cabal, update the version in this file ) +hledger/package.yaml: $(VERSIONFILE) \ + $(call def-help-hide,hledger/package.yaml, update the version in this file ) perl -p -e "s/(^ *version:) *.*/\1 $(VERSION)/" -i $@ perl -p -e "s/(^[ ,]*hledger(-lib)? *[>=]=) *.*/\1 $(VERSION)/" -i $@ perl -p -e "s/(-DVERSION=\")[^\"]+/\$${1}$(VERSION)/" -i $@ -hledger-web/hledger-web.cabal: $(VERSIONFILE) \ - $(call def-help-hide,hledger-web/hledger-web.cabal, update the version in this file ) +hledger-web/package.yaml: $(VERSIONFILE) \ + $(call def-help-hide,hledger-web/package.yaml, update the version in this file ) perl -p -e "s/(^ *version:) *.*/\1 $(VERSION)/" -i $@ perl -p -e "s/(^[ ,]*hledger(-lib|-web)? *[>=]=) *.*/\1 $(VERSION)/" -i $@ perl -p -e "s/(-DVERSION=\")[^\"]+/\$${1}$(VERSION)/" -i $@ @@ -1277,10 +1278,12 @@ tagrelease: \ ############################################################################### $(call def-help-subsection,MISCELLANEOUS:) -# allow automatic variables in the prerequisites of subsequent rules +# allow automatic variables (using $$) in the prerequisites of subsequent rules .SECONDEXPANSION: -gencabalfiles: $$(CABALFILESFROMHPACK) \ +# XXX enable for all cabal files when hpack is a little better +# gencabalfiles: $$(CABALFILES) +gencabalfiles: doc/site/hakyll-std.cabal \ $(call def-help,gencabalfiles, regenerate cabal files from their package.yaml definitions ) %.cabal: $$(dir $$@)package.yaml \ diff --git a/doc/site/hakyll-std.cabal b/doc/site/hakyll-std.cabal index d6307d67d..d997bc823 100644 --- a/doc/site/hakyll-std.cabal +++ b/doc/site/hakyll-std.cabal @@ -17,7 +17,7 @@ description: A simple hakyll website builder suitable for (eg) software-relat category: Web homepage: https://github.com/simonmichael/hledger/blob/master/doc/site/hakyll-std.hs bug-reports: https://github.com/simonmichael/hledger/issues -author: Simon Michael +author: Simon Michael maintainer: - license: BSD3 license-file: LICENSE diff --git a/doc/site/package.yaml b/doc/site/package.yaml index 1b88a2a18..2c12c159f 100644 --- a/doc/site/package.yaml +++ b/doc/site/package.yaml @@ -19,7 +19,7 @@ description : | category : Web github : simonmichael/hledger homepage : https://github.com/simonmichael/hledger/blob/master/doc/site/hakyll-std.hs -author : Simon Michael +author : Simon Michael maintainer : '-' dependencies: diff --git a/hledger-lib/package.yaml b/hledger-lib/package.yaml new file mode 100644 index 000000000..0ac23f0b2 --- /dev/null +++ b/hledger-lib/package.yaml @@ -0,0 +1,134 @@ +# hpack specification for generating the cabal file +# https://github.com/sol/hpack#readme +# http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html + +# currently the cabal file will have these limitations (which must be fixed by hand if needed): +# - does not specify tested-with or extensions +# - does not allow building with time < 1.5, and therefore GHC < 7.2.1 +# - does not allow building without pretty-show, and therefore GHC < 7.4.1 +# - does not allow building with Double + +name : hledger-lib +version : '0.26' +stability : stable +category : Finance, Console +synopsis : Core data types, parsers and utilities for the hledger accounting tool. +description : | + hledger is a library and set of user tools for working + with financial data (or anything that can be tracked in a + double-entry accounting ledger.) It is a haskell port and + friendly fork of John Wiegley's Ledger. hledger provides + command-line, curses and web interfaces, and aims to be a + reliable, practical tool for daily use. + +license : GPL +author : Simon Michael +maintainer : Simon Michael +github : simonmichael/hledger +homepage : http://hledger.org +bug-reports : http://hledger.org/bugs +# XXX not supported +#tested-with : GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.1 + +extra-source-files: + - CHANGES + +# XXX not supported +# flag double +# description: Use old Double number representation (instead of Decimal), for testing/benchmarking. +# default: False +# manual: True +# +# flag old-locale +# description: A compatibility flag, set automatically by cabal. +# If false then depend on time >= 1.5, +# if true then depend on time < 1.5 together with old-locale. +# default: False + +dependencies: + - base >= 4.3 && < 5 + - base-compat >= 0.8.1 + - array + - blaze-markup >= 0.5.1 + - bytestring + - cmdargs >= 0.10 && < 0.11 + - containers + - csv + - Decimal + - directory + - filepath + - mtl + - mtl-compat + - old-time + - parsec >= 3 + - regex-tdfa + - safe >= 0.2 + - split >= 0.1 && < 0.3 + - transformers >= 0.2 && < 0.5 + - utf8-string >= 0.3.5 && < 1.1 + - HUnit +# XXX not supported +# if impl(ghc >= 7.4) +# dependencies: pretty-show >= 1.6.4 +# if flag(old-locale) +# build-depends: time < 1.5, old-locale +# else +# build-depends: time >= 1.5 + - pretty-show >= 1.6.4 + - time >= 1.5 + +ghc-options: + -Wall + -fno-warn-unused-do-bind + -fno-warn-name-shadowing + -fno-warn-missing-signatures + -fno-warn-type-defaults + -fno-warn-orphans + +library: + # XXX not supported + # if flag(double) + # cpp-options: -DDOUBLE + # source-dirs: . # XXX includes Setup and uncommitted stuff + exposed-modules: + - Hledger + - Hledger.Data + - Hledger.Data.Account + - Hledger.Data.AccountName + - Hledger.Data.Amount + - Hledger.Data.Commodity + - Hledger.Data.Dates + - Hledger.Data.Journal + - Hledger.Data.Ledger + - Hledger.Data.OutputFormat + - Hledger.Data.Posting + - Hledger.Data.RawOptions + - Hledger.Data.TimeLog + - Hledger.Data.Transaction + - Hledger.Data.Types + - Hledger.Query + - Hledger.Read + - Hledger.Read.CsvReader + - Hledger.Read.JournalReader + - Hledger.Read.TimelogReader + - Hledger.Reports + - Hledger.Reports.ReportOptions + - Hledger.Reports.BalanceHistoryReport + - Hledger.Reports.BalanceReport + - Hledger.Reports.EntriesReport + - Hledger.Reports.MultiBalanceReports + - Hledger.Reports.PostingsReport + - Hledger.Reports.TransactionsReports + - Hledger.Utils + - Hledger.Utils.Debug + - Hledger.Utils.Regex + - Hledger.Utils.UTF8IOCompat + +tests: + tests: + main: suite.hs + source-dirs: tests + dependencies: + - hledger-lib + - test-framework + - test-framework-hunit diff --git a/hledger-web/package.yaml b/hledger-web/package.yaml new file mode 100644 index 000000000..ecdfdd52d --- /dev/null +++ b/hledger-web/package.yaml @@ -0,0 +1,240 @@ +# hpack specification for generating the cabal file +# https://github.com/sol/hpack#readme +# http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html + +# currently the cabal file will have these limitations (which must be fixed by hand if needed): +# - does not specify tested-with or extensions +# - does not allow building in non-threaded mode (for debian) or dev or library-only mode (for yesod devel) +# - does not allow building with time < 1.5, and therefore GHC < 7.2.1 + +name : hledger-web +version : '0.26' +stability : stable +category : Finance +synopsis : A web interface for the hledger accounting tool +description : | + hledger is a library and set of user tools for working + with financial data (or anything that can be tracked in a + double-entry accounting ledger.) It is a haskell port and + friendly fork of John Wiegley's Ledger. hledger provides + command-line, curses and web interfaces, and aims to be a + reliable, practical tool for daily use. + +license : GPL +author : Simon Michael +maintainer : Simon Michael +github : simonmichael/hledger +homepage : http://hledger.org +bug-reports : http://hledger.org/bugs +# XXX not supported +#tested-with : GHC==7.6.3, GHC==7.8.4, GHC==7.10.1 + +extra-source-files: + - CHANGES + - config/favicon.ico + - config/keter.yaml + - config/robots.txt + - config/routes + - config/settings.yml + - messages/en.msg + - static/css/bootstrap-theme.css + - static/css/bootstrap-theme.css.map + - static/css/bootstrap-theme.min.css + - static/css/bootstrap.css + - static/css/bootstrap.css.map + - static/css/bootstrap.min.css + - static/fonts/glyphicons-halflings-regular.eot + - static/fonts/glyphicons-halflings-regular.svg + - static/fonts/glyphicons-halflings-regular.ttf + - static/fonts/glyphicons-halflings-regular.woff + - static/hledger.css + - static/hledger.js + - static/js/bootstrap.js + - static/js/bootstrap.min.js + - static/js/excanvas.js + - static/js/excanvas.min.js + - static/js/jquery.cookie.js + - static/js/jquery.flot.canvas.js + - static/js/jquery.flot.canvas.min.js + - static/js/jquery.flot.categories.js + - static/js/jquery.flot.categories.min.js + - static/js/jquery.flot.crosshair.js + - static/js/jquery.flot.crosshair.min.js + - static/js/jquery.flot.errorbars.js + - static/js/jquery.flot.errorbars.min.js + - static/js/jquery.flot.fillbetween.js + - static/js/jquery.flot.fillbetween.min.js + - static/js/jquery.flot.image.js + - static/js/jquery.flot.image.min.js + - static/js/jquery.flot.js + - static/js/jquery.flot.min.js + - static/js/jquery.flot.navigate.js + - static/js/jquery.flot.navigate.min.js + - static/js/jquery.flot.pie.js + - static/js/jquery.flot.pie.min.js + - static/js/jquery.flot.resize.js + - static/js/jquery.flot.resize.min.js + - static/js/jquery.flot.selection.js + - static/js/jquery.flot.selection.min.js + - static/js/jquery.flot.stack.js + - static/js/jquery.flot.stack.min.js + - static/js/jquery.flot.symbol.js + - static/js/jquery.flot.symbol.min.js + - static/js/jquery.flot.threshold.js + - static/js/jquery.flot.threshold.min.js + - static/js/jquery.flot.time.js + - static/js/jquery.flot.time.min.js + - static/js/jquery.flot.tooltip.js + - static/js/jquery.flot.tooltip.min.js + - static/js/jquery.hotkeys.js + - static/js/jquery.js + - static/js/jquery.min.js + - static/js/jquery.url.js + - static/js/typeahead.bundle.js + - static/js/typeahead.bundle.min.js + - templates/default-layout-wrapper.hamlet + - templates/default-layout.hamlet + - templates/homepage.hamlet + - templates/homepage.julius + - templates/homepage.lucius + - templates/normalize.lucius + +# XXX not supported +# flag threaded +# Description: Build with support for multithreaded execution +# Default: True + +# flag dev +# Description: Turn on development settings, like auto-reload templates. +# Default: False + +# flag library-only +# Description: Build for use with "yesod devel" +# Default: False + +# flag old-locale +# description: A compatibility flag, set automatically by cabal. +# If false then depend on time >= 1.5, +# if true then depend on time < 1.5 together with old-locale. +# default: False + +dependencies: + - hledger-lib == 0.26 + - hledger == 0.26 + - base >= 4 && < 5 + - base-compat >= 0.8.1 + - blaze-html + - blaze-markup + - bytestring + - clientsession + - cmdargs >= 0.10 && < 0.11 + - data-default + - directory + - filepath + - hjsmin + - http-conduit + - http-client + - HUnit + - conduit-extra >= 1.1 + - parsec >= 3 + - safe >= 0.2 + - shakespeare >= 2.0 + - template-haskell + - text + - transformers + - wai + - wai-extra + - wai-handler-launch >= 1.3 + - warp + - yaml + - yesod >= 1.4 && < 1.5 + - yesod-core + - yesod-form + - yesod-static + - json + # required by extra ghci utilities: + # - fsnotify + # - hsdev + # - mtl + +# if flag(old-locale) +# build-depends: time < 1.5, old-locale +# else +# build-depends: time >= 1.5 + - time >= 1.5 + +ghc-options: + -Wall + -fno-warn-unused-do-bind + -fno-warn-name-shadowing + -fno-warn-missing-signatures + -fno-warn-type-defaults + -fno-warn-orphans + +# XXX not supported +# extensions: +# CPP +# MultiParamTypeClasses +# NoImplicitPrelude +# OverloadedStrings +# QuasiQuotes +# RecordWildCards +# TemplateHaskell +# TypeFamilies +# # -- seem to not be needed at present: +# # -- GADTs +# # -- GeneralizedNewtypeDeriving +# # -- FlexibleContexts +# # -- EmptyDataDecls +# # -- NoMonomorphismRestriction + +cpp-options: -DVERSION="0.26" +# XXX +# if flag(dev) || flag(library-only) +# cpp-options: -DDEVELOPMENT + +library: + # source-dirs: . # XXX includes Setup and uncommitted stuff + exposed-modules: + - Application + - Foundation + - Handler.AddForm + - Handler.Common + - Handler.JournalR + - Handler.RegisterR + - Handler.RootR + - Handler.SidebarR + - Handler.Utils + - Hledger.Web + - Hledger.Web.Main + - Hledger.Web.Options + - Import + - Settings + - Settings.Development + - Settings.StaticFiles + #- Setup # stops yesod devel complaining but requires depending on Cabal + +executables: + hledger-web: + # XXX + # if flag(library-only) + # buildable: False + # if flag(threaded) + # ghc-options: -threaded + ghc-options: + -threaded + # if flag(dev) + # ghc-options: -O0 + source-dirs: app + main: main.hs + dependencies: + - hledger-web == 0.26 + +tests: + test: + source-dirs: tests + main: main.hs + dependencies: + - hledger-web + - hspec + - yesod-test diff --git a/hledger/package.yaml b/hledger/package.yaml new file mode 100644 index 000000000..529d40801 --- /dev/null +++ b/hledger/package.yaml @@ -0,0 +1,158 @@ +# hpack specification for generating the cabal file +# https://github.com/sol/hpack#readme +# http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html + +# currently the cabal file will have these limitations (which must be fixed by hand if needed): +# - does not specify tested-with or extensions or benchmarks +# - does not allow building in non-threaded mode (for debian) +# - does not allow building with time < 1.5, and therefore GHC < 7.2.1 +# - does not allow building without pretty-show, and therefore GHC < 7.4.1 +# - does not allow building without threads or curses + +name : hledger +version : '0.26' +stability : stable +category : Finance, Console +synopsis : The main command-line interface for the hledger accounting tool. +description : | + hledger is a library and set of user tools for working + with financial data (or anything that can be tracked in a + double-entry accounting ledger.) It is a haskell port and + friendly fork of John Wiegley's Ledger. hledger provides + command-line, curses and web interfaces, and aims to be a + reliable, practical tool for daily use. + +license : GPL +author : Simon Michael +maintainer : Simon Michael +github : simonmichael/hledger +homepage : http://hledger.org +bug-reports : http://hledger.org/bugs +# XXX not supported +#tested-with : GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.1 + +extra-source-files: + - CHANGES + +# XXX not supported +# flag threaded +# Description: Build with support for multithreaded execution +# Default: True + +# flag curses +# Description: On POSIX systems, enable curses support for auto-detecting terminal width. +# Default: True + +# flag old-locale +# description: A compatibility flag, set automatically by cabal. +# If false then depend on time >= 1.5, +# if true then depend on time < 1.5 together with old-locale. +# default: False + +dependencies: + - hledger-lib == 0.26 + - base >= 4.3 && < 5 + - base-compat >= 0.8.1 + - containers + - unordered-containers + - cmdargs >= 0.10 && < 0.11 + - csv + - directory + - filepath + - haskeline >= 0.6 && <= 0.8 + - HUnit + - mtl + - mtl-compat + - old-time + - parsec >= 3 + - process + - regex-tdfa + - safe >= 0.2 + - split >= 0.1 && < 0.3 + - text >= 0.11 + - tabular >= 0.2 && < 0.3 + - utf8-string >= 0.3.5 && < 1.1 + - wizards == 1.0.* +# XXX not supported +# if impl(ghc >= 7.10) +# -- ghc 7.10 requires shakespeare 2.0.2.2+ +# build-depends: shakespeare >= 2.0.2.2 && < 2.1 +# else +# -- for older ghcs, allow shakespeare 1.x (which also requires shakespeare-text) +# -- http://www.yesodweb.com/blog/2014/04/consolidation-progress +# build-depends: +# shakespeare >= 1.0 && < 2.1 +# ,shakespeare-text >= 1.0 && < 1.2 + - shakespeare >= 2.0.2.2 && < 2.1 +# if !os(windows) && flag(curses) +# build-depends: terminfo + - terminfo +# if impl(ghc >= 7.4) +# dependencies: pretty-show >= 1.6.4 + - pretty-show >= 1.6.4 +# if flag(old-locale) +# build-depends: time < 1.5, old-locale +# else +# build-depends: time >= 1.5 + - time >= 1.5 + +ghc-options: + -Wall + -fno-warn-unused-do-bind + -fno-warn-name-shadowing + -fno-warn-missing-signatures + -fno-warn-type-defaults + -fno-warn-orphans + +cpp-options: -DVERSION="0.26" + +library: + # source-dirs: . # XXX includes Setup and uncommitted stuff + exposed-modules: + - Hledger.Cli + - Hledger.Cli.Main + - Hledger.Cli.Options + - Hledger.Cli.Tests + - Hledger.Cli.Utils + - Hledger.Cli.Version + - Hledger.Cli.Add + - Hledger.Cli.Accounts + - Hledger.Cli.Balance + - Hledger.Cli.Balancesheet + - Hledger.Cli.Cashflow + - Hledger.Cli.Histogram + - Hledger.Cli.Incomestatement + - Hledger.Cli.Print + - Hledger.Cli.Register + - Hledger.Cli.Stats + +executables: + hledger: + source-dirs: app + main: hledger-cli.hs + # if flag(threaded) + # ghc-options: -threaded + ghc-options: + -threaded + dependencies: + - hledger == 0.26 + +tests: + test: + source-dirs: test + main: test.hs + dependencies: + - hledger + - test-framework + - test-framework-hunit + +# XXX not supported +# benchmarks: +# bench: +# source-dirs: bench +# main: bench.hs +# dependencies: +# - hledger +# - criterion +# - html +# - timeit