WebOS 3.0

The following guide covers the installation routine for WebOS 3.0.

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.76_i386.deb)
  • the WebOS SDK (palm-sdk_3.0.0-svn486609-pho643_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.76_i386.deb
...
dpkg --contents palm-sdk_3.0.0-svn486609-pho643_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/webos3 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/webos3

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/webos3/
dpkg-deb -x palm-sdk_1.4.5-svn307799-sdk1457-pho465_i386.deb ~/software/webos3/
rm -rfv ~/software/webos3/usr
mv ~/software/webos3/opt/* ~/software/webos3/
rm -rfv ~/software/webos3/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/webos3/PalmSDK/Current/bin

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

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

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/webos3
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 phones or tablets themselves.

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:

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

Wrapping the Binaries

Next, create small wrapper scripts for the novacom applications under ~/software/webos3, 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

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 the 1024×768 emulator image.

If you have started palm-emulator once you will the image properly set up in your VirtualBox environment, so that you can start it up from VirtualBox later on.

Start Developing

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

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