mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-19 10:17:35 +03:00
tools: start generating cabal files with hpack
hakyll-std's cabal file is now generated by hpack from an easier yaml config file, which looks like a valuable timesaver. "make gencabalfiles" will regenerate this cabal file (and soon the others) when needed.
This commit is contained in:
parent
9a93a2b5f5
commit
4a3b09e1ed
39
Makefile
39
Makefile
@ -15,6 +15,7 @@
|
|||||||
# - shelltestrunner (latest version from hackage or possibly git), runs functional tests
|
# - shelltestrunner (latest version from hackage or possibly git), runs functional tests
|
||||||
# - hasktags, generates tag files for code navigation
|
# - hasktags, generates tag files for code navigation
|
||||||
# - profiteur, renders profiles as interactive html
|
# - profiteur, renders profiles as interactive html
|
||||||
|
# - hpack, generates cabal files from package.yaml files
|
||||||
# - hakyll-std, my generic site-building hakyll script
|
# - hakyll-std, my generic site-building hakyll script
|
||||||
#
|
#
|
||||||
# Kinds of hledger builds:
|
# Kinds of hledger builds:
|
||||||
@ -112,7 +113,10 @@ SOURCEFILES:= \
|
|||||||
|
|
||||||
CABALFILES:= \
|
CABALFILES:= \
|
||||||
hledger/hledger.cabal \
|
hledger/hledger.cabal \
|
||||||
hledger-*/*.cabal
|
hledger-*/*.cabal \
|
||||||
|
|
||||||
|
CABALFILESFROMHPACK:= \
|
||||||
|
doc/site/hakyll-std.cabal
|
||||||
|
|
||||||
WEBFILES:= \
|
WEBFILES:= \
|
||||||
hledger-web/templates/* \
|
hledger-web/templates/* \
|
||||||
@ -820,8 +824,6 @@ $(call def-help-subsection,DOCUMENTATION:)
|
|||||||
doc/site/hakyll-std hakyll-std: \
|
doc/site/hakyll-std hakyll-std: \
|
||||||
doc/site/hakyll-std.hs \
|
doc/site/hakyll-std.hs \
|
||||||
doc/site/TableOfContents.hs \
|
doc/site/TableOfContents.hs \
|
||||||
doc/site/hakyll-std.cabal \
|
|
||||||
doc/site/stack.yaml \
|
|
||||||
$(call def-help,hakyll-std, build a generic hakyll site builder script )
|
$(call def-help,hakyll-std, build a generic hakyll site builder script )
|
||||||
cd doc/site; stack ghc hakyll-std
|
cd doc/site; stack ghc hakyll-std
|
||||||
|
|
||||||
@ -1275,13 +1277,34 @@ tagrelease: \
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
$(call def-help-subsection,MISCELLANEOUS:)
|
$(call def-help-subsection,MISCELLANEOUS:)
|
||||||
|
|
||||||
|
# allow automatic variables in the prerequisites of subsequent rules
|
||||||
|
.SECONDEXPANSION:
|
||||||
|
|
||||||
|
gencabalfiles: $$(CABALFILESFROMHPACK) \
|
||||||
|
$(call def-help,gencabalfiles, regenerate cabal files from their package.yaml definitions )
|
||||||
|
|
||||||
|
%.cabal: $$(dir $$@)package.yaml \
|
||||||
|
$(call def-help-hide,PATH/SOME.cabal, regenerate a cabal file from its package.yaml definition with hpack )
|
||||||
|
cd $(dir $*) && \
|
||||||
|
hpack && \
|
||||||
|
touch $(notdir $@) && \
|
||||||
|
cabal check
|
||||||
|
|
||||||
|
cabal%: \
|
||||||
|
$(call def-help,cabalCMD, run cabal CMD inside each hledger package directory )
|
||||||
|
for p in $(PACKAGES); do (cd $$p; cabal $*); done
|
||||||
|
|
||||||
|
all%: \
|
||||||
|
$(call def-help,all"CMD", run CMD inside each hledger package directory )
|
||||||
|
for p in $(PACKAGES); do (cd $$p; $*); done
|
||||||
|
|
||||||
usage: cabalusage stackusage \
|
usage: cabalusage stackusage \
|
||||||
$(call def-help,usage, show size of various dirs )
|
$(call def-help,usage, show size of various dirs )
|
||||||
du -sh .git bin data doc extra
|
du -sh .git bin data doc extra
|
||||||
du -sh .
|
du -sh .
|
||||||
|
|
||||||
stackusage: \
|
stackusage: \
|
||||||
$(call def-help,stackusage, show size of stack working dirs )
|
$(call def-help,stackusage, show size of stack working dirs if any )
|
||||||
-du -shc `find . -name '.stack*'`
|
-du -shc `find . -name '.stack*'`
|
||||||
|
|
||||||
cabalusage: \
|
cabalusage: \
|
||||||
@ -1322,14 +1345,6 @@ Clean: stackclean cabalclean cleanghc cleantags \
|
|||||||
|
|
||||||
# reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))
|
# reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))
|
||||||
|
|
||||||
cabal%: \
|
|
||||||
$(call def-help,cabalCMD, run cabal CMD inside each hledger package directory )
|
|
||||||
for p in $(PACKAGES); do (cd $$p; cabal $*); done
|
|
||||||
|
|
||||||
all%: \
|
|
||||||
$(call def-help,all"CMD", run CMD inside each hledger package directory )
|
|
||||||
for p in $(PACKAGES); do (cd $$p; $*); done
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# LOCAL UNTRACKED CUSTOMISATIONS
|
# LOCAL UNTRACKED CUSTOMISATIONS
|
||||||
|
|
||||||
|
@ -209,10 +209,10 @@ and the default view given by [bugs.hledger.org](http://bugs.hledger.org) exclud
|
|||||||
$ cd hledger
|
$ cd hledger
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Install optional extra tools (see the Makefile for a list):
|
3. Install [GNU Make](http://www.gnu.org/software/make) and other optional extra tools (see the Makefile for a list):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ stack install shelltestrunner hasktags profiteur
|
$ stack install shelltestrunner hasktags profiteur hpack
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Run `make` or `stack --help` to see some suggested commands:
|
4. Run `make` or `stack --help` to see some suggested commands:
|
||||||
|
@ -1,39 +1,45 @@
|
|||||||
|
-- This file has been generated from package.yaml by hpack version 0.5.2.
|
||||||
|
--
|
||||||
|
-- see: https://github.com/sol/hpack
|
||||||
|
|
||||||
name: hakyll-std
|
name: hakyll-std
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
synopsis: Generic hakyll site builder script.
|
synopsis: Generic hakyll site builder script (shipped with hledger)
|
||||||
description: Generic hakyll site builder script.
|
description: A simple hakyll website builder suitable for (eg) software-related websites, intended to be used as-is without recompilation. Features:
|
||||||
homepage: http://github.com/simonmichael/hledger
|
.
|
||||||
|
- renders markdown and common web file types found in standard places
|
||||||
|
- a site.tmpl template will be used when rendering markdown files
|
||||||
|
- "- toc" in markdown files is replaced by a table of contents
|
||||||
|
- fenced code blocks are appropriately syntax-highlighted by highlighting-kate
|
||||||
|
(you should provide a syntax.css)
|
||||||
|
.
|
||||||
|
See the module doc (follow homepage link) for precise details.
|
||||||
|
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
|
||||||
|
maintainer: -
|
||||||
license: BSD3
|
license: BSD3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Simon Michael
|
|
||||||
maintainer: simon@joyful.com
|
|
||||||
-- copyright:
|
|
||||||
category: Web
|
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
-- extra-source-files:
|
cabal-version: >= 1.10
|
||||||
cabal-version: >=1.10
|
|
||||||
|
|
||||||
-- library
|
source-repository head
|
||||||
-- hs-source-dirs: src
|
type: git
|
||||||
-- build-depends: base >= 4.7 && < 5
|
location: https://github.com/simonmichael/hledger
|
||||||
-- default-language: Haskell2010
|
|
||||||
|
|
||||||
executable hakyll-std
|
executable hakyll-std
|
||||||
default-language: Haskell2010
|
|
||||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N
|
|
||||||
hs-source-dirs: .
|
|
||||||
main-is: hakyll-std.hs
|
main-is: hakyll-std.hs
|
||||||
other-modules: TableOfContents
|
build-depends:
|
||||||
build-depends: base >= 4.7 && < 5
|
base >= 4.7 && < 5
|
||||||
,hakyll >=4.7
|
, hakyll >=4.7
|
||||||
,pandoc >=1.15
|
, pandoc
|
||||||
,pandoc-types
|
, pandoc-types
|
||||||
,process
|
, process
|
||||||
,directory
|
, directory
|
||||||
,data-default
|
, data-default
|
||||||
,blaze-html
|
, blaze-html
|
||||||
,containers
|
, containers
|
||||||
|
other-modules:
|
||||||
-- source-repository head
|
TableOfContents
|
||||||
-- type: git
|
default-language: Haskell2010
|
||||||
-- location: https://github.com/simonmichael/hledger
|
|
||||||
|
39
doc/site/package.yaml
Normal file
39
doc/site/package.yaml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# hpack specification for generating the cabal file
|
||||||
|
# (run "hpack" in this directory)
|
||||||
|
|
||||||
|
name : hakyll-std
|
||||||
|
version : 0.1.0
|
||||||
|
license : BSD3
|
||||||
|
synopsis : Generic hakyll site builder script (shipped with hledger)
|
||||||
|
description : |
|
||||||
|
A simple hakyll website builder suitable for (eg) software-related websites, intended to be used as-is without recompilation. Features:
|
||||||
|
|
||||||
|
- renders markdown and common web file types found in standard places
|
||||||
|
- a site.tmpl template will be used when rendering markdown files
|
||||||
|
- "- toc" in markdown files is replaced by a table of contents
|
||||||
|
- fenced code blocks are appropriately syntax-highlighted by highlighting-kate
|
||||||
|
(you should provide a syntax.css)
|
||||||
|
|
||||||
|
See the module doc (follow homepage link) for precise details.
|
||||||
|
|
||||||
|
category : Web
|
||||||
|
github : simonmichael/hledger
|
||||||
|
homepage : https://github.com/simonmichael/hledger/blob/master/doc/site/hakyll-std.hs
|
||||||
|
author : Simon Michael
|
||||||
|
maintainer : '-'
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- base >= 4.7 && < 5
|
||||||
|
- hakyll >=4.7
|
||||||
|
- pandoc #>=1.15
|
||||||
|
- pandoc-types
|
||||||
|
- process
|
||||||
|
- directory
|
||||||
|
- data-default
|
||||||
|
- blaze-html
|
||||||
|
- containers
|
||||||
|
|
||||||
|
executables:
|
||||||
|
hakyll-std:
|
||||||
|
main: hakyll-std.hs
|
||||||
|
other-modules: TableOfContents
|
Loading…
Reference in New Issue
Block a user