OverviewPython requires zlib, openssl, ncurses, bzip, and SQlite3. Python is not very cross-compile friendly because it uses some binaries generated during the compilation procedure for the rest of the compilation. Therefore we do a two-pass compilation, one natively to get the required binaries, and once again to cross-compile. All the dependencies are statically linked to make deployment easier. This version uses better compiler flags and the latest releases of the dependencies. It is a much smaller package than the previous one. AcknowledgementsThe original version of the patch used to make python cross-compilable comes from here. The patch used in this version is augmented to allow static compilation using libraries not on the standard locations. PreparationMake sure you have a cross-compiling virtual machine properly setup. Compilationsudo apt-get install build-essential patch
export DEST=/mnt/DroboFS/Shares/DroboApps/python2
cd ~/code/
wget http://zlib.net/zlib-1.2.6.tar.gz
tar zxf zlib-1.2.6.tar.gz
cd zlib-1.2.6
CFLAGS="$CFLAGS -O3" ./configure --prefix=$DEST --static
make clean && make
ZLIB=`pwd`
cd ..
wget http://www.openssl.org/source/openssl-1.0.1.tar.gz
tar zxf openssl-1.0.1.tar.gz
cd openssl-1.0.1
./Configure linux-generic32 -DL_ENDIAN --prefix=$DEST --openssldir=$DEST/etc/ssl no-shared no-zlib-dynamic --with-zlib-include=$ZLIB --with-zlib-lib=$ZLIB
sed -i -e "s/CFLAG= /CFLAG=${CFLAGS} /g" Makefile
make clean && make && make install_sw
rm -fr $DEST/bin $DEST/include $DEST/lib $DEST/misc
OPENSSL=`pwd`
cd ..
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
tar zxf ncurses-5.9.tar.gz
cd ncurses-5.9/
./configure --host=arm-none-linux-gnueabi --prefix=$DEST --without-shared
make clean && make
cd include
ln -s curses.h ncurses.h
cd ..
NCURSES=`pwd`
cd ..
wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar zxf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6/
make clean
make libbz2.a CC=$CC AR=$AR RANLIB=$RANLIB CFLAGS="$CFLAGS -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64"
BZIP=`pwd`
cd ..
wget http://www.sqlite.org/sqlite-autoconf-3071000.tar.gz
tar zxf sqlite-autoconf-3071000.tar.gz
cd sqlite-autoconf-3071000/
CFLAGS="$CFLAGS -O3" ./configure --host=arm-none-linux-gnueabi --prefix=$DEST --disable-shared
make clean && make
SQLITE=`pwd`
cd ..
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar zxf Python-2.7.2.tgz
cd Python-2.7.2/
. ~/uncrosscompile.sh
./configure
make python Parser/pgen
mv python hostpython
mv Parser/pgen Parser/hostpgen
make distclean
. ~/crosscompile.sh
wget -O Python-2.7.2-drobofs.patch http://www.droboports.com/app-repository/python-2-7-2/Python-2.7.2-drobofs.patch
Packagingcd $DEST ~/bin/package.sh InstallingDownload the TGZ file below and place it in you DroboApps share. If you do not have SSH access, reboot your Drobo. Otherwise, SSH in and type: /usr/bin/DroboApps.sh install Final remarksThis is not a conventional DroboApp in the sense that once installed, it is ready for use. This one just makes the Python binaries and libraries available for further use, and does not attempt to change the DroboFS configuration in any way. A good start to make it easier to use can be found here. Also, you can create a link to the perl binary in the proper folder in an SSH session like this: cd /usr/bin ln -s /mnt/DroboFS/Shares/DroboApps/python2/bin/python . To get easy_install execute these commands after Python is installed on the DroboFS: mkdir -p /mnt/DroboFS/Shares/DroboApps/python2/tmp cd /mnt/DroboFS/Shares/DroboApps/python2/tmp export TMPDIR=/mnt/DroboFS/Shares/DroboApps/python2/tmp wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11-py2.7.egg --prefix=/mnt/DroboFS/Shares/DroboApps/python2 Note: You should replace the above URL for the setuptools.egg with the latest from the easy_install page. Please visit the DroboSpace forums to leave your comments, suggestions and feedback. |

