forked from zeronet-conservancy/zeronet-conservancy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-installer.sh
More file actions
executable file
·83 lines (72 loc) · 2.23 KB
/
build-installer.sh
File metadata and controls
executable file
·83 lines (72 loc) · 2.23 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
#!/bin/bash
# Build script for creating EpixNet installers locally
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Detect OS
OS_TYPE=$(uname -s)
ARCH=$(uname -m)
echo -e "${GREEN}=== EpixNet Installer Builder ===${NC}"
echo "Detected OS: $OS_TYPE ($ARCH)"
# Check Python version
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
echo "Python version: $PYTHON_VERSION"
# Install build dependencies
echo -e "${YELLOW}Installing build dependencies...${NC}"
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install pyinstaller
# Generate build info
echo -e "${YELLOW}Generating build info...${NC}"
# Convert OS_TYPE to platform name
case "$OS_TYPE" in
Darwin)
PLATFORM="macosx"
;;
Linux)
PLATFORM="libredesktop"
;;
MINGW64_NT*|MSYS_NT*|CYGWIN_NT*)
PLATFORM="windows"
;;
*)
PLATFORM="$OS_TYPE"
;;
esac
python3 build.py --type=installer --platform="$PLATFORM"
# Create dist directory
mkdir -p dist/installers
# Build based on OS
case "$OS_TYPE" in
Linux)
echo -e "${YELLOW}Building for Linux...${NC}"
python3 -m PyInstaller epixnet.spec --distpath dist/linux
cd dist/linux
tar -czf ../installers/EpixNet-linux-${ARCH}.tar.gz EpixNet/
cd ../..
echo -e "${GREEN}✓ Linux build complete: dist/installers/EpixNet-linux-${ARCH}.tar.gz${NC}"
;;
Darwin)
echo -e "${YELLOW}Building for macOS...${NC}"
python3 -m PyInstaller epixnet.spec --distpath dist/macos
hdiutil create -volname "EpixNet" -srcfolder dist/macos/EpixNet.app -ov -format UDZO dist/installers/EpixNet-macos.dmg
echo -e "${GREEN}✓ macOS build complete: dist/installers/EpixNet-macos.dmg${NC}"
;;
MINGW64_NT*|MSYS_NT*|CYGWIN_NT*)
echo -e "${YELLOW}Building for Windows...${NC}"
python3 -m PyInstaller epixnet.spec --distpath dist/windows
cd dist/windows
7z a -r ../installers/EpixNet-windows-x64.zip EpixNet/
cd ../..
echo -e "${GREEN}✓ Windows build complete: dist/installers/EpixNet-windows-x64.zip${NC}"
;;
*)
echo -e "${RED}Unsupported OS: $OS_TYPE${NC}"
exit 1
;;
esac
echo -e "${GREEN}=== Build complete! ===${NC}"
echo "Installer location: dist/installers/"