move portable copyfile function into tools/autowaf.py and use it in both gtk2_ardour and taglib

This commit is contained in:
Paul Davis 2013-12-19 12:55:52 -05:00
parent 298768fb73
commit 94993816cc
4 changed files with 9 additions and 7 deletions

View File

@ -365,11 +365,6 @@ def build_color_scheme(path, prefix):
f.close()
return color_scheme
def copyfile (task):
src = task.inputs[0].abspath()
tgt = task.outputs[0].abspath()
shutil.copy2 (src, tgt)
def build(bld):
VERSION = "%s.%s" % (bld.env['MAJOR'], bld.env['MINOR'])
@ -644,7 +639,7 @@ def build(bld):
obj.install_path = None
set_subst_dict(obj, light_rc_subst_dict)
obj = bld(rule = copyfile)
obj = bld(rule = autowaf.copyfile)
obj.source = [ 'ardour3_widget_list.rc' ]
obj.target = 'ardour3_widgets.rc'
obj.install_path = None

View File

@ -103,7 +103,7 @@ def build(bld):
for h in headers:
tgt = bld.path.get_bld().make_node (os.path.join ('taglib', os.path.basename (h)))
if not os.path.exists (tgt.bldpath()):
bld (rule = "cp ${SRC} ${TGT}",
bld (rule = autowaf.copyfile,
source = bld.path.make_node (os.path.join ('taglib', h)),
target = tgt)

View File

@ -10,6 +10,7 @@ import glob
import os
import subprocess
import sys
import shutil
from waflib import Configure, Context, Logs, Node, Options, Task, Utils
from waflib.TaskGen import feature, before, after
@ -91,6 +92,12 @@ def set_options(opt, debug_by_default=False):
help="LV2 bundles [Default: LIBDIR/lv2]")
g_step = 1
def copyfile (task):
# a cross-platform utility for copying files as part of tasks
src = task.inputs[0].abspath()
tgt = task.outputs[0].abspath()
shutil.copy2 (src, tgt)
def check_header(conf, lang, name, define='', mandatory=True):
"Check for a header"
includes = '' # search default system include paths

BIN
waf vendored

Binary file not shown.