Thursday, December 15, 2011

Installing Cadsoft Eagle 6 on Ubuntu 10.4

Update (19 Dec 2014): Just reviewing old blog posts. This article is now way out of date. Please ignore.

Update (5 Mar 2012): I've just been informed that libpng-1.4.8 has been replaced by libpng-1.4.9 and removed from ftp.simplesystems.org. I'll update the script in the next few days. In the mean time, please edit the script to change the version of libpng.

The recently released Eagle 6 from Cadsoft has a dependency on libpng 1.4, libjpeg 8, libcrypt 1.0, libssl 1.0. My Ubuntu 10.4 distribution has older versions of these libraries which Eagle 6 does not like.

There are a few posts on how to fix this, eg this one. However it relies on some helpful person's pre-built binaries. While I'm sure it's perfectly good, I'm just a little too paranoid to copy and execute code from an unknown source. So I set about downloading and building these libraries from source. I've written up the procedure as a bash script in case someone as paranoid as myself would like to do the same.

This script will build these libraries from source, and copy them to a directory specifically for use with Eagle.

This is the procedure:
  1. First create an empty directory. Copy this script into it. Next open the script with an editor.
  2. Set EAGLE_DEPS_DIR to a location where you want the libraries to be copied to after building (eg /home/joe/libeagle in my case)
  3. I recommend that you verify the download locations of the library sources before you run this script. This is security best practice: it's generally not a good idea to download and execute code from an untrusted source. Once you are happy with the download URLs, then set I_HAVE_VERIFIED_DOWNLOAD_LOCATIONS=true
  4. Save and run the script. If it's your first time running it, it will download the sources. Subsequent runs wont waste bandwidth if they are already there. Building the libraries will take a few minutes.
  5. Verify the contents of the directory defined in EAGLE_DEPS_DIR. It should have the following files:
    • libcrypto.so.1.0.0
    • libjpeg.so.8.3.0
    • libpng14.so.14.8.0
    • libssl.so.1.0.0
    and these symbolic links:
    • libjpeg.so.8 -> /home/joe/libeagle/libjpeg.so.8.3.0
    • libpng14.so.14 -> /home/joe/libeagle/libpng14.so.14.8.0
  6. Before running the Eagle installer or the Eagle software set environment variable LD_LIBRARY_PATH to include this directory (eg export LD_LIBRARY_PATH=/home/joe/libeagle )
Enjoy!

Update (30 Jan 2012): I received some improvements to the script from Leandro (wisleca@gmail.com).  Revision 2 is here.

16 comments:

  1. Ta, handy, was just about to write up similar script and post myself :)

    Googled first and found yours, laziness wins so I'll use yours!

    ReplyDelete
  2. Got two errors using this with Ubuntu 11.10. The first was I needed to install zlib1g-dev. Now I'm stuck on the problem:

    /tmp/eagle-setup.10469/eagle-6.0.0/bin/eagle: error while loading shared libraries: libpng14.so.14: wrong ELF class: ELFCLASS64

    I know I've got a 64 bit installation, but does Eagle only support 32 bit installations?

    Any ideas how to get past this?

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I ran into that problem too on my 64 bit ubuntu 11.10 . managed to get it working by downloading 32bit binaries from slack
    http://slackware.osuosl.org/slackware-current/slackware/l/libpng-1.4.8-i486-1.txz

    then just copy the file from : libpng-1.4.8-i486-1/usr/lib

    worked like a charm , hope this helps .

    ReplyDelete
  5. I ran into that problem too on my 64 bit ubuntu 11.10 . managed to get it working by downloading 32bit binaries from slack
    http://slackware.osuosl.org/slackware-current/slackware/l/libpng-1.4.8-i486-1.txz

    then just copy the file from : libpng-1.4.8-i486-1/usr/lib

    worked like a charm , hope this helps .

    ReplyDelete
  6. I have a 64bit system, so I had to do some others things aswell. First I needed to install some basic 32bit libraries

    sudo apt-get install lib32cr0 lib32gcc1 lib32z1 lib32z1-dev libc6-dev-i386 libc6-i386

    Second, when running the mentioned script, I had to prefix it like this:

    CFLAGS="-O2 -m32" bash ./build-eagle6-deplibs.sh

    ReplyDelete
  7. Hi Joe, thanks for the script: big help for newbies like me!

    BTW, the only missing lib in my case (Ubuntu dsk 11.10 32b) was libpng:

    $ ldd /opt/eagle-6.1.0/bin/eagle | egrep "not found"
    libpng14.so.14 => not found

    Adjusted your script accordingly and worked fine. I'm emailing you some modifications aimed to easily accommodate newer lib versions.

    Thanks!

    ReplyDelete
  8. libpng-1.4.8 has been replaced by libpng-1.4.9 and removed from ftp.simplesystems.org.

    ReplyDelete
  9. Thanks for the tip re libpng. I'll update the script in the next few days.

    ReplyDelete
  10. When I set my environment path, it didn't work without the trailing / just figured I'd leave that for somebody.

    ReplyDelete
  11. New location of libpng
    LIBPNG_SOURCE_URL=ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng14/libpng-1.4.8.tar.bz2

    ReplyDelete
  12. You haven't updated your script to include the NEW location:

    New location of libpng
    LIBPNG_SOURCE_URL=ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng14/libpng-1.4.8.tar.bz2

    Thanks....Paul

    ReplyDelete
  13. Thanks for putting this together. Needed it for my Debian system (which had libjepeg8 but not the others).

    I did need to modify it to change the libpng URL, as noted above -- but I tried instead the most recent libpng14 release at ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.12.tar.bz2 , and all seems fine.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete