Skip to content

Commit bb49d21

Browse files
author
Barnabás Domozi
committed
AppImage packaging
1 parent c709db4 commit bb49d21

File tree

6 files changed

+83
-0
lines changed

6 files changed

+83
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ add_subdirectory(plugins) # must precede webgui
3535
add_subdirectory(webgui)
3636
add_subdirectory(webgui-new)
3737
add_subdirectory(webserver)
38+
add_subdirectory(packaging)
3839

3940
# Install java libraries
4041
install(DIRECTORY

Config.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ set(INSTALL_BIN_DIR "bin")
5757
set(DATABASE sqlite CACHE STRING "Database type")
5858
string(TOUPPER ${DATABASE} DATABASE_U)
5959

60+
# Installation directory for dependencies
61+
set(INSTALL_DEPS_DIR_NAME "deps")
62+
6063
# Set up the dynamic libraries' runtime path to the install folder
6164
set(CMAKE_SKIP_BUILD_RPATH FALSE)
6265
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

packaging/CMakeLists.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Install shared objects to $CMAKE_INSTALL_PREFIX/lib/deps/
2+
if(INSTALL_RUNTIME_DEPENDENCIES OR ENABLE_PACKAGING)
3+
install(TARGETS CodeCompass_parser CodeCompass_webserver util gitservice cppparser RUNTIME_DEPENDENCIES LIBRARY DESTINATION "${INSTALL_LIB_DIR}/${INSTALL_DEPS_DIR_NAME}")
4+
endif()
5+
6+
if(NOT ENABLE_PACKAGING)
7+
return()
8+
endif()
9+
10+
if(NOT PACKAGE_VERSION)
11+
set(PACKAGE_VERSION "1.0")
12+
endif()
13+
14+
set(PACKAGE_DIR "codecompass")
15+
16+
add_custom_target(
17+
appimage
18+
19+
COMMAND mkdir -p ${PACKAGE_DIR}/usr/
20+
21+
COMMAND echo "Adding CodeCompass installation: ${CMAKE_INSTALL_PREFIX}"
22+
COMMAND cp -r ${CMAKE_INSTALL_PREFIX}/* ${PACKAGE_DIR}/usr/
23+
24+
COMMAND echo "Removing webgui-new sources ..."
25+
COMMAND rm -rf ${PACKAGE_DIR}/usr/share/codecompass/webgui-new/app/
26+
27+
COMMAND cp -r ${CMAKE_SOURCE_DIR}/packaging/appimage/* ${PACKAGE_DIR}
28+
COMMAND chmod +x ${PACKAGE_DIR}/AppRun
29+
30+
COMMAND echo "---------- AppRun file ----------"
31+
COMMAND cat ${PACKAGE_DIR}/AppRun
32+
COMMAND echo "---------------------------------"
33+
34+
COMMAND sed -i "s/\%PACKAGE_VERSION\%/${PACKAGE_VERSION}/" ${PACKAGE_DIR}/codecompass.desktop
35+
36+
COMMAND echo "---------- Desktop file ----------"
37+
COMMAND cat ${PACKAGE_DIR}/codecompass.desktop
38+
COMMAND echo "----------------------------------"
39+
40+
COMMAND echo "Building CodeCompass AppImage ..."
41+
COMMAND appimagetool-x86_64.AppImage ${PACKAGE_DIR}
42+
COMMAND echo "Done!"
43+
)

packaging/appimage/AppRun

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
usage()
4+
{
5+
echo "CodeCompass AppImage"
6+
echo "Usage:"
7+
echo "./CodeCompass.AppImage parser <parser arguments>"
8+
echo "./CodeCompass.AppImage webserver <webserver arguments>"
9+
echo "./CodeCompass.AppImage logger <logger arguments>"
10+
}
11+
12+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APPDIR/usr/lib/deps/"
13+
14+
if [ -z "$1" ]; then
15+
usage
16+
elif [ "$1" == "parser" ]; then
17+
shift
18+
exec $APPDIR/usr/bin/CodeCompass_parser "$@"
19+
elif [ "$1" == "webserver" ]; then
20+
shift
21+
exec $APPDIR/usr/bin/CodeCompass_webserver "$@"
22+
elif [ "$1" == "logger" ]; then
23+
shift
24+
exec $APPDIR/usr/bin/CodeCompass_logger "$@"
25+
else
26+
usage
27+
fi
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
3+
Type=Application
4+
Version=%PACKAGE_VERSION%
5+
Name=CodeCompass
6+
Comment=CodeCompass is a pluginable code comprehension tool.
7+
Icon=logo
8+
Terminal=true
9+
Categories=Development;

packaging/appimage/logo.png

146 KB
Loading

0 commit comments

Comments
 (0)