diff --git a/deploy/finalize_bundle_ubuntu.py b/deploy/finalize_bundle_ubuntu.py new file mode 100644 index 0000000000..5a47c9bf85 --- /dev/null +++ b/deploy/finalize_bundle_ubuntu.py @@ -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" + + + diff --git a/deploy/linux_icon.ico b/deploy/linux_icon.ico new file mode 100644 index 0000000000..36fa4fc639 Binary files /dev/null and b/deploy/linux_icon.ico differ diff --git a/deploy/make_shortcut.sh b/deploy/make_shortcut.sh new file mode 100755 index 0000000000..2dca91c00d --- /dev/null +++ b/deploy/make_shortcut.sh @@ -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 \ No newline at end of file diff --git a/deploy/ubuntu_x64.spec b/deploy/ubuntu_x64.spec index 93beae193c..ba8d343e42 100644 --- a/deploy/ubuntu_x64.spec +++ b/deploy/ubuntu_x64.spec @@ -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') diff --git a/deploy/write_version_file.py b/deploy/write_version_file.py index 7d746d629a..3c48f4794d 100644 --- a/deploy/write_version_file.py +++ b/deploy/write_version_file.py @@ -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" \ No newline at end of file +if __name__ == '__main__': + main("dist/pupil_capture") \ No newline at end of file