Warning
This app was not yet tested on the N900 device. Use at your own risk.
Note
This guide assumes you are using a Debian-based system (like Ubuntu 24.04) on an x86_64 architecture.
Run the script compile_python.sh
on your x86_64 device to cross-compile Python 3.11 for the N900 device.
This script automates the process of downloading, configuring, and compiling Python 3.11.
The script installs dependencies listed in the dependencies.txt
file, such as:
arm-linux-gnueabihf-gcc
gcc-arm-linux-gnueabihf
g++-arm-linux-gnueabihf
crossbuild-essential-armhf
build-essential
...
The script compile_python.sh
will configure the make file for cross-compilation, and compile it for the ARM architecture. Used settings are:
CC=arm-linux-gnueabihf-gcc \
./configure \
--build="$(./config.guess)" \
--host=arm-linux-gnueabihf \
--prefix="$INSTALL_DIR" \
--enable-optimizations \
--disable-ipv6 \
--enable-shared \
--without-ensurepip \
--with-build-python=/usr/bin/python3.11 \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no
After running the script, Python 3.11 will be installed in the python-arm-install
directory.
Note
Check if the installation was successful by running:
file python-arm-install/bin/python3.11
It should output something like: ELF 32-bit ARM
This guide does not support IPv6.
configure: error: You must get working getaddrinfo() function or pass the "--disable-ipv6" option to configure.
Could not build the ssl module! Python requires a OpenSSL 1.1.1 or newer
For compiling Python 3.11 you need compatible versions of Python and its dependencies already installed on your system. If you change the Python version, you may need to update the dependencies accordingly.
Warning
checking for --with-build-python... configure: error: "/usr/bin/python3" has incompatible version 3.12 (expected: 3.11)
[!warning] TODO This script was not yet done.
Run helper script package_python.sh
to create a Debian package for Python 3.11.
Run the script package_python.sh
to create the necessary directory structure for packaging Python 3.11:
./package_python.sh
You have to manually edit the DEBIAN/control
file to set the correct package name, version, architecture, maintainer, and description.
control
file example:
Package: python
Version: 3.11.10
Architecture: armhf
Maintainer: elPytel <[email protected]>
Section: interpreters
Priority: optional
Description: Python 3.11.10 for Nokia N900
After compiling Python, you need to move the binaries to the correct location in the package structure.
Move the python binaries to the python_3.11.10_armhf/usr/bin/
directory:
Run the helper script build_python_deb.sh
(again) to create the Debian package:
./build_python_deb.sh
This will create a .deb
file in the current directory, which you can then install on your N900 device.
You can use scp
to copy the package to your N900 device:
scp python_3.11.10_armhf.deb user@<n900_ip>:/home/user/MyDocs/