Skip to content

Mac OS X


The following software packages are required for building Seafile client on macOS:

  • XCode (10.2 or later)

    Newer versions of XCode may work, but not tested. Some tweaks may be applied to the build scripts in order to compile or package the application.

  • Qt 5.15 (official package)

  • MacPorts
  • Other dependencies

    The following packages are required to be installed via MacPorts:

    $ sudo port install autoconf automake pkgconfig libtool glib2 libevent vala openssl git jansson cmake curl libwebsockets

Also, add following lines to the ~/.bash_profile file:

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig
export LIBTOOL=glibtool
export LIBTOOLIZE=glibtoolize
export CPPFLAGS="-I/opt/local/include"
export LDFLAGS="-L/opt/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names"

export PATH=$QT_BASE/bin:$PATH

Compile & Run

Clone Source Code

We assume the workspace is located at ~/seafile-workspace. Then, run following commands in a shell:

$ cd ~/seafile-workspace
$ git clone
$ git clone
$ git clone

Compile libsearpc

$ cd ~/seafile-workspace/libsearpc

$ ./
$ ./configure
$ make
$ sudo make install

Compile seafile

$ cd ~/seafile-workspace/seafile

$ ./
$ ./configure
$ make
$ sudo make install

Compile seafile-client

$ cd ~/seafile-workspace/seafile-client

cmake -G "Unix Makefiles" -B build -S .
cmake --build build --target seafile-applet

Run seafile-applet

$ cd ~/seafile-workspace/seafile-client/build
$ ./seafile-applet

Package Application

Additonal setups are required for packing Seafile client on macOS:

  • dropDMG
  • certifications
  • notarization username and password

Code Signing

A mac application must be distribution-signed before shipping. More technical details can be found from the post at developer forums.

Before signing, please make sure to import the distribution certification. Then, the permission of imported key should be changed: right click the imported key in Keychain Access -> select "Get Info" -> select "Access Control" -> choose "Allow all applications to access this item".

Now, executables and frameworks inside the bundle can be signed with the codesign command. See the seafile/scripts/build/ script for actual signing commands.


Notarization is the final step before shipping a DMG installer. The notarytool command can be used to submit or staple the installer. See the seafile/scripts/build/ script for actual notarizing commands.

Run Packaging Script

Some changes need to be applied to the seafile/scripts/build/ script before running it.

  • comment out sparkle related lines:

    # for fn in _glob('Contents/Frameworks/Sparkle.framework/Versions/A/Resources/*'):
    #     do_sign(fn, preserve_entitlemenets=False)
    # for fn in (
    #         'Contents/Frameworks/Sparkle.framework/Versions/A/Resources/',
    #         'Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle',
    # ):
    #    do_sign(join(appdir, fn))
    # copy_sparkle_framework()
  • Update altool path in seafile/scripts/build/

    _altool() {
        xcrun altool "$@"

Then, run following commands in a shell:

$ cd ~/seafile-workspace/seafile/scripts/build
$ python --brand="" --version=1.0.0 --nostrip