From 7058045d3a438398a9dadddd4d5b092ecafece55 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Fri, 9 Feb 2018 22:05:21 +0100 Subject: [PATCH 1/2] Use py2app to build Mac app --- Makefile | 20 ++------------------ setup.py | 51 ++++++++++++++------------------------------------- 2 files changed, 16 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index 4175b3d..202b3ae 100644 --- a/Makefile +++ b/Makefile @@ -76,25 +76,9 @@ deb: clean_deb # Build a Mac OS X APP bundle app: clean_app -ifeq ($(PYINSTALLER),) - @echo "The path to pyinstaller is not set in PYINSTALLER.\n\ - Try:\tPYINSTALLER=\"path/to/pyinstaller\" make app" -else - python $(PYINSTALLER)/pyinstaller.py -wy \ - -n "$(APP_NAME)" \ - -i "deployment/mac/icon.icns" \ - tikz_editor.pyw - rm -rf "dist/$(APP_NAME)" - cp "deployment/mac/icon.icns" "dist/$(APP_NAME).app/Contents/Resources/icon-windowed.icns" - - ln -s /Applications dist - hdiutil create -fs HFS+ -volname "$(APP_NAME)" -srcfolder dist "dist/$(APP_NAME)-$(APP_VERSION).dmg" - #hdiutil internet-enable -yes "dist/$(APP_NAME)-$(APP_VERSION).dmg" - rm dist/Applications - + pip3 install sip PyQt5 qscintilla + python3 ./setup.py py2app open dist -endif - ##################### # Cleaning commands # diff --git a/setup.py b/setup.py index 7900ff7..6d2bc05 100755 --- a/setup.py +++ b/setup.py @@ -1,43 +1,20 @@ -#!/usr/bin/env python +""" +This is a setup.py script generated by py2applet -# Copyright 2012 (C) Mickael Menu -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . +Usage: + python setup.py py2app +""" -# automatically downloads setuptools if needed -import distribute_setup -distribute_setup.use_setuptools() +from setuptools import setup -from setuptools import setup, find_packages - -import tikz_editor.globals as globals +APP = ['tikz_editor.pyw'] +DATA_FILES = [] +OPTIONS = {'iconfile': 'deployment/mac/icon.icns'} setup( - name = globals.APPLICATION_NAME, - version = globals.VERSION, - packages = find_packages(), - include_package_data = True, - package_data = {'': ['*.png', '*.html']}, - - # metadatas - author = globals.AUTHORS, - author_email = globals.EMAIL, - description = globals.APPLICATION_DESCRIPTION, - license = "GPL v2", - keywords = "tikz code editor latex preview", - url = globals.WEBSITE, - - # auto-creates a GUI Python script to launch the application - entry_points = {'gui_scripts': ['tikz-editor = tikz_editor:start']} + name="Tikz Editor", + app=APP, + data_files=DATA_FILES, + options={'py2app': OPTIONS}, + setup_requires=['py2app'], ) From 451f5def16e32e7abe077e69eab1bc632f836e44 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Sat, 4 Aug 2018 12:56:09 +0100 Subject: [PATCH 2/2] Add requirements used by TikZ editor --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 6d2bc05..35ef5b8 100755 --- a/setup.py +++ b/setup.py @@ -17,4 +17,9 @@ data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], + install_requires=[ + "sip >= 4", + "PyQt5 >= 5.4", + "qscintilla >= 2.0", + ], )