Support for c2hs

Rules

c2hs_library

name

A unique name for this target.

deps

extra_args

Extra arguments that should be passedto c2hs.

src_strip_prefix

Directory in which module hierarchy starts.

srcs

version

Executable version. If this is specified, CPP version macros will be generated for this build.

Macros and Functions

c2hs_toolchain

Declare a Haskell c2hs toolchain.

You need at least one of these declared somewhere in your BUILD files for the chs_library rule to work. Once declared, you then need to register the toolchain using register_toolchains in your WORKSPACE file (see example below).

Examples

In a BUILD file:

c2hs_toolchain(
    name = "c2hs",
    c2hs = "@c2hs//:bin",
)

where @c2hs is an external repository defined in the WORKSPACE, e.g. using:

nixpkgs_package(
    name = "c2hs",
    attribute_path = "haskell.packages.ghc822.c2hs",
)

register_toolchains("//:c2hs")

name

c2hs

kwargs