Skip to content

Commit

Permalink
Packaging documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wbqpk3 committed Oct 28, 2024
1 parent bb49d21 commit 8655df4
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/deps.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,4 @@ relevant during compilation.
| `CODECOMPASS_LINKER` | The path of the linker, if the system's default linker is to be overridden. |
| `WITH_PLUGIN`/`WITHOUT_PLUGIN` | The names of the plugins to be built/skipped at build. Possible values are **cpp**, **cpp_reparse**, **dummy**, **git**, **metrics**, **search**. The `metrics` and `search` plugins are fundamental, they will be compiled even if not included. `WITH_PLUGIN` **cannot** be used together with `WITHOUT_PLUGIN`. Example: `-DWITH_PLUGIN="cpp;git"` This will compile the cpp, git, metrics and search plugins. |
| `WITH_AUTH` | The names of the authentication plugins to be compiled. Possible values are **plain** and **ldap**. `plain` **cannot** be skipped. Example: `-DWITH_AUTH="plain;ldap"`|
| `INSTALL_RUNTIME_DEPENDENCIES` | If enabled, the required shared objects will be copied to `${CMAKE_INSTALL_PREFIX}/lib/deps/`. Optional, disabled by default. |
79 changes: 79 additions & 0 deletions doc/packaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Packaging
Before running or installing any package verify its checksum:
```
sha256sum <package file>
```

# AppImage

## Running CodeCompass AppImage
Set execution permissions:
```
chmod +x ./CodeCompass.AppImage
```

Run AppImage:
```
./CodeCompass.AppImage
```

AppImage Usage:
```
./CodeCompass.AppImage parser <parser arguments>
```
```
./CodeCompass.AppImage webserver <webserver arguments>
```
```
./CodeCompass.AppImage logger <logger arguments>
```

## Building CodeCompass AppImage

### appimagetool
To build AppImages, we need to use `appimagetool`.
1. Download `appimagetool-x86_64.AppImage` from https://github.com/AppImage/AppImageKit/releases
2. Place `appimagetool-x86_64.AppImage` into a directory which is added to the `PATH` environmental variable.
3. Set execution permissions: ```chmod +x ./appimagetool-x86_64.AppImage```
4. Verify `appimagetool-x86_64.AppImage` is runnable from any directory: `which appimagetool-x86_64.AppImage`

### Building AppImage
First, we need to build CodeCompass.

Create a build folder:
```
mkdir build
cd build
```

To enable packaging, run CMake with `-DENABLE_PACKAGING=1`:
```
cmake .. \
-DCMAKE_INSTALL_PREFIX=<CodeCompass_install_dir> \
-DDATABASE=<database_type> \
-DCMAKE_BUILD_TYPE=<build_type> \
-DLLVM_DIR=/usr/lib/llvm-11/cmake \
-DClang_DIR=/usr/lib/cmake/clang-11 \
-DENABLE_PACKAGING=1
```

Build and install CodeCompass:
```
make -j $(nproc)
make install
```

Build AppImage:
```
make appimage
```

The built package will be located in `build/packaging/`.

## Build options
The built package can be customized by using CMake variables.

| Variable | Meaning |
| -------------------- | ---------------------------------------- |
| `PACKAGE_VERSION` | Version of the package for the manifest file. If not specified, version `1.0` will be used. |

0 comments on commit 8655df4

Please sign in to comment.