summary refs log tree commit diff
path: root/pkgs/tools/graphics/qrdecode/default.nix
blob: 515bbb0fcda39388d33190a537850d1206ce0585 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
args :  
let 
  lib = args.lib;
  fetchurl = args.fetchurl;
  fullDepEntry = args.fullDepEntry;

  version = lib.getAttr ["version"] "0.9.3" args; 
  buildInputs = with args; [
    libpng libcv
  ];
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"];

  preConfigure = fullDepEntry ''
    cd src
    sed -e /LDCONFIG/d -i libdecodeqr/Makefile.in
  '' ["doUnpack"];
  postInstall = fullDepEntry ''
    cp sample/simple/simpletest $out/bin/qrdecode 
    cd ..
  '' ["doMake"];
  createDirs = fullDepEntry ''
    ensureDir $out/bin $out/lib $out/include $out/share
  '' ["defEnsureDir"];

  name = "libdecodeqr-" + version;
  meta = {
    description = "QR code decoder library";
  };
}