-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·84 lines (71 loc) · 2.04 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·84 lines (71 loc) · 2.04 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
#!/bin/bash
# Build script for Explorium CLI macOS binary
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "=== Explorium CLI Build Script ==="
echo ""
# Get architecture
ARCH=$(uname -m)
echo "Building for architecture: $ARCH"
echo ""
# Clean previous builds
echo "Cleaning previous builds..."
rm -rf build/ dist/ *.egg-info
# Ensure dependencies are installed
echo "Installing dependencies..."
pip install -e . -q
pip install pyinstaller -q
# Build the binary
echo ""
echo "Building binary with PyInstaller..."
pyinstaller --onefile \
--name explorium \
--exclude-module setuptools \
--exclude-module pkg_resources \
--exclude-module tkinter \
--exclude-module matplotlib \
--exclude-module numpy \
--exclude-module pandas \
--exclude-module scipy \
--exclude-module PIL \
explorium_cli/main.py
# Check if build succeeded
if [[ -f "dist/explorium" ]]; then
echo ""
echo "=== Build Successful ==="
echo ""
# Get binary info
BINARY_PATH="dist/explorium"
BINARY_SIZE=$(du -h "$BINARY_PATH" | cut -f1)
echo "Binary location: $BINARY_PATH"
echo "Binary size: $BINARY_SIZE"
echo "Architecture: $(file "$BINARY_PATH" | grep -o 'arm64\|x86_64')"
echo ""
# Test the binary
echo "Testing binary..."
if "$BINARY_PATH" --help > /dev/null 2>&1; then
echo "✓ Binary runs successfully"
else
echo "✗ Binary test failed"
exit 1
fi
# Create versioned copy
VERSION=$(grep 'version = ' pyproject.toml | head -1 | cut -d'"' -f2)
VERSIONED_NAME="explorium-${VERSION}-macos-${ARCH}"
cp "$BINARY_PATH" "dist/${VERSIONED_NAME}"
echo "✓ Created versioned binary: dist/${VERSIONED_NAME}"
echo ""
echo "=== Installation ==="
echo ""
echo "To install system-wide, run:"
echo " sudo cp dist/explorium /usr/local/bin/"
echo ""
echo "Or add to your PATH:"
echo " export PATH=\"\$PATH:$SCRIPT_DIR/dist\""
echo ""
else
echo ""
echo "=== Build Failed ==="
exit 1
fi