How to install/use a local version of package using Stack?

后端 未结 1 1520
梦如初夏
梦如初夏 2020-12-15 03:04

The situation is, I am trying to install Netwire using Stack. However, there is a problem in the latest netwire 5.0.1, as reported by dhobbs: http://hub.darcs.net/ertes/netw

相关标签:
1条回答
  • 2020-12-15 03:47

    So you have a project where you want to use your locally patched Netwire version and in your project you have a stack.yml, as an example:

    flags: {}
    packages:
    - '.'
    extra-deps: {}
    resolver: lts-3.7
    

    You also have an dependency on netwire declared in your cabal file.

    To use you patched Netwire in this project of yours you simply put the patched Netwire package in a subdirectory of your project, perhaps called netwire, and update your stack.yml as such:

    flags: {}
    packages:
    - '.'
    - netwire
    extra-deps: {}
    resolver: lts-3.7
    

    Now stack build will build your project with the patched Netwire version.

    You can also put the modified source online (if the license permits) and refer to the source using either a tarball URL

    - https://example.com/netwire.tar.gz
    

    or a git repository and commit reference:

    - location:
        git: git@example.com/netwire
        commit: 6a86ee32e5b869a877151f74064572225e1a0398
    

    (Check out the documentation for more info: https://docs.haskellstack.org/en/stable/yaml_configuration/#packages-and-extra-deps)

    0 讨论(0)
提交回复
热议问题