WebOS 1.4.5

The following guide covers the installation routine for WebOS 1.4.5.

Please note that Palm/HP seems to have removed the 1.4.5 SDK packages for downloading.

Prerequisites

Install the following ports:

  • archivers/dpkg
  • java/jdk16
  • java/linux-sun-jdk16
  • emulators/virtualbox-ose
  • shells/bash

Installing the necessary Bits and Pieces

First of all, download the Ubuntu packages of the WebOS SDK, including

  • the novacom 32-bit package (palm-novacom_1.0.56_i386.deb)
  • the WebOS SDK (palm-sdk_1.4.5-svn307799-sdk1457-pho465_i386.deb)

As you notice, both are in the Debian DEB package format, which requires you to install archivers/dpkg from the ports in order to unpack them. Do not unpack them yet. First, take a look at the package layout to understand where anything will be installed. To do this, simply type

dpkg --contents palm-novacom_1.0.56_i386.deb
...
dpkg --contents palm-sdk_1.4.5-svn307799-sdk1457-pho465_i386.deb

You will notice that both packages will install content into the /opt and /usr prefix. The part installed under /usr however are mostly symbolic links to the executables and scripts as well as a set of changelog.XX files, which can be omitted. Furthermore, I strongly suggest not to install the packages as root, but to unpack them manually into some user-specific directory instead (there is no specific reason for this except for that I do not like such pieces of software to be scattered around with the base OS).

That said, we will use the following installation layout for the necessary parts:

  • /home/USER/software/palm as the base directory for the WebOS SDK
  • /opt for some symlinks (those are required for the palm-inspector application)

Create the base directory:

mkdir -p ~/software/palm

Unpack the packages, get rid of the superfluous stuff and move the directory order a bit to have easier (shortened) access to anything:

dpkg-deb -x palm-novacom_1.0.56_i386.deb ~/software/palm/
dpkg-deb -x palm-sdk_1.4.5-svn307799-sdk1457-pho465_i386.deb ~/software/palm/
rm -rfv ~/software/palm/usr
mv ~/software/palm/opt/* ~/software/palm/
rm -rfv ~/software/palm/opt

Script Adjustments

Now it is time to adjust the scripts to make them work properly in your environment. As the scripts use some bashisms, you need to install shells/bash from the ports. Once done, go to

cd ~/software/palm/PalmSDK/Current/bin

Except for palm-worm all scripts feature a similar structure, which makes patching straightforward. In

  • palm-generate
  • palm-help
  • palm-install
  • palm-launch
  • palm-log
  • palm-package

change the lines

HERE="$(where_am_i "$0")"
        
# look for relative dirs
JARS_DIR="$(abs_path "$HERE/../share/jars")

to

HERE="$(dirname `realpath "$0"`)"
        
# look for relative dirs
JARS_DIR="$HERE/../share/jars"

In palm-emulator, also replace the lines

IMAGES_DIR="$(abs_path "$HERE/../share/emulator/images")"

with

IMAGES_DIR="$HERE/../share/emulator/images"

and add

export JAVA_HOME=/usr/local/linux-sun-jdk1.6.0

right after

set -e

To make all scripts work without explicitly calling bash beforehand, replace the shebang

#!/bin/bash

with

#!/usr/bin/env bash

palm-worm is the only script that uses a better integration purpose using environment variables, but we do not mind here (for the proxy and palm-inspector changes, you could leave it as is, though). Replace

# remove the trailing slash (if any)
SDK_DIR=${PalmSDK%/}

with

# remove the trailing slash (if any)
SDK_DIR="$(dirname `realpath "$0"`)/../"

That's it for patching the basic scripts. To keep ways short, symlink anything into the base directory:

cd ~/software/palm
ln -s PalmSDK/Current/bin/palm-* .

Making Novacom work

novacom is the fundamental service that allows you to install, run, inspect, … your developed application on the VirtualBox emulator or connected mobile phone. It acts as service proxy in both directions.

NOTE: I did not try to access the phone yet (only the emulator), so it is not guaranteed to work nor I can ensure that it will not cause serious damage to the phone itself.

Installing the Dependencies

novacom relies on libusb and since we are using the Ubuntu packages of the WebOS SDK, we obviously need the Ubuntu packages for the shared libraries. Download libusb-0.1-4_0.1.12-14_i386.deb from the Ubuntu package repository, unpack it and move the required libraries to the SDK directory:

dpkg-deb -x libusb-0.1-4_0.1.12-14_i386.deb tmp
mv tmp/lib/* ~/software/palm/PalmSDK/Current/lib/
rm -rfv tmp

Wrapping the Binaries

Next, create small wrapper scripts for the novacom applications under ~/software/palm, so they can find all required libraries:

  • novacom.sh
#!/bin/sh

CURDIR="$(dirname `realpath "$0"`)"

export LD_LIBRARY_PATH=$CURDIR/PalmSDK/Current/lib:"$LD_LIBRARY_PATH"
cd $CURDIR && exec ./Palm/novacom/novacom $*
  • novacomd.sh
#!/bin/sh

CURDIR="$(dirname `realpath "$0"`)"

export LD_LIBRARY_PATH=$CURDIR/PalmSDK/Current/lib:"$LD_LIBRARY_PATH"
cd $CURDIR && exec ./Palm/novacom/novacomd $*
  • novaterm.sh
#!/bin/sh

CURDIR="$(dirname `realpath "$0"`)"

export LD_LIBRARY_PATH=$CURDIR/PalmSDK/Current/lib:"$LD_LIBRARY_PATH"
cd $CURDIR && exec ./Palm/novacom/novacom $* -t open tty://0

Making Palminspector work

Note: palminspector is for inspecting and debugging Mojo/web-based applications and their DOM layout. If you do not intend to develop such applications, you can skip this.

palminspector is a WebKit based application that allows you to inspect your web application's layout at run-time.

Installing the Dependencies

Palm missed to bundle all required libraries with it, which requires you to download and unpack a large set of packages from the Ubuntu package repository. The following packages are required:

  • libenchant1c2a_1.6.0-0ubuntu1_i386.deb
  • libfam0_2.7.0-16.1_i386.deb
  • libgcrypt11_1.4.4-5ubuntu2_i386.deb
  • libgio-fam_2.22.0-0ubuntu1_i386.deb
  • libgnutls13_2.0.4-1ubuntu2.6_i386.deb
  • libgpg-error0_1.6-1ubuntu2_i386.deb
  • libicu38_3.8-6ubuntu0.2_i386.deb
  • libtasn1-3_2.4-1_i386.deb
  • libxml2_2.7.6.dfsg-1ubuntu1_i386.deb

Unpack and copy them as follows:

dpkg-deb x libenchant1c2a_1.6.0-0ubuntu1_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libxml2_2.7.6.dfsg-1ubuntu1_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libicu38_3.8-6ubuntu0.2_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libgnutls13_2.0.4-1ubuntu2.6_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libgcrypt11_1.4.4-5ubuntu2_i386.deb tmp
mv tmp/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libtasn1-3_2.4-1_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libgpg-error0_1.6-1ubuntu2_i386.deb tmp
mv tmp/lib/* ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libgio-fam_2.22.0-0ubuntu1_i386.deb tmp
mv tmp/usr/lib/gio ~/software/palm/PalmSDK/Current/lib/

dpkg-deb -x libfam0_2.7.0-16.1_i386.deb tmp
mv tmp/usr/lib/* ~/software/palm/PalmSDK/Current/lib/

Wrapping the Binary

Create a wrapper script palminspector.sh for palminspector under ~/software/palm, so it can find all required libraries:

#!/bin/sh

CURDIR="$(dirname `realpath "$0"`)"

export LD_LIBRARY_PATH=$CURDIR/PalmSDK/Current/lib:"$LD_LIBRARY_PATH"
cd $CURDIR && exec ./PalmSDK/Current/bin/palminspector $*

Work around Path Issues

Unfortunately palminspector seems to have the SDK path hardcoded within the binary, so you must link your PalmSDK directory to /opt.

ln -s /home/USER/software/palm/PalmSDK /opt/PalmSDK

Setting up the VirtualBox Image

The WebOS emulator relies on VirtualBox, thus you need to install emulators/virtualbox-ose from the ports. Once you installed and configured VirtualBox to your needs, you can execute palm-emulator to set up the both emulator images for the Palm Pre and Palm Pixi screen sizes.

You can ignore the “Novacom not responding” warning, since we set up the emulator images and execute them directly from VirtualBox later on.

Once you started palm-emulator twice (once for either image), you will find both images properly set up in your VirtualBox environment, so that you can fire start them up from VirtualBox later on.

Start Developing

That's it! Now you can start to develop your own WebOS applications under FreeBSD.

docs/webos145.txt · Last modified: 2011/07/17 10:06 by marcusva
Driven by DokuWiki Blog RSS feed