From f904e3c821cf9d42aca72abc42996b958c57db30 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 19 Nov 2010 13:12:13 +0000 Subject: [PATCH] Brute-force fix; I cannot understand why GCC behaves in a complicated way, but there is a simple workaround svn path=/nixpkgs/branches/stdenv-updates/; revision=24771 --- .../libraries/opencv/changeset_r3190.diff | 20 +++++++++++++++++++ pkgs/development/libraries/opencv/default.nix | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/development/libraries/opencv/changeset_r3190.diff diff --git a/pkgs/development/libraries/opencv/changeset_r3190.diff b/pkgs/development/libraries/opencv/changeset_r3190.diff new file mode 100644 index 000000000000..4a614659e723 --- /dev/null +++ b/pkgs/development/libraries/opencv/changeset_r3190.diff @@ -0,0 +1,20 @@ +--- opencv/src/highgui/cvcap_ffmpeg.cpp ++++ opencv/src/highgui/cvcap_ffmpeg.cpp +@@ -49,6 +49,15 @@ + #if !defined(WIN32) || defined(__MINGW32__) + // some versions of FFMPEG assume a C99 compiler, and don't define INT64_C +-#ifndef INT64_C +-#define INT64_C ++#if !defined INT64_C || !defined UINT64_C ++# if __WORDSIZE == 64 ++# define INT64_C(c) c ## UL ++# else ++# define INT64_C(c) c ## ULL ++# endif ++# if __WORDSIZE == 64 ++# define UINT64_C(c) c ## UL ++# else ++# define UINT64_C(c) c ## ULL ++# endif + #define __STDC_CONSTANT_MACROS + // force re-inclusion of stdint.h to get INT64_C macro diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix index 1b64875d6310..c8b77d5f5725 100644 --- a/pkgs/development/libraries/opencv/default.nix +++ b/pkgs/development/libraries/opencv/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { buildInputs = [ cmake gtk glib libjpeg libpng libtiff jasper ffmpeg pkgconfig xineLib gstreamer ]; + patches = [ ./changeset_r3190.diff ]; + meta = { description = "Open Computer Vision Library with more than 500 algorithms"; homepage = http://opencv.willowgarage.com/;