From 40b13e798b9bdeb614865f67f961af1b825c2325 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 9 Aug 2014 17:13:21 -0300 Subject: [PATCH] CImg and WxCam - New Packages #3519 In this commit, I'm including two new softwares * CImg: A small, simple image toolkit library * WxCam: a small, simple, wxGTK-based webcam application --- pkgs/applications/video/wxcam/default.nix | 52 +++++++++++++++++++++ pkgs/development/libraries/cimg/builder.sh | 12 +++++ pkgs/development/libraries/cimg/default.nix | 27 +++++++++++ pkgs/top-level/all-packages.nix | 9 ++++ 4 files changed, 100 insertions(+) create mode 100644 pkgs/applications/video/wxcam/default.nix create mode 100644 pkgs/development/libraries/cimg/builder.sh create mode 100644 pkgs/development/libraries/cimg/default.nix diff --git a/pkgs/applications/video/wxcam/default.nix b/pkgs/applications/video/wxcam/default.nix new file mode 100644 index 000000000000..1f66d9a589b0 --- /dev/null +++ b/pkgs/applications/video/wxcam/default.nix @@ -0,0 +1,52 @@ +{ stdenv, fetchurl +, pkgconfig +, intltool +, libX11, libXv, libSM +, gtk, libglade +, wxGTK +, perlXMLParser +, xvidcore +, mjpegtools +, alsaLib +, libv4l +, cimg +}: + +stdenv.mkDerivation rec { + + name = "wxcam-${version}"; + version = "1.1"; + + src = fetchurl { + url = "http://downloads.sourceforge.net/project/wxcam/wxcam/${version}/${name}.tar.gz"; + sha256 = "1765bvc65fpzn9ycnnj5hais9xkx9v0sm6a878d35x54bpanr859"; + }; + + buildInputs = with stdenv.lib; + [ pkgconfig intltool libX11 libXv libSM gtk libglade wxGTK perlXMLParser xvidcore mjpegtools alsaLib libv4l cimg ]; + + NIX_CFLAGS_COMPILE="-I ${cimg}/include/cimg"; + + postUnpack = '' + sed -ie 's|/usr/share/|'"$out/share/"'|g' $sourceRoot/Makefile.in + ''; + + installPhase = '' + make install prefix="$out" wxcamdocdir="$out/share/doc/wxcam" + ''; + + meta = { + description = "An open-source, wxGTK-based webcam app for Linux"; + longDescription = '' + wxCam is a webcam application for linux. It supports video recording + (avi uncompressed and Xvid formats), snapshot taking, and some special + commands for philips webcams, so you can also use it for astronomy purposes. + It supports both video4linux 1 and 2 drivers, + so it should work on a very large number of devices. + ''; + homepage = http://wxcam.sourceforge.net/; + license = stdenv.lib.licenses.gpl3Plus; + maintainers = [ stdenv.lib.maintainers.AndersonTorres ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/development/libraries/cimg/builder.sh b/pkgs/development/libraries/cimg/builder.sh new file mode 100644 index 000000000000..bbd5f7125517 --- /dev/null +++ b/pkgs/development/libraries/cimg/builder.sh @@ -0,0 +1,12 @@ + +source $stdenv/setup + +unpackPhase +cd $sourceRoot + +install -dm 755 $out/include/cimg $out/share/doc/cimg/html $out/share/cimg/examples $out/share/cimg/plugins + +install -m 644 CImg.h $out/include/cimg +cp -dr --no-preserve=ownership html/* $out/share/doc/cimg/html/ +cp -dr --no-preserve=ownership examples/* $out/share/cimg/examples/ +cp -dr --no-preserve=ownership plugins/* $out/share/cimg/plugins/ diff --git a/pkgs/development/libraries/cimg/default.nix b/pkgs/development/libraries/cimg/default.nix new file mode 100644 index 000000000000..17b18e8f0be8 --- /dev/null +++ b/pkgs/development/libraries/cimg/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchurl +, unzip +}: + +stdenv.mkDerivation rec { + + name = "cimg-${version}"; + version = "1.5.9"; + + src = fetchurl { + url = "http://downloads.sourceforge.net/project/cimg/CImg-${version}.zip"; + sha256 = "1xn20643gcbl76kvy9ajhwbyjjb73mg65q32ma8mdkwn1qhn7f7c"; + }; + + buildInputs = with stdenv.lib; + [ unzip ]; + + builder = ./builder.sh; + + meta = with stdenv.lib; { + description = "A small, open source, C++ toolkit for image processing"; + homepage = http://cimg.sourceforge.net/; + license = licenses.cecill-c; + maintainers = [ maintainers.AndersonTorres ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1003bf4652c3..2686936fe683 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4481,6 +4481,8 @@ let capnproto = callPackage ../development/libraries/capnproto { }; + cimg = callPackage ../development/libraries/cimg { }; + scmccid = callPackage ../development/libraries/scmccid { }; ccrtp = callPackage ../development/libraries/ccrtp { }; @@ -10221,6 +10223,13 @@ let wxhexeditor = callPackage ../applications/editors/wxhexeditor { }; + wxcam = callPackage ../applications/video/wxcam { + inherit (gnome) libglade; + inherit intltool; + wxGTK = wxGTK28; + gtk = gtk2; + }; + x11vnc = callPackage ../tools/X11/x11vnc { }; x2vnc = callPackage ../tools/X11/x2vnc { };