How to install Cherrytree

Hello,
I have a very basic (linux) question regarding how to install an application on linux tree.

I’ve build the application Cherrytree (note taking application) from source in /opt/cherrytree_0.99.27.
As a result I get the application cherrytree in the directory /opt/cherrytree_0.99.27/build.

The application is running fine, and I could set the french language that is good for me.
But if I copy the application in /usr/bin and run it, I can’t change any more the language that remains in english.

How should I install this application in the correct directory?
Many thanks in advance.

When an application is designed to run from /opt, you should not move it and certainly not to /usr/bin. And why do you want to do that?

Also you do not explain how you set the language. Normally the environment of a user should have been setup to her/his preferred language and applications should pick that up., thus no need to set for the application.

But why didn’t you install from https://software.opensuse.org/package/cherrytree?search_term=cherrytree?

Which you should have found by using https://software.opensuse.org/

Thanks Henk,

I wrongly thought that /usr/bin was where to put the executable application (because it is in the PATH and it could to be run from everywhere).
The environment of a user have been setup to my preferred language when running the application from /opt.
When I try to run it from /usr/bin, I’ve try to change the language within the menu “preferences” of the application with no success.

I try to build the application because of the version which was old in Leap 15.2 repos.
So I do it to see how was the newer version of cherrytree :), and also for discovering how to build an application.
But It is better to stay with prepackaged application when existing in my opensuse version.
Thanks again for your answer

I do not know the application, but I assume you (as user) run it from the GUI (Desktop). You normally set your language somewhere in the desktop and that should then be picked up by all programs that need it. In fact this is not restricted to the desktop, but also works in the CLI.

boven:~ # ls -l aap
ls: cannot access 'aap': No such file or directory
boven:~ # LANG=de_DE.UTF-8 ls -l aap
ls: Zugriff auf 'aap' nicht möglich: Datei oder Verzeichnis nicht gefunden
boven:~ # LANG=fr_FR.UTF-8 ls -l aap
ls: impossible d'accéder à 'aap': Aucun fichier ou dossier de ce type
boven:~ #

But it looks as if you set the language in the application itself. That of course means that there is some configuration file somewhere. It could be that by moving the executable of the application, it can not find it’s other files anymore. A product is often more then just it’s executable (or executeables) and everything has it’s place. Particular in Unix/Linux where product provided by the sytem (distribution) will use places like /usr/bin, /usr/lib, /etc, ~/.whatever etc. for different things like executeables, central configuration files with defaults, local configuration files of the system manager, personal configuration by the end-user. temporary files during the application is running and more.
So moving one file may not help in keeping this building together. :wink:

That said, I note a few strange things in your story.
You have put the source in /opt. That is not correct IMHO, because that is not the run-able application. It is a place not usable by the end-user for building the application.

I have no idea, because you do not explain what you did, in what form you downloaded that source. Often that is in the form of a so called tarball, a tar and compressed archive of files. The user that is going to build the product will put it in e directory of himself. Something like ~/cherrytree or ~/my-building-place/cherrytree, depending on how the users organises his building activities.
After uncompressing and untarring, there of is a file with a name similar to README, read.me. That should have important information.
Then the product is build there and the result (maybe several files, or even trees of files) will be in a directory there.
When this is such a tarball, it should also be possible to install the redy built product. That is the one and only task that should be done as root.

So, maybe you can inform us about what “source” you downloaded and how you started from there.

Here is the way I proceed to install Cherrytree:

Building Cherrytree on Opensuse
https://github.com/giuspen/cherrytree

Install dependencies:

sudo zypper install cmake gcc-c++ gtkmm3-devel gtksourceviewmm3_0-devel gspell-devel libxml++26-devel sqlite3-devel libcurl-devel libuchardet-devel

I had to add tumbleweed repository to get gtksourceviewmm3_0-devel.

I got the cherrytree source from https://www.giuspen.com/cherrytree/, then I untar it.

cd /opt
tar xJvf cherrytree_0.99.27.tar.xz

Here is the tree

cb@cblinux:/opt/cherrytree_0.99.27> tree -L 1
.
├── build
├── build.sh
├── changelog.txt
├── CMakeLists.txt
├── cmake_uninstall.cmake.in
├── config.h
├── config.h.cmake
├── data
├── debian
├── icons
├── icons.gresource.xml
├── language-specs
├── license.txt
├── po
├── README.md
├── scripts
├── src
├── styles
└── tests

10 directories, 9 files

And I have followed the README instruction to compile :

mkdir cherrytree/build
cd cherrytree/build
cmake ../
make -j$(nproc --all)

And I need to run my application from /opt/build:

./build/cherrytree

Then I have put a link to the application /opt/cherrytree_0.99.27/build/cherrytree to my desktop in order to run it easily.
You suggest I should have builded the application in an other location?
Regards

I assume you did all the tar and subsequent cmake and make as root. This is wrong!

You should NOT have put it is /opt, as explained above. One should never do things as root when not needed. And mere compiling, linking, etc. can be done by every user, thus no need to use root.

How long is that readme file? can you post it here so we can see what the developers try to tell you?

And, after the build is correct, one typically does

make install

as root. That is the only part of the whole process that should run as root.

Take care about adding repos from other versions ie TW be sure to disable after you install the package you want or you may start getting lots of TW stuff and break 15.2

As I can remember I’ve only untar as root, and subsequent cmake and make as normal user.

Here is the README.md that is a bit long, I put in red the Opensuse part.
**
CherryTree **
A hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single XML or SQLite file. The project home page is
cherrytree – giuspen.
Installation Guide
Debian/Linux Mint/Ubuntu
Arch Linux/Manjaro Linux
Fedora
Opensuse
MacOs
Windows
**Links on used libraries **
https://www.gtkmm.org/en/documentation.shtml Programming with gtkmm 4 gtkmm: gtkmm Reference Manual https:/
gtkmm: Class Hierarchy
https://developer.gnome.org/gtksourceviewmm/stable/
https://developer.gnome.org/libxml++-tutorial/stable/ https://developer.gnome.org/libxml++/stable/
Projects/gspell - GNOME Wiki! https://developer.gnome.org/gspell/stable/
Build/Debug with Visual Studio Code on Linux
Running Visual Studio Code on 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.
Install the system requirements.
Open the project in VS Code.
(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.
Run the Remote-Containers: Open Folder in Container… command.
See previous section for Build and Debug instructions.
**To test install locally and create a package **
cmake -DCMAKE_INSTALL_PREFIX=./local_usr …/
make -j$(nproc --all) && make install
cpack -G DEB
**
Building Cherrytree on Ubuntu 20.04 **
Install dependencies:: sh sudo apt install build-essential libxml2-utils cmake libgtkmm-3.0-dev libgtksourceviewmm-3.0-dev
libxml++2.6-dev libsqlite3-dev gettext libgspell-1-dev libcurl4-openssl-dev libuchardet-dev Get cherrytree source, compile and run:
sh git clone GitHub - giuspen/cherrytree: cherrytree cd cherrytree git submodule update --init mkdir build cd build cmake
…/ make -j$(nproc --all) ./build/cherrytree Install documentation: sh sudo apt install devhelp libgtkmm-3.0-doc
libgtksourceviewmm-3.0-doc libglibmm-2.4-doc libpangomm-1.4-doc libxml++2.6-doc libgspell-1-doc devhelp sh xdg-open /usr
share/doc/libgtkmm-3.0-doc/reference/html/index.html xdg-open /usr/share/doc/libgtksourceviewmm-3.0-doc/reference/html
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 **
Install dependencies: sh sudo pacman -S gtksourceviewmm libxml++2.6 gspell uchardet
Get cherrytree source, compile and run: sh git clone GitHub - giuspen/cherrytree: cherrytree cd cherrytree git submodule update
–init mkdir build cd build cmake …/ make -j$(nproc --all) ./build/cherrytree
**Building Cherrytree on Fedora 33 **
Install dependencies: sh sudo dnf install @development-tools gcc-c++ libtool autoconf gtkmm30-devel gtksourceviewmm3-devel
libxml+±devel libsq3-devel gettext-devel gettext intltool libxml2 gspell-devel cmake libcurl-devel uchardet uchardet-develGet cherrytree source, compile and run: sh git clone GitHub - giuspen/cherrytree: cherrytree cd cherrytree git submodule update
–init mkdir build cd build cmake …/ make -j$(nproc --all) ./cherrytree
(OPTIONAL) Download Documentation sh sudo dnf install gtkmm30-doc gtksourceviewmm3-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/doc
gtksourceviewmm-3.0/reference/html/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 gcc-c++ gtkmm3-devel gtksourceviewmm3_0-devel gspell-devel libxml++26-devel
sqlite3-devel libcurl-devel libuchardet-devel
Get cherrytree source, compile and run:
sh git clone GitHub - giuspen/cherrytree: cherrytree
cd cherrytree
git submodule update --init
mkdir build
cd build
cmake …/
make -j$(nproc --all)
./build/cherrytree
**Building Cherrytree on MacOS **
Install dependencies: sh brew install python3 cmake pkg-config gtksourceviewmm3 gnome-icon-theme gspell libxml++ curl uchardet
Get cherrytree source, compile and run: sh git clone GitHub - giuspen/cherrytree: cherrytree cd cherrytree git submodule update
–init mkdir build cd build cmake …/ make -j$(sysctl -n hw.ncpu) ./build/cherrytree
To install: sh make install
**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 and cmake pacman -S –needed –noconfirm mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake gtkmm3, gtksourceviewmm3, libxml++2.6, sqlite3, gspell, curl pacman -S –needed –noconfirm mingw-w64-x86_64-gtkmm3 mingw-w64-x86_64-gtksourceviewmm3 mingw-w64-x86_64-libxml++2.6 mingw-w64-x86_64 sqlite3 mingw-w64-x86_64-gspell mingw-w64-x86_64-curl mingw-w64-x86_64-uchardet gettext, git, nano, meld3 pacman -S –needed –noconfirm mingw-w64-x86_64-gettext git nano mingw-w64-x86_64-meld3
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 export LC_ALL=C CHERRYTREE_CONFIG_FOLDER=“C:/Users/${USER}/AppData/Local/cherrytree” -d
{CHERRYTREE_CONFIG_FOLDER} ] || mkdir -p ${CHERRYTREE_CONFIG_FOLDER} alias l=“ls -lah --color” bind ‘“\e[A”:history-search
backward’ bind ‘“\e[B”:history-search-forward’ Get cherrytree source, compile and run: ```sh git clone GitHub - giuspen/cherrytree: cherrytree cd cherrytree git submodule update –init build Release (optimised) ./build.sh Release build Debug (not optimised, with debug symbols) ./build.sh Debug run cherrytree ./build/cherrytree.exe ``` [b]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 fulfille

Hi, Yes I had some pains with that and a had to reinstall :'(.
Regards

Hm

**Building Cherrytree on Opensuse **
Install dependencies:

sh sudo zypper install cmake gcc-c++ gtkmm3-devel gtksourceviewmm3_0-devel gspell-devel libxml++26-devel
sqlite3-devel libcurl-devel libuchardet-devel 

Get cherrytree source, compile and run:

sh git clone https://github.com/giuspen/cherrytree.git 
cd cherrytree 
git submodule update --init 
mkdir build 
cd build 
cmake ../ 
make -j$(nproc --all) 
./build/cherrytree

I hazve no idea if this is normal with github sources, but it looks weird to me.

sh sudo zypper .....

???

But the main problem here is: why did you put this somewhere inside /opt? That is nowhere in the document.
And the next is then: That is normally (when you did not opened it up for who cares) not accessible for other then root. Which means that you did in fact all those commands “as root”. Which this document did NOT tell you to do.

The recipe as I see it here will put the product inside the home directory of the users who does this (and NOT as a system installed product). Thus apart from the zypper command in the begin, there is no reason to ask root to do anything. It is a end-user thing.

My advice would be

  • to log in as the user that needs that application.
  • create a cherrytree directory in a suitable place in your home directory and make it your working directory.
  • make a copy of the downloaded file there
  • As root clean up all the mess inside /opt (this can be done later, but I personally am a fan of clean things).
  • now do the building of the product as the normal user.
  • Check if it works to satisfaction.
  • Either add the directory where the executable is now to your PATH (in ~/.profile), or alternative make a symbolic link inside ~/bin to the executable (your own bin is already in the PATH.

When in doubt, please ask here first.

Why are you even compiling it manually.

Add repo:

https://build.opensuse.org/package/show/GNOME%3AApps/cherrytree

Then install Cherrytree via YAST or sudo zypper in cherrytree

Always, before anything else, check software.opensuse.org/search for the package.

That’s OK.
zypper is used to install the necessary build tools and dependencies from openSUSE repos…
Github provides only the source and nothing else(typically).

TSU

I want to put the things clean, so I will reconfigure all as you suggested to do.
Many thanks for your help and have a good day.
Regards

Looks like only Tumbleweed has **almost **the current released stable(apparently a version was released days ago).
For every other version openSUSE, the version is badly out of date.

TSU

Hello,
It was only to test the newest version of this application.
Regards

Hi
Packager/Maintainer for cherrytree here :wink: Not a lot can do for Leap since there are old libraries involved :frowning: I’ve just pushed the 99.27+11 to factory and have an open upstream bug to be fixed. Once that is sorted I can investigate getting something built for Leap…

This is a mistake, not only does adding a TW repo to your LEAP install endanger your system (please don’t run an update or make absolutely sure the repo is disabled!)
The “devel” file likely won’t provide the necessary headers that match your installed version of gtksourceviewmm3_0
and
The file you need is in your default LEAP repos. The following is from one of my LEAP 15.2 machines

zypper se gtksourceviewmmRetrieving repository 'Main Update Repository' metadata ............[done]
Building repository 'Main Update Repository' cache .................[done]
Loading repository data...
Reading installed packages...


S | Name                     | Summary                           | Type
--+--------------------------+-----------------------------------+--------
  | gtksourceviewmm-devel    | Development files for the gtkso-> | package
  | libgtksourceviewmm-3_0-0 | C++ interface for gtksourceview   | package



This specific action you did probably breaks your build unless your gtksourceviewmm was updated to use the TW version.

TSU

Hi
The Leap versions are too old… plus it’s glibmm2_4 that is the issue…

I disagree with what is being said here.
In general, building apps that are accessible by all Users on the system (any normal User and the root account itself) requires the app to be built in a system-accessible location. Users should not access apps located in a different User directory.

To the @OP,
IMO you did what you did correctly, following the build instructions provided by the source. Unsaid is if your source location is in /opt… Although possible, my guess is that your source is some other location and the build installed the app in /opt by default. In other words, when something is compiled and includes installation, although the build typically creates a binary in a subdirectory of the source, the installation can put the compiled app anywhere on the system (and then the source can optionally be removed).

TSU

I was of course not talking about the use of zypper to install something, but about the strange construct of being in a shell, then calling a shell, that calls sudo, that calls zypper.