Skip to content

Commit 5f30ef2

Browse files
committed
fix linux x86_64 build
1 parent 0f6bd39 commit 5f30ef2

4 files changed

Lines changed: 244 additions & 207 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ conda create -n pyqt python=3.10
3535
conda activate pyqt
3636
pip install pdm
3737
pdm sync
38+
pip install -e .
3839
pdm run build.py
3940
```
4041

build.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,31 @@
4141
f"--windows-icon-from-ico={ICON_PATH}",
4242
]
4343

44+
elif platform.system() == "Linux":
45+
args = [
46+
"python",
47+
"-m",
48+
"nuitka",
49+
# "--mingw64",
50+
"--standalone",
51+
f"--output-dir=dist",
52+
"--follow-import-to=fish",
53+
"main.py",
54+
f"--onefile", # default onefile is enough (not unzipping)
55+
"--output-filename=fish",
56+
"--include-data-dir=assets=assets",
57+
"--include-data-dir=locales=locales",
58+
"--include-data-files=fish_audio_preprocess=fish_audio_preprocess/=**/*.py",
59+
"--windows-console-mode=disable",
60+
"--enable-plugins=pkg-resources",
61+
"--enable-plugins=pyqt6",
62+
# --follow-import-to=numpy
63+
"--nofollow-import-to=mkl,click,scipy,pandas,matplotlib,pytest",
64+
"--include-qt-plugins=sensible,multimedia",
65+
"--show-memory",
66+
"--show-progress",
67+
]
68+
4469
else:
4570
args = [
4671
"pyinstaller",

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
import platform
13
import signal
24
import sys
35
import time
@@ -19,6 +21,9 @@ def __init__(self):
1921
def main():
2022
t1 = time.time()
2123
qdarktheme.enable_hi_dpi()
24+
if platform.system() == "Linux":
25+
# 使用libx11.so桌面系统定位坐标
26+
os.environ["QT_QPA_PLATFORM"] = "xcb"
2227
app = QtWidgets.QApplication(sys.argv)
2328
splash = SplashScreen()
2429
splash.show()

0 commit comments

Comments
 (0)