From 5e9e73cd0e817eefda1604adf5577489c095bd74 Mon Sep 17 00:00:00 2001 From: knotteye Date: Sat, 17 Apr 2021 10:40:06 -0500 Subject: [PATCH] Make windows happy Switch to nuitka3 for all platforms --- .gitignore | 3 +-- Makefile | 4 ++-- installer.cfg | 26 -------------------------- monkeypatch.py | 9 +-------- plchat.py | 9 +++------ 5 files changed, 7 insertions(+), 44 deletions(-) delete mode 100644 installer.cfg diff --git a/.gitignore b/.gitignore index 326263f..8febc9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ __pycache__ plchat.build -dist -build \ No newline at end of file +dist \ No newline at end of file diff --git a/Makefile b/Makefile index 04d1acb..b07b355 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ ifeq ($(PREFIX),) PREFIX := /usr/local endif -PRODUCTVER=0001 +PRODUCTVER=0100 all: default pack @@ -11,7 +11,7 @@ fresh: clean default pack systemlibs: systemlibtarget pack default: - nuitka3 --follow-imports --nofollow-import-to=PyQt5 --nofollow-import-to=PySide --nofollow-import-to=PyQt4 --nofollow-import-to=PySide2 --windows-disable-console --windows-icon-from-ico=fedi.ico --windows-company-name=plchat --windows-product-name=plchat --windows-product-version=$(PRODUCTVER) --python-flag=-O -o plchat plchat.py + nuitka3 --follow-imports --windows-disable-console --windows-icon-from-ico=fedi.ico --windows-company-name=plchat --windows-product-name=plchat --windows-product-version=$(PRODUCTVER) --python-flag=-O -o plchat plchat.py systemlibtarget: nuitka3 --nofollow-imports --follow-import=misc --follow-import=monkeypatch --follow-import=pleroma --follow-import=timeconvert --follow-import=videowidget --follow-import=audiowidget --windows-disable-console --windows-icon-from-ico=fedi.ico --windows-company-name=plchat --windows-product-name=plchat --windows-product-version=$(PRODUCTVER) --python-flag=-O -o plchat plchat.py diff --git a/installer.cfg b/installer.cfg deleted file mode 100644 index f0596de..0000000 --- a/installer.cfg +++ /dev/null @@ -1,26 +0,0 @@ -[Application] -name=PlChat -version=1.0 -entry_point=plchat:main -icon = fedi.ico - -[Python] -version=3.8.8 -bitness=64 -format=bundled - -[Include] -pypi_wheels = python-dateutil==2.8.1 - QtPy==1.9.0 - keyring==22.0.1 - PySide2==5.15.2 - appdirs==1.4.4 - python-magic==0.4.22 - python-magic-bin==0.4.14 - websockets==8.1 - -files = LICENSE - fedi.svg - send.svg - unread.svg - COPYING \ No newline at end of file diff --git a/monkeypatch.py b/monkeypatch.py index a8b5a8c..8a8c74a 100644 --- a/monkeypatch.py +++ b/monkeypatch.py @@ -28,16 +28,9 @@ import os, time, platform from ctypes import cdll, util -#try: -# if os.name == 'posix': -# libc = cdll.LoadLibrary("libc.so.6") -# elif os.name == 'nt': -# libc = cdll.kernel32 -#except: -# libc = None try: if platform.system() == "Windows": - libc_path = util.find_library("msvcrt") + libc_path = "kernel32" else: libc_path = util.find_library("c") libc = cdll.LoadLibrary(libc_path) diff --git a/plchat.py b/plchat.py index a343db1..145883a 100644 --- a/plchat.py +++ b/plchat.py @@ -51,7 +51,7 @@ STATIC_PREF = '' ICON_PATH = 'fedi.svg' class App(QMainWindow): - settings = QSettings() + settings = QSettings(APPDATA+"/settings.ini") _eventloop = asyncio.new_event_loop() accts = {} @@ -1442,7 +1442,7 @@ def updateAnimationPref(): else: STATIC_PREF = 'static_' -def main(): +if __name__ == '__main__': _mkdir(CACHE+'/img/') _mkdir(CACHE+'/vid/') _mkdir(CACHE+'/audio/') @@ -1451,7 +1451,4 @@ def main(): app.setOrganizationName("plchat") app.setApplicationName("plchat") ex = App(app.processEvents) - sys.exit(ex._eventloop.run_forever()) - -if __name__ == '__main__': - main() \ No newline at end of file + sys.exit(ex._eventloop.run_forever()) \ No newline at end of file