1{ lib, stdenv, fetchFromGitHub, ncurses, groff }:
2
3stdenv.mkDerivation rec {
4 pname = "wiggle";
5 version = "1.3";
6
7 src = fetchFromGitHub {
8 owner = "neilbrown";
9 repo = "wiggle";
10 rev = "v${version}";
11 sha256 = "18ilzr9sbal1j8p1d94ilm1j5blac5cngvcvjpdmgmpw6diy2ldf";
12 };
13
14 buildInputs = [ ncurses groff ];
15
16 configurePhase = ''
17 makeFlagsArray=( CFLAGS="-I. -O3"
18 STRIP="-s"
19 INSTALL="install"
20 BINDIR="$out/bin"
21 MANDIR="$out/share/man"
22 )
23 patchShebangs .
24 '';
25
26 meta = with lib; {
27 homepage = "https://blog.neil.brown.name/category/wiggle/";
28 description = "Tool for applying patches with conflicts";
29 mainProgram = "wiggle";
30 longDescription = ''
31 Wiggle applies patches to a file in a similar manner to the patch(1)
32 program. The distinctive difference is, however, that wiggle will
33 attempt to apply a patch even if the "before" part of the patch doesn't
34 match the target file perfectly. This is achieved by breaking the file
35 and patch into words and finding the best alignment of words in the file
36 with words in the patch. Once this alignment has been found, any
37 differences (word-wise) in the patch are applied to the file as best as
38 possible. Also, wiggle will (in some cases) detect changes that have
39 already been applied, and will ignore them.
40 '';
41 license = licenses.gpl2Plus;
42 platforms = platforms.all;
43 maintainers = [ ];
44 };
45}