From 1853f174d11040b3901e4c83d89f2578320a2e42 Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Mon, 23 Jan 2017 21:50:23 +0100 Subject: [PATCH] opencv-3.1: get ippicv from the nix store If ippicv can't be found in the directory: 3rdparty/ippicv/downloads/${platform}-${md5} it will be downloaded instead. Commit 7fedbe7 accidentally swapped the md5 with the sha256 causing ippicv to be downloaded each time opencv gets build. This patch fixes that. --- pkgs/development/libraries/opencv/3.x.nix | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 978b28aaa480..831cb1ec67c3 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -59,22 +59,21 @@ stdenv.mkDerivation rec { }); preConfigure = - let ippicvVersion = "20151201"; - ippicvPlatform = if stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux" then "linux" - else throw "ICV is not available for this platform (or not yet supported by this package)"; - ippicvHash = if ippicvPlatform == "linux" then "1nph0w0pdcxwhdb5lxkb8whpwd9ylvwl97hn0k425amg80z86cs3" - else throw "ippicvHash: impossible"; - - ippicvName = "ippicv_${ippicvPlatform}_${ippicvVersion}.tgz"; - ippicvArchive = "3rdparty/ippicv/downloads/linux-${ippicvHash}/${ippicvName}"; + let version = "20151201"; + md5 = "808b791a6eac9ed78d32a7666804320e"; + sha256 = "1nph0w0pdcxwhdb5lxkb8whpwd9ylvwl97hn0k425amg80z86cs3"; + platform = if stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux" then "linux" + else throw "ICV is not available for this platform (or not yet supported by this package)"; + name = "ippicv_${platform}_${version}.tgz"; ippicv = fetchurl { - url = "https://github.com/Itseez/opencv_3rdparty/raw/ippicv/master_${ippicvVersion}/ippicv/${ippicvName}"; - sha256 = ippicvHash; + url = "https://github.com/Itseez/opencv_3rdparty/raw/ippicv/master_${version}/ippicv/${name}"; + inherit sha256; }; + dir = "3rdparty/ippicv/downloads/${platform}-${md5}"; in lib.optionalString enableIpp '' - mkdir -p $(dirname ${ippicvArchive}) - ln -s ${ippicv} ${ippicvArchive} + mkdir -p "${dir}" + ln -s "${ippicv}" "${dir}/${name}" ''; buildInputs =