Skip to content

Commit

Permalink
adding ubuntu bundle tools
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassner committed Oct 6, 2013
1 parent 690279b commit 7bc75e4
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 16 deletions.
25 changes: 25 additions & 0 deletions deploy/finalize_bundle_ubuntu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import sys,os
import write_version_file
import shutil

distribtution_dir = 'dist'
pupil_capture_dir = os.path.join(distribtution_dir, 'pupil_capture')
pupil_capture_exc = os.path.join(pupil_capture_dir,'pupil_capture')
v4l2_exc = os.path.join(pupil_capture_dir,'v4l2-ctl')


os.chmod(pupil_capture_exc,0775)
os.chmod(v4l2_exc,0775)
print "gave pupil_capture and v4l2 excecutables proper rights"

shutil.copy('make_shortcut.sh',os.path.join(distribtution_dir,'make_shortcut.sh'))
print "copied a small script that creates a shortcut for the user into distribtution_dir"
os.chmod(os.path.join(distribtution_dir,'make_shortcut.sh'),0775)
print "gave that file excetion rights"

print "starting version stript:"
write_version_file.main(pupil_capture_dir)
print "created version file in dist folder"



Binary file added deploy/linux_icon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions deploy/make_shortcut.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo $BASEDIR

TEXT="
[Desktop Entry]\n
Version=1.0\n
Name=Pupil Capture\n
Comment=Pupil Capture Software\n
Exec= ${BASEDIR}/pupil_capture/pupil_capture\n
Icon= ${BASEDIR}/pupil_capture/icon.ico\n
Terminal=true\n
Type=Application\n
Categories=Application;"


echo $TEXT > pupil_capture.desktop
chmod 775 pupil_capture.desktop
1 change: 1 addition & 0 deletions deploy/ubuntu_x64.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coll = COLLECT(exe,
[('libAntTweakBar.so', '/usr/lib/libAntTweakBar.so','BINARY')],
[('libglfw.so', '/usr/local/lib/libglfw.so','BINARY')],
[('v4l2-ctl', '/usr/bin/v4l2-ctl','BINARY')],
[('icon.ico', 'linux_icon.ico','DATA')],
strip=None,
upx=True,
name='pupil_capture')
39 changes: 23 additions & 16 deletions deploy/write_version_file.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
import os,sys

modules_path = os.path.join(os.path.abspath(__file__).rsplit(os.path.sep,2)[0],'pupil_src','shared_modules')
sys.path.append(modules_path)
print modules_path
from git_version import get_tag_commit
def main(target_dir):
modules_path = os.path.join(os.path.abspath(__file__).rsplit(os.path.sep,2)[0],'pupil_src','shared_modules')
sys.path.append(modules_path)
from git_version import get_tag_commit

version = get_tag_commit()
print "Current version of Pupil: ",version
version = get_tag_commit()
print "Current version of Pupil: ",version

with open("dist/pupil_capture/_version_string_",'w') as f:
f.write(version)
print 'Wrote version into: "dist/pupil_capture/_version_string_" '

try:
with open("dist/pupil_capture.app/_version_string_",'w') as f:
with open(os.path.join(target_dir,'_version_string_'),'w') as f:
f.write(version)
print 'Wrote version into: "dist/pupil_capture.app/_version_string_" '
except:
print"I guess you are not bundling a macos app."
print 'Wrote version into: %s' %os.path.join(target_dir,'_version_string_')

try:
with open(os.path.join(target_dir+'.app','_version_string_'),'w') as f:
f.write(version)
print 'Wrote version into: %s '%os.path.join(target_dir+'.app','_version_string_')
except:
print"You are not bundling a macos app,did not write into the .app bundle"

def get_version():
modules_path = os.path.join(os.path.abspath(__file__).rsplit(os.path.sep,2)[0],'pupil_src','shared_modules')
sys.path.append(modules_path)
from git_version import get_tag_commit
return get_tag_commit()

print "done"
if __name__ == '__main__':
main("dist/pupil_capture")

0 comments on commit 7bc75e4

Please sign in to comment.