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
|
# Build from source code
- [Debian (+Ubuntu/Linux Mint)](#building-cherrytree-on-debian-ubuntulinux-mint)
- [Arch Linux (+Manjaro Linux)](#building-cherrytree-on-arch-linux-manjaro-linux)
- [Gentoo](#building-cherrytree-on-gentoo)
- [Fedora](#building-cherrytree-on-fedora)
- [Opensuse](#building-cherrytree-on-opensuse)
- [MacOs](#building-cherrytree-on-macos)
- [Windows](#building-cherrytree-on-windows)
## Build/Debug with Visual Studio Code on Linux
https://code.visualstudio.com/docs/setup/linux
required installation of Extension "C/C++"
```sh
cd cherrytree
code .
```
Build with: Ctrl+Shift+B
Debug with: F5
## Build/Debug with Visual Studio Code using a container
It is possible to use a container as a full-featured development environment from VS Code.
This works on any operating system that supports Docker.
1. Install the [system requirements](https://code.visualstudio.com/docs/remote/containers#_system-requirements).
2. Open the project in VS Code.
3. (optional) Edit `.devcontainer/devcontainer.json` to set your `DISPLAY` environment variable and/or edit other settings.
It is also possible to run the container on a remote Docker host, see the comment at the end.
4. Run the *Remote-Containers: Open Folder in Container...* command.
5. See previous section for Build and Debug instructions.
## To build using the bundled spdlog and fmt libraries
```sh
./build.sh bundledspdfmt
```
## To create an AppImage bundle
```sh
./build.sh appimage
```
## To generate a backtrace for a crash bug report
```sh
./build.sh debug
gdb ./build/cherrytree
(gdb) r
```
...after reproducing the crash
```sh
(gdb) bt
```
## Building Cherrytree on Debian (+Ubuntu/Linux Mint)
Install dependencies:
```sh
sudo apt install build-essential cmake ninja-build libgtkmm-3.0-dev libgtksourceview-4-dev libxml++2.6-dev libsqlite3-dev gettext libgspell-1-dev libcurl4-openssl-dev libuchardet-dev libfribidi-dev libvte-2.91-dev libfmt-dev libspdlog-dev file libxml2-utils
sudo apt install texlive-latex-base dvipng # optional for LatexBoxes support
```
Note: On Debian10 / Ubuntu 18.04 libfmt-dev and libspdlog-dev are not used since too old; bundled source code is built instead
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
./build.sh
./build/cherrytree
```
To create a debian package
```sh
./build.sh deb
```
Install documentation:
```sh
sudo apt install devhelp libgtkmm-3.0-doc libgtksourceview-4-doc libglibmm-2.4-doc libpangomm-1.4-doc libxml++2.6-doc libgspell-1-doc libvte-2.91-doc
```
devhelp
```sh
xdg-open /usr/share/doc/libgtkmm-3.0-doc/reference/html/index.html
xdg-open /usr/share/gtk-doc/html/gtksourceview-4.0/index.html
xdg-open /usr/share/doc/libglibmm-2.4-doc/reference/html/index.html
xdg-open /usr/share/doc/libpangomm-1.4-doc/reference/html/index.html
xdg-open /usr/share/doc/libxml++2.6-doc/reference/html/index.html
xdg-open /usr/share/doc/libgspell-1-dev/html/index.html
```
## Building Cherrytree on Arch Linux (+Manjaro Linux)
Install dependencies:
```sh
sudo pacman -S gtkmm3 gtksourceview4 libxml++2.6 gspell uchardet fmt spdlog
```
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
./build.sh
./build/cherrytree
```
## Building Cherrytree on Gentoo
Build and Install cherrytree:
```sh
sudo emerge cherrytree
```
## Building Cherrytree on Fedora
Install dependencies:
```sh
sudo dnf install cmake ninja-build gcc-c++ gtkmm30-devel gtksourceview4-devel gspell-devel libxml++-devel libcurl-devel uchardet-devel fmt-devel spdlog-devel vte291-devel sqlite-devel
sudo dnf install texlive-scheme-basic texlive-dvipng # optional for LatexBoxes support
```
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
./build.sh
./build/cherrytree
```
To create an rpm package
```sh
sudo dnf install rpm-build
./build.sh rpm
```
(OPTIONAL) Download Documentation
```sh
sudo dnf install gtkmm30-doc gtksourceview4-doc glibmm24-doc glibmm24-doc libxml++-doc
```
(OPTIONAL) Open Documentation
```sh
xdg-open /usr/share/doc/gtkmm-3.0/reference/html/index.html
xdg-open /usr/share/gtk-doc/html/gtksourceview-4.0/index.html
xdg-open /usr/share/doc/glibmm-2.4/reference/html/index.html
xdg-open /usr/share/doc/pangomm-1.4/reference/html/index.html
xdg-open /usr/share/doc/libxml++2.6/reference/html/index.html
```
## Building Cherrytree on OpenSuse
Install dependencies:
```sh
sudo zypper install cmake ninja gcc-c++ gtkmm3-devel gtksourceview4-devel gspell-devel libxml++26-devel sqlite3-devel libcurl-devel libuchardet-devel fmt-devel spdlog-devel vte-devel
```
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
./build.sh
./build/cherrytree
```
To create an rpm package
```sh
sudo zypper install rpm-build
./build.sh rpm
```
## Building Cherrytree on MacOS
NOTE: Cherrytree is available as an [Installer](https://gitlab.com/dehesselle/cherrytree_macos/-/releases) or in [Homebrew](https://formulae.brew.sh/formula/cherrytree) or [Mac Ports](https://ports.macports.org/port/cherrytree)
In order build it yourself in [Homebrew](https://brew.sh/):
Install dependencies:
```sh
brew install cmake ninja pkg-config python3 adwaita-icon-theme fmt gspell gtksourceview4 libxml++ spdlog uchardet fribidi curl vte3
brew link icu4c --force
brew install --cask basictex
sudo tlmgr update --self
sudo tlmgr install dvipng
```
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
./build.sh
./build/cherrytree
```
## Building Cherrytree on Windows
Install MSYS2: https://www.msys2.org/ (we cover here the packages for 64 bit installation)
Launch 'MSYS2 MinGW 64-bit' terminal (there are 3 different terminals, make sure it is 64-bit otherwise it will cause issues)
Run the following command multiple times there until there are no more updates:
```sh
pacman -Syuu
```
Install required packages to build cherrytree:
```sh
# toolchain, cmake, ninja
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja
# gtkmm3, gtksourceview4, libxml++2.6, sqlite3
pacman -S --needed --noconfirm mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceview4 mingw-w64-x86_64-libxml++2.6 mingw-w64-x86_64-sqlite3
# gspell, curl, uchardet, fribidi, fmt, spdlog
pacman -S --needed --noconfirm mingw-w64-x86_64-gspell mingw-w64-x86_64-curl mingw-w64-x86_64-uchardet mingw-w64-x86_64-fribidi mingw-w64-x86_64-fmt mingw-w64-x86_64-spdlog
# latex, dvipng, gettext, git, nano
pacman -S --needed --noconfirm mingw-w64-x86_64-texlive-core mingw-w64-x86_64-gettext git nano
```
use native windows theme
```sh
mkdir /etc/gtk-3.0
nano /etc/gtk-3.0/settings.ini
```
```ini
[Settings]
gtk-theme-name=win32
```
console settings
```sh
nano ~/.bashrc
```
```sh
CHERRYTREE_CONFIG_FOLDER="C:/Users/${USER}/AppData/Local/cherrytree"
[ -d ${CHERRYTREE_CONFIG_FOLDER} ] || mkdir -p ${CHERRYTREE_CONFIG_FOLDER}
alias l="ls -lah --color"
alias g=git
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
```
Get cherrytree source, compile and run:
```sh
git clone https://github.com/giuspen/cherrytree.git
cd cherrytree
git submodule update --init
./build.sh
./build/cherrytree.exe
```
Troubleshooting:
- Cannot build: make sure to start 64-bit terminal
- Cannot build: remove `cherrytree/build` folder and start `build.sh` script again
- Cannot start cherrytree: you either have to run cherrytree from the msys2 mingw64 terminal or copy and replace cherrytree in `cherrytree_0.99.X_win64_portable` folder (downloaded from the site) by the new one, so dependencies are fulfilled
|