-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
116 lines (94 loc) · 3.69 KB
/
Makefile
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
104
105
106
107
108
109
110
111
112
113
114
115
116
VER=$(shell grep __version__ negar_gui/constants.py|cut -d= -f2|tr -d '\" ')
# Check if running inside a virtual environment
VENV:=$(shell echo "$${VIRTUAL_ENV-}")
NEGAR:=$(if $(VENV),$(VIRTUAL_ENV)/bin/negar-gui,$(HOME)/.local/bin/negar-gui)
APP_DESKTOP:="$(HOME)/.local/share/applications/negar.desktop"
.ONESHELL:
ver:
@echo negar-gui, Ver. $(VER)
.PHONY: generate_desktop_file
generate_desktop_file:
@cp negar_gui/icons/logo.png $(HOME)/.local/share/icons/negar.png
@echo "Generating the desktop file..."
cat <<EOF > $(APP_DESKTOP)
[Desktop Entry]
Name=Negar
Exec=$(NEGAR)
Icon=negar.png
Version=$(VER)
Hidden=false
Terminal=false
Type=Application
Categories=Utility;
Comment=Graphical User Interface for Negar -- Persian Text Editor
EOF
@chmod +x $(APP_DESKTOP)
@echo "Desktop file generated successfully."
.PHONY: uninstall
uninstall:
@echo "Uninstalling negar-gui ..."
pip uninstall negar-gui
@echo "Removing the desktop file and its icon ..."
rm -fv $(APP_DESKTOP) $(HOME)/.local/share/icons/negar.png
@echo "Desktop file removed successfully."
setup: ver
python setup.py sdist
python setup.py bdist_wheel
lins: ver setup generate_desktop_file
pip install "dist/negar_gui-$(VER)-py3-none-any.whl"
pins: ver generate_desktop_file
pip install negar-gui==$(VER)
upypi: setup
twine upload "dist/negar_gui-$(VER).tar.gz"
utest: setup
twine upload -r testpypi "dist/negar_gui-$(VER).tar.gz"
upload: setup upypi utest
nuCompile: setup ver
nuitka3 negar_gui/main.py --standalone --onefile --linux-onefile-icon=negar_gui/icons/logo.png \
--enable-plugin=pyqt5 --nofollow-import-to=tkinter --lto=no \
-o dist/negar-gui-v$(VER).bin \
--output-dir=dist --remove-output \
--include-data-file=.negar/lib/python3.12/site-packages/pyuca/allkeys-9.0.0.txt=pyuca/allkeys-9.0.0.txt \
--include-data-file=.negar/lib/python3.12/site-packages/negar/data/untouchable.dat=negar/data/untouchable.dat
# --include-data-dir=.negar/lib/python3.12/site-packages/negar=negar/data \
# --module python-negar --include-package=python-negar
# --include-package-data=python-negar=*.dat \
ls -lh dist
piCompile: setup ver
@rm build/gui/ -rfv
pyinstaller -p negar_gui --onefile --windowed --clean -i"negar_gui/icons/logo.ico" \
--collect-data pyuca --noupx negar_gui/main.py -n negar-gui-v$(VER) \
--add-data negar_gui/ts/fa.qm:ts \
--add-data ../python-negar/negar/data/untouchable.dat:negar/data # &> pyins.out
ls -lh dist
trans: ver
pylupdate5 -verbose negar_gui/Ui_mwin.py -ts negar_gui/ts/fa-uimwin.ts
pylupdate5 -verbose negar_gui/Ui_uwin.py -ts negar_gui/ts/fa-uiuwin.ts
pylupdate5 -verbose negar_gui/Ui_hwin.py -ts negar_gui/ts/fa-uihwin.ts
pylupdate5 -verbose negar_gui/main.py -ts negar_gui/ts/fa-main.ts
lrelease negar_gui/ts/fa-*.ts -qm negar_gui/ts/fa.qm
res: ver
pyrcc5 negar_gui/resource.qrc -o negar_gui/resource_rc.py
sed "s/PyQt5/PyQt6/g" -i negar_gui/resource_rc.py
ui: ver
pyuic6 negar_gui/mwin.ui -xo negar_gui/Ui_mwin.py
pyuic6 negar_gui/uwin.ui -xo negar_gui/Ui_uwin.py
pyuic6 negar_gui/hwin.ui -xo negar_gui/Ui_hwin.py
sres: ver
pyside2-rcc negar_gui/resource.qrc -o negar_gui/resource_rc.py
sui: ver
pyside2-uic --from-imports negar_gui/mwin.ui -o negar_gui/Ui_mwin.py
pyside2-uic --from-imports negar_gui/uwin.ui -o negar_gui/Ui_uwin.py
strans: ver
pyside2-lupdate -verbose negar_gui/Ui_mwin.py -ts negar_gui/ts/fa-uimwin.ts
pyside2-lupdate -verbose negar_gui/Ui_uwin.py -ts negar_gui/ts/fa-uiuwin.ts
pyside2-lupdate -verbose negar_gui/main.py -ts negar_gui/ts/fa-main.ts
pyside2-lrelease negar_gui/ts/fa-*.ts -qm negar_gui/ts/fa.qm
clean: ver
@rm negar_gui.egg-info/ -rfv
@rm build/ -rfv
@rm dist/ -rfv
@rm gui.build/ -rfv
@rm gui.dist/ -rfv
@rm negar*.spec -rfv
@rm negar_gui/__pycache__ -rfv