-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux AppImage #774
Draft
wbqpk3
wants to merge
2
commits into
Ericsson:master
Choose a base branch
from
wbqpk3:appimage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Linux AppImage #774
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -j $(nproc) | ||
``` | ||
|
||
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. | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Install shared objects to $CMAKE_INSTALL_PREFIX/lib/deps/ | ||
if(INSTALL_RUNTIME_DEPENDENCIES OR ENABLE_PACKAGING) | ||
install(TARGETS CodeCompass_parser CodeCompass_webserver util gitservice cppparser RUNTIME_DEPENDENCIES LIBRARY DESTINATION "${INSTALL_LIB_DIR}/${INSTALL_DEPS_DIR_NAME}") | ||
endif() | ||
|
||
if(NOT ENABLE_PACKAGING) | ||
return() | ||
endif() | ||
|
||
if(NOT PACKAGE_VERSION) | ||
set(PACKAGE_VERSION "1.0") | ||
endif() | ||
|
||
set(PACKAGE_DIR "codecompass") | ||
|
||
add_custom_target( | ||
appimage | ||
|
||
COMMAND mkdir -p ${PACKAGE_DIR}/usr/ | ||
|
||
COMMAND echo "Adding CodeCompass installation: ${CMAKE_INSTALL_PREFIX}" | ||
COMMAND cp -r ${CMAKE_INSTALL_PREFIX}/* ${PACKAGE_DIR}/usr/ | ||
|
||
COMMAND echo "Removing webgui-new sources ..." | ||
COMMAND rm -rf ${PACKAGE_DIR}/usr/share/codecompass/webgui-new/app/ | ||
|
||
COMMAND cp -r ${CMAKE_SOURCE_DIR}/packaging/appimage/* ${PACKAGE_DIR} | ||
COMMAND chmod +x ${PACKAGE_DIR}/AppRun | ||
|
||
COMMAND echo "---------- AppRun file ----------" | ||
COMMAND cat ${PACKAGE_DIR}/AppRun | ||
COMMAND echo "---------------------------------" | ||
|
||
COMMAND sed -i "s/\%PACKAGE_VERSION\%/${PACKAGE_VERSION}/" ${PACKAGE_DIR}/codecompass.desktop | ||
|
||
COMMAND echo "---------- Desktop file ----------" | ||
COMMAND cat ${PACKAGE_DIR}/codecompass.desktop | ||
COMMAND echo "----------------------------------" | ||
|
||
COMMAND echo "Building CodeCompass AppImage ..." | ||
COMMAND appimagetool-x86_64.AppImage ${PACKAGE_DIR} | ||
COMMAND echo "Done!" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() | ||
{ | ||
echo "CodeCompass AppImage" | ||
echo "Usage:" | ||
echo "./CodeCompass.AppImage parser <parser arguments>" | ||
echo "./CodeCompass.AppImage webserver <webserver arguments>" | ||
echo "./CodeCompass.AppImage logger <logger arguments>" | ||
} | ||
|
||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APPDIR/usr/lib/deps/" | ||
|
||
if [ -z "$1" ]; then | ||
usage | ||
elif [ "$1" == "parser" ]; then | ||
shift | ||
exec $APPDIR/usr/bin/CodeCompass_parser "$@" | ||
elif [ "$1" == "webserver" ]; then | ||
shift | ||
exec $APPDIR/usr/bin/CodeCompass_webserver "$@" | ||
elif [ "$1" == "logger" ]; then | ||
shift | ||
exec $APPDIR/usr/bin/CodeCompass_logger "$@" | ||
else | ||
usage | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
|
||
Type=Application | ||
Version=%PACKAGE_VERSION% | ||
Name=CodeCompass | ||
Comment=CodeCompass is a pluginable code comprehension tool. | ||
Icon=logo | ||
Terminal=true | ||
Categories=Development; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing
libfuse2
was also required on Ubuntu 22.04, as only v3 is preinstalled, which not compatible with AppImage.