Compilation ARM64 - DONE

Finally, I fixed it -
https://manual.seafile.com/build_seafile/server.html
there is a link to old version of evhtp package (v1.1.6)
Compiled and install it.
Now my ARM64 self-built package is fully working.

sudo pip install moviepy
sudo pip install django-appconf
sudo pip install qrcode
sudo pip install django-formtools
sudo pip install captcha
sudo pip install django-webpack-loader
sudo pip install django-tagging
sudo pip install django-simple-captcha

make sure to install above Python packages

if pip point to pip3, then use pip2 to install above packages

Share my binary package:
http://rockpro64.ddns.net/seafile-server_6.3.4_arm64.tar.gz
(for Ubuntu 18.04LTS only, gcc7 compiler, GLIBC_VER2.5)

install ldap development package :
sudo apt install libldap2-dev
my build includes ldap feature
http://rockpro64.ddns.net/seafile-server_6.3.4_arm64_gcc6.tar.gz
(for Ubuntu 16.04LTS )

Verify what is missing or why seafile or seahub not started.

logs/controller.log and seafile.log can tell the reason why seafile does not start properly.
./seahub.sh start-fastcgi
shows what is wrong or missing for seahub

Once everything is good and ready.
./seafile.sh start
./seahub.sh start
Per official document, start-fastcgi is obsoleted, but good for debugging purpose.

Create D service script file for seafile and seahub, and put them into /etc/systemd/system
sudo systemctl start seafile
sudo systemctl start seahub

Seems like such a laborious and extremely complicated process. Is there any plan to move all of this to an ARM64 supported Docker image?!

I have made a docker image for ARM64, tested on rpi3 with ubuntu 18.04 64bit and qnap TS-212P3 (RTD1295 4C A53).

Change ~/Downloads/seafile to your prefer folder. 8000 for seafile, 8080 for WebDAV (need to enable), 8082 for seahub.

docker run --name seafile \
  -v ~/Downloads/seafile:/home/seafile \
  -p 8000:8000 \
  -p 8080:8080 \
  -p 8082:8082 \
  -ti mjysci/seafile:arm64v8

After configuration, ^P^Q to detach.

Could you please handle the MaridaDB support with their official image and just link it. Restoring those mixed images is pain in the ass. Additionally, Seafile should be stored under /opt. Maybe look at some existing good Docker seafile images and port one of them to ARM64.

First of all thank you for your image.

Unfortunately it doesn’t run on my rockpro64.
I got every time a INTERNAL SERVER ERROR, the seahub.log is empty and i can’t find any useful information in the seafile.log

Edit: The docker file from mjy works btw, but it looks strange.

@coinabc Maybe you can try my compilation guide above. A friend of mine who owns another RK3399 board compiled it just fine by following my instructions.

Yes, that will be my next step.
But what is the latest version of the compilation guide, your second post or the guide from jzhang18?

Probably his, I moved a long time ago off seafile in favor of syncthing.

Alright, thanks.

I tried to compile seafile today.
So far everything has worked, only the last command build-server.py (packaging) didn’t work.
I got an error after i execute build-server.py (with some params)

[ERROR] ~/seafile-sources/libsearpc-3.1.0.tar.gz not exists

But if i check it with ls ~/seafile-sources/libsearpc-3.1.0.tar.gz the file was found.

7.0 is out and i think we need an update on how to compile seafile. I was able to compile seafile in chroot, but without mysql support.
Seems like a missed one step :’) Maybe you guys can help us out getting 7.0 compiled for arm64

7.0.4 arm64 sqlite only

#!/bin/bash
export BASE=/opt/seafile
export DIR=$BASE/src
export LC_ALL=C
export CHROOTD=/opt/arm64chroot
#export CHROOTD=/home/helge/debian-arm64/
export MIRROR=http://mirror.netcologne.de/debian/
export SUITE=buster


mkdir -p $CHROOTD
mkdir -p $DIR
#We're "crosscompiling"
qemu-debootstrap --arch=arm64 --keyring /usr/share/keyrings/debian-archive-keyring.gpg --variant=buildd --include=bash,apt-utils,ca-certificates,cmake,build-essential $SUITE $CHROOTD $MIRROR

#Mounts for chroot
mount -t proc none "$CHROOTD/proc"
mount -t sysfs none "$CHROOTD/sys"
mount --bind /dev/pts "$CHROOTD/dev/pts"

#CHROOT in
LANG=C LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot "$CHROOTD"

#Export again
export BASE=/opt/seafile
export DIR=$BASE/src
#export DIR=$BASE/dev
export CORES=4
export LOGDIR=$BASE/log
export VERSION=7.0

#export PKG_CONFIG_PATH=/usr/local/include/evhtp:/usr/local/lib/:/usr/local/include:/usr/include/mariadb/mysql:/usr/include/mariadb/:$DIR/ccnet-server:$DIR/libsearpc:$DIR/seafile-server/lib
export PKG_CONFIG_PATH=/usr/include/mariadb/mysql:/usr/include/mariadb:$DIR/ccnet-server:$DIR/libsearpc:$DIR/seafile-server/lib:$DIR/seafile-server:/opt/seafile/src/libevhtp/libevhtp-1.1.6:/usr/include
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#export PATH=$DIR/seahub_thirdparty:$PATH

mkdir -p $CHROOTD
mkdir -p $DIR
mkdir -p $LOGDIR

# Install Packages
apt-get install apt-get install autoconf automake libpq-dev libtool libevent-dev libcurl4-openssl-dev libgtk2.0-dev uuid-dev intltool libsqlite3-dev valac libjansson-dev cmake qtchooser qtbase5-dev libqt5webkit5-dev qttools5-dev qttools5-dev-tools libssl-dev wget git libjpeg-dev  libldap2-dev python-openssl libssl-dev python-pip python-numpy libevent-dev libonig-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmariadbclient-dev default-libmysqlclient-dev libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-dev python-setuptools python-setuptools cmake

#libmysqlcppconn-dev libmariadbd-dev 
# entfernt : python3-numpy python3-pip python3-openssl python3-dev python3-setuptools

cd $DIR
git clone https://www.github.com/haiwen/libevhtp.git
cd $DIR/libevhtp
cmake -j$CORES
#cmake -j$CORES -DEVHTP_DISABLE_SSL=ON -DEVHTP_BUILD_SHARED=OFF .
#cmake -j$CORES -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DEVHTP_BUILD_SHARED:STRING=ON .
make -j$CORES
make install
ldconfig

https://github.com/ellzey/libevhtp/archive/1.1.6.tar.gz

#apt install libevhtp-dev

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/libsearpc.git
cd $DIR/libsearpc
sed -i "s,3.1.0,$VERSION,g" $DIR/libsearpc/configure.ac
./autogen.sh
./configure
make -j$CORES 2>&1 | tee $LOGDIR/make_libsearpc
make -j$CORES dist 2>&1 | tee $LOGDIR/make_libsearpc_dist

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/ccnet-server.git
cd $DIR/ccnet-server
#edit version in configure.ac
sed -i "s,6.0.1,$VERSION,g" $DIR/ccnet-server/configure.ac
#Enable subir-objects to get rid of warning
#https://github.com/aria2/aria2/issues/120
sed -i "s,AM_INIT_AUTOMAKE(\[1.9 foreign\]),AM_INIT_AUTOMAKE(\[1.9 foreign\] \[subdir-objects\])," $DIR/ccnet-server/configure.ac
./autogen.sh
#./configure --with-mysql=/usr/local/bin/mariadb_config 2>&1 | tee $LOGDIR/configure_ccnet-server
./configure 2>&1 | tee $LOGDIR/configure_ccnet-server

#mysql check doesnt understand mariadb_config output - 
#
#checking for MySQL... /usr/bin/yes: unrecognized option '--include'
#Try '/usr/bin/yes --help' for more information.
#/usr/bin/yes: unrecognized option '--libs'
#Try '/usr/bin/yes --help' for more information.
#
#./configure --enable-ldap --with-mysql --enable-python 2>&1 | tee $LOGDIR/configure_ccnet-server

make -j$CORES dist 2>&1 | tee $LOGDIR/make_ccnet-server_dist

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/seafile-server.git
cd $DIR/seafile-server
#edit version in configure.ac
sed -i "s,6.0.1,$VERSION,g" $DIR/seafile-server/configure.ac
#Add [include-subdir] in AM_INIT_AUTOMAKE
sed -i "s,AM_INIT_AUTOMAKE(\[1.9 foreign\]),AM_INIT_AUTOMAKE(\[1.9 foreign\] \[subdir-objects\])," $DIR/seafile-server/configure.ac
./autogen.sh
./configure
#Configure with mysql enforced
# ./configure --with-mysql 2>&1 | tee $LOGDIR/configure_seafile-server
make -j$CORES dist 2>&1 | tee $LOGDIR/cmake_seafile-server

mkdir $DIR/seahub_thirdparty
cd $DIR/seahub_thirdparty

wget https://files.pythonhosted.org/packages/27/c0/fbd352ca76050952a03db776d241959d5a2ee1abddfeb9e2a53fdb489be4/pytz-2019.2.tar.gz;
wget https://github.com/django/django/archive/2.1.10.tar.gz;
wget https://files.pythonhosted.org/packages/8a/3d/c60e4f71fd1dae740b72dc8f780b2a7985daa324dd2b62cfa762408265b4/django-statici18n-1.8.3.tar.gz;
wget https://files.pythonhosted.org/packages/cd/c1/dae52ea01111eb657f30941fe803f3fbd3c807b1fefcdc39e6d312d7f9fd/djangorestframework-3.10.2.tar.gz;
wget https://files.pythonhosted.org/packages/73/ba/e14cc0a8ebecb043175abee1dcab15b2612952f91793ddfdfeefd0892a2f/django_compressor-2.3.tar.gz;
wget https://files.pythonhosted.org/packages/9b/c3/c36344d4c11e4d825fe42ed53367d6fa6d837e3028d8be56f208a7379cd2/jsonfield-2.0.2.tar.gz;
wget https://files.pythonhosted.org/packages/f2/52/80915bf5f998c630f56cdd544511b1779a6fdf5a629e415c239d7b55f2d1/django-post_office-3.2.1.tar.gz;
wget https://files.pythonhosted.org/packages/47/52/68ba8e5e8ba251e54006a49441f7ccabca83b6bef5aedacb4890596c7911/gunicorn-19.9.0.tar.gz;
wget https://files.pythonhosted.org/packages/bb/b5/26cc8f7baf0ddebd3e61a354a2bcc692cfe8005123c37ee3d8507c4c7511/flup-1.0.3.tar.gz;
wget https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz;
wget https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz;
wget https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz;
wget https://files.pythonhosted.org/packages/5e/4d/5732084d462b428325d98d8409e40215344098e39366b27d3af8cbee4d33/django-picklefield-2.0.tar.gz;
wget https://github.com/haiwen/django-constance/archive/bde7f7c.zip;
wget https://files.pythonhosted.org/packages/7b/b0/fa20fce23e9c3b55b640e629cb5edf32a85e6af3cf7af599940eb0c753fe/jdcal-1.4.1.tar.gz;
wget https://pypi.python.org/packages/source/e/et_xmlfile/et_xmlfile-1.0.1.tar.gz;
wget https://files.pythonhosted.org/packages/ba/06/b899c8867518df19e242d8cbc82d4ba210f5ffbeebb7704c695e687ab59c/openpyxl-2.6.2.tar.gz;
wget https://files.pythonhosted.org/packages/47/04/5fc6c74ad114032cd2c544c575bffc17582295e9cd6a851d6026ab4b2c00/futures-3.3.0.tar.gz;
wget https://files.pythonhosted.org/packages/4a/86/ccbb8225dec0621f99f7e19f3dea0a629f1e41bd99fd58ac3e2f388e028f/django-formtools-2.1.tar.gz;
wget https://files.pythonhosted.org/packages/19/d5/6c7d4e103d94364d067636417a77a6024219c58cd6e9f428ece9b5061ef9/qrcode-6.1.tar.gz;
wget https://files.pythonhosted.org/packages/72/8e/ae6dadff544fb0499f9491589d0621ee2f5a9705880c4d0784c22c72233a/Djblets-1.0.12.tar.gz;

mv bde7f7c.zip django_constance.zip
mv 2.1.10.tar.gz djangoframework.tar.gz



#export PYTHONPATH=/usr/local/lib/python3/dist-packages:/$DIR/seahub_thirdparty
export PYTHONPATH=/$DIR/seahub_thirdparty
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/chardet-3.0.4.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django-formtools-2.1.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django-picklefield-2.0.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django-post_office-3.2.1.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django-statici18n-1.8.3.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django_compressor-2.3.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/django_constance.zip
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/djangoframework.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/djangorestframework-3.10.2.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/et_xmlfile-1.0.1.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/flup-1.0.3.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/futures-3.3.0.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/gunicorn-19.9.0.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/index.html
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/jdcal-1.4.1.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/jsonfield-2.0.2.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/openpyxl-2.6.2.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/python-dateutil-2.8.0.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/pytz-2019.2.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/qrcode-6.1.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/six-1.12.0.tar.gz
python3 /usr/lib/python3/dist-packages/easy_install.py -d . $DIR/seahub_thirdparty/Djblets-1.0.12.tar.gz

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/seahub.git
#git clone https://github.com/haiwen/seahub.git
cd $DIR/seahub
./tools/gen-tarball.py --version=$VERSION --branch=HEAD

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/seafobj.git
#git clone https://github.com/haiwen/seafobj.git
cd $DIR/seafobj
make dist

cd $DIR
git clone -b $VERSION --single-branch https://github.com/haiwen/seafdav.git
#git clone https://github.com/haiwen/seafdav.git
cd $DIR/seafdav
make

cd $DIR
mkdir $DIR/seafile-sources
cp $DIR/libsearpc/libsearpc-*.tar.gz $DIR/seafile-sources
cp $DIR/ccnet-server/ccnet-*.tar.gz $DIR/seafile-sources
cp $DIR/seafile-server/seafile-*.tar.gz $DIR/seafile-sources
cp $DIR/seahub/seahub-*.tar.gz $DIR/seafile-sources
cp $DIR/seafobj/seafobj.tar.gz $DIR/seafile-sources
cp $DIR/seafdav/seafdav.tar.gz $DIR/seafile-sources

mkdir $DIR/seafile-server-pkgs

python3 $DIR/seafile-server/scripts/build/build-server.py \
--version=$VERSION \
--libsearpc_version=$VERSION \
--ccnet_version=$VERSION \
--seafile_version=$VERSION  \
--thirdpartdir=$DIR/seahub_thirdparty \
--srcdir=$DIR/seafile-sources \
--outputdir=$DIR/seafile-server-pkgs \
--mysql_config=/usr/bin/mariadb_config \
--jobs=$CORES 2>&1 | tee $LOGDIR/build-server

@TCB13 @opfer15 I commit the build script for this. You are welcome to contribute.
Build for aarch64 (OrangePi Lite2 with Armbian Bionic) is successful

github .com/haiwen/seafile-rpi/blob/master/build.sh

2 Likes

@towa48
Thx for the effort. I’ll try it in a few days, when i am back at my building maschine.

@towa48
i think in the file build.sh, line 114 has to be “git reset --hard $LIBSEARPC_TAG” and not “git reset --hard $VERSION_TAG”

@tfischer73 yep, you are right. Can you create PR for this?

Seafile is succesfully created and runs on a nanopim4 with armbian Debian Buster

@towa48
PR is created

1 Like

@tfischer73 have you done any benchmarks on the NanoPi M4? Can you share details on CPU/Ram usage? Thank you.