Skip to content

Commit 265fdd0

Browse files
committed
Merge pull request #6 from bweir/master
Added Mac target
2 parents 884eab5 + c1113b3 commit 265fdd0

File tree

21 files changed

+195
-43
lines changed

21 files changed

+195
-43
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ propelleride.exe
88
openspin.exe
99
p1load.exe
1010

11+
propelleride.app
12+
openspin.app
13+
p1load.app
14+
1115
staging/
1216
*.swp
1317
*.pro.user
1418
*~
1519
Makefile
1620
*.binary
21+
22+
.DS_Store
23+
.qmake.stash

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "src/openspin/OpenSpin"]
2-
path = src/openspin/OpenSpin
2+
path = src/openspin/repo
33
url = https://github.com/bweir/OpenSpin

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,19 @@ PropellerIDE has been built on Windows 7 and 8.
101101

102102
### OS X
103103

104-
*Not yet available.*
104+
Install XCode through the App Store, then install the command-line tools through the terminal.
105+
106+
```
107+
xcode-select --install
108+
```
109+
110+
Type `make mac` to create an app bundle and DMG package for distribution.
111+
112+
```
113+
make mac
114+
```
115+
116+
The Qt version used must match the XCode version. The easiest solution is to use the latest version of xcode and Qt.
105117

106118
## Credits
107119

dist/Info.plist

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>English</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>PropellerIDE</string>
9+
<key>CFBundleExecutable</key>
10+
<string>PropellerIDE</string>
11+
<key>CFBundleIconFile</key>
12+
<string>propelleride.icns</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>com.parallax.PropellerIDE</string>
15+
<key>CFBundleInfoDictionaryVersion</key>
16+
<string>6.0</string>
17+
<key>CFBundleName</key>
18+
<string>PropellerIDE</string>
19+
<key>CFBundlePackageType</key>
20+
<string>APPL</string>
21+
<key>CFBundleShortVersionString</key>
22+
<string>0.20</string>
23+
<key>CFBundleVersion</key>
24+
<string>1</string>
25+
<key>LSApplicationCategoryType</key>
26+
<string>public.app-category.developer-tools</string>
27+
<key>LSMinimumSystemVersion</key>
28+
<string>10.7</string>
29+
<key>NSHumanReadableCopyright</key>
30+
<string>Copyright © 2014, Parallax Inc. PropellerIDE is released under the GPLv3 license.</string>
31+
<key>NSPrincipalClass</key>
32+
<string>NSApplication</string>
33+
<key>NSSupportsSuddenTermination</key>
34+
<string>YES</string>
35+
</dict>
36+
</plist>

dist/dmg.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
source="$1"
4+
title="$2"
5+
target="$3"
6+
size=$(echo "$((`du -s ${source} | awk '{print $1}'`+1000))")
7+
echo ${size}
8+
9+
tmpdevice="$(dirname ${source})/pack.temp.dmg"
10+
11+
hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ \
12+
-fsargs "-c c=64,a=16,e=16" -format UDRW -size ${size}k ${tmpdevice}
13+
14+
device=$(hdiutil attach -readwrite -noverify -noautoopen "${tmpdevice}" | \
15+
egrep '^/dev/' | sed 1q | awk '{print $1}')
16+
17+
background="newspin.png"
18+
applicationName="PropellerIDE.app"
19+
20+
VOLUME_DIR="/Volumes/${title}/.background/"
21+
mkdir "${VOLUME_DIR}"
22+
cp -f dist/${background} "${VOLUME_DIR}"
23+
24+
echo '
25+
tell application "Finder"
26+
tell disk "'${title}'"
27+
open
28+
set current view of container window to icon view
29+
set toolbar visible of container window to false
30+
set statusbar visible of container window to false
31+
set the bounds of container window to {400, 100, 900, 434}
32+
set theViewOptions to the icon view options of container window
33+
set arrangement of theViewOptions to not arranged
34+
set icon size of theViewOptions to 72
35+
set background picture of theViewOptions to file ".background:'${background}'"
36+
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
37+
set position of item "'${applicationName}'" of container window to {105, 180}
38+
set position of item "Applications" of container window to {395, 180}
39+
update without registering applications
40+
delay 5
41+
close
42+
end tell
43+
end tell
44+
' | osascript
45+
46+
chmod -Rf go-w /Volumes/"${title}"
47+
sync
48+
sync
49+
hdiutil detach "${device}"
50+
hdiutil convert "${tmpdevice}" -format UDZO -imagekey zlib-level=9 -o "${target}"
51+
rm -f "${tmpdevice}"

dist/ftp.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
3+
import ftplib
4+
import os, sys
5+
import getpass, platform
6+
7+
filename = sys.argv[1]
8+
9+
print "Enter host:"
10+
host = raw_input()
11+
print "Enter user name:"
12+
username = raw_input()
13+
print "Enter password:"
14+
passwd = getpass.getpass()
15+
16+
ftp = ftplib.FTP(host)
17+
ftp.login(username,passwd)
18+
ftp.cwd("/public_html/downloads/"+platform.system())
19+
20+
command = 'STOR ' + filename
21+
ftp.storbinary(command, open(filename, "rb"), 1024)

dist/installer.iss

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
#define MyAppName "PropellerIDE"
55
#define MyAppURL "www.parallax.com"
66
#define MyAppExeName "propelleride.exe"
7-
#define MyAppBin "{app}"
8-
#define MyPath ".."
97
;#define FtdiChipApp "CDM v2.12.00 WHQL Certified.exe"
108

11-
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12-
; ---- IMPORTANT!!! ---- Set this to your QtPath
13-
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14-
#define QtPath "C:\Qt\5.3\mingw482_32"
15-
169
[Setup]
1710
; NOTE: The value of AppId uniquely identifies this application.
1811
; Do not use the same AppId value in installers for other applications.
@@ -26,7 +19,7 @@ AppSupportURL={#MyAppURL}
2619
AppUpdatesURL={#MyAppURL}
2720
DefaultDirName={pf}\{#MyAppName}
2821
DefaultGroupName={#MyAppName}
29-
OutputDir="."
22+
OutputDir="../staging/"
3023
OutputBaseFilename=propelleride-{#MyAppVersion}-win-setup
3124
Compression=lzma/Max
3225
SolidCompression=true
@@ -36,7 +29,7 @@ UsePreviousUserInfo=no
3629
DisableDirPage=yes
3730
DisableProgramGroupPage=yes
3831
DisableReadyPage=no
39-
WizardImageFile="{#MyPath}\gfx\propellerbanner.bmp"
32+
WizardImageFile="..\gfx\propellerbanner.bmp"
4033

4134
[Languages]
4235
Name: "english"; MessagesFile: "compiler:Default.isl"
@@ -47,19 +40,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
4740
Name: FtdiChip; Description: "Install FTDI Chip USB Serial Port Drivers"; Flags: checkedonce;
4841

4942
[Files]
50-
Source: "{#MyPath}\src\propelleride\propelleride.exe"; DestDir: "{app}"; Flags: ignoreversion
51-
Source: "{#MyPath}\src\p1load\p1load.exe"; DestDir: "{app}"; Flags: ignoreversion
52-
Source: "{#MyPath}\src\OpenSpin\openspin.exe"; DestDir: "{app}"; Flags: ignoreversion
53-
Source: "{#MyPath}\gfx\propellerhat.ico"; DestDir: "{app}"; Flags: ignoreversion
54-
Source: "{#MyPath}\doc"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
55-
Source: "{#MyPath}\library"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
56-
Source: "{#MyPath}\src\prebuilt\win32\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
57-
58-
Source: "{#QtPath}\bin\Qt5Core.dll"; DestDir: "{#MyAppBin}"; Flags: ignoreversion
59-
Source: "{#QtPath}\bin\Qt5Gui.dll"; DestDir: "{#MyAppBin}"; Flags: ignoreversion
60-
Source: "{#QtPath}\bin\Qt5Widgets.dll"; DestDir: "{#MyAppBin}"; Flags: ignoreversion
61-
Source: "{#QtPath}\bin\Qt5PrintSupport.dll"; DestDir: "{#MyAppBin}"; Flags: ignoreversion
62-
Source: "{#QtPath}\plugins\platforms\qwindows.dll"; DestDir: "{#MyAppBin}\platforms"; Flags: ignoreversion
43+
Source: "../staging/propelleride/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
6344

6445
[Icons]
6546
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ; IconFilename: "{app}\propellerhat.ico";

dist/newspin.png

76.3 KB
Loading

dist/propelleride.png

19 KB
Loading

makefile

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ DIR_BUILD := $(DIR)/build
66

77
DIR_STAGING := $(DIR)/staging
88
DIR_OUT := $(DIR_STAGING)
9-
deb: DIR_OUT := $(DIR_STAGING)/usr
109

1110
DIR_DIST := $(DIR)/dist
1211

@@ -62,13 +61,26 @@ clean_staging:
6261
clean: clean_staging
6362
cd $(DIR_SRC); $(QMAKE); $(MAKE) clean
6463

64+
deb: DIR_OUT := $(DIR_STAGING)/propelleride/usr
6565
deb: clean_staging copy
66-
mkdir -p $(DIR_STAGING)/DEBIAN/ ; \
67-
cp -f $(DIR_DIST)/control $(DIR_STAGING)/DEBIAN/control ; \
66+
mkdir -p $(DIR_STAGING)/propelleride/DEBIAN/ ; \
67+
cp -f $(DIR_DIST)/control $(DIR_STAGING)/propelleride/DEBIAN/control ; \
6868
sed -e "s/VERSION/$(VERSION)/" \
6969
-e "s/CPU/$(CPU)/" \
70-
-i $(DIR_STAGING)/DEBIAN/control ; \
71-
dpkg-deb -b $(DIR_STAGING) $(DIR_DIST)/propelleride-$(VERSION)-$(CPU).deb
70+
-i $(DIR_STAGING)/propelleride/DEBIAN/control ; \
71+
dpkg-deb -b $(DIR_STAGING)/propelleride $(DIR_STAGING)/propelleride-$(VERSION)-$(CPU).deb
7272

73-
win: build
73+
74+
win: DIR_OUT := "$(DIR_STAGING)/propelleride"
75+
win: clean_staging copy
76+
cd $(DIR_OUT); \
77+
windeployqt propelleride.exe; \
7478
$(ISCC) //dMyAppVersion=$(VERSION) "$(DIR_DIST)/installer.iss"
79+
80+
81+
mac: DIR_OUT := "$(DIR_STAGING)/PropellerIDE.app/Contents"
82+
mac: clean_staging copy
83+
cd $(DIR_STAGING) ; \
84+
macdeployqt $(DIR_STAGING)/PropellerIDE.app ; \
85+
cp -f $(DIR_DIST)/Info.plist $(DIR_OUT)
86+
$(DIR_DIST)/dmg.sh $(DIR_STAGING)/PropellerIDE.app PropellerIDE $(DIR_STAGING)/propelleride-$(VERSION)-$(CPU).dmg

0 commit comments

Comments
 (0)