From 490398feb91209ed3fceee6e8eeb1d109e54dc4a Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Fri, 20 Jan 2012 14:28:24 -0500 Subject: [PATCH] Now builds on Linux --- README_INSTALL.txt | 18 +++++++++++++++++- control | 9 +++++++++ lightningbeam | 3 +++ lightningbeam.desktop | 8 ++++++++ lightningbeam.py | 10 ++++++++-- mkdebian | 30 ++++++++++++++++++++++++++++++ postinst | 3 +++ postrm | 2 ++ preinst | 2 ++ prerm | 2 ++ svlgui.py | 18 ++++++++++++------ 11 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 control create mode 100755 lightningbeam create mode 100644 lightningbeam.desktop create mode 100755 mkdebian create mode 100755 postinst create mode 100755 postrm create mode 100755 preinst create mode 100755 prerm diff --git a/README_INSTALL.txt b/README_INSTALL.txt index 2f895d2..a7eb1f6 100644 --- a/README_INSTALL.txt +++ b/README_INSTALL.txt @@ -5,4 +5,20 @@ Building on Windows: c:\Python27\python.exe setup.py py2exe 2. Copy the GUI folder from the root directory into dist\. 3. The executable is in dist\lightningbeam.exe. You probably do need most if the DLL's, I haven't - gone through them yet. \ No newline at end of file + gone through them yet. + +Building on Ubuntu/Debian: + 1. In a terminal, type: + ./mkdebian + cd debian + dpkg --build lightningbeam ./ + 2. Now there is a package, which can be installed however. + 3. To create a RPM package: + sudo apt-get install alien + alien -r lightningbeam.deb + 4. To create a Slackware TGZ package: + alien -t lightningbeam.deb +Building on Mac OSX: + 1. In a terminal, type: + /usr/bin/python setup.py py2app + 2. This will create an .app package. diff --git a/control b/control new file mode 100644 index 0000000..003dba7 --- /dev/null +++ b/control @@ -0,0 +1,9 @@ +Package: lightningbeam +Version: 1.0.0-alpha2 +Section: graphics +Priority: optional +Architecture: any +Installed-size: 27000 +Depends: bash, python +Maintainer: skycooler@gmail.com +Description: Lightningbeam is an open-source animated content creation tool. diff --git a/lightningbeam b/lightningbeam new file mode 100755 index 0000000..90a2fb9 --- /dev/null +++ b/lightningbeam @@ -0,0 +1,3 @@ +#! /bin/bash + +/usr/bin/env python /usr/share/lightningbeam/lightningbeam.py diff --git a/lightningbeam.desktop b/lightningbeam.desktop new file mode 100644 index 0000000..83eb90b --- /dev/null +++ b/lightningbeam.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Version=1.0.0-alpha2 +Name=Lightningbeam +Exec=/usr/bin/lightningbeam +Icon=lightningbeam +Terminal=false +Categories=Graphics diff --git a/lightningbeam.py b/lightningbeam.py index d7dbeae..e331954 100755 --- a/lightningbeam.py +++ b/lightningbeam.py @@ -26,6 +26,12 @@ import webbrowser #misc_funcs - miscelleneous functions in a separate file so as not to clutter things up too much import misc_funcs +#If we can import this, we are in the install directory. Mangle media paths accordingly. +try: + from distpath import media_path +except: + media_path = "" + #specify the current version and what version files it can still open LIGHTNINGBEAM_VERSION = "1.0-alpha1" LIGHTNINGBEAM_COMPAT = ["1.0-alpha1"] @@ -326,7 +332,7 @@ elif svlgui.SYSTEM=="android": MainWindow.stage.add(root, 0,0) svlgui.FOCUS = MainWindow.stage layers = svlgui.Group(skipl=True) -b = svlgui.Image("media/object_active.png",0,0,True,MainWindow.layerbox,16,1,True) +b = svlgui.Image(media_path+"media/object_active.png",0,0,True,MainWindow.layerbox,16,1,True) layers.add(b) MainWindow.layerbox.add(layers,0,0) @@ -415,7 +421,7 @@ def add_keyframe(widget=None): MainWindow.timelinebox.draw() def add_layer(widget=None): root.descendItem().add_layer(root.descendItem()._al) - layers.add(svlgui.Image("media/object_active.png",0,root.descendItem().layers.index(root.descendItem().activelayer)*32,True,MainWindow.layerbox,16,1,True)) + layers.add(svlgui.Image(media_path+"media/object_active.png",0,root.descendItem().layers.index(root.descendItem().activelayer)*32,True,MainWindow.layerbox,16,1,True)) print root.descendItem().layers.index(root.descendItem().activelayer)*32 #MainWindow.layerbox.draw() def delete_layer(widget=None): diff --git a/mkdebian b/mkdebian new file mode 100755 index 0000000..f4efdd8 --- /dev/null +++ b/mkdebian @@ -0,0 +1,30 @@ +#! /bin/bash + +mkdir -p debian/lightningbeam/usr/bin +mkdir -p debian/lightningbeam/usr/share/lightningbeam +mkdir -p debian/lightningbeam/usr/share/applications +mkdir -p debian/lightningbeam/usr/share/icons +mkdir -p debian/lightningbeam/DEBIAN + +cp lightningbeam debian/lightningbeam/usr/bin/ +cp lightningbeam.py debian/lightningbeam/usr/share/lightningbeam/ +cp svlgui.py debian/lightningbeam/usr/share/lightningbeam/ +cp misc_funcs.py debian/lightningbeam/usr/share/lightningbeam/ +cp lightningbeam_windows.py debian/lightningbeam/usr/share/lightningbeam/ +cp colors.py debian/lightningbeam/usr/share/lightningbeam/ +cp gpl.txt debian/lightningbeam/usr/share/lightningbeam/ +cp -r swfc debian/lightningbeam/usr/share/lightningbeam/ +cp -r GUI debian/lightningbeam/usr/share/lightningbeam/ +cp -r media debian/lightningbeam/usr/share/lightningbeam/ + +cp lightningbeam.desktop debian/lightningbeam/usr/share/applications/ + +cp media/icon_128.png debian/lightningbeam/usr/share/icons/lightningbeam.png + +cp control debian/lightningbeam/DEBIAN/ +cp postrm debian/lightningbeam/DEBIAN/ +cp preinst debian/lightningbeam/DEBIAN/ +cp postinst debian/lightningbeam/DEBIAN/ +cp prerm debian/lightningbeam/DEBIAN/ + +echo 'media_path = "/usr/share/lightningbeam/"' > debian/lightningbeam/usr/share/lightningbeam/distpath.py diff --git a/postinst b/postinst new file mode 100755 index 0000000..5d899bd --- /dev/null +++ b/postinst @@ -0,0 +1,3 @@ +#! /bin/bash + + diff --git a/postrm b/postrm new file mode 100755 index 0000000..05a7907 --- /dev/null +++ b/postrm @@ -0,0 +1,2 @@ +#!/bin/bash + diff --git a/preinst b/preinst new file mode 100755 index 0000000..f682536 --- /dev/null +++ b/preinst @@ -0,0 +1,2 @@ +#! /bin/bash + diff --git a/prerm b/prerm new file mode 100755 index 0000000..05a7907 --- /dev/null +++ b/prerm @@ -0,0 +1,2 @@ +#!/bin/bash + diff --git a/svlgui.py b/svlgui.py index 2720681..9759945 100644 --- a/svlgui.py +++ b/svlgui.py @@ -167,6 +167,12 @@ if sys.platform=="linux2": from GUI.StdButtons import DefaultButton, CancelButton from GUI.Files import FileType from GUI.Geometry import offset_rect, rect_sized + + #If we can import this, we are in the install directory. Mangle media paths accordingly. + try: + from distpath import media_path + except: + media_path = "" #app = GUI.application() SYSTEM="osx" TEMPDIR = "/tmp" @@ -2140,7 +2146,7 @@ class OverlayWindow: # Clear background to transparent black cr.set_source_rgba(0.0,0.0,0.0,2.0-(time.time()-startime)) cr.paint() - image = "media/logo-transparent.png" + image = media_path+"media/logo-transparent.png" surface = cairo.ImageSurface.create_from_png(image) pat = cairo.SurfacePattern(surface) cr.set_source(pat) @@ -2233,7 +2239,7 @@ class ColorSelectionWindow: pass group._onMouseMove = dummy canvas.add(group,0,0) - im = Image("media/colors.png",skipl=True) + im = Image(media_path+"media/colors.png",skipl=True) group.add(im) group.window = win group.canvas = canvas @@ -2379,10 +2385,10 @@ class FramesCanvas(Canvas): if SYSTEM == 'osx': self.canvas.draw = self._draw self.canvas.mouse_down = self.mouse_down - self.ackfr = GUI.Image(file = "media/keyframe_active.png") - self.inackfr = GUI.Image(file = "media/keyframe_inactive.png") - self.acfr = GUI.Image(file = "media/frame_active_tween.png") - self.inacfr = GUI.Image(file = "media/frame_inactive_tween.png") + self.ackfr = GUI.Image(file = media_path+"media/keyframe_active.png") + self.inackfr = GUI.Image(file = media_path+"media/keyframe_inactive.png") + self.acfr = GUI.Image(file = media_path+"media/frame_active_tween.png") + self.inacfr = GUI.Image(file = media_path+"media/frame_inactive_tween.png") def _draw(self,cr,update_rect): for k in xrange(len(self.root.descendItem().layers)): FRAMES = self.root.descendItem().layers[k].frames