1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292
|
============
Installation
============
Srain is available on :ref:`install-packages-gnu-linux`,
:ref:`install-packages-windows`, :ref:`install-packages-macos` and
:ref:`install-packages-bsd`.
.. contents::
:local:
:backlinks: none
.. _install-dependencies:
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
libsoup
libconfig >= 1.5
libsecret
openssl
python-sphinx Optional, for building documentation
adwaita-icon-theme Or other icon themes
=================== =================================================== ========
.. _install-building:
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:
.. parsed-literal::
$ wget https://github.com/SrainApp/srain/archive/|release|.tar.gz
$ tar -xvzf |release|.tar.gz
$ cd srain-|release|
Or get git version:
.. code-block:: console
$ 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:
.. code-block:: console
$ meson setup builddir
$ cd builddir
$ ninja
Install(root privileges required):
.. code-block:: console
$ 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:
.. code-block:: console
$ meson setup -Ddoc_builders=[] builddir
.. _Meson: https://mesonbuild.com
Makefile Helper
---------------
We also provide a simple Makefile helper to simplify meson commands.
It is convenient for development.
.. code-block:: console
$ 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
.. _Meson: https://mesonbuild.com
Distribution Packages
=====================
.. _install-packages-gnu-linux:
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):
.. code-block:: console
$ yay -S srain
$ yay -S srain-git # git version
If you are the user of `Arch Linux CN Repository`_, try:
.. code-block:: console
# pacman -S archlinuxcn/srain
# pacman -S archlinuxcn/srain-git # git version
.. _srain: https://aur.archlinux.org/packages/srain
.. _srain-git: https://aur.archlinux.org/packages/srain-git
.. _Arch Linux CN Repository: https://www.archlinuxcn.org/archlinux-cn-repo-and-mirror
.. _install-packages-debian:
Debian
~~~~~~
Srain now in `offical repository of Debian`__:
.. code-block:: console
# apt install srain
__ https://packages.debian.org/unstable/net/srain
.. _install-packages-flatpak:
Fedora
~~~~~~
Srain now in `offical repository of fedora`_, use ``dnf`` to install it.
.. code-block:: console
# dnf install srain
.. _offical repository of fedora: https://apps.fedoraproject.org/packages/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:
.. code-block:: console
$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak install flathub im.srain.Srain
.. _cpba: https://github.com/cpba
.. _Flatpak manifest for Srain: https://github.com/SrainApp/srain-contrib/tree/master/pack/flatpak
.. _Flathub: https://flathub.org
.. _install-packages-gentoo:
Gentoo
~~~~~~
Please refers to `gentoo portage overlays`_.
.. _gentoo portage overlays: https://gpo.zugaina.org/net-im/srain
.. _install-packages-opensuse:
openSUSE
~~~~~~~~
`alois`_ is maintaining `openSUSE package for Srain`_,
following this link to install it.
.. _alois: https://build.opensuse.org/user/show/alois
.. _openSUSE package for Srain: https://software.opensuse.org/package/Srain
.. _install-packages-windows:
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`_.
.. _Github release page: https://github.com/SrainApp/srain/releases
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:
.. code-block:: console
$ 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:
.. code-block:: console
$ 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. [#Alexpux-MINGW-packages-issue-3939]_
.. _MSYS2 project: http://www.msys2.org/
.. _MinGW PKGBUILD for Srain: https://github.com/SrainApp/srain-contrib/tree/master/pack/mingw
.. [#Alexpux-MINGW-packages-issue-3939] https://github.com/Alexpux/MINGW-packages/issues/3939#issuecomment-397988379
.. _install-packages-macos:
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:
.. code-block:: console
$ brew install coreutils gcc pkg-config # building
$ brew install gettext glib-networking gtk+3 libsoup libconfig openssl adwaita-icon-theme
Next, tell `pkg-config` where to find the libraries we just installed:
.. code-block:: console
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"
.. _Homebrew: https://brew.sh/
Then follow the steps in :ref:`install-building`.
.. _install-packages-bsd:
BSD
---
OpenBSD
~~~~~~~
Please refers to `OpenBSD Ports`_.
.. _OpenBSD Ports: https://openports.se/net/srain
|