build: Copy images to lib/%APP/ during build

From here, I can copy the entire directory when I choose to install.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-06-02 10:17:22 -04:00
parent e23ecd4bfb
commit dcaeb8cbd1
2 changed files with 23 additions and 2 deletions

View File

@ -44,8 +44,8 @@ def symlink(target, source, env):
SConscript(['include/Sconscript'])
ocarina = env.Program('bin/ocarina-player', directory(["libsaria", "ocarina"]))
oc_link = env.Command("ocarina.bin", "bin/ocarina-player", symlink)
oc_scripts = app_directory("ocarina", ["scripts"])
Default([ocarina, oc_link, oc_scripts])
oc_other = app_directory("ocarina", ["scripts", "images"])
Default([ocarina, oc_link, oc_other])
# Install Ocarina
scripts = os.listdir("scripts/")

21
images/Sconscript Normal file
View File

@ -0,0 +1,21 @@
#!/usr/bin/python
import shutil
from config import *
lib = "../lib/" + application + "/%s"
def copy_image(target, source, env):
dst = str(target[0].rfile())
src = str(source[0].rfile())
shutil.copy(src, dst)
images = []
if application == "ocarina":
images = ["ocarina.png", "ocarina512.png"]
files = []
for image in images:
dst = lib % image
files.append(env.Command(dst, image, copy_image))
Return('files')