TL:DR; I managed to fix all the issues, check the post bellow for detailed compile instructions or just grab my complied version for ARM64. https://cdn.iklive.eu/tcb13/2018/seafile-server_6.3.0_arm64.tar.gz
So I own a ARM64 device and I would like to compile seafile server from the source code for it. So there is this page on the manual about compiling Seafile on raspberry pi and since I’m running on a ARM device it should be similar. In theory it is easy, however I’ve encountered issues try after try, fix after fix.
Here is my current compilation process. I’m buying everything to the /mnt/SU1/apps/seafile/dev
dir:
sudo apt-get install build-essential
sudo apt-get install libevent-dev libcurl4-openssl-dev libglib2.0-dev uuid-dev intltool libsqlite3-dev libmariadbclient-dev-compat libarchive-dev libtool libjansson-dev valac libfuse-dev re2c flex python-setuptools cmake
mkdir -p /mnt/SU1/apps/seafile/dev
cd /mnt/SU1/apps/seafile/dev
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/seafile-server/lib:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/libsearpc:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/mnt/SU1/apps/seafile/dev/ccnet-server:$PKG_CONFIG_PATH
git clone https://github.com/haiwen/libsearpc.git
cd libsearpc
git reset --hard v3.1-latest
./autogen.sh
./configure
make
make dist
cd ..
git clone https://github.com/haiwen/ccnet-server.git
cd ccnet-server
git reset --hard v6.3.0-server
./autogen.sh
./configure
make dist
Now here I have my first roadblock, there a compilation error related to libssl. I managed to fix this by applying the patch here: https://github.com/haiwen/ccnet/commit/445b72e52895431d02f5f6380a773409c689d8ea
So first question: why is this merged to ccnet but not to ccnet-server? Not really a issue but okay.
I proceeded with the compilation process after applying the patch and trying again:
cd ..
git clone ...github-com/haiwen/seafile-server.git
cd seafile-server
git reset --hard v6.3.0-server
./autogen.sh
./configure
make dist
And… roadblock two. Another libssl issue. Fix available here https://github.com/haiwen/seafile-server/pull/151/files, once again not merged.
I proceeded with the compilation process after applying the patch and trying again (links removed because I’m a new user):
cd ..
git clone ...github.com/haiwen/seahub.git
cd seahub
git reset --hard v6.3.0-server
./tools/gen-tarball.py --version=6.3.0 --branch=HEAD
cd ..
git clone ...github.com/haiwen/seafobj.git
cd seafobj
git reset --hard v6.3.0-server
make dist
cd ..
git clone ...github.com/haiwen/seafdav.git
cd seafdav
git reset --hard v6.3.0-server
make
cd ..
mkdir seafile-sources
cp libsearpc/libsearpc-*.tar.gz seafile-sources
cp ccnet-server/ccnet-*.tar.gz seafile-sources
cp seafile-server/seafile-*.tar.gz seafile-sources
cp seahub/seahub-*.tar.gz seafile-sources
cp seafobj/seafobj.tar.gz seafile-sources
cp seafdav/seafdav.tar.gz seafile-sources
cd ..
mkdir seahub_thirdpart; cd seahub_thirdpart
wget [all the recommended stuff, had to cut out because I'm a new user]
mv bde7f7c.zip django_constance.zip
export PYTHONPATH=.
easy_install -d . pytz-2016.1.tar.gz
easy_install -d . Django-1.8.18.tar.gz
easy_install -d . django-statici18n-1.1.3.tar.gz
easy_install -d . djangorestframework-3.3.2.tar.gz
easy_install -d . django_compressor-1.4.tar.gz
easy_install -d . jsonfield-1.0.3.tar.gz
easy_install -d . django-post_office-2.0.6.tar.gz
easy_install -d . gunicorn-19.4.5.tar.gz
easy_install -d . flup-1.0.2.tar.gz
easy_install -d . chardet-2.3.0.tar.gz
easy_install -d . python-dateutil-1.5.tar.gz
easy_install -d . six-1.9.0.tar.gz
easy_install -d . django-picklefield-0.3.2.tar.gz
easy_install -d . django_constance.zip
easy_install -d . jdcal-1.2.tar.gz
easy_install -d . et_xmlfile-1.0.1.tar.gz
easy_install -d . openpyxl-2.3.0.tar.gz
At this point everything look just fine no more errors, all the extra python dependencies are installed etc. Now it was time to run seafile-server/scripts/build/build-server.py
in order to build everything.
Roadblock 3: build-server.py fails because it can find the versions I set:
seafile-server/scripts/build/build-server.py
--version=6.3.0
--libsearpc_version=3.0.8
--ccnet_version=6.3.0
--seafile_version=6.3.0
--thirdpartdir=/mnt/SU1/apps/seafile/dev/seahub_thirdpart
--srcdir=/mnt/SU1/apps/seafile/dev/seafile-sources
--outputdir=/mnt/SU1/apps/seafile/dev/seafile-server-pkgs
As you can see above I always did git reset --hard v6.3.0-server
to force version 6.3.0
of everything however due to some reason I don’t understand the make dist
command built ccnet
as ccnet-6.0.1.tar.gz
… Why? Just why?
I ended up renaming a bunch of files to 6.0.1 and run:
seafile-server/scripts/build/build-server.py
--version=6.3.0
--libsearpc_version=3.0.8
--ccnet_version=6.0.1
--seafile_version=6.0.1
--thirdpartdir=/mnt/SU1/apps/seafile/dev/seahub_thirdpart
--srcdir=/mnt/SU1/apps/seafile/dev/seafile-sources
--outputdir=/mnt/SU1/apps/seafile/dev/seafile-server-pkgs
And it was working until… roadblock 4: some error with ldap. Since I didn’t want it I simply edited build-server.py
and removed --enable-ldap
.
Tried to compile again, no more ldap error however… roadblock 5:
[INFO] ------------------------------------------
[INFO] Seafile server 6.3.0: BUILD INFO
[INFO] ------------------------------------------
[INFO] seafile: 6.0.1
[INFO] ccnet: 6.0.1
[INFO] libsearpc: 3.0.8
[INFO] builddir: /tmp/seafile-server-build
[INFO] outputdir: /mnt/SU1/apps/seafile/dev/seafile-server-pkgs
[INFO] source dir: /mnt/SU1/apps/seafile/dev/seafile-sources
[INFO] strip symbols: True
[INFO] s3 support: None
[INFO] clean on exit: True
[INFO] ------------------------------------------
[INFO] press any key to continue
[INFO] ------------------------------------------
[...lots of make output...]
[INFO] Uncompressing seahub
Traceback (most recent call last):
File "seafile-server/scripts/build/build-server.py", line 905, in <module>
main()
File "seafile-server/scripts/build/build-server.py", line 899, in main
seahub.build()
File "seafile-server/scripts/build/build-server.py", line 252, in build
self.write_version_to_settings_py()
File "seafile-server/scripts/build/build-server.py", line 261, in write_version_to_settings_py
with open(settings_py, 'a+') as fp:
IOError: [Errno 2] No such file or directory: '/tmp/seafile-server-build/seahub-6.0.1/seahub/settings.py'
[INFO] remove builddir before exit
Now, I tried to run the script with the --keep
option and inspected /tmp/seafile-server-build/
:
ls /tmp/seafile-server-build/
ccnet-6.0.1 libsearpc-3.0.8 seafile-6.0.1 seafile-server seahub-6.3.0
Turns out… my previous fix for the version mismatch crap just blew on my face here.
Why is there so many things actually broken in the major version 6.3.0? What am I doing wrong here? I tried other versions and the issues are the same. Why am I doing git reset --hard v6.3.0-server
to force version 6.3.0
and some stuff builds as 6.0.1
?
Is it normal to have so many roadblocks in compiling seafile? I mean, I’m just following the manual and nothing works as expected. How can I make this work?
Thank you.