Install the Tizen SDK on Debian

Updated July 2013: the Tizen project has released the Tizen SDK 2.2. When installing the SDK on a distribution other than Ubuntu, the installer does not complain that the distribution is unsupported. As a consequence, the changes described here are no longer necessary.

Updated May 2013: the Tizen project has released the Tizen SDK 2.1. Linux support is still limited to Ubuntu but I have updated the patch for Debian.

The Tizen project has released version 2.0 of its software development kit in mid february. The Tizen SDK is available for Mac OS X, Windows and Linux. Unfortunately, Linux support is limited to Ubuntu.

Maintaining software and ensuring that it works on several Linux distributions has a cost. However, I think it is a bit contradictory for Tizen to aspire to compete with three mobile OSes (iOS, Androïd, and Windows Phone) while supporting no more than three platforms for its SDK.

Fortunately, it is quite easy to install the Tizen SDK on Debian 7.0 "Wheezy". Here is how.

The SDK, which can be downloaded there, is a self-extracting archive: a tarball is appended to a shell script:

$ head -n 1 tizen-sdk-ubuntu64-v2.1.4.bin
#!/bin/bash
$ tail -n +130 tizen-sdk-ubuntu64-v2.1.4.bin | tar zt
InstallManager
InstallManagerP
InstallManager.jar
installmanager.conf

In order to add support for Debian or your favorite Linux distribution, the install script has to be modified. The script reads the content of /etc/lsb-release, but this file is missing from Debian. Instead, the lsb_release should be invoked.

Here is a patch for the Tizen SDK installer that adds support for Debian Wheezy:

--- tizen-sdk-ubuntu64-v2.1.4.bin   2013-05-28 23:04:57.073651552 +0200
+++ tizen-sdk-ubuntu64-v2.1.4.bin   2013-05-28 23:12:55.405631436 +0200
@@ -1,7 +1,7 @@
 #!/bin/bash

 ORI_FILE_md5sum="80064b2d0c0e3e5a921471e5c500d981"
-ORI_FILE_LEN="130"
+ORI_FILE_LEN="141"

 TPUT="`which tput`"
 if test -t 0 -a -t 1 -a -n "$TPUT"; then
@@ -16,7 +16,8 @@

 OS_BLOCKSIZE=`df -k . |head -n 1 | awk '{if ( $4 ~ /%/) { print $1 } else { print $2 } }'`
 OS_BIT=`getconf LONG_BIT`
-OS_VERSION=`cat /etc/lsb-release | grep DISTRIB_RELEASE | awk -F= '{print $2}'`
+DISTRIB_ID=`lsb_release --short --id`
+DISTRIB_RELEASE=`lsb_release --short --release`

 JAVA_VERSION=`java -version 2>&1 | sed -n "/^java version/p"`
 JAVA_BIT_FLAG=`java -version 2>&1 | egrep -e 64-Bit`
@@ -36,14 +37,25 @@
 INSTALLATION_CHECK="procps gettext libdbus-1-3 libcurl3 expect gtk2-engines-pixbuf grep zip make libgnome2-0"
 pkg_list=""

-# ubuntu version 10.x and 11.x and 12.x and 32bit
-if [ "10.04" = ${OS_VERSION} ] || [ "10.10" = ${OS_VERSION} ]; then
-   INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-arm-static"
-elif [ "11.04" = ${OS_VERSION} ] || [ "11.10" = ${OS_VERSION} ]; then
-   INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static"
-elif [ "12.04" = ${OS_VERSION} ] || [ "12.10" = ${OS_VERSION} ]; then
-   INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static libwebkitgtk-1.0-0"
-fi
+case "${DISTRIB_ID}" in
+   Debian)
+       if [ "${DISTRIB_RELEASE}" = '7.0' ]; then
+           INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static libwebkitgtk-1.0-0"
+       fi
+       ;;
+   Ubuntu)
+       if [ "${DISTRIB_RELEASE}" = '10.04' ] || [ "${DISTRIB_RELEASE}" = '10.10' ]; then
+           INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-arm-static"
+       elif [ "${DISTRIB_RELEASE}" = '11.04' ] || [ "${DISTRIB_RELEASE}" = '11.10' ]; then
+           INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static"
+       elif [ "${DISTRIB_RELEASE}" = '12.04' ] || [ "${DISTRIB_RELEASE}" = '12.10' ]; then
+           INSTALLATION_CHECK="$INSTALLATION_CHECK qemu-user-static libwebkitgtk-1.0-0"
+       fi
+       ;;
+   *)
+       echo "${CE} Unsupported distribution: ${DISTRIB_ID} ${CN}"
+   ;;
+esac

 NVIDIA_CHECK=`lspci | grep nVidia`
 MESA_CHECK=`dpkg -l | egrep -e libgl1-mesa-glx' '`
@@ -65,8 +77,7 @@
 ## check the default java as OpenJDK ##
 CHECK_OPENJDK=`java -version 2>&1 | egrep -e OpenJDK`
 if [ -n "${CHECK_OPENJDK}" ] ; then
-   echo "${CE} OpenJDK is not supported. Try again with Oracle JDK. ${CN}"
-   exit 1
+   echo "${CE} Warning: Oracle JDK is preferred over OpenJDK. ${CN}"
 fi

 ## check the java installation ##
@@ -95,7 +106,7 @@
 fi

 ## check the mesa driver for emulator ##
-if [ "10.10" = ${OS_VERSION} ] && [ -n "${NVIDIA_CHECK}" ] && [ -z "${MESA_CHECK}" ] ; then
+if [ ${DISTRIB_RELEASE} = '10.10' ] && [ -n "${NVIDIA_CHECK}" ] && [ -z "${MESA_CHECK}" ] ; then
    echo "We recommend that you use the Mesa OpenGL implementation in Ubuntu 10.10 and nVidia enviroment."
    echo "Please install${CE} libgl1-mesa-glx ${CN}package."
    exit 1

The original installer verifies that the Java virtual machine from Oracle is present. However, the SDK seems to work pretty well with OpenJDK. So I decided to disable the check for Oracle's JVM.