Skip to content

Commit

Permalink
Added deployment for Mac OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu committed May 19, 2012
1 parent 452acc0 commit f78b989
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -27,3 +27,6 @@ pip-log.txt
.mr.developer.cfg

.DS_Store

*.log
*.spec
35 changes: 33 additions & 2 deletions Makefile
Expand Up @@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.

APP_NAME = $(shell python tikz_editor/globals APPLICATION_NAME)
APP_VERSION = $(shell python tikz_editor/globals VERSION)
PYRCC = pyrcc4
DEPLOY_DIR = $(shell pwd)/deployment

Expand All @@ -21,6 +23,7 @@ all:
@echo " install: Run the Python installation script"
@echo " clean: Remove temporary build files"
@echo " resources: (dev) Build the PyQt resources module (dep. pyrcc4)"
@echo " app: (dev) Build a Mac OS X APP bundle (dep. pyinstaller)"
@echo " deb: (dev) Build an Ubuntu DEB package (dep. dh_make, debuild)"


Expand Down Expand Up @@ -49,7 +52,7 @@ deb: clean_deb
DEBFULLNAME="$(shell python tikz_editor/globals MAINTAINER)" \
dh_make -s -n -r cdbs -c gpl2 \
-e "$(shell python tikz_editor/globals EMAIL)" \
-p "tikz-editor_$(shell python tikz_editor/globals VERSION)" \
-p "tikz-editor_$(APP_VERSION)" \
-t $(DEPLOY_DIR)/deb

rm -rf debian/*.ex
Expand All @@ -58,6 +61,28 @@ deb: clean_deb
debuild -us -uc


# 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

open dist
endif


#####################
# Cleaning commands #
#####################
Expand All @@ -73,4 +98,10 @@ clean_deb:
rm -rf build
rm -rf .pc

clean: clean_setup clean_deb
clean_app:
rm -rf build
rm -rf dist
rm -f *.log
rm -f *.spec

clean: clean_setup clean_deb clean_app
File renamed without changes.

0 comments on commit f78b989

Please sign in to comment.