2008-11-15 18:54:09 +01:00
|
|
|
args :
|
|
|
|
let
|
|
|
|
lib = args.lib;
|
|
|
|
fetchurl = args.fetchurl;
|
2009-05-20 01:25:58 +02:00
|
|
|
fullDepEntry = args.fullDepEntry;
|
2008-11-15 18:54:09 +01:00
|
|
|
|
2009-05-24 12:57:41 +02:00
|
|
|
version = lib.attrByPath ["version"] "0.9.3" args;
|
2008-11-15 18:54:09 +01:00
|
|
|
buildInputs = with args; [
|
2010-10-14 12:51:31 +02:00
|
|
|
libpng opencv
|
2008-11-15 18:54:09 +01:00
|
|
|
];
|
|
|
|
in
|
|
|
|
rec {
|
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.debian.org/debian/pool/main/libd/libdecodeqr/libdecodeqr_${version}.orig.tar.gz";
|
|
|
|
sha256 = "1kmljwx69h7zq6zlp2j19bbpz11px45z1abw03acrxjyzz5f1f13";
|
|
|
|
};
|
|
|
|
|
|
|
|
inherit buildInputs;
|
|
|
|
configureFlags = [];
|
|
|
|
|
|
|
|
/* doConfigure should be specified separately */
|
|
|
|
phaseNames = ["preConfigure" "doConfigure" "doMake"
|
|
|
|
"createDirs" "doMakeInstall" "postInstall"];
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
preConfigure = fullDepEntry ''
|
2008-11-15 18:54:09 +01:00
|
|
|
cd src
|
|
|
|
sed -e /LDCONFIG/d -i libdecodeqr/Makefile.in
|
2010-10-14 17:44:58 +02:00
|
|
|
sed -e '/#include <cv.h>/a#include <ml.h>' -i libdecodeqr/imagereader.h
|
|
|
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${args.opencv}/include/opencv"
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lcxcore"
|
2008-11-15 18:54:09 +01:00
|
|
|
'' ["doUnpack"];
|
2009-05-20 01:25:58 +02:00
|
|
|
postInstall = fullDepEntry ''
|
2008-11-15 18:54:09 +01:00
|
|
|
cp sample/simple/simpletest $out/bin/qrdecode
|
|
|
|
cd ..
|
|
|
|
'' ["doMake"];
|
2009-05-20 01:25:58 +02:00
|
|
|
createDirs = fullDepEntry ''
|
2008-11-15 18:54:09 +01:00
|
|
|
ensureDir $out/bin $out/lib $out/include $out/share
|
|
|
|
'' ["defEnsureDir"];
|
|
|
|
|
|
|
|
name = "libdecodeqr-" + version;
|
|
|
|
meta = {
|
|
|
|
description = "QR code decoder library";
|
|
|
|
};
|
|
|
|
}
|