HowTo compile package "uvccapture" within openembedded

In order to compile any new package for the NSLU2 box you should use openembedded and a cross development environment. As webcam a Logitech E3500 is used. The driver is "uvcvideo" (can be enabled in the kernel .configure file). As capture programs "w3cam (vidcat)" and "gphoto2" can not be used. The program "uvccapture" is known to work under slugOS 4.8beta, but the binary does not work under slugOS5 because of library problems.

Cross Environment

My host system is an i386 PC with Ubuntu 0810 running. You start with the MastertMakefile:
http://www.nslu2-linux.org/wiki/Development/MasterMakefile
There is an updated user manual for openembedded available:
http://docs.openembedded.org/usermanual/usermanual.html
Help may come from chat IRC freenode#openslug.

In order to compile a single package there is already a package "helloworld" provided. Let's look first at the pathes:
/home/rudi/slug/openembedded/packages/helloworld/helloworld_1.0.0.bb
Surprise, you will found no C source code. I will describe what is different in the distribution, compared to the usermanual.
The File helloworld_1.0.0.bb is a BitBake File and creates in the function "do_fetch()" the C source file "helloworld.c".

In order to learn how it works use the provided example "helloworld", type within folder "slug":

cd slugos; source setup-env; bitbake  -v -b openembedded/packages/helloworld/helloworld_1.0.0.bb

Setup Package for optware

First you need a make template. see
http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware and
http://www.nslu2-linux.org/wiki/Optware/PackagingBestPractices
The source package is in : http://packages.debian.org/squeeze/uvccapture
The template file is in "slug/optware/make/template.mk". Next type cd slug/optware then make make/uvccapture.mk.

http://www.uv-ac.de/openembedded/openembedded-3.html#HowConfigWorks

Setup Package for openembedded, uvccapture

As a help for the command "patch" and "diff" look at: http://www.linuxforums.org/applications/using_diff_and_patch.html

To generate a patch file for the original Makefile use: diff -uN uvccapture-0.5/Makefile Makefile > Makefile.patch

With the help of Jon Barber I could setup a BitBake file for uvccapture.

# uvccapture_0.5.bb  2009-03-06 RudolfReuter
DESCRIPTION = "USB UVC Video Class Snapshot Software for V4L2 driver."
SECTION = "console/multimedia"
PRIORITY = "optional"
DEPENDS="jpeg"
LICENSE = "GPLV2"
PR = "r0"

SRC_URI = "http://ftp.de.debian.org/debian/pool/main/u/uvccapture/uvccapture_0.5.orig.tar.gz \
           file://Makefile.patch;patch=1"

do_compile() {
   make
}

do_install() {
        install -d ${D}${bindir}
        install -m 0755 ${S}/uvccapture ${D}${bindir}/uvccapture
}

The patch file for the original makefile is:

--- uvccapture-0.5/Makefile     2008-08-01 04:26:18.000000000 +0200
+++ Makefile    2009-03-09 10:46:22.000000000 +0100
@@ -1,13 +1,13 @@
-CC=gcc
+#CC=gcc
 CPP=g++
 APP_BINARY=uvccapture
-VERSION = 0.4
-PREFIX=/usr/local/bin
+VERSION = 0.5
+PREFIX=/usr/bin

 WARNINGS = -Wall


-CFLAGS = -std=gnu99 -O2 -DLINUX -DVERSION=\"$(VERSION)\" $(WARNINGS)
+CFLAGS += -std=gnu99 -O2 -DLINUX -DVERSION=\"$(VERSION)\" $(WARNINGS)
 CPPFLAGS = $(CFLAGS)

 OBJECTS= uvccapture.o v4l2uvc.o


Go back to CategoryNslu2 or FrontPage ; KontaktEmail (ContactEmail)

CrossBuildUvccaptureSlugOS5 (last edited 2011-03-23 05:38:11 by dslb-084-058-142-238)