From 3ea7529c14c73f015807643c2d979fda4a3335d0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 26 Nov 2013 21:54:48 -0500 Subject: fix broken situation with respect to taglib on windows where we used to use symlinks to fix up taglib's insane header/directory structure Symlinks don't work correctly with git on windows, so instead we now copy the required "public" headers into the build tree as part of the build. Works on Linux. --- libs/taglib/wscript | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) (limited to 'libs/taglib/wscript') diff --git a/libs/taglib/wscript b/libs/taglib/wscript index 8c1f1fdd1e..219cbd3f08 100644 --- a/libs/taglib/wscript +++ b/libs/taglib/wscript @@ -34,6 +34,79 @@ def build(bld): if bld.is_defined('USE_EXTERNAL_LIBS'): return + # the story: taglib distributes its headers all over the place then copies them + # into place during an install. but we're not planning to do an install. so this + # doesn't work when code does #include . + # + # one approach is to store symlinks in the repository. but this breaks on windows + # where symlink support and git are not very well developed (if at all) + # + # the approach here is to copy the header files as part of the build step, if necessary + + headers = [ + './ape/apefooter.h', + './ape/apeitem.h', + './ape/apetag.h', + './mpeg/id3v2/frames/attachedpictureframe.h', + './mpeg/id3v2/frames/commentsframe.h', + './flac/flacfile.h', + './flac/flacproperties.h', + './mpeg/id3v2/frames/generalencapsulatedobjectframe.h', + './mpeg/id3v1/id3v1genres.h', + './mpeg/id3v1/id3v1tag.h', + './mpeg/id3v2/id3v2extendedheader.h', + './mpeg/id3v2/id3v2footer.h', + './mpeg/id3v2/id3v2framefactory.h', + './mpeg/id3v2/id3v2frame.h', + './mpeg/id3v2/id3v2header.h', + './mpeg/id3v2/id3v2synchdata.h', + './mpeg/id3v2/id3v2tag.h', + './mpc/mpcfile.h', + './mpc/mpcproperties.h', + './mpeg/mpegfile.h', + './mpeg/mpegheader.h', + './mpeg/mpegproperties.h', + './ogg/oggfile.h', + './ogg/flac/oggflacfile.h', + './ogg/oggpage.h', + './ogg/oggpageheader.h', + './mpeg/id3v2/frames/relativevolumeframe.h', + './ogg/speex/speexfile.h', + './ogg/speex/speexproperties.h', + './toolkit/taglib.h', + './toolkit/tbytevector.h', + './toolkit/tbytevectorlist.h', + './toolkit/tdebug.h', + './mpeg/id3v2/frames/textidentificationframe.h', + './toolkit/tfile.h', + './toolkit/tlist.h', + 'toolkit/tlist.tcc', + './toolkit/tmap.h', + 'toolkit/tmap.tcc', + './trueaudio/trueaudiofile.h', + './trueaudio/trueaudioproperties.h', + './toolkit/tstring.h', + './toolkit/tstringlist.h', + './toolkit/unicode.h', + './mpeg/id3v2/frames/uniquefileidentifierframe.h', + './mpeg/id3v2/frames/unknownframe.h', + './mpeg/id3v2/frames/unsynchronizedlyricsframe.h', + './mpeg/id3v2/frames/urllinkframe.h', + './ogg/vorbis/vorbisfile.h', + './ogg/vorbis/vorbisproperties.h', + './wavpack/wavpackfile.h', + './wavpack/wavpackproperties.h', + './mpeg/xingheader.h', + './ogg/xiphcomment.h', + ] + + 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}", + source = bld.path.make_node (os.path.join ('taglib', h)), + target = tgt) + # Library obj = bld(features = 'cxx cxxshlib') sources = bld.path.ant_glob('taglib/*.cpp') @@ -69,7 +142,7 @@ def build(bld): taglib/ogg/speex taglib/ogg/flac '''.split() - obj.export_includes = ['.', 'taglib', 'taglib/toolkit'] + obj.export_includes = ['.', 'taglib' ] obj.includes = include_dirs obj.defines = ['MAKE_TAGLIB_LIB'] obj.name = 'libtaglib' -- cgit v1.2.3 From 94993816cc5da618d3bab4fa9eb145db575ba1b1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 19 Dec 2013 12:55:52 -0500 Subject: move portable copyfile function into tools/autowaf.py and use it in both gtk2_ardour and taglib --- gtk2_ardour/wscript | 7 +------ libs/taglib/wscript | 2 +- tools/autowaf.py | 7 +++++++ waf | Bin 94823 -> 94861 bytes 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'libs/taglib/wscript') diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index cd606029eb..f5ff15e9c6 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -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 diff --git a/libs/taglib/wscript b/libs/taglib/wscript index 219cbd3f08..709eb0fd90 100644 --- a/libs/taglib/wscript +++ b/libs/taglib/wscript @@ -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) diff --git a/tools/autowaf.py b/tools/autowaf.py index 46c563519f..7d4da7b061 100644 --- a/tools/autowaf.py +++ b/tools/autowaf.py @@ -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 diff --git a/waf b/waf index 927b8ae126..c29d226aff 100755 Binary files a/waf and b/waf differ -- cgit v1.2.3