Turns out this has a C extension, which means it needs to be compiled.
Install prerequisites
Run the command:
Code: Select all
sudo apt install libmysqlclient-dev
NOTE: The header files from the GPL code tarball for the NAS box don't work, so this is the next best option.
Copy the header files to the required location:
Code: Select all
sudo cp -R /usr/include/mysql ~/nas-sysroot/usr/local/include/mysql/
Copying libmysqlclient shared libraries into the right place
Download "nasroot.tar.gz" from https://wmtprojectsforum.altervista.org ... /NAS%20Box
Then, extract it and run the following commands:
Code: Select all
sudo cp usr/local/modules/lib/libmysqlclient* /home/wmt/nas-sysroot/lib
cd /home/wmt/nas-sysroot/lib
sudo ln -s libmysqlclient.so.16 libmysqlclient.so
sudo ln -s libmysqlclient_r.so.16 libmysqlclient_r.so
sudo chown wmt:wmt -R /home/wmt/nas-sysroot/lib
Downloading python-libmysqlclient
Download the source tarball for version 1.4.4 from https://pypi.org/project/mysqlclient/
Compiling and installing
Download the "mysql_config.txt" file from https://wmtprojectsforum.altervista.org ... x/Packages, and run the commands:
Code: Select all
sudo cp ./mysql_config /usr/bin
sudo chmod o+rx /usr/bin/
Code: Select all
CC="arm-unknown-linux-gnueabi-gcc --sysroot=/home/wmt/nas-sysroot" CFLAGS="-I/home/wmt/nas-sysroot/usr/local/include/mysql" LD_LIBRARY_PATH="/home/wmt/nas-sysroot/lib:/home/wmt/nas-sysroot/usr/local/lib" qemu-arm-static -L /home/wmt/nas-sysroot ~/nas-sysroot/usr/local/bin/python3 setup.py install