From 3ee15fe7b746e9d5d2832e51fea3b28fe49d3519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?--=3DFurtiF=E2=84=A2=3D--?= Date: Wed, 10 Apr 2024 03:35:04 +0200 Subject: [PATCH] add mac os app and dmg support --- ddt4all_data/mac-os/builddmg.sh | 21 ++++++++++++ ddt4all_data/mac-os/main.spec | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100755 ddt4all_data/mac-os/builddmg.sh create mode 100644 ddt4all_data/mac-os/main.spec diff --git a/ddt4all_data/mac-os/builddmg.sh b/ddt4all_data/mac-os/builddmg.sh new file mode 100755 index 0000000..b4af1ed --- /dev/null +++ b/ddt4all_data/mac-os/builddmg.sh @@ -0,0 +1,21 @@ +#!/bin/sh +pyinstaller --noconfirm main.spec +# Create a folder (named dmg) to prepare our DMG in (if it doesn't already exist). +mkdir -p dist/dmg +# Empty the dmg folder. +rm -r dist/dmg/* +# Copy the app bundle to the dmg folder. +cp -r "dist/DDT4ALL.app" dist/dmg +# If the DMG already exists, delete it. +test -f "dist/DDT4ALL.dmg" && rm "dist/DDT4ALL.dmg" +create-dmg \ + --volname "DDT4ALL" \ + --volicon "../icons/obd.icns" \ + --window-pos 200 120 \ + --window-size 600 300 \ + --icon-size 100 \ + --icon "DDT4ALL.app" 175 120 \ + --hide-extension "DDT4ALL.app" \ + --app-drop-link 425 120 \ + "dist/DDT4ALL.dmg" \ + "dist/dmg/" diff --git a/ddt4all_data/mac-os/main.spec b/ddt4all_data/mac-os/main.spec new file mode 100644 index 0000000..943438f --- /dev/null +++ b/ddt4all_data/mac-os/main.spec @@ -0,0 +1,59 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['../../main.py'], + pathex=[], + binaries=[], + datas=[ + ('../../ddt4all_data/icons', 'ddt4all_data/icons'), + ('../../ddt4all_data/locale', 'ddt4all_data/locale'), + ('../../ddt4all_data/*.json', 'ddt4all_data'), + ('../../ddt4all_data/*.qss', 'ddt4all_data'), + ('../../ddtplugins/*.py', 'ddtplugins'), + ('../../dataeditor.py', '.'), + ('../../displaymod.py', '.'), + ('../../*.py', '.'), + ##('../../ecu.zip', '.') + ], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='DDT4ALL', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='DDT4ALL', +) +app = BUNDLE( + coll, + name='DDT4ALL.app', + icon='../icons/obd.icns', + bundle_identifier='com.github.cedric.ddt4all', +)