2015-06-16 15:24:12 -07:00
|
|
|
{ stdenv, fetchurl, libpng, opencv }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "libdecodeqr-${version}";
|
|
|
|
version = "0.9.3";
|
2008-11-15 09:54:09 -08:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-05-21 14:52:24 -07:00
|
|
|
url = "mirror://debian/pool/main/libd/libdecodeqr/libdecodeqr_${version}.orig.tar.gz";
|
2008-11-15 09:54:09 -08:00
|
|
|
sha256 = "1kmljwx69h7zq6zlp2j19bbpz11px45z1abw03acrxjyzz5f1f13";
|
|
|
|
};
|
|
|
|
|
2015-06-16 15:24:12 -07:00
|
|
|
buildInputs = [ libpng opencv ];
|
2008-11-15 09:54:09 -08:00
|
|
|
|
2015-06-16 15:24:12 -07:00
|
|
|
preConfigure = ''
|
2008-11-15 09:54:09 -08:00
|
|
|
cd src
|
|
|
|
sed -e /LDCONFIG/d -i libdecodeqr/Makefile.in
|
2010-10-14 08:44:58 -07:00
|
|
|
sed -e '/#include <cv.h>/a#include <ml.h>' -i libdecodeqr/imagereader.h
|
2015-06-16 15:24:12 -07:00
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${opencv}/include/opencv"
|
2010-10-14 08:44:58 -07:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lcxcore"
|
2015-06-16 15:24:12 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = "mkdir -p $out/bin $out/lib $out/include $out/share";
|
|
|
|
postInstall = "cp sample/simple/simpletest $out/bin/qrdecode";
|
2008-11-15 09:54:09 -08:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "QR code decoder library";
|
2015-06-16 15:24:12 -07:00
|
|
|
broken = true;
|
2008-11-15 09:54:09 -08:00
|
|
|
};
|
|
|
|
}
|