Loading ...
Sorry, an error occurred while loading the content.

12836Re: trouble getting to grips with .bb files. (sucsesfull python pil install)

Expand Messages
  • dunkclimbs
    May 2 8:44 AM
    • 0 Attachment
      ok, so i finaly resolved this by going about it by a different route.

      i had initialy ruled out trying to compile packages nativley as my ram
      disk is too small to allow me to install the native compiler by the
      "ipkg install openslug-native" method described in the documentation.
      when i tried the slug ran out of memory and the kernel started killing
      processes.

      i realised (late one night after hours of fighting with bitbake) that
      i don't need gcc and all it's tools to install the PIL library as it's
      a python extention and so is realy just a collection of python scripts.

      to install PIL i downloaded it onto the slug from here
      http://effbot.org/downloads/Imaging-1.1.5.tar.gz
      unpack it into /tmp/
      edit /tmp/Imaging-1.1.5/setup.py and change "JPEG_ROOT = " to point to
      my jpeg-6b libraries.
      (do the same for the other _ROOT options if you need those too.)
      from there just follow the README and "$ python setup.py install".
      the python interpeter complains about a few missing modules so you
      have a few more packages to install allong the way.
      (http://ipkgfind.nslu2-linux.org/ will tell you where to find them.)
      all in all it was fairly painless once i realised that it could be
      done this way.
      this technique should work for any python add on.

      from there pil worked. my robot is a step closer to seeing it's
      suroundings.

      i'd still like to know how to do all this with bitbake though to save
      someone else all this trouble down the line.
      how do i tell bitbake to insert the proper "JPEG_ROOT = " into setup.py?

      hope this helps someone.

      dunk.



      --- In nslu2-linux@yahoogroups.com, "dunkclimbs" <mrdunk@...> wrote:
      >
      > so i'm new to OpenSlug and having difficulty writing .bb files for
      > bitbake.
      >
      > this closest i have found to documentation on the process:
      > http://oe.handhelds.org/cgi-bin/moin.cgi/bb_20file
      > and
      > http://www.vanille.de/tools/FOSDEM2005.pdf
      > but neither are very clear.
      > is there a better resource that i am just not finding?
      >
      > i need to decode jpeg images from a webcam for a robot vision project.
      >
      > the package i want to buld is the Python Imaging Libary (PIL for
      > short) from Imaging-1.1.5.tar.gz.
      > the .bb file below builds a package that installs ok and is loadable
      > in python but dosn't see the libjpeg62 package so fails when i try to
      > actually use an image. (example output from python interpriter below.)
      > if i was configuring it for the host machine i would edit ImConfig.h
      > and insert the line "#define HAVE_LIBJPEG 1" as described here:
      > http://plone.sourceforge.net/archetypes/known_issues.html
      >
      > how can i tell bitbake to pass the "#define HAVE_LIBJPEG 1" option
      > during the build?
      >
      >
      > here's my python-pil.bb so far...
      > ------------------------------------------------
      > DESCRIPTION = "PIL"
      > SECTION = "devel/python"
      > PRIORITY = "optional"
      > MAINTAINER = "dunk"
      > LICENSE = "GPL"
      > SRCNAME = "Imaging"
      > PR = "ml0"
      > PV = "1.1.5"
      >
      > SRC_URI = "http://effbot.org/downloads/${SRCNAME}-${PV}.tar.gz"
      > S = "${WORKDIR}/${SRCNAME}-${PV}"
      >
      > inherit distutils
      > --------------------------------------------------
      >
      >
      > and the output in python when i try to use it:
      > --------------------------------------------------
      > root@bot:~# python
      > Python 2.4.1 (#2, Feb 9 2006, 18:23:50)
      > [GCC 3.4.4] on linux2
      > Type "help", "copyright", "credits" or "license" for more information.
      > >>> import Image
      > >>> im1 = Image.open("/tmp/test.jpg")
      > >>> l1 = im1.getdata()
      > Traceback (most recent call last):
      > File "<stdin>", line 1, in ?
      > File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 796, in
      > getdata
      > self.load()
      > File "/usr/lib/python2.4/site-packages/PIL/ImageFile.py", line 180,
      > in load
      > d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
      > File "/usr/lib/python2.4/site-packages/PIL/Image.py", line 328, in
      > _getdecoder
      > raise IOError("decoder %s not available" % decoder_name)
      > IOError: decoder jpeg not available
      > >>>
      > --------------------------------------------------
      >
      > any help apreciated!
      >
      > dunk.
      >
    • Show all 2 messages in this topic