-- Leo's gemini proxy

-- Connecting to warp.geminispace.club:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en

Compiling Lagrange on Debian / Devuan - Part 2 (updated Jan 27, 2022)


Whether you liked or not the first part, the real instruction starts here.


> If you changed your mind and decided to read the first part...


Compiling Lagrange on Debian / Devuan - Part 1


If you are new to compile application by yourself you need to setup your building environment and you need to download before the following packages:


sudo apt install build-essential checkinstall devscripts


Get Your Hands Dirty


> I posted this article on Station and gently Skyjake gave me special hints to make this article better:

> --------------------------------

> A few notes:

>

> The recursive clone of the repository checks out HarfBuzz and FriBidi as well, however on Debian it's probably better to use the system-provided versions of these libraries. So instead make a normal checkout and call "git submodule update --init lib/the_Foundation" only.

> All of these are included as submodules so platforms where the libraries aren't readily available can work, too.

>

> The ENABLE options you're setting are the defaults, so they can be omitted from the command line. And as mentioned, the popup menu option likely is not needed with v1.10.

>

> All the information necessary are available through this external link:

> https://git.skyjake.fi/gemini/lagrange "Lagrange Gitea Repo"

>

> Furthermore:

>

> The ENABLE_KERNING option affects the simple fallback text renderer only. It is used if HarfBuzz is not available for doing the more complex text shaping.


Git Section


Let us begin with the git repo:


git clone --branch release https://git.skyjake.fi/gemini/lagrange
cd lagrange
git submodule update --init lib/the_Foundation

The source code is bigger than I expected...


Receiving objects: 100% (23712/23712), 35.43 MiB | 47.00 KiB/s, done.

It doesn't matter I am going to do the math at the very end of this page.


Download The Dependencies Required


The instruction shows up the instruction for Ubuntu which will most likely work for Debian and Devuan as well.


sudo apt install cmake zip libsdl2-dev libssl-dev libpcre3-dev zlib1g-dev libunistring-dev libfribidi-dev libmpg123-dev libharfbuzz-dev

It looks like I had some library already installed:


Reading package lists... Done

Building dependency tree... Done
Reading state information... Done
libfribidi-dev is already the newest version (1.0.8-2).
libharfbuzz-dev is already the newest version (2.7.4-1).
libharfbuzz-dev set to manually installed.
libsdl2-dev is already the newest version (2.0.20+dfsg-2).
libssl-dev is already the newest version (1.1.1m-1).
libpcre3-dev is already the newest version (2:8.39-13).
zip is already the newest version (3.0-12).
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2).

The following additional packages will be installed:
  cmake-data dh-elpa-helper libjsoncpp25 libout123-0 librhash0
  libsyn123-0

Suggested packages:
  cmake-doc ninja-build cmake-format

The following NEW packages will be installed:
  cmake cmake-data dh-elpa-helper libjsoncpp25 libmpg123-dev
  libout123-0 librhash0 libsyn123-0 libunistring-dev

0 upgraded, 9 newly installed, 0 to remove and 77 not upgraded.
Need to get 10.9 MB of archives.
After this operation, 41.7 MB of additional disk space will be used.

Cmake Section


Assuming we are already inside the Lagrange folder:


$ mkdir build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/bin

$ cmake --build .

> The first attempt didn't really work out but I solved thanks to Skyajke and Lykso


The compilation is pretty fast.

Let us see what is inside the folder:


$ ls -la
total 3904
drwxr-xr-x  4 debian debian    4096 Jan 27 10:14 .
drwxr-xr-x 11 debian debian    4096 Jan 27 10:12 ..
-rw-r--r--  1 debian debian   32701 Jan 27 10:13 CMakeCache.txt
drwxr-xr-x  6 debian debian    4096 Jan 27 10:14 CMakeFiles
-rw-r--r--  1 debian debian    3610 Jan 27 10:13 cmake_install.cmake
-rw-r--r--  1 debian debian     259 Jan 27 10:13 fi.skyjake.Lagrange.desktop
-rwxr-xr-x  1 debian debian 1471080 Jan 27 10:14 lagrange
drwxr-xr-x  3 debian debian    4096 Jan 27 10:13 lib
-rw-r--r--  1 debian debian   53048 Jan 27 10:13 Makefile
-rw-r--r--  1 debian debian 2408948 Jan 27 10:13 resources.lgr

Moving Forward


At this point you can continue and install Lagrange for the users or simply using the binary already created and a "desktop file" (to save .local/share/applications) to add an item on the menu.


[Desktop Entry]
Name=Lagrange
Comment=A Beautiful Gemini Client
Categories=Network;
Exec=$HOME/Git/lagrange/build/lagrange %U
Terminal=false
Type=Application
StartupWMClass=lagrange
Icon=fi.skyjake.Lagrange
MimeType=x-scheme-handler/gemini;x-scheme-handler/gopher;

Math Is The Path!


Now I got my shiny Lagrange binary all myself and I am feeling pretty cool! But what about the whole point?


Let's do some math!


Lagrange binary itself is about 1.5M !


$ du -shc lagrange
1.5M	lagrange
1.5M	total

The whole folder is 61M :


$ du -shc lagrange
61M	lagrange
61M	total

If I add the "41.7 MB of additional disk space" due the packaging needed to compile Lagrange, excluded the generic ones, to compile Lagrange is required around 103M of space which is ten times smaller than by Lagrange provided by Flatpak/Flathub.


I recall that Appimage version of Lagrange is just about 9.18M:


Lagrange-1.10.2-x86_64.AppImage			9.1 MiB

Just check by yourself!


I recall also the Flatpak version requires 1.1G only to download Lagrange:


du -h -s  /var/lib/flatpak/
1.1G	/var/lib/flatpak/

To recap:


just the binary: 1.5M

Appimage bundle: 9.1M

Git repo + stuff: 103M

Flatpak version: 1.1G


The results is merciless toward Flatpak, even compiling the source the Flatpak version is ten times bigger. You can listen all the amazing novelties about it but Flatpak will occupy a lot of space on your disk not matter what, if you are fine with this then we are all happy with you, otherwise its only good point is the centralized interface from which you can handle everything by an intuitive CLI.


However centralized tool are coming in also for Appimage such as:


Appimagepool


Which allows to download and manage Appimage bundles from a central repository. Appimage will not replace your distro packaging system but surely it is more pragmatic than Flatpak. I am not sure you can find all the software you need through Appimagepool but you may be lucky.


Wrapping This Up!


Now I learned how to compile lagrange by myself hence I can keep up with the development without the use of Flatpak or Appimage, until it will be finally available on Debian. Perhaps will not be the difference in my life but I learned that C and C++ software use different way to compile the source code; and I'd like to say the C compiling is lesser convoluted.


For comments or suggestion write me at:


freezr AT mailbox DOT org


↩ go back

-- Response ended

-- Page fetched on Wed May 22 01:17:55 2024