From a0604dd47bf2fff2b0eb45834010f1ded7eb820c Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 15 Nov 2008 17:54:09 +0000 Subject: [PATCH] Added qrencode and qrdecode - tools for QR code. Qrdecode behaves strangely (Debian package does the same, so probably upstream bug) svn path=/nixpkgs/trunk/; revision=13304 --- pkgs/development/libraries/libcv/default.nix | 33 ++++++++++++++++ pkgs/tools/graphics/qrdecode/default.nix | 41 ++++++++++++++++++++ pkgs/tools/graphics/qrencode/default.nix | 27 +++++++++++++ pkgs/top-level/all-packages.nix | 13 +++++++ 4 files changed, 114 insertions(+) create mode 100644 pkgs/development/libraries/libcv/default.nix create mode 100644 pkgs/tools/graphics/qrdecode/default.nix create mode 100644 pkgs/tools/graphics/qrencode/default.nix diff --git a/pkgs/development/libraries/libcv/default.nix b/pkgs/development/libraries/libcv/default.nix new file mode 100644 index 000000000000..7daa084c8e54 --- /dev/null +++ b/pkgs/development/libraries/libcv/default.nix @@ -0,0 +1,33 @@ +args : +let + lib = args.lib; + fetchurl = args.fetchurl; + FullDepEntry = args.FullDepEntry; + + version = lib.getAttr ["version"] "" args; + buildInputs = with args; [ + libtiff libpng libjpeg pkgconfig + gtk glib + ]; +in +rec { + src = fetchurl { + url = ftp://ftp.debian.org/debian/pool/main/o/opencv/opencv_0.9.7.orig.tar.gz; + sha256 = "14qnm59gn518gjxwjb9hm3ij0b1awlxa76qdvnn5ygxsx713lf2j"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be specified separately */ + phaseNames = ["doConfigure" "doMakeInstall" "postInstall"]; + + postInstall = FullDepEntry ('' + ln -s $out/include/opencv/* $out/include + '') ["doMakeInstall" "minInit"]; + + name = "libcv-" + version; + meta = { + description = "libcv - computer vision library"; + }; +} diff --git a/pkgs/tools/graphics/qrdecode/default.nix b/pkgs/tools/graphics/qrdecode/default.nix new file mode 100644 index 000000000000..bd850a509b4b --- /dev/null +++ b/pkgs/tools/graphics/qrdecode/default.nix @@ -0,0 +1,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"; + }; +} diff --git a/pkgs/tools/graphics/qrencode/default.nix b/pkgs/tools/graphics/qrencode/default.nix new file mode 100644 index 000000000000..28f7b579b4d1 --- /dev/null +++ b/pkgs/tools/graphics/qrencode/default.nix @@ -0,0 +1,27 @@ +args : +let + lib = args.lib; + fetchurl = args.fetchurl; + + version = lib.getAttr ["version"] "3.0.3" args; + buildInputs = with args; [ + libpng pkgconfig + ]; +in +rec { + src = fetchurl { + url = "http://megaui.net/fukuchi/works/qrencode/qrencode-${version}.tar.gz"; + sha256 = "1f5nnbk016casqfprdli50ssv08l0gj5zrd0q4rdvzfwqy67i7vm"; + }; + + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be specified separately */ + phaseNames = ["doConfigure" "doMakeInstall"]; + + name = "qrencode-" + version; + meta = { + description = "QR code encoder"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 07e92a6e8684..f2db22906861 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3133,6 +3133,11 @@ let inherit (gtkLibs) glib; }; + libcv = builderDefsPackage (import ../development/libraries/libcv) { + inherit libtiff libjpeg libpng pkgconfig; + inherit (gtkLibs) gtk glib; + }; + libdaemon = import ../development/libraries/libdaemon { inherit fetchurl stdenv; }; @@ -7313,6 +7318,14 @@ let libjpeg readline libtool; }; + qrdecode = builderDefsPackage (import ../tools/graphics/qrdecode) { + inherit libpng libcv; + }; + + qrencode = builderDefsPackage (import ../tools/graphics/qrencode) { + inherit libpng pkgconfig; + }; + gqview = import ../applications/graphics/gqview { inherit fetchurl stdenv pkgconfig libpng; inherit (gtkLibs) gtk;