mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-02 14:36:15 -04:00
Ripping out dmg code, replacing pyinstaller with py2app for OSX -- still in progress (#151)
This commit is contained in:
parent
aae9995c5f
commit
a86cda4549
11 changed files with 105 additions and 175 deletions
|
@ -1,61 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
||||
DMG_DIR=$ROOT/dist/dmg
|
||||
DMG_TMP_NAME=$ROOT/dist/tmp.dmg
|
||||
DMG_NAME=$ROOT/dist/OnionShare.dmg
|
||||
TITLE=OnionShare
|
||||
VOLUME=/Volumes/$TITLE
|
||||
|
||||
cd $ROOT
|
||||
|
||||
# deleting dist
|
||||
echo Deleting dist folder
|
||||
rm -rf $ROOT/dist &>/dev/null 2>&1
|
||||
|
||||
# build the .app
|
||||
echo Building OnionShare.app
|
||||
pyinstaller -w -y $ROOT/install/onionshare-osx.spec
|
||||
|
||||
# create the .dmg
|
||||
echo Creating DMG
|
||||
mkdir -p $DMG_DIR
|
||||
hdiutil create -srcfolder $DMG_DIR -volname $TITLE -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW -size 100mb $DMG_TMP_NAME
|
||||
DEVICE=$(hdiutil attach -readwrite -noverify -noautoopen $DMG_TMP_NAME | egrep '^/dev/' | sed 1q | awk '{print $1}')
|
||||
sleep 10
|
||||
|
||||
# set up the dmg
|
||||
echo Setting up DMG
|
||||
cp -r $ROOT/dist/OnionShare.app $VOLUME
|
||||
ln -s /Applications $VOLUME/Applications
|
||||
mkdir $VOLUME/.background
|
||||
cp $ROOT/install/dmg_background.png $VOLUME/.background/background.png
|
||||
echo '
|
||||
tell application "Finder"
|
||||
tell disk "'${TITLE}'"
|
||||
open
|
||||
set current view of container window to icon view
|
||||
set toolbar visible of container window to false
|
||||
set statusbar visible of container window to false
|
||||
set the bounds of container window to {100, 100, 400, 480}
|
||||
set theViewOptions to the icon view options of container window
|
||||
set arrangement of theViewOptions to not arranged
|
||||
set icon size of theViewOptions to 72
|
||||
set background picture of theViewOptions to file ".background:background.png"
|
||||
set position of item "'${TITLE}.app'" of container window to {60, 288}
|
||||
set position of item "Applications" of container window to {268, 288}
|
||||
update without registering applications
|
||||
delay 10
|
||||
eject
|
||||
end tell
|
||||
end tell
|
||||
' | osascript
|
||||
|
||||
# finalize the DMG
|
||||
echo Finalizing DMG
|
||||
hdiutil convert $DMG_TMP_NAME -format UDZO -imagekey zlib-level=9 -o $DMG_NAME
|
||||
rm -r $DMG_DIR
|
||||
rm -f $DMG_TMP_NAME
|
||||
|
||||
# all done
|
||||
echo DMG created: $DMG_NAME
|
14
install/build_osx.sh
Executable file
14
install/build_osx.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
|
||||
cd $ROOT
|
||||
|
||||
# deleting dist
|
||||
echo Deleting dist folder
|
||||
rm -rf $ROOT/dist &>/dev/null 2>&1
|
||||
|
||||
# build the .app
|
||||
echo Building OnionShare.app
|
||||
python setup.py py2app
|
||||
|
||||
# codesign the .app
|
Binary file not shown.
Before Width: | Height: | Size: 157 KiB |
|
@ -1,52 +0,0 @@
|
|||
# -*- mode: python -*-
|
||||
a = Analysis(['install/onionshare-launcher.py'],
|
||||
pathex=['.'],
|
||||
hiddenimports=['onionshare', 'onionshare_gui'],
|
||||
hookspath=None,
|
||||
runtime_hooks=None)
|
||||
a.datas += [
|
||||
('onionshare/index.html', 'onionshare/index.html', 'DATA'),
|
||||
('onionshare/404.html', 'onionshare/404.html', 'DATA'),
|
||||
('images/logo.png', 'images/logo.png', 'DATA'),
|
||||
('images/drop_files.png', 'images/drop_files.png', 'DATA'),
|
||||
('images/server_stopped.png', 'images/server_stopped.png', 'DATA'),
|
||||
('images/server_started.png', 'images/server_started.png', 'DATA'),
|
||||
('images/server_working.png', 'images/server_working.png', 'DATA'),
|
||||
('locale/de.json', 'locale/de.json', 'DATA'),
|
||||
('locale/en.json', 'locale/en.json', 'DATA'),
|
||||
('locale/es.json', 'locale/es.json', 'DATA'),
|
||||
('locale/fi.json', 'locale/fi.json', 'DATA'),
|
||||
('locale/fr.json', 'locale/fr.json', 'DATA'),
|
||||
('locale/it.json', 'locale/it.json', 'DATA'),
|
||||
('locale/nl.json', 'locale/nl.json', 'DATA'),
|
||||
('locale/no.json', 'locale/no.json', 'DATA'),
|
||||
('locale/pt.json', 'locale/pt.json', 'DATA'),
|
||||
('locale/ru.json', 'locale/ru.json', 'DATA'),
|
||||
('locale/tr.json', 'locale/tr.json', 'DATA'),
|
||||
]
|
||||
pyz = PYZ(a.pure)
|
||||
exe = EXE(pyz,
|
||||
a.scripts,
|
||||
exclude_binaries=True,
|
||||
name='onionshare-launcher',
|
||||
debug=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
console=False )
|
||||
coll = COLLECT(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='onionshare')
|
||||
app = BUNDLE(exe,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
strip=False,
|
||||
upx=True,
|
||||
name='OnionShare.app',
|
||||
appname='OnionShare',
|
||||
icon='install/onionshare.icns',
|
||||
version=open('version').read().strip())
|
Loading…
Add table
Add a link
Reference in a new issue