qrdecode: reimplement using mkDerivation

Also mark as broken; I have verified that the build fails with
the original build recipe.
This commit is contained in:
Joachim Fasting 2015-06-17 00:24:12 +02:00
parent a1e397c4fb
commit 8aa63b34da
2 changed files with 14 additions and 29 deletions

View File

@ -1,44 +1,29 @@
args : { stdenv, fetchurl, libpng, opencv }:
let
lib = args.lib; stdenv.mkDerivation rec {
fetchurl = args.fetchurl; name = "libdecodeqr-${version}";
fullDepEntry = args.fullDepEntry; version = "0.9.3";
version = lib.attrByPath ["version"] "0.9.3" args;
buildInputs = with args; [
libpng opencv
];
in
rec {
src = fetchurl { src = fetchurl {
url = "mirror://debian/pool/main/libd/libdecodeqr/libdecodeqr_${version}.orig.tar.gz"; url = "mirror://debian/pool/main/libd/libdecodeqr/libdecodeqr_${version}.orig.tar.gz";
sha256 = "1kmljwx69h7zq6zlp2j19bbpz11px45z1abw03acrxjyzz5f1f13"; sha256 = "1kmljwx69h7zq6zlp2j19bbpz11px45z1abw03acrxjyzz5f1f13";
}; };
inherit buildInputs; buildInputs = [ libpng opencv ];
configureFlags = [];
/* doConfigure should be specified separately */ preConfigure = ''
phaseNames = ["preConfigure" "doConfigure" "doMake"
"createDirs" "doMakeInstall" "postInstall"];
preConfigure = fullDepEntry ''
cd src cd src
sed -e /LDCONFIG/d -i libdecodeqr/Makefile.in sed -e /LDCONFIG/d -i libdecodeqr/Makefile.in
sed -e '/#include <cv.h>/a#include <ml.h>' -i libdecodeqr/imagereader.h 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_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${opencv}/include/opencv"
export NIX_LDFLAGS="$NIX_LDFLAGS -lcxcore" export NIX_LDFLAGS="$NIX_LDFLAGS -lcxcore"
'' ["doUnpack"]; '';
postInstall = fullDepEntry ''
cp sample/simple/simpletest $out/bin/qrdecode preInstall = "mkdir -p $out/bin $out/lib $out/include $out/share";
cd .. postInstall = "cp sample/simple/simpletest $out/bin/qrdecode";
'' ["doMake"];
createDirs = fullDepEntry ''
mkdir -p $out/bin $out/lib $out/include $out/share
'' ["defEnsureDir"];
name = "libdecodeqr-" + version;
meta = { meta = {
description = "QR code decoder library"; description = "QR code decoder library";
broken = true;
}; };
} }

View File

@ -11908,7 +11908,7 @@ let
java = if stdenv.isLinux then jre else jdk; java = if stdenv.isLinux then jre else jdk;
}; };
qrdecode = builderDefsPackage (callPackage ../tools/graphics/qrdecode) { qrdecode = callPackage ../tools/graphics/qrdecode {
libpng = libpng12; libpng = libpng12;
opencv = opencv_2_1; opencv = opencv_2_1;
}; };