From c14f3e4039741cfc970252ade65c83e93aeabf30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 17 Aug 2014 23:43:08 +0200 Subject: [PATCH 1/3] uvccapture: new package "Capture image from USB webcam at a specified interval" I apply patches from Debian to make it build with V4L2 (instead of v1 API) and fix some warnings/bugs. Source code is also downloaded from Debian, as uvccapture homepage is unavailable. Homepage: http://linux-uvc.berlios.de/ (seems to have vanished...) --- .../applications/video/uvccapture/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/applications/video/uvccapture/default.nix diff --git a/pkgs/applications/video/uvccapture/default.nix b/pkgs/applications/video/uvccapture/default.nix new file mode 100644 index 000000000000..468db4625103 --- /dev/null +++ b/pkgs/applications/video/uvccapture/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchurl, libjpeg }: + +let + debianPatches = fetchurl { + url = "mirror://debian/pool/main/u/uvccapture/uvccapture_0.5-3.debian.tar.gz"; + sha256 = "0m29by13nw1r8sch366qzdxg5rsd1k766kqg1nj2pdb8f7pwjh9r"; + }; + +in + +stdenv.mkDerivation rec { + name = "uvccapture-0.5"; + + src = fetchurl { + url = "mirror://debian/pool/main/u/uvccapture/uvccapture_0.5.orig.tar.gz"; + sha256 = "1b3akkcmr3brbf93akr8xi20w8zqf2g0qfq928500wy04qi6jqpi"; + }; + + buildInputs = [ libjpeg ]; + + patchPhase = '' + tar xvf "${debianPatches}" + for fname in debian/patches/fix_videodev_include_FTBFS.patch \ + debian/patches/warnings.patch \ + debian/patches/numbuffers.patch + do + echo "Applying patch $fname" + patch < "$fname" + done + ''; + + makeFlagsArray = [ "PREFIX=$(out)/bin/" ]; + + preInstall = '' + mkdir -p "$out/bin" + ''; + + # Upstream has no man page, install one from Debian + postInstall = '' + mkdir -p "$out/share/man/man1" + cp -v debian/uvccapture.1 "$out/share/man/man1/" + ''; + + meta = with stdenv.lib; { + description = "Capture image from USB webcam at a specified interval"; + homepage = http://linux-uvc.berlios.de/; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 200881c916a6..5c367ee75b68 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9847,6 +9847,8 @@ let uucp = callPackage ../tools/misc/uucp { }; + uvccapture = callPackage ../applications/video/uvccapture { }; + uwimap = callPackage ../tools/networking/uwimap { }; uzbl = callPackage ../applications/networking/browsers/uzbl { From 4ee77e2fc5394531f1c1b049d49845da45bd425d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 17 Aug 2014 22:56:52 +0200 Subject: [PATCH 2/3] libtar: new package libtar is a C library for manipulating POSIX tar files. http://www.feep.net/libtar/ --- pkgs/development/libraries/libtar/default.nix | 23 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/development/libraries/libtar/default.nix diff --git a/pkgs/development/libraries/libtar/default.nix b/pkgs/development/libraries/libtar/default.nix new file mode 100644 index 000000000000..7a8dfa7a6227 --- /dev/null +++ b/pkgs/development/libraries/libtar/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchgit, autoreconfHook }: + +stdenv.mkDerivation rec { + version = "1.2.20"; + name = "libtar-${version}"; + + # Maintenance repo for libtar (Arch Linux uses this) + src = fetchgit { + url = "git://repo.or.cz/libtar.git"; + rev = "refs/tags/v${version}"; + sha256 = "1pjsqnqjaqgkzf1j8m6y5h76bwprffsjjj6gk8rh2fjsha14rqn9"; + }; + + buildInputs = [ autoreconfHook ]; + + meta = with stdenv.lib; { + description = "C library for manipulating POSIX tar files"; + homepage = http://www.feep.net/libtar/; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5c367ee75b68..967c097dbd00 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5502,6 +5502,8 @@ let libspatialite = callPackage ../development/libraries/libspatialite { }; + libtar = callPackage ../development/libraries/libtar { }; + libtasn1 = callPackage ../development/libraries/libtasn1 { }; libtheora = callPackage ../development/libraries/libtheora { }; From 006ebdfe7853002299ebf8b14e175eb68f37a31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 17 Aug 2014 22:58:02 +0200 Subject: [PATCH 3/3] linuxstopmotion: new package Linux Stopmotion is a program for creating stop-motion animation movies. http://linuxstopmotion.org/ I had to apply a small patch to make grabbing images from webcam work (using uvccapture). I find it odd that it didn't work without the patch, seeing that Arch Linux also have the v0.8.0 version, but with no patch. Latest Ubuntu (14.04) has v0.7.2, which is unaffected. --- .../video/linuxstopmotion/default.nix | 36 +++++++++++++++++++ ...stopmotion-fix-wrong-isProcess-logic.patch | 33 +++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 71 insertions(+) create mode 100644 pkgs/applications/video/linuxstopmotion/default.nix create mode 100644 pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch diff --git a/pkgs/applications/video/linuxstopmotion/default.nix b/pkgs/applications/video/linuxstopmotion/default.nix new file mode 100644 index 000000000000..23a033844b38 --- /dev/null +++ b/pkgs/applications/video/linuxstopmotion/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchgit, pkgconfig, qt4, SDL, SDL_image, libvorbis, libtar, libxml2 +, gamin +}: + +stdenv.mkDerivation rec { + version = "0.8"; + name = "linuxstopmotion-${version}"; + + src = fetchgit { + url = "git://git.code.sf.net/p/linuxstopmotion/code"; + rev = "refs/tags/${version}"; + sha256 = "1xkkrhllgy2d7k0vrdj794ya7y3g3n7xh8c2qgnb26yrarz79dqj"; + }; + + buildInputs = [ pkgconfig qt4 SDL SDL_image libvorbis libtar libxml2 gamin ]; + + patches = [ ./linuxstopmotion-fix-wrong-isProcess-logic.patch ]; + + configurePhase = '' + qmake PREFIX="$out" + ''; + + # Installation breaks without this + preInstall = '' + mkdir -p "$out/share/stopmotion/translations/" + cp -v build/*.qm "$out/share/stopmotion/translations/" + ''; + + meta = with stdenv.lib; { + description = "Create stop-motion animation movies"; + homepage = http://linuxstopmotion.org/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch b/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch new file mode 100644 index 000000000000..caab48d0e2d9 --- /dev/null +++ b/pkgs/applications/video/linuxstopmotion/linuxstopmotion-fix-wrong-isProcess-logic.patch @@ -0,0 +1,33 @@ +From b23b7dab1d540b0710fcb9ded1c6256a49844906 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= +Date: Wed, 20 Aug 2014 22:22:00 +0200 +Subject: [PATCH] Fix wrong "isProcess" logic + +Stopmotion wrongly thinks that uvccapture should be run as a daemon, +even though configuration for uvccapture has no "daemon-like" command +line to be run (according to "preferences"). The result is an error +popup instead of video/image grabbing. + +This brings back the "isProcess" logic that was in stopmotion v0.7.2, +because it seems to work, while the current logic (v0.8.0) seems to +fail. +--- + src/presentation/frontends/qtfrontend/frameview.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/presentation/frontends/qtfrontend/frameview.cpp b/src/presentation/frontends/qtfrontend/frameview.cpp +index e44dca7..d2c41fd 100644 +--- a/src/presentation/frontends/qtfrontend/frameview.cpp ++++ b/src/presentation/frontends/qtfrontend/frameview.cpp +@@ -270,7 +270,7 @@ bool FrameView::on() { + Preference device(QString("device%1") + .arg(activeDev).toLatin1().constData(), ""); + QString pre = QString(prepoll.get()).replace("$VIDEODEVICE", device.get()); +- bool isProcess = startDaemon.get(); ++ bool isProcess = (strcmp(startDaemon.get(), "") == 0) ? false : true; + + bool isCameraReady = true; + this->grabber = new CommandLineGrabber(capturedFile.path(), isProcess); +-- +2.0.2 + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 967c097dbd00..f8675c985ab9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9630,6 +9630,8 @@ let conf = config.st.conf or null; }; + linuxstopmotion = callPackage ../applications/video/linuxstopmotion { }; + sweethome3d = recurseIntoAttrs ( (callPackage ../applications/misc/sweethome3d { }) // (callPackage ../applications/misc/sweethome3d/editors.nix { sweethome3dApp = sweethome3d.application;