Add support for patches

#6734

Issue Details

3 months ago
No assignee
type: enhancementtype: discusscomponent: buildcomponent: configuration
mpilgremmpilgrem
opened 3 months ago
Author

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:

Example of what @juhp did, using RPM macros:

cabal unpack %{ghcide} sed -e "s/@GHCIDE@/%{ghcide}/" %{SOURCE1} > cabal.project ( cd %{ghcide} %patch -P1 -p2 )

Example of hypothetical command line options:

stack build --patch ghcide:the-first.patch --patch ghcide:second.patch - stack build --patches "ghcide:first.patch,second.patch ..."