diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index c6eb7c8b0180..22c9ea4872b5 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -1,24 +1,30 @@ { lib, stdenv, fetchgit, fetchpatch, pythonPackages, docutils , acl, binutils, bzip2, cbfstool, cdrkit, colord, cpio, diffutils, e2fsprogs, file, fpc, gettext, ghc , gnupg1, gzip, jdk, libcaca, mono, pdftk, poppler_utils, sng, sqlite, squashfsTools, unzip, vim, xz +, colordiff , enableBloat ? false }: pythonPackages.buildPythonApplication rec { name = "diffoscope-${version}"; - version = "52"; + version = "63"; namePrefix = ""; src = fetchgit { url = "git://anonscm.debian.org/reproducible/diffoscope.git"; rev = "refs/tags/${version}"; - sha256 = "18nqsd51rc0rldyxnjmzn86154asianhv415llhbxpr1a6zwqis6"; + sha256 = "018c0xcgf6pgq493dib29pfyqpj7vb93a6qfmdh790fpxa2j1zyd"; }; patches = [ # Ignore different link counts. ./ignore_links.patch + + # Our Glibc doesn't have the C.UTF-8 locale yet + # (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8), so use + # en_US.UTF-8 instead. + ./locale.patch ]; postPatch = '' @@ -31,7 +37,7 @@ pythonPackages.buildPythonApplication rec { # FIXME: move xxd into a separate package so we don't have to pull in all of vim. propagatedBuildInputs = (with pythonPackages; [ debian libarchive-c python_magic tlsh rpm ]) ++ map lib.getBin ([ acl binutils bzip2 cbfstool cdrkit cpio diffutils e2fsprogs file gettext - gzip libcaca poppler_utils sng sqlite squashfsTools unzip vim xz + gzip libcaca poppler_utils sng sqlite squashfsTools unzip vim xz colordiff ] ++ lib.optionals enableBloat [ colord fpc ghc gnupg1 jdk mono pdftk ]); doCheck = false; # Calls 'mknod' in squashfs tests, which needs root diff --git a/pkgs/tools/misc/diffoscope/ignore_links.patch b/pkgs/tools/misc/diffoscope/ignore_links.patch index 4e5046390fa9..ceea0dc94d4e 100644 --- a/pkgs/tools/misc/diffoscope/ignore_links.patch +++ b/pkgs/tools/misc/diffoscope/ignore_links.patch @@ -1,21 +1,15 @@ -From: Eelco Dolstra - -Nix deduplicates by hard-linking identical files, so it's normal for -the the number of links to a file to differ. ---- -diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py -index 7d1cd75..bd91eb0 100644 ---- a/diffoscope/comparators/directory.py -+++ b/diffoscope/comparators/directory.py -@@ -47,6 +47,7 @@ class Stat(Command): +diff -ru -x '*~' diffoscope-orig/diffoscope/comparators/directory.py diffoscope/diffoscope/comparators/directory.py +--- diffoscope-orig/diffoscope/comparators/directory.py 1970-01-01 01:00:01.000000000 +0100 ++++ diffoscope/diffoscope/comparators/directory.py 2016-12-08 17:37:55.000315157 +0100 +@@ -49,6 +49,7 @@ FILE_RE = re.compile(r'^\s*File:.*$') - DEVICE_RE = re.compile(r'Device: [0-9a-f]+h/[0-9]+d') - INODE_RE = re.compile(r'Inode: [0-9]+') -+ LINKS_RE = re.compile(r'Links: [0-9]+') + DEVICE_RE = re.compile(r'Device: [0-9a-f]+h/[0-9]+d\s+') + INODE_RE = re.compile(r'Inode: [0-9]+\s+') ++ LINKS_RE = re.compile(r'Links: [0-9]+\s+') ACCESS_TIME_RE = re.compile(r'^Access: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') CHANGE_TIME_RE = re.compile(r'^Change: [0-9]{4}-[0-9]{2}-[0-9]{2}.*$') - -@@ -55,6 +56,7 @@ class Stat(Command): + +@@ -57,6 +58,7 @@ line = Stat.FILE_RE.sub('', line) line = Stat.DEVICE_RE.sub('', line) line = Stat.INODE_RE.sub('', line) diff --git a/pkgs/tools/misc/diffoscope/locale.patch b/pkgs/tools/misc/diffoscope/locale.patch new file mode 100644 index 000000000000..408d3ba2ce04 --- /dev/null +++ b/pkgs/tools/misc/diffoscope/locale.patch @@ -0,0 +1,14 @@ +diff -ru -x '*~' diffoscope-orig/diffoscope/__init__.py diffoscope/diffoscope/__init__.py +--- diffoscope-orig/diffoscope/__init__.py 1970-01-01 01:00:01.000000000 +0100 ++++ diffoscope/diffoscope/__init__.py 2016-12-08 17:48:51.732122110 +0100 +@@ -81,8 +81,8 @@ + for var in ['LANG', 'LC_NUMERIC', 'LC_TIME', 'LC_COLLATE', 'LC_MONETARY', + 'LC_MESSAGES', 'LC_PAPER', 'LC_NAME', 'LC_ADDRESS', + 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION']: +- os.environ[var] = 'C' +- os.environ['LC_CTYPE'] = 'C.UTF-8' ++ os.environ[var] = 'en_US' ++ os.environ['LC_CTYPE'] = 'en_US.UTF-8' + os.environ['TZ'] = 'UTC' + +