This document provides instructions for building Debian packages for OLLMchat.
The source package builds the following binary packages:
- libocmarkdown1 - Base markdown parsing library (libocmarkdown.so)
- libocmarkdowngtk1 - GTK markdown rendering library (libocmarkdowngtk.so)
- libollmchat1 - Base LLM library (libollmchat.so), GTK widgets (libollmchatgtk.so), and SQLite library (libocsqlite.so)
- libocmarkdown-dev - Development files for libocmarkdown (headers, VAPI files)
- libocmarkdowngtk-dev - Development files for libocmarkdowngtk (headers, VAPI files)
- libollmchat-dev - Development files for libollmchat, libollmchatgtk, and libocsqlite (headers, VAPI files)
- ollmchat - Main application executable installed to
/usr/bin - ollmchat-tools - Command-line tools (oc-md2html, oc-html2md) installed to
/usr/bin - ollmchat-doc - Test executables (oc-test-cli, oc-markdown-test) installed to
/usr/share/doc/ollmchat
Install the required build dependencies:
sudo apt-get update
sudo apt-get install build-essential devscripts debhelper meson ninja-build \
pkg-config valac libgee-0.8-dev libglib2.0-dev libgobject-2.0-dev \
libgio-2.0-dev libjson-glib-dev libsoup-3.0-dev libxml2-dev libsqlite3-dev \
libgtk-4-dev libgtksourceview-5-dev libadwaita-1-dev gobject-introspection \
libgirepository1.0-devTo build all binary packages:
dpkg-buildpackage -us -uc -bThis will:
- Configure the build using Meson
- Compile all libraries and executables
- Install files to a temporary directory
- Package files into separate .deb packages
- Create the packages in the parent directory
To build a source package (for uploading to a PPA or repository):
dpkg-buildpackage -us -uc -STo build packages with debug symbols:
DEB_BUILD_OPTIONS="debug" dpkg-buildpackage -us -uc -bTo perform a clean build (removes build directory first):
debian/rules clean
dpkg-buildpackage -us -uc -bFiles are installed to standard Debian locations:
- Libraries:
/usr/lib/<arch>/(e.g.,/usr/lib/x86_64-linux-gnu/) - Headers:
/usr/include/ - VAPI files:
/usr/share/vala/vapi/ - GIR files:
/usr/share/gir-1.0/ - Typelib files:
/usr/lib/<arch>/girepository-1.0/ - Application:
/usr/bin/(ollmchat) - Tools:
/usr/bin/(oc-md2html, oc-html2md) - Test executables:
/usr/share/doc/ollmchat/(oc-test-*)
libocmarkdown1has no library dependencies (only system libraries)libocmarkdowngtk1depends onlibocmarkdown1libollmchat1includes all three libraries (ollmchat, ollmchatgtk, ocsqlite)ollmchat-toolsdepends onlibocmarkdown1- Development packages depend on their corresponding runtime packages
The build uses /usr as the prefix. To change this, modify debian/rules:
override_dh_auto_configure:
meson setup build --prefix=/usr/localTo change which files go into which packages, edit the corresponding .install files in the debian/ directory:
debian/libocmarkdown1.install- Runtime files for libocmarkdowndebian/libocmarkdown-dev.install- Development files for libocmarkdowndebian/libocmarkdowngtk1.install- Runtime files for libocmarkdowngtkdebian/libocmarkdowngtk-dev.install- Development files for libocmarkdowngtkdebian/libollmchat1.install- Runtime files for libollmchatdebian/libollmchat-dev.install- Development files for libollmchatdebian/ollmchat.install- Main application executabledebian/ollmchat-tools.install- Command-line toolsdebian/ollmchat-doc.install- Test executables
After building, install the packages:
sudo dpkg -i ../libocmarkdown1_*.deb
sudo dpkg -i ../libocmarkdown-dev_*.deb
sudo dpkg -i ../libocmarkdowngtk1_*.deb
sudo dpkg -i ../libocmarkdowngtk-dev_*.deb
sudo dpkg -i ../libollmchat1_*.deb
sudo dpkg -i ../libollmchat-dev_*.deb
sudo dpkg -i ../ollmchat_*.deb
sudo dpkg -i ../ollmchat-tools_*.deb
sudo dpkg -i ../ollmchat-doc_*.debOr install all at once:
sudo dpkg -i ../*.debCheck that libraries are installed:
dpkg -L libocmarkdown1
dpkg -L libollmchat1Test the command-line tools:
oc-md2html --help
oc-html2md --helpEnsure all build dependencies are installed (see Prerequisites section).
Make sure the runtime packages are installed. Development packages only contain headers and VAPI files, not the actual libraries.
VAPI files are installed to /usr/share/vala/vapi/. Ensure the development packages are installed and that your Vala compiler can find them (they should be found automatically).
GIR and typelib files are generated during the build. If they're missing, check that:
gobject-introspectionis installed- The build completed successfully
- The runtime packages are installed
To update the package version, edit debian/changelog:
dch -i # Interactive editor
# or
dch -v 1.0.1-1 "New upstream release"Then rebuild the packages.
-
Build the source package:
dpkg-buildpackage -S
-
Upload to PPA:
dput ppa:your-ppa/ollmchat ../ollmchat_*.changes