forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
visual-hexdiff: init at 0.0.53 (NixOS#327172)
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchurl, | ||
fetchpatch, | ||
ncurses, | ||
}: | ||
stdenv.mkDerivation { | ||
pname = "visual-hexdiff"; | ||
version = "0.0.53"; | ||
|
||
src = fetchurl { | ||
url = "mirror://ubuntu/pool/universe/h/hexdiff/hexdiff_0.0.53.orig.tar.gz"; | ||
hash = "sha256-M1bmkW63pHlfl9zNWEq0EGN1rpVGo+BTUKM9ot4HWqo="; | ||
}; | ||
|
||
patches = [ | ||
# Some changes the debian/ubuntu developers made over the original source code | ||
# See https://changelogs.ubuntu.com/changelogs/pool/universe/h/hexdiff/hexdiff_0.0.53-0ubuntu4/changelog | ||
(fetchpatch { | ||
url = "mirror://ubuntu/pool/universe/h/hexdiff/hexdiff_0.0.53-0ubuntu4.diff.gz"; | ||
sha256 = "sha256-X5ONNp9jeACxsulyowDQJ6REX6bty6L4in0/+rq8Wz4="; | ||
decode = "gunzip --stdout"; | ||
name = "hexdiff_0.0.53-0ubuntu4.diff"; | ||
stripLen = 1; | ||
}) | ||
]; | ||
|
||
postPatch = | ||
'' | ||
# Fix compiler error that wants a string literal as format string for `wprintw` | ||
substituteInPlace sel_file.c \ | ||
--replace-fail 'wprintw(win, txt_aide_fs[foo]);' 'wprintw(win, "%s", txt_aide_fs[foo]);' | ||
'' | ||
+ lib.optionalString stdenv.hostPlatform.isDarwin '' | ||
# Fix compiler error on Darwin: conflicting types for 'strdup' | ||
substituteInPlace sel_file.c \ | ||
--replace-fail 'char *strdup(char *);' ' ' | ||
''; | ||
|
||
buildInputs = [ ncurses ]; | ||
|
||
preInstall = '' | ||
mkdir -p $out/bin/ | ||
''; | ||
|
||
makeFlags = [ "PREFIX=$(out)" ]; | ||
|
||
meta = with lib; { | ||
description = "Visual hexadecimal difference editor"; | ||
homepage = "http://tboudet.free.fr/hexdiff/"; | ||
license = licenses.wtfpl; | ||
maintainers = with maintainers; [ erictapen ]; | ||
mainProgram = "hexdiff"; | ||
platforms = platforms.unix; | ||
}; | ||
} |