commercialhaskell / commercialhaskell/stack

Add support for patches

Open
#6,734 3 comments 0 reactions 0 assignees View on GitHub
component: build component: configuration type: discuss type: enhancement
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

Based on a discussion in the Cabal and Hackage room on Matrix, initiated by @juhp:

In short, the ability to extend a project description to specify one or more `*.patch` files in respect of a package, for one or more packages, the patch files being applied in the order listed to modify the source code files before they are built; and the extension either happening at the command line or by agumenting Stack's project-level configuration file.

---

Example of a `*.patch` file:
* https://github.com/haskell/haskell-language-server/commit/fb17921128bd56ba74872cae9539767e63b9fd79.patch

Example of what @juhp did, using RPM macros:
~~~text
cabal unpack %{ghcide}
sed -e "s/@GHCIDE@/%{ghcide}/" %{SOURCE1} > cabal.project
( cd %{ghcide}
%patch -P1 -p2
)
~~~

Example of hypothetical command line options:
~~~text
stack build --patch ghcide:the-first.patch --patch ghcide:second.patch
-
stack build --patches "ghcide:first.patch,second.patch ..."
~~~

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.