Skip to content

Repository files navigation

SeafileClientBuildTools

This project is no longer updated.

This project cross-compiles the Seafile client for Windows (i686/x86_64) from a Fedora machine using MinGW, and also builds the Linux client. It was written because at the time upstream had no Windows build of its own.

Why it is no longer updated

Seafile now builds natively on Windows, so these tools are no longer needed. Upstream added a Visual Studio build on 2020-11-18 — haiwen/seafile commit cb877e00, "portable visual studio 2019" (PR #2378) — about a year after this project was last maintained, and moved its Windows dependencies to vcpkg in 2025.

Official instructions for building the client on Windows:

Two consequences of that shift made continuing here pointless:

  1. The official path is MSVC/vcpkg on a Windows host. It documents no MinGW build and no cross-compilation from Linux, so the approach this project takes is no longer exercised or supported upstream.
  2. Later Seafile releases depend on libraries that only the vcpkg path supplies — libargon2, and libwebsockets through a patched custom vcpkg port. Building a current Seafile with these tools would mean cross-compiling those too, and in the case of libwebsockets the notification support is entangled such that disabling it leaves the daemon unlinkable.

The one thing this repository still does is build the last Seafile it was maintained for, on a current Fedora. See below.

Verified state

pins.mk pins every upstream source to an exact commit, chosen as the newest commit on or before 2019-11-25 — the last time this project's build logic was maintained. That is the combination these tools actually support:

Source Commit Date
jansson ca88677b 2019-10-24
libevent aff23122 2019-11-17
libsearpc 35a19401 2019-11-01
seafile 2412bc04 2019-11-19 (v7.0.4)
seafile-client d2c971c4 2019-11-22

Clean HOST_OS=MINGW32 and HOST_OS=MINGW64 builds of these pins were verified on Fedora 44 (gcc 16, mingw-w64 gcc 16, CMake 4.3, Qt 5.15) and produce Windows binaries:

ms-build/bin/seaf-daemon.exe        PE32  (console), i386
ms-build/bin/seafile-applet.exe     PE32  (GUI),     i386
ms-build64/bin/seaf-daemon.exe      PE32+ (console), x86-64
ms-build64/bin/seafile-applet.exe   PE32+ (GUI),     x86-64

Building 2019 sources with a toolchain six years newer needs compatibility handling, all of which lives in the Makefile:

  • RELAX_CFLAGS — current GCC turns several older sloppy-C patterns into hard errors; these relax them back to warnings.
  • WIN32_WINNT_CFLAGS — the sources ask for _WIN32_WINNT 0x0403 (NT 4.0), but current mingw headers declare Vista-era MIB_* types only above 0x0600 while iphlpapi.h uses them unconditionally, so the build fails inside the system headers. Requests Vista instead.
  • PKG_CONFIG overrides — the mingw32-pkg-config wrapper rewrites every .pc prefix into the mingw sysroot, which corrupts the paths of the libraries this build installs into its own prefix.
  • Source fixups for seafile-client: glib headers hoisted out of extern "C" blocks (current glib declares a C++ template there), an explicit <QPainterPath> include (required since Qt 5.15), and CMAKE_POLICY_VERSION_MINIMUM (CMake 4 dropped the policy version this source declares).

UpdatePins.sh was written to move a pin forward only when a clean build with the newer commit succeeds, reverting otherwise. It is left in place, but note the limitation above: bumping seafile to a current release needs libargon2 and libwebsockets added to this build first.

Why the base image is pinned too

Pinning the sources is only half of it. The Dockerfile and the CI workflow both name fedora:44 rather than fedora:latest, because the compatibility handling above is specific to a toolchain generation: a newer Fedora brings a newer GCC, Qt and CMake, and these 2019 sources then fail again for reasons that have nothing to do with any change here. Keep the two in step if either moves.

Package versions are deliberately not pinned individually. Within one Fedora release they are stable enough, and pinning exact versions would break sooner — Fedora drops older builds from its repositories, at which point the exact version can no longer be installed at all.

Continuous integration

.github/workflows/build.yml builds all three targets on every push and pull request, as a matrix of MINGW32, MINGW64 and the native Linux build. The job declares container: fedora:44, so the steps run directly inside the Fedora toolchain; nothing in CI builds or runs a docker image, and the *DockerVerification.sh scripts are only for doing the same thing by hand locally.

For the two Windows targets the workflow also runs ResolveDllDeps.py, which copies the dependency DLLs (Qt, glib, OpenSSL, libcurl, the MinGW runtime, and the libraries this build produces) and the Qt plugins next to the executables. Without that the .exe files cannot start on a Windows machine. The Linux build skips it and resolves its shared libraries from the system.

Each target then uploads its bin directory, so the artifacts are:

Artifact Contents
seafile-client-windows-i686 seafile-applet.exe, seaf-daemon.exe, ~35 DLLs, Qt plugins (i386)
seafile-client-windows-x86_64 the same for x86-64
seafile-client-linux-x86_64 seafile-applet, seaf-daemon, seaf-cli (ELF)

Note that GitHub deletes workflow artifacts after 90 days by default; download anything worth keeping.

Initialize and build

When you are in Fedora, run InstallDevPackagesFedora.sh script to install all necessary packages firstly.

How to build Windows client

Run make or make HOST_OS=MINGW32 and get i686 32-bits ./ms-build folder. Run make HOST_OS=MINGW64 and get x86_64-bits ./ms-build64 folder.

How to build Linux client

Run make HOST_OS= and get ./build folder.

How to run docker script

Run InitDockerVerification.sh to create docker image and related environment for the first time. Run RunDockerVerification.sh to create a new docker instance and build Seafile client. The build contents would be placed in your host directory by docker volumn. In your ./build it's the Linux build. The ./ms-build is the 32-bits Windows build and ./ms-build64 is the 64-bits build. Run DropDockerVerification.sh to drop the docker image and related environment.

Contact

This project is not updated any more, so issues about building current Seafile are best directed at upstream (see the links above). For anything about this repository itself: https://github.com/xnervwang/SeafileClientBuildTools, or email Xnerv Wang xnervwang@gmail.com.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages