返回提交历史
Deleted
scripts/build-nuitka.sh
+0
-89
XFEstudio/gpt4free
Delete build-nuitka.sh
679ceadc
代码差异
1 个文件
+0
-89
@@ -1,89 +0,0 @@
1
#!/bin/bash
2
# Nuitka build script for g4f
3
# This script builds g4f executables using Nuitka for different platforms and architectures
4
5
set -e
6
7
# Default values
8
PLATFORM=${PLATFORM:-$(uname -s | tr '[:upper:]' '[:lower:]')}
9
ARCHITECTURE=${ARCHITECTURE:-$(uname -m)}
10
VERSION=${G4F_VERSION:-0.0.0-dev}
11
OUTPUT_DIR=${OUTPUT_DIR:-dist}
12
13
# Normalize architecture names
14
case "${ARCHITECTURE}" in
15
"x86_64"|"amd64")
16
ARCH="x64"
17
;;
18
"arm64"|"aarch64")
19
ARCH="arm64"
20
;;
21
"armv7l"|"armhf")
22
ARCH="armv7"
23
;;
24
*)
25
ARCH="${ARCHITECTURE}"
26
;;
27
esac
28
29
# Create output directory
30
mkdir -p "${OUTPUT_DIR}"
31
32
echo "Building g4f with Nuitka..."
33
echo "Platform: ${PLATFORM}"
34
echo "Architecture: ${ARCH} (${ARCHITECTURE})"
35
echo "Version: ${VERSION}"
36
echo "Output: ${OUTPUT_DIR}"
37
38
# Set output filename based on platform
39
case "${PLATFORM}" in
40
"windows"|"win32")
41
OUTPUT_NAME="g4f-windows-${VERSION}-${ARCH}.exe"
42
NUITKA_ARGS="--windows-console-mode=attach --onefile"
43
;;
44
"darwin"|"macos")
45
OUTPUT_NAME="g4f-macos-${VERSION}-${ARCH}"
46
NUITKA_ARGS="--macos-create-app-bundle --onefile"
47
;;
48
"linux")
49
OUTPUT_NAME="g4f-linux-${VERSION}-${ARCH}"
50
NUITKA_ARGS="--onefile"
51
;;
52
*)
53
OUTPUT_NAME="g4f-${PLATFORM}-${VERSION}-${ARCH}"
54
NUITKA_ARGS="--onefile"
55
;;
56
esac
57
58
# Basic Nuitka arguments
59
NUITKA_COMMON_ARGS="
60
--standalone
61
--output-filename=${OUTPUT_NAME}
62
--output-dir=${OUTPUT_DIR}
63
--remove-output
64
--no-pyi-file
65
--assume-yes-for-downloads
66
--show-progress
67
--show-memory
68
--include-package=g4f
69
"
70
71
# Platform-specific optimizations
72
if [[ "${PLATFORM}" == "windows" ]] && [[ -f "projects/windows/icon.ico" ]]; then
73
NUITKA_ARGS="${NUITKA_ARGS} --windows-icon-from-ico=projects/windows/icon.ico"
74
fi
75
76
# Build command
77
echo "Running Nuitka build..."
78
python -m nuitka ${NUITKA_COMMON_ARGS} ${NUITKA_ARGS} g4f_cli.py
79
80
echo "Build completed: ${OUTPUT_DIR}/${OUTPUT_NAME}"
81
82
# Verify the build
83
if [[ -f "${OUTPUT_DIR}/${OUTPUT_NAME}" ]]; then
84
echo "✓ Build successful!"
85
ls -la "${OUTPUT_DIR}/${OUTPUT_NAME}"
86
else
87
echo "✗ Build failed - output file not found"
88
exit 1
89
fi