mirror of
https://github.com/void-linux/void-packages.git
synced 2025-08-01 02:12:55 +02:00
Manual.md: update haskell instructions
This commit is contained in:
parent
6454d3f62c
commit
91ed3d9e2c
1 changed files with 34 additions and 6 deletions
40
Manual.md
40
Manual.md
|
@ -1138,6 +1138,10 @@ for compiling cargo -sys crates.
|
||||||
It also adds a `cargo` wrapper that detects and passes builds through `cargo-auditable`.
|
It also adds a `cargo` wrapper that detects and passes builds through `cargo-auditable`.
|
||||||
This helper is added by default for packages that use the `cargo` build style.
|
This helper is added by default for packages that use the `cargo` build style.
|
||||||
|
|
||||||
|
- `haskell` specifies environment variables for cabal.
|
||||||
|
This helper is added by default for packages that use the `haskell-stack` or
|
||||||
|
`cabal` build style.
|
||||||
|
|
||||||
<a id="functions"></a>
|
<a id="functions"></a>
|
||||||
### Functions
|
### Functions
|
||||||
|
|
||||||
|
@ -1698,21 +1702,45 @@ The path to the package's source inside `$GOPATH` is available as
|
||||||
<a id="pkgs_haskell"></a>
|
<a id="pkgs_haskell"></a>
|
||||||
#### Haskell packages
|
#### Haskell packages
|
||||||
|
|
||||||
We build Haskell package using `stack` from
|
Haskell packages can be built either with the `cabal` or `haskell-stack`
|
||||||
[Stackage](http://www.stackage.org/), generally the LTS versions.
|
build style, use whichever is more convenient or better supported by upstream,
|
||||||
Haskell templates need to have host dependencies on `ghc` and `stack`,
|
sometimes only one of the two is possible. For packages that have haskell
|
||||||
and set build style to `haskell-stack`.
|
parts but use a different build style like `gnu-makefile`, make sure to use
|
||||||
|
the `haskell` build helper.
|
||||||
|
|
||||||
The following variables influence how Haskell packages are built:
|
The following variables influence how packages are built with cabal:
|
||||||
|
|
||||||
|
- `cabal_index_state`: The state of the hackage cabal index to use for
|
||||||
|
fetching dependencies. The source package of a haskell project should
|
||||||
|
come with a freeze file that sets the index state, some also set it in
|
||||||
|
their cabal project file. If it does not, then this has to be set to an ISO
|
||||||
|
timestamp in the package template. For example `2025-07-05T14:01:16Z`.
|
||||||
|
- `configure_args`: Arguments passed to `cabal configure`. The configure step
|
||||||
|
generates the `cabal.project.local` file.
|
||||||
|
- `make_build_args`: Arguments passed to `cabal build`.
|
||||||
|
- `make_build_target`: Target passed to `cabal build`.
|
||||||
|
- `make_check_args`: Arguments passed to `cabal test`.
|
||||||
|
- `make_check_target`: Test target passed to cabal instead of "test".
|
||||||
|
- `make_install_target`: Target passed to `cabal install`.
|
||||||
|
|
||||||
|
And these variables influence how packages are built with stack:
|
||||||
|
|
||||||
- `stackage`: The Stackage version used to build the package, e.g.
|
- `stackage`: The Stackage version used to build the package, e.g.
|
||||||
`lts-3.5`. Alternatively:
|
`lts-3.5`. Alternatively:
|
||||||
- You can prepare a `stack.yaml` configuration for the project and put it
|
- You can prepare a `stack.yaml` configuration for the project and put it
|
||||||
into `files/stack.yaml`.
|
into `files/stack.yaml`.
|
||||||
- If a `stack.yaml` file is present in the source files, it will be used
|
- If a `stack.yaml` file is present in the source files, it will be used.
|
||||||
- `make_build_args`: This is passed as-is to `stack build ...`, so
|
- `make_build_args`: This is passed as-is to `stack build ...`, so
|
||||||
you can add your `--flag ...` parameters there.
|
you can add your `--flag ...` parameters there.
|
||||||
|
|
||||||
|
To patch dependencies of haskell packages they have to be fetched explicitly
|
||||||
|
from hackage by adding them to `distfiles` instead of letting cabal or stack
|
||||||
|
download them. Once extracted and patched, the path to the patched version
|
||||||
|
can be added to `packages` in `cabal.project` or `stack.yaml`.
|
||||||
|
Stack will find them automatically if no `stack.yaml` file exists by scanning
|
||||||
|
the directory. The build tool will then use the patched version of the
|
||||||
|
depencency instead of downloading it from hackage.
|
||||||
|
|
||||||
<a id="pkgs_font"></a>
|
<a id="pkgs_font"></a>
|
||||||
#### Font packages
|
#### Font packages
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue