-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy pathbuild_linux.sh
More file actions
executable file
·103 lines (85 loc) · 2.91 KB
/
build_linux.sh
File metadata and controls
executable file
·103 lines (85 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
set -e
echo "======================================"
echo "LoliProfiler Linux Build Script (CLI Only)"
echo "======================================"
# Check if QT5Path is set
if [ -z "$QT5Path" ]; then
echo "QT5Path environment variable is not set, trying to auto-detect..."
# Try to find Qt5 installation
if [ -d "/usr/lib64/qt5" ]; then
export QT5Path="/usr/lib64/qt5"
elif [ -d "/usr/lib/x86_64-linux-gnu/qt5" ]; then
export QT5Path="/usr/lib/x86_64-linux-gnu/qt5"
else
# Try to use qmake to find Qt5
if command -v qmake-qt5 &> /dev/null; then
export QT5Path=$(qmake-qt5 -query QT_INSTALL_PREFIX)
elif command -v qmake &> /dev/null; then
export QT5Path=$(qmake -query QT_INSTALL_PREFIX)
else
echo "ERROR: Cannot find Qt5 installation. Please set QT5Path environment variable."
exit 1
fi
fi
fi
echo "QT5Path: $QT5Path"
# Set build paths
export ReleasePath="./build/cmake/bin/release"
export DeployPath="./dist"
# Clean previous build
echo "Cleaning previous build..."
rm -rf ./build
rm -rf ./dist
# Create build directory
mkdir -p build/cmake
# Configure with CMake (CLI only, no GUI)
echo "Configuring CMake (CLI only)..."
cd build/cmake
cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$QT5Path \
-DBUILD_GUI=OFF
# Build
echo "Building LoliProfilerCLI..."
make -j$(nproc) LoliProfilerCLI
# Install to release directory
echo "Installing to release directory..."
make install
cd ../..
# Create deployment directory
echo "Creating deployment package..."
mkdir -p $DeployPath/LoliProfiler
# Copy CLI binary
echo "Copying LoliProfilerCLI binary..."
cp -v $ReleasePath/LoliProfilerCLI $DeployPath/LoliProfiler/
# Deploy Qt dependencies
echo "Deploying Qt dependencies..."
bash scripts/Deployqt_linux.sh
# Copy Python analysis scripts
echo "Copying Python analysis scripts..."
cp -v markdown_to_html.py $DeployPath/LoliProfiler/
cp -v analyze_heap.py $DeployPath/LoliProfiler/
cp -v requirements.txt $DeployPath/LoliProfiler/
# Copy MCP server
echo "Copying MCP server..."
mkdir -p $DeployPath/LoliProfiler/mcp_server
cp -v mcp_server/__init__.py $DeployPath/LoliProfiler/mcp_server/
cp -v mcp_server/tree_model.py $DeployPath/LoliProfiler/mcp_server/
cp -v mcp_server/heap_explorer_server.py $DeployPath/LoliProfiler/mcp_server/
cp -v .mcp.json $DeployPath/LoliProfiler/
# Copy config files if they exist
if [ -d "res" ]; then
echo "Copying resource files..."
mkdir -p $DeployPath/LoliProfiler/res
cp -rv res/* $DeployPath/LoliProfiler/res/ 2>/dev/null || true
fi
# Create archive
echo "Creating distribution archive..."
cd $DeployPath
zip -r LoliProfiler-linux-cli.zip LoliProfiler
cd ..
echo "======================================"
echo "Build completed successfully!"
echo "Distribution package: $DeployPath/LoliProfiler-linux-cli.zip"
echo "======================================"