Skip to content

Latest commit

 

History

History
302 lines (197 loc) · 8.24 KB

install.rst

File metadata and controls

302 lines (197 loc) · 8.24 KB

Installation

Srain is available on :ref:`install-packages-gnu-linux`, :ref:`install-packages-windows`, :ref:`install-packages-macos` and :ref:`install-packages-bsd`.

Dependencies

Name Notes Version
meson Only for Building > 0.47.0
make Optional, only for development  
appstream Only for building, on Debian-based distributions  
coreutils Only for building  
gcc Only for building  
pkg-config Only for building  
gettext Only for building  
glib2    
glib-networking Optional, for TLS connection support  
gtk+3   >= 3.18
libsoup3   >= 3.0
libconfig   >= 1.5
libsecret    
openssl    
python-sphinx Optional, for building documentation  
adwaita-icon-theme Or any other icon themes  
libayatana-appindicator Optional application indicator support, can be disabled by meson options -Dapp_indicator=false  

Building

You should install the aboved :ref:`install-dependencies` on your platform before the following steps.

Firstly, download source code of srain, you can get source code of latest release:

$ wget https://github.com/SrainApp/srain/archive/|release|.tar.gz
$ tar -xvzf |release|.tar.gz
$ cd srain-|release|

Or get git version:

$ git clone https://github.com/SrainApp/srain.git
$ cd srain

Play with Meson

Srain use Meson with ninja backend as its build system. You can build it via the following commands:

$ meson setup builddir
$ cd builddir
$ ninja

Warning

If building on macOS or another system where you might not have ayatana-appindicator, you have to somehow install that manually or disable it (it is optional) by running meson setup builddir -Dapp_indicator=false

Install(root privileges required):

$ cd builddir
# ninja install

HTML documentation and manpage are built and installed by default, if you don't need them, just set meson option doc_builders to an empty array when setup:

$ meson setup -Ddoc_builders=[] builddir

Makefile Helper

We also provide a simple Makefile helper to simplify meson commands. It is convenient for development.

$ make           # Build srain
$ make build     # Same as above
$ make install   # Install srain to prefix under project root
$ make run       # Run srain with isolated $HOME and XDG Directory
$ make debug     # Same as `make run`, but with GDB attached
$ make inspect   # Same as `make run`, but with GtkInspector
$ make clean     # Remove all compilation and installation result
$ make doc       # View installed HTML documentation

Distribution Packages

GNU/Linux

Arch Linux

Packages srain and srain-git (git version) are available on AUR, it is quite easy to install using AUR helper(yay as an example):

$ yay -S srain
$ yay -S srain-git # git version

If you are the user of Arch Linux CN Repository, try:

# pacman -S archlinuxcn/srain
# pacman -S archlinuxcn/srain-git # git version

Debian

Srain now in offical repository of Debian:

# apt install srain

Fedora

Srain now in offical repository of fedora, use dnf to install it.

# dnf install srain

Flatpak

cpba is maintaining Flatpak manifest for Srain and The built package is available on Flathub, just execute the following commands to install if you already have flatpak installed:

$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub im.srain.Srain

Gentoo

Please refers to gentoo portage overlays.

openSUSE

alois is maintaining openSUSE package for Srain, following this link to install it.

Windows

Srain requires Windows 7 or later.

Pre-built package

After :ref:`version-1.1.2`, we provide Windows portable binary that you can get it from Github release page.

Build byself

If you want to build Srain on Windows youself, you should use the toolchains provided by MSYS2 project.

Firstly install MSYS2, then open a MSYS2 shell, install the basic build tools:

$ pacman -S base-devel
$ pacman -S mingw-w64-i686-toolchain     # For 32-bit Windows
$ pacman -S mingw-w64-x86_64-toolchain   # For 64-bit Windows

Then download the package script from MinGW PKGBUILD for Srain, run the following commands at the directory of PKGBUILD:

$ MINGW_INSTALLS=mingw32 makepkg-mingw -fsi # For 32-bit Windows
$ MINGW_INSTALLS=mingw64 makepkg-mingw -fsi # For 64-bit Windows

If everything goes well, Srain is installed under your MinGW prefix.

Note

If you suffer the "error while loading shared libraries: xxxx.dll: cannot open shared object file: No such file or directory" problem when running, please run it in cmd but not msys2 shell, and it will show you real missing library. [1]

[1]https://github.com/Alexpux/MINGW-packages/issues/3939#issuecomment-397988379

macOS

Warning

macOS support of Srain is still experimental.

There is not a distribution package or package script for Srain on macOS, you should build Srain by yourself.

Firstly install Homebrew, run the following commands to install dependencies:

$ brew install coreutils gcc pkg-config # building
$ brew install gettext glib-networking gtk+3 libsoup libconfig openssl adwaita-icon-theme libsecret

Next, tell pkg-config where to find the libraries we just installed:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/usr/local/opt/icu4c/lib/pkgconfig"
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/usr/local/opt/openssl@3/lib/pkgconfig"

Then follow the steps in :ref:`install-building`.

BSD

OpenBSD

Please refers to OpenBSD Ports.