From 1ccd84cd8cb344617eee98527588f28507a810eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carn=C3=AB=20Draug?= Date: Wed, 21 Jan 2015 17:45:51 +0000 Subject: [PATCH] x-scons: new mimetype for SCons scripts as subclass of x-python. Scons is a build-system whose recipes/build rules are python scripts. As such its files are also valid python scripts (why it is subclassing x-python). The configuration files are pretty much always named "SConstruct". In addition, "SConscript" files can also exist to extend an existing SConstruct file. They can be named anything but by convention they are named SConscript or SConscript.build_name. This also fixes bug #87920 --- freedesktop.org.xml.in | 7 + tests/SConscript | 663 +++++++++++++++++++++ tests/SConscript.buildinfo | 67 +++ tests/SConstruct | 1379 ++++++++++++++++++++++++++++++++++++++++++++ tests/list | 8 + 5 files changed, 2124 insertions(+) create mode 100644 tests/SConscript create mode 100644 tests/SConscript.buildinfo create mode 100644 tests/SConstruct diff --git a/freedesktop.org.xml.in b/freedesktop.org.xml.in index 263b0ff..f1634b5 100644 --- a/freedesktop.org.xml.in +++ b/freedesktop.org.xml.in @@ -5547,6 +5547,13 @@ command to generate the output files. + + <_comment>SCons configuration file + + + + + <_comment>Python script diff --git a/tests/SConscript b/tests/SConscript new file mode 100644 index 0000000..3d900bc --- /dev/null +++ b/tests/SConscript @@ -0,0 +1,663 @@ +# vi: syntax=python:et:ts=4 + +import commands, os +from subprocess import Popen, PIPE +from glob import glob + +Import("*") + +for env in [test_env, client_env, env]: + env.Append(CPPDEFINES = "$EXTRA_DEFINE") + +#color_range.cpp should be removed, but game_config depends on it. +#game_config has very few things that are needed elsewhere, it should be +#removed. Requires moving path and version at least to other files. + +libwesnoth_core_sources = Split(""" + color_range.cpp + config.cpp + gettext.cpp + hash.cpp + log.cpp + map.cpp + map_location.cpp + md5.cpp + thread.cpp + tstring.cpp + util.cpp + version.cpp + serialization/binary_or_text.cpp + serialization/parser.cpp + serialization/preprocessor.cpp + serialization/schema_validator.cpp + serialization/string_utils.cpp + serialization/tokenizer.cpp + serialization/validator.cpp + tools/schema/tag.cpp + """) + +libwesnoth_core_sources.extend(env.Object("network_worker.cpp", EXTRA_DEFINE = env['raw_sockets'] and "NETWORK_USE_RAW_SOCKETS" or None)) + +if env["use_network_ana"]: + client_env.Append(CPPPATH = ["#/src/ana/api"]) + libwesnoth_core_sources.append("network_ana.cpp") + libwesnoth_core_sources.append("network_manager_ana.cpp") + ana = SConscript("ana/src/SConscript", exports = {"env" : client_env}) +else: + libwesnoth_core_sources.append("network.cpp") + ana = [] + +game_config_env = env.Clone() +filesystem_env = env.Clone() +if env["PLATFORM"] != "win32": + game_config_env.Append(CPPDEFINES = "WESNOTH_PATH='\"$datadir\"'") + if env['localedirname']: + filesystem_env.Append(CPPDEFINES = "LOCALEDIR='\"$localedirname\"'") + if not os.path.isabs(env['localedirname']): + filesystem_env.Append(CPPDEFINES = "HAS_RELATIVE_LOCALEDIR") + if env['version_suffix'] and not env['prefsdir']: + filesystem_env['prefsdir'] = ".wesnoth$version_suffix" + if filesystem_env['prefsdir']: + filesystem_env.Append(CPPDEFINES = "PREFERENCES_DIR='\"$prefsdir\"'") + +if env['default_prefs_file']: + client_env.Append(CPPDEFINES = "DEFAULT_PREFS_PATH='\"$default_prefs_file\"'") + + game_config_env['default_prefs_file'] = env['default_prefs_file'] + game_config_env.Append(CPPDEFINES = "DEFAULT_PREFS_PATH='\"$default_prefs_file\"'") + if not os.path.isabs(env['default_prefs_file']): + filesystem_env.Append(CPPDEFINES = "HAS_RELATIVE_DEFPREF") + +libwesnoth_core_sources.extend([ + game_config_env.Object("game_config.cpp"), + filesystem_env.Object("filesystem.cpp") + ]) + +libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources), ana] + +libwesnoth_sources = Split(""" + arrow.cpp + pathfind/astarsearch.cpp + builder.cpp + cavegen.cpp + clipboard.cpp + construct_dialog.cpp + cursor.cpp + display.cpp + events.cpp + generic_event.cpp + hotkeys.cpp + image.cpp + image_modifications.cpp + joystick.cpp + game_end_exceptions.cpp + key.cpp + language.cpp + loadscreen.cpp + map_create.cpp + map_label.cpp + mapgen.cpp + mapgen_dialog.cpp + marked-up_text.cpp + minimap.cpp + pathutils.cpp + preferences.cpp + preferences_display.cpp + race.cpp + random.cpp + reports.cpp + show_dialog.cpp + sound.cpp + soundsource.cpp + sound_music_track.cpp + terrain.cpp + terrain_translation.cpp + text.cpp + time_of_day.cpp + tooltips.cpp + video.cpp + theme.cpp + widgets/button.cpp + widgets/file_menu.cpp + widgets/label.cpp + widgets/menu.cpp + widgets/menu_style.cpp + widgets/progressbar.cpp + widgets/scrollarea.cpp + widgets/scrollbar.cpp + widgets/slider.cpp + widgets/textbox.cpp + widgets/widget.cpp + wml_exception.cpp + """) +libwesnoth_sources.extend([ + client_env.Object("font.cpp", EXTRA_DEFINE = client_env['fribidi'] and "HAVE_FRIBIDI" or None), + ]) + +libwesnoth = client_env.Library("wesnoth", libwesnoth_sources) + +libwesnothd_sources = Split(""" + loadscreen_empty.cpp + tools/dummy_video.cpp + """) +libwesnothd = env.Library("wesnothd", libwesnothd_sources) + +libcampaignd_sources = Split(""" + addon/validation.cpp + """) +libcampaignd = env.Library("campaignd", libcampaignd_sources, OBJPREFIX = "campaignd_") + +libwesnoth_sdl_sources = Split(""" + sdl_utils.cpp + tracer.cpp + """) +libwesnoth_sdl = client_env.Library("wesnoth_sdl", libwesnoth_sdl_sources) + +libcutter_sources = Split(""" + tools/exploder_utils.cpp + tools/exploder_cutter.cpp + """) +libcutter = client_env.Library("cutter", libcutter_sources) + +# Used by both 'wesnoth' and 'test' targets +wesnoth_sources = Split(""" + about.cpp + actions/attack.cpp + actions/create.cpp + actions/heal.cpp + actions/move.cpp + actions/undo.cpp + actions/vision.cpp + addon/client.cpp + addon/info.cpp + addon/manager.cpp + addon/manager_ui.cpp + addon/state.cpp + addon/validation.cpp + ai/actions.cpp + ai/akihara/recruitment.cpp + ai/composite/ai.cpp + ai/composite/aspect.cpp + ai/composite/component.cpp + ai/composite/contexts.cpp + ai/composite/engine.cpp + ai/composite/engine_default.cpp + ai/composite/engine_fai.cpp + ai/composite/engine_lua.cpp + ai/composite/goal.cpp + ai/composite/rca.cpp + ai/composite/stage.cpp + ai/configuration.cpp + ai/contexts.cpp + ai/default/ai.cpp + ai/default/attack.cpp + ai/default/contexts.cpp + ai/formula/ai.cpp + ai/formula/callable_objects.cpp + ai/formula/candidates.cpp + ai/formula/function_table.cpp + ai/formula/stage_side_formulas.cpp + ai/formula/stage_unit_formulas.cpp + ai/game_info.cpp + ai/gamestate_observer.cpp + ai/interface.cpp + ai/lua/core.cpp + ai/lua/lua_object.cpp + ai/lua/unit_advancements_aspect.cpp + ai/manager.cpp + ai/registry.cpp + ai/testing.cpp + ai/testing/aspect_attacks.cpp + ai/testing/ca.cpp + ai/testing/ca_global_fallback.cpp + ai/testing/ca_testing_move_to_targets.cpp + ai/testing/ca_testing_recruitment.cpp + ai/testing/stage_fallback.cpp + ai/testing/stage_rca.cpp + animated_game.cpp + attack_prediction.cpp + attack_prediction_display.cpp + callable_objects.cpp + commandline_options.cpp + config_cache.cpp + controller_base.cpp + dialogs.cpp + editor/action/action.cpp + editor/action/action_unit.cpp + editor/action/action_label.cpp + editor/action/action_village.cpp + editor/action/action_item.cpp + editor/action/mouse/mouse_action.cpp + editor/action/mouse/mouse_action_map_label.cpp + editor/action/mouse/mouse_action_unit.cpp + editor/action/mouse/mouse_action_village.cpp + editor/action/mouse/mouse_action_item.cpp + editor/map/editor_map.cpp + editor/map/map_context.cpp + editor/map/map_fragment.cpp + editor/map/context_manager.cpp + editor/palette/editor_palettes.cpp + editor/palette/terrain_palettes.cpp + editor/palette/tristate_button.cpp + editor/palette/unit_palette.cpp + editor/palette/item_palette.cpp + editor/palette/palette_manager.cpp + editor/editor_controller.cpp + editor/editor_display.cpp + editor/editor_main.cpp + editor/editor_preferences.cpp + editor/toolkit/brush.cpp + editor/toolkit/editor_toolkit.cpp + filechooser.cpp + floating_textbox.cpp + formula.cpp + formula_debugger.cpp + formula_debugger_fwd.cpp + formula_function.cpp + formula_string_utils.cpp + formula_tokenizer.cpp + game_controller.cpp + game_controller_abstract.cpp + game_controller_new.cpp + game_display.cpp + game_errors.cpp + game_events.cpp + game_instance.cpp + game_preferences.cpp + gamestatus.cpp + gui/auxiliary/canvas.cpp + gui/auxiliary/event/dispatcher.cpp + gui/auxiliary/event/distributor.cpp + gui/auxiliary/event/handler.cpp + gui/auxiliary/iterator/iterator.cpp + gui/auxiliary/iterator/walker_grid.cpp + gui/auxiliary/iterator/walker_widget.cpp + gui/auxiliary/log.cpp + gui/auxiliary/placer.cpp + gui/auxiliary/placer/horizontal_list.cpp + gui/auxiliary/placer/vertical_list.cpp + gui/auxiliary/old_markup.cpp + gui/auxiliary/timer.cpp + gui/auxiliary/tips.cpp + gui/auxiliary/widget_definition.cpp + gui/auxiliary/widget_definition/button.cpp + gui/auxiliary/widget_definition/drawing.cpp + gui/auxiliary/widget_definition/horizontal_scrollbar.cpp + gui/auxiliary/widget_definition/image.cpp + gui/auxiliary/widget_definition/label.cpp + gui/auxiliary/widget_definition/listbox.cpp + gui/auxiliary/widget_definition/matrix.cpp + gui/auxiliary/widget_definition/minimap.cpp + gui/auxiliary/widget_definition/multi_page.cpp + gui/auxiliary/widget_definition/panel.cpp + gui/auxiliary/widget_definition/progress_bar.cpp + gui/auxiliary/widget_definition/repeating_button.cpp + gui/auxiliary/widget_definition/scroll_label.cpp + gui/auxiliary/widget_definition/scrollbar_panel.cpp + gui/auxiliary/widget_definition/slider.cpp + gui/auxiliary/widget_definition/spacer.cpp + gui/auxiliary/widget_definition/stacked_widget.cpp + gui/auxiliary/widget_definition/text_box.cpp + gui/auxiliary/widget_definition/toggle_button.cpp + gui/auxiliary/widget_definition/toggle_panel.cpp + gui/auxiliary/widget_definition/tree_view.cpp + gui/auxiliary/widget_definition/vertical_scrollbar.cpp + gui/auxiliary/widget_definition/window.cpp + gui/auxiliary/window_builder.cpp + gui/auxiliary/window_builder/button.cpp + gui/auxiliary/window_builder/control.cpp + gui/auxiliary/window_builder/drawing.cpp + gui/auxiliary/window_builder/helper.cpp + gui/auxiliary/window_builder/horizontal_listbox.cpp + gui/auxiliary/window_builder/horizontal_scrollbar.cpp + gui/auxiliary/window_builder/instance.cpp + gui/auxiliary/window_builder/image.cpp + gui/auxiliary/window_builder/label.cpp + gui/auxiliary/window_builder/listbox.cpp + gui/auxiliary/window_builder/matrix.cpp + gui/auxiliary/window_builder/minimap.cpp + gui/auxiliary/window_builder/multi_page.cpp + gui/auxiliary/window_builder/pane.cpp + gui/auxiliary/window_builder/panel.cpp + gui/auxiliary/window_builder/password_box.cpp + gui/auxiliary/window_builder/progress_bar.cpp + gui/auxiliary/window_builder/repeating_button.cpp + gui/auxiliary/window_builder/scroll_label.cpp + gui/auxiliary/window_builder/scrollbar_panel.cpp + gui/auxiliary/window_builder/slider.cpp + gui/auxiliary/window_builder/spacer.cpp + gui/auxiliary/window_builder/stacked_widget.cpp + gui/auxiliary/window_builder/text_box.cpp + gui/auxiliary/window_builder/toggle_button.cpp + gui/auxiliary/window_builder/toggle_panel.cpp + gui/auxiliary/window_builder/tree_view.cpp + gui/auxiliary/window_builder/vertical_scrollbar.cpp + gui/auxiliary/window_builder/viewport.cpp + gui/dialogs/addon/description.cpp + gui/dialogs/addon/filter_options.cpp + gui/dialogs/addon/uninstall_list.cpp + gui/dialogs/addon_connect.cpp + gui/dialogs/addon_list.cpp + gui/dialogs/campaign_difficulty.cpp + gui/dialogs/campaign_selection.cpp + gui/dialogs/chat_log.cpp + gui/dialogs/data_manage.cpp + gui/dialogs/debug_clock.cpp + gui/dialogs/dialog.cpp + gui/dialogs/edit_label.cpp + gui/dialogs/editor/editor_edit_label.cpp + gui/dialogs/editor/custom_tod.cpp + gui/dialogs/editor_generate_map.cpp + gui/dialogs/editor_new_map.cpp + gui/dialogs/editor_resize_map.cpp + gui/dialogs/editor_set_starting_position.cpp + gui/dialogs/folder_create.cpp + gui/dialogs/formula_debugger.cpp + gui/dialogs/game_delete.cpp + gui/dialogs/game_load.cpp + gui/dialogs/game_save.cpp + gui/dialogs/gamestate_inspector.cpp + gui/dialogs/language_selection.cpp + gui/dialogs/lobby/lobby_data.cpp + gui/dialogs/lobby/lobby_info.cpp + gui/dialogs/lobby_main.cpp + gui/dialogs/lobby_player_info.cpp + gui/dialogs/message.cpp + gui/dialogs/mp_cmd_wrapper.cpp + gui/dialogs/mp_change_control.cpp + gui/dialogs/mp_connect.cpp + gui/dialogs/mp_create_game.cpp + gui/dialogs/mp_create_game_choose_mods.cpp + gui/dialogs/mp_create_game_set_password.cpp + gui/dialogs/mp_depcheck_confirm_change.cpp + gui/dialogs/mp_depcheck_select_new.cpp + gui/dialogs/mp_host_game_prompt.cpp + gui/dialogs/mp_login.cpp + gui/dialogs/mp_method_selection.cpp + gui/dialogs/network_transmission.cpp + gui/dialogs/popup.cpp + gui/dialogs/edit_text.cpp + gui/dialogs/simple_item_selector.cpp + gui/dialogs/tip.cpp + gui/dialogs/title_screen.cpp + gui/dialogs/transient_message.cpp + gui/dialogs/unit_attack.cpp + gui/dialogs/unit_create.cpp + gui/dialogs/wml_message.cpp + gui/lib/types/point.cpp + gui/widgets/button.cpp + gui/widgets/container.cpp + gui/widgets/control.cpp + gui/widgets/drawing.cpp + gui/widgets/generator.cpp + gui/widgets/grid.cpp + gui/widgets/helper.cpp + gui/widgets/horizontal_scrollbar.cpp + gui/widgets/image.cpp + gui/widgets/label.cpp + gui/widgets/list.cpp + gui/widgets/listbox.cpp + gui/widgets/matrix.cpp + gui/widgets/minimap.cpp + gui/widgets/multi_page.cpp + gui/widgets/pane.cpp + gui/widgets/panel.cpp + gui/widgets/password_box.cpp + gui/widgets/progress_bar.cpp + gui/widgets/repeating_button.cpp + gui/widgets/scroll_label.cpp + gui/widgets/scrollbar.cpp + gui/widgets/scrollbar_container.cpp + gui/widgets/scrollbar_panel.cpp + gui/widgets/settings.cpp + gui/widgets/slider.cpp + gui/widgets/spacer.cpp + gui/widgets/stacked_widget.cpp + gui/widgets/text.cpp + gui/widgets/text_box.cpp + gui/widgets/toggle_button.cpp + gui/widgets/toggle_panel.cpp + gui/widgets/tree_view.cpp + gui/widgets/tree_view_node.cpp + gui/widgets/vertical_scrollbar.cpp + gui/widgets/viewport.cpp + gui/widgets/widget.cpp + gui/widgets/window.cpp + halo.cpp + help.cpp + intro.cpp + leader_list.cpp + leader_scroll_dialog.cpp + lobby_preferences.cpp + menu_events.cpp + mouse_events.cpp + mouse_handler_base.cpp + movetype.cpp + mp_depcheck.cpp + mp_game_settings.cpp + mp_options.cpp + multiplayer.cpp + multiplayer_connect.cpp + multiplayer_create.cpp + multiplayer_lobby.cpp + multiplayer_ui.cpp + multiplayer_wait.cpp + network_asio.cpp + pathfind/pathfind.cpp + pathfind/teleport.cpp + persist_context.cpp + persist_manager.cpp + persist_var.cpp + play_controller.cpp + playcampaign.cpp + playmp_controller.cpp + playsingle_controller.cpp + playturn.cpp + portrait.cpp + replay.cpp + replay_controller.cpp + resources.cpp + save_blocker.cpp + savegame.cpp + savegame_config.cpp + scripting/debug_lua.cpp + scripting/lua.cpp + settings.cpp + sha1.cpp + side_filter.cpp + statistics.cpp + statistics_dialog.cpp + storyscreen/controller.cpp + storyscreen/interface.cpp + storyscreen/part.cpp + storyscreen/render.cpp + team.cpp + terrain_filter.cpp + tod_manager.cpp + unit.cpp + unit_abilities.cpp + unit_animation.cpp + unit_display.cpp + unit_frame.cpp + unit_helper.cpp + unit_id.cpp + unit_map.cpp + unit_types.cpp + variable.cpp + variant.cpp + whiteboard/action.cpp + whiteboard/attack.cpp + whiteboard/highlighter.cpp + whiteboard/manager.cpp + whiteboard/mapbuilder.cpp + whiteboard/move.cpp + whiteboard/recall.cpp + whiteboard/recruit.cpp + whiteboard/side_actions.cpp + whiteboard/suppose_dead.cpp + whiteboard/utility.cpp + widgets/combo.cpp + widgets/combo_drag.cpp + widgets/drop_target.cpp + widgets/scrollpane.cpp + """) + +if env["PLATFORM"] == "win32": + wesnoth_sources.append("windows_tray_notification.cpp") + +wesnoth_sources.extend(client_env.Object("game_preferences_display.cpp", EXTRA_DEFINE = env["PLATFORM"] != "win32" and "WESNOTH_PREFIX='\"$prefix\"'" or None)) +wesnoth_sources.extend(client_env.Object("hotkey_preferences_display.cpp", EXTRA_DEFINE = env["PLATFORM"] != "win32" and "WESNOTH_PREFIX='\"$prefix\"'" or None)) + +libwesnoth_extras = client_env.Library("wesnoth_extras", wesnoth_sources) + +libwesnoth_extras.extend(SConscript("lua/SConscript")) + +# +# Target declarations +# + +def error_action(target, source, env): + from SCons.Errors import UserError + raise UserError, "Target disabled because its prerequisites are not met" + +def WesnothProgram(env, target, source, can_build, **kw): + if can_build: + if env["build"] == "base": + bin = env.Program(target, source, **kw) + else: + bin = env.Program("#/" + target + build_suffix, source, **kw) + env.Alias(target, bin) + else: + bin = env.Alias(target, [], error_action) + AlwaysBuild(bin) + locals()[target] = bin + Export(target) + +for env in [test_env, client_env, env]: + env.AddMethod(WesnothProgram) + +wesnoth_objects = ["game.cpp", libwesnoth_extras, libwesnoth_core, libwesnoth_sdl, + libwesnoth, env["wesnoth_res"]] +if env["host"] in ["x86_64-nacl", "i686-nacl"]: + wesnoth_objects += [SConscript("nacl/SConscript")] +client_env.WesnothProgram("wesnoth", wesnoth_objects, have_client_prereqs) + +campaignd_sources = Split(""" + server/input_stream.cpp + """) + +if env["PLATFORM"] == "win32": env["fifodir"] = "" +campaignd_sources.extend(env.Object("campaign_server/campaign_server.cpp", EXTRA_DEFINE = env['fifodir'] and "FIFODIR='\"$fifodir\"'" or None)) + +env.WesnothProgram("campaignd", campaignd_sources + [libwesnoth_core, libwesnothd, libcampaignd], have_server_prereqs) + +wesnothd_sources = Split(""" + server/ban.cpp + server/forum_user_handler.cpp + server/game.cpp + server/input_stream.cpp + server/metrics.cpp + server/player.cpp + server/player_network.cpp + server/proxy.cpp + server/room.cpp + server/room_manager.cpp + server/sample_user_handler.cpp + server/simple_wml.cpp + server/user_handler.cpp + """) +wesnothd_sources.extend(env.Object("server/server.cpp", EXTRA_DEFINE = env['fifodir'] and "FIFODIR='\"$fifodir\"'" or None)) + +env.WesnothProgram("wesnothd", wesnothd_sources + [libwesnoth_core, libwesnothd], have_server_prereqs) + +cutter_sources = Split(""" + tools/cutter.cpp + """) +client_env.WesnothProgram("cutter", cutter_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"]) + +exploder_sources = Split(""" + tools/exploder.cpp + tools/exploder_composer.cpp + """) +client_env.WesnothProgram("exploder", exploder_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"]) + +schema_generator_sources = Split(""" + tools/schema/schema_generator.cpp + tools/schema/sourceparser.cpp + tools/schema/error_container.cpp + """) +client_env.WesnothProgram("schema_generator", schema_generator_sources + [libwesnoth_core, libwesnothd], have_client_prereqs) + +test_utils_sources = Split(""" + tests/utils/game_config_manager.cpp + tests/utils/fake_event_source.cpp + tests/utils/fake_display.cpp + """) + +wesmage_sources = Split(""" + wesmage/wesmage.cpp + wesmage/exit.cpp + wesmage/filter.cpp + wesmage/options.cpp + tools/dummy_video.cpp + tools/exploder_utils.cpp + sdl_utils.cpp + tracer.cpp + loadscreen_empty.cpp + """) +client_env.WesnothProgram("wesmage", wesmage_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "wesmage_", LIBS = ["$LIBS", "png"]) + +libtest_utils = test_env.Library("test_utils", test_utils_sources) + +test_sources = Split(""" + tests/floating_point_emulation.cpp + tests/main.cpp + tests/test_addons.cpp + tests/test_commandline_options.cpp + tests/test_formula_ai.cpp + tests/test_formula_function.cpp + tests/test_image_modifications.cpp + tests/test_lexical_cast.cpp + tests/test_network_worker.cpp + tests/test_team.cpp + tests/test_unit_map.cpp + tests/test_util.cpp + tests/test_sdl_utils.cpp + tests/test_serialization.cpp + tests/test_version.cpp + tests/test_whiteboard_side_actions.cpp + tests/gui/fire_event.cpp + tests/gui/iterator.cpp + tests/gui/test_drop_target.cpp + tests/gui/test_gui2.cpp + tests/gui/test_save_dialog.cpp + tests/gui/visitor.cpp + tests/utils/play_scenario.cpp + """) +test_sources.extend(test_env.Object("tests/test_config_cache.cpp")) + +test = test_env.WesnothProgram("test", test_sources + [libwesnoth_extras, libwesnoth_core, libwesnoth_sdl, libwesnoth, libwesnoth_extras, libtest_utils], have_test_prereqs) + +create_images_sources = Split(""" + tests/create_images.cpp + tools/dummy_video.cpp + tools/exploder_utils.cpp + sdl_utils.cpp + tracer.cpp + loadscreen_empty.cpp +""") + +env.WesnothProgram("create_images", create_images_sources + [libwesnoth_core], have_server_prereqs, OBJPREFIX = "create_images_", LIBS = ["$LIBS", "png"]) + +if env.get("have_autorevision"): + game_config_env.Append(CPPDEFINES = 'LOAD_REVISION') + +sources = [] +if "TAGS" in COMMAND_LINE_TARGETS: + sources = [ Glob(os.path.join(dir, pattern)) for dir in ["", "*", "*/*"] for pattern in ["*.cpp", "*.hpp"] ] + +Export("sources") + +# Local variables: +# mode: python +# end: diff --git a/tests/SConscript.buildinfo b/tests/SConscript.buildinfo new file mode 100644 index 0000000..da48235 --- /dev/null +++ b/tests/SConscript.buildinfo @@ -0,0 +1,67 @@ +# -*- mode: python; -*- + +# This SConscript describes construction of buildinfo.cpp, which is independent of the +# build variant's target. + +import os +import sys + +import buildscripts.utils + +Import('env windows usev8') + +def getSysInfo(): + if windows: + return "windows " + str( sys.getwindowsversion() ) + else: + return " ".join( os.uname() ) + +buildinfo_filename = '$BUILD_DIR/buildinfo.cpp' +env.NoCache(buildinfo_filename) + +buildinfo_template = ''' +#include +#include + +#include "mongo/util/version.h" + +namespace mongo { + const char * gitVersion() { return "%(git_version)s"; } + const char * compiledJSEngine() { return "%(js_engine)s"; } + const char * allocator() { return "%(allocator)s"; } + const char * loaderFlags() { return "%(loader_flags)s"; } + const char * compilerFlags() { return "%(compiler_flags)s"; } + std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; } +} // namespace mongo +''' + +def generate_buildinfo(env, target, source, **kw): + git_version = buildscripts.utils.getGitVersion() + if len(env["MONGO_MODULES"]): + git_version += " modules: " + ", ".join(env["MONGO_MODULES"]) + + if usev8: + js_engine = "V8" + else: + js_engine = "Unknown" + + contents = str(source[0]) % dict(git_version=git_version, + js_engine=js_engine, + sys_info=getSysInfo(), + allocator=GetOption('allocator'), + loader_flags=env.subst('$LINKFLAGS $LDFLAGS', + source=source, target=target), + compiler_flags=env.subst('$CXXFLAGS $CCFLAGS $CFLAGS', + source=source, target=target)) + out = open(str(target[0]), 'wb') + try: + out.write(contents) + finally: + out.close() + +env.Command(buildinfo_filename, + Value(buildinfo_template), + Action(generate_buildinfo, "Generating $TARGET")) +env.AlwaysBuild(buildinfo_filename) +env.Install('$BUILD_DIR/mongo', buildinfo_filename) + diff --git a/tests/SConstruct b/tests/SConstruct new file mode 100644 index 0000000..8b83b2f --- /dev/null +++ b/tests/SConstruct @@ -0,0 +1,1379 @@ +# +# SConstruct file to build scons packages during development. +# +# See the README.rst file for an overview of how SCons is built and tested. + +copyright_years = '2001 - 2014' + +# This gets inserted into the man pages to reflect the month of release. +month_year = 'September 2014' + +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +import distutils.util +import fnmatch +import os +import os.path +import re +import stat +import sys +import tempfile + +import bootstrap + +project = 'scons' +default_version = '2.3.4' +copyright = "Copyright (c) %s The SCons Foundation" % copyright_years + +platform = distutils.util.get_platform() + +SConsignFile() + +# +# An internal "whereis" routine to figure out if a given program +# is available on this system. +# +def whereis(file): + exts = [''] + if platform == "win32": + exts += ['.exe'] + for dir in os.environ['PATH'].split(os.pathsep): + f = os.path.join(dir, file) + for ext in exts: + f_ext = f + ext + if os.path.isfile(f_ext): + try: + st = os.stat(f_ext) + except: + continue + if stat.S_IMODE(st[stat.ST_MODE]) & 0111: + return f_ext + return None + +# +# We let the presence or absence of various utilities determine whether +# or not we bother to build certain pieces of things. This should allow +# people to still do SCons packaging work even if they don't have all +# of the utilities installed (e.g. RPM). +# +dh_builddeb = whereis('dh_builddeb') +fakeroot = whereis('fakeroot') +gzip = whereis('gzip') +rpmbuild = whereis('rpmbuild') +hg = os.path.exists('.hg') and whereis('hg') +svn = os.path.exists('.svn') and whereis('svn') +unzip = whereis('unzip') +zip = whereis('zip') + +# +# Now grab the information that we "build" into the files. +# +date = ARGUMENTS.get('DATE') +if not date: + import time + date = time.strftime("%Y/%m/%d %H:%M:%S", time.localtime(time.time())) + +developer = ARGUMENTS.get('DEVELOPER') +if not developer: + for variable in ['USERNAME', 'LOGNAME', 'USER']: + developer = os.environ.get(variable) + if developer: + break + +build_system = ARGUMENTS.get('BUILD_SYSTEM') +if not build_system: + import socket + build_system = socket.gethostname().split('.')[0] + +version = ARGUMENTS.get('VERSION', '') +if not version: + version = default_version + +hg_status_lines = [] +svn_status_lines = [] + +if hg: + cmd = "%s status --all 2> /dev/null" % hg + hg_status_lines = os.popen(cmd, "r").readlines() + +if svn: + cmd = "%s status --verbose 2> /dev/null" % svn + svn_status_lines = os.popen(cmd, "r").readlines() + +revision = ARGUMENTS.get('REVISION', '') +def generate_build_id(revision): + return revision + +if not revision and hg: + hg_heads = os.popen("%s heads 2> /dev/null" % hg, "r").read() + cs = re.search('changeset:\s+(\S+)', hg_heads) + if cs: + revision = cs.group(1) + b = re.search('branch:\s+(\S+)', hg_heads) + if b: + revision = b.group(1) + ':' + revision + def generate_build_id(revision): + result = revision + if [l for l in hg_status_lines if l[0] in 'AMR!']: + result = result + '[MODIFIED]' + return result + +if not revision and svn: + svn_info = os.popen("%s info 2> /dev/null" % svn, "r").read() + m = re.search('Revision: (\d+)', svn_info) + if m: + revision = m.group(1) + def generate_build_id(revision): + result = 'r' + revision + if [l for l in svn_status_lines if l[0] in 'ACDMR']: + result = result + '[MODIFIED]' + return result + +checkpoint = ARGUMENTS.get('CHECKPOINT', '') +if checkpoint: + if checkpoint == 'd': + import time + checkpoint = time.strftime('%Y%m%d', time.localtime(time.time())) + elif checkpoint == 'r': + checkpoint = 'r' + revision + version = version + '.beta.' + checkpoint + +build_id = ARGUMENTS.get('BUILD_ID') +if build_id is None: + if revision: + build_id = generate_build_id(revision) + else: + build_id = '' + +python_ver = sys.version[0:3] + +# +# Adding some paths to sys.path, this is mainly needed +# for the doc toolchain. +# +addpaths = [os.path.abspath(os.path.join(os.getcwd(), 'bin')), + os.path.abspath(os.path.join(os.getcwd(), 'QMTest'))] +for a in addpaths: + if a not in sys.path: + sys.path.append(a) + + +# Re-exporting LD_LIBRARY_PATH is necessary if the Python version was +# built with the --enable-shared option. + +ENV = { 'PATH' : os.environ['PATH'] } +for key in ['LOGNAME', 'PYTHONPATH', 'LD_LIBRARY_PATH']: + if key in os.environ: + ENV[key] = os.environ[key] + +build_dir = ARGUMENTS.get('BUILDDIR', 'build') +if not os.path.isabs(build_dir): + build_dir = os.path.normpath(os.path.join(os.getcwd(), build_dir)) + +command_line_variables = [ + ("BUILDDIR=", "The directory in which to build the packages. " + + "The default is the './build' subdirectory."), + + ("BUILD_ID=", "An identifier for the specific build." + + "The default is the Subversion revision number."), + + ("BUILD_SYSTEM=", "The system on which the packages were built. " + + "The default is whatever hostname is returned " + + "by socket.gethostname()."), + + ("CHECKPOINT=", "The specific checkpoint release being packaged, " + + "which will be appended to the VERSION string. " + + "A value of CHECKPOINT=d will generate a string " + + "of 'd' plus today's date in the format YYYMMDD. " + + "A value of CHECKPOINT=r will generate a " + + "string of 'r' plus the Subversion revision " + + "number. Any other CHECKPOINT= string will be " + + "used as is. There is no default value."), + + ("DATE=", "The date string representing when the packaging " + + "build occurred. The default is the day and time " + + "the SConstruct file was invoked, in the format " + + "YYYY/MM/DD HH:MM:SS."), + + ("DEVELOPER=", "The developer who created the packages. " + + "The default is the first set environment " + + "variable from the list $USERNAME, $LOGNAME, $USER."), + + ("REVISION=", "The revision number of the source being built. " + + "The default is the Subversion revision returned " + + "'svn info', with an appended string of " + + "'[MODIFIED]' if there are any changes in the " + + "working copy."), + + ("VERSION=", "The SCons version being packaged. The default " + + "is the hard-coded value '%s' " % default_version + + "from this SConstruct file."), +] + +Default('.', build_dir) + +packaging_flavors = [ + ('deb', "A .deb package. (This is currently not supported.)"), + + ('rpm', "A RedHat Package Manager file."), + + ('tar-gz', "The normal .tar.gz file for end-user installation."), + + ('src-tar-gz', "A .tar.gz file containing all the source " + + "(including tests and documentation)."), + + ('local-tar-gz', "A .tar.gz file for dropping into other software " + + "for local use."), + + ('zip', "The normal .zip file for end-user installation."), + + ('src-zip', "A .zip file containing all the source " + + "(including tests and documentation)."), + + ('local-zip', "A .zip file for dropping into other software " + + "for local use."), +] + +test_deb_dir = os.path.join(build_dir, "test-deb") +test_rpm_dir = os.path.join(build_dir, "test-rpm") +test_tar_gz_dir = os.path.join(build_dir, "test-tar-gz") +test_src_tar_gz_dir = os.path.join(build_dir, "test-src-tar-gz") +test_local_tar_gz_dir = os.path.join(build_dir, "test-local-tar-gz") +test_zip_dir = os.path.join(build_dir, "test-zip") +test_src_zip_dir = os.path.join(build_dir, "test-src-zip") +test_local_zip_dir = os.path.join(build_dir, "test-local-zip") + +unpack_tar_gz_dir = os.path.join(build_dir, "unpack-tar-gz") +unpack_zip_dir = os.path.join(build_dir, "unpack-zip") + +if platform == "win32": + tar_hflag = '' + python_project_subinst_dir = os.path.join("Lib", "site-packages", project) + project_script_subinst_dir = 'Scripts' +else: + tar_hflag = 'h' + python_project_subinst_dir = os.path.join("lib", project) + project_script_subinst_dir = 'bin' + + + +import textwrap + +indent_fmt = ' %-26s ' + +Help("""\ +The following aliases build packages of various types, and unpack the +contents into build/test-$PACKAGE subdirectories, which can be used by the +runtest.py -p option to run tests against what's been actually packaged: + +""") + +aliases = sorted(packaging_flavors + [('doc', 'The SCons documentation.')]) + +for alias, help_text in aliases: + tw = textwrap.TextWrapper( + width = 78, + initial_indent = indent_fmt % alias, + subsequent_indent = indent_fmt % '' + ' ', + ) + Help(tw.fill(help_text) + '\n') + +Help(""" +The following command-line variables can be set: + +""") + +for variable, help_text in command_line_variables: + tw = textwrap.TextWrapper( + width = 78, + initial_indent = indent_fmt % variable, + subsequent_indent = indent_fmt % '' + ' ', + ) + Help(tw.fill(help_text) + '\n') + + + +zcat = 'gzip -d -c' + +# +# Figure out if we can handle .zip files. +# +zipit = None +unzipit = None +try: + import zipfile + + def zipit(env, target, source): + print "Zipping %s:" % str(target[0]) + def visit(arg, dirname, names): + for name in names: + path = os.path.join(dirname, name) + if os.path.isfile(path): + arg.write(path) + zf = zipfile.ZipFile(str(target[0]), 'w') + olddir = os.getcwd() + os.chdir(env['CD']) + try: os.path.walk(env['PSV'], visit, zf) + finally: os.chdir(olddir) + zf.close() + + def unzipit(env, target, source): + print "Unzipping %s:" % str(source[0]) + zf = zipfile.ZipFile(str(source[0]), 'r') + for name in zf.namelist(): + dest = os.path.join(env['UNPACK_ZIP_DIR'], name) + dir = os.path.dirname(dest) + try: + os.makedirs(dir) + except: + pass + print dest,name + # if the file exists, then delete it before writing + # to it so that we don't end up trying to write to a symlink: + if os.path.isfile(dest) or os.path.islink(dest): + os.unlink(dest) + if not os.path.isdir(dest): + open(dest, 'wb').write(zf.read(name)) + +except: + if unzip and zip: + zipit = "cd $CD && $ZIP $ZIPFLAGS $( ${TARGET.abspath} $) $PSV" + unzipit = "$UNZIP $UNZIPFLAGS $SOURCES" + +def SCons_revision(target, source, env): + """Interpolate specific values from the environment into a file. + + This is used to copy files into a tree that gets packaged up + into the source file package. + """ + t = str(target[0]) + s = source[0].rstr() + contents = open(s, 'rb').read() + # Note: We construct the __*__ substitution strings here + # so that they don't get replaced when this file gets + # copied into the tree for packaging. + contents = contents.replace('__BUILD' + '__', env['BUILD']) + contents = contents.replace('__BUILDSYS' + '__', env['BUILDSYS']) + contents = contents.replace('__COPYRIGHT' + '__', env['COPYRIGHT']) + contents = contents.replace('__DATE' + '__', env['DATE']) + contents = contents.replace('__DEVELOPER' + '__', env['DEVELOPER']) + contents = contents.replace('__FILE' + '__', str(source[0]).replace('\\', '/')) + contents = contents.replace('__MONTH_YEAR'+ '__', env['MONTH_YEAR']) + contents = contents.replace('__REVISION' + '__', env['REVISION']) + contents = contents.replace('__VERSION' + '__', env['VERSION']) + contents = contents.replace('__NULL' + '__', '') + open(t, 'wb').write(contents) + os.chmod(t, os.stat(s)[0]) + +revaction = SCons_revision +revbuilder = Builder(action = Action(SCons_revision, + varlist=['COPYRIGHT', 'VERSION'])) + +def soelim(target, source, env): + """ + Interpolate files included in [gnt]roff source files using the + .so directive. + + This behaves somewhat like the soelim(1) wrapper around groff, but + makes us independent of whether the actual underlying implementation + includes an soelim() command or the corresponding command-line option + to groff(1). The key behavioral difference is that this doesn't + recursively include .so files from the include file. Not yet, anyway. + """ + t = str(target[0]) + s = str(source[0]) + dir, f = os.path.split(s) + tfp = open(t, 'w') + sfp = open(s, 'r') + for line in sfp.readlines(): + if line[:4] in ['.so ', "'so "]: + sofile = os.path.join(dir, line[4:-1]) + tfp.write(open(sofile, 'r').read()) + else: + tfp.write(line) + sfp.close() + tfp.close() + +def soscan(node, env, path): + c = node.get_text_contents() + return re.compile(r"^[\.']so\s+(\S+)", re.M).findall(c) + +soelimbuilder = Builder(action = Action(soelim), + source_scanner = Scanner(soscan)) + +# When copying local files from a Repository (Aegis), +# just make copies, don't symlink them. +SetOption('duplicate', 'copy') + +env = Environment( + ENV = ENV, + + BUILD = build_id, + BUILDDIR = build_dir, + BUILDSYS = build_system, + COPYRIGHT = copyright, + DATE = date, + DEVELOPER = developer, + DISTDIR = os.path.join(build_dir, 'dist'), + MONTH_YEAR = month_year, + REVISION = revision, + VERSION = version, + DH_COMPAT = 2, + + TAR_HFLAG = tar_hflag, + + ZIP = zip, + ZIPFLAGS = '-r', + UNZIP = unzip, + UNZIPFLAGS = '-o -d $UNPACK_ZIP_DIR', + + ZCAT = zcat, + + RPMBUILD = rpmbuild, + RPM2CPIO = 'rpm2cpio', + + TEST_DEB_DIR = test_deb_dir, + TEST_RPM_DIR = test_rpm_dir, + TEST_SRC_TAR_GZ_DIR = test_src_tar_gz_dir, + TEST_SRC_ZIP_DIR = test_src_zip_dir, + TEST_TAR_GZ_DIR = test_tar_gz_dir, + TEST_ZIP_DIR = test_zip_dir, + + UNPACK_TAR_GZ_DIR = unpack_tar_gz_dir, + UNPACK_ZIP_DIR = unpack_zip_dir, + + BUILDERS = { 'SCons_revision' : revbuilder, + 'SOElim' : soelimbuilder }, + + PYTHON = '"%s"' % sys.executable, + PYTHONFLAGS = '-tt', + ) + +Version_values = [Value(version), Value(build_id)] + +# +# Define SCons packages. +# +# In the original, more complicated packaging scheme, we were going +# to have separate packages for: +# +# python-scons only the build engine +# scons-script only the script +# scons the script plus the build engine +# +# We're now only delivering a single "scons" package, but this is still +# "built" as two sub-packages (the build engine and the script), so +# the definitions remain here, even though we're not using them for +# separate packages. +# + +python_scons = { + 'pkg' : 'python-' + project, + 'src_subdir' : 'engine', + 'inst_subdir' : os.path.join('lib', 'python1.5', 'site-packages'), + 'rpm_dir' : '/usr/lib/scons', + + 'debian_deps' : [ + 'debian/changelog', + 'debian/control', + 'debian/copyright', + 'debian/dirs', + 'debian/docs', + 'debian/postinst', + 'debian/prerm', + 'debian/rules', + ], + + 'files' : [ 'LICENSE.txt', + 'README.txt', + 'setup.cfg', + 'setup.py', + ], + + 'filemap' : { + 'LICENSE.txt' : '../LICENSE.txt' + }, + + 'buildermap' : {}, + + 'extra_rpm_files' : [], + + 'explicit_deps' : { + 'SCons/__init__.py' : Version_values, + }, +} + +# Figure out the name of a .egg-info file that might be generated +# as part of the RPM package. There are two complicating factors. +# +# First, the RPM spec file we generate will just execute "python", not +# necessarily the one in sys.executable. If *that* version of python has +# a distutils that knows about Python eggs, then setup.py will generate a +# .egg-info file, so we have to execute any distutils logic in a subshell. +# +# Second, we can't just have the subshell check for the existence of the +# distutils.command.install_egg_info module and generate the expected +# file name by hand, the way we used to, because different systems can +# have slightly different .egg-info naming conventions. (Specifically, +# Ubuntu overrides the default behavior to remove the Python version +# string from the .egg-info file name.) The right way to do this is to +# actually call into the install_egg_info() class to have it generate +# the expected name for us. +# +# This is all complicated enough that we do it by writing an in-line +# script to a temporary file and then feeding it to a separate invocation +# of "python" to tell us the actual name of the generated .egg-info file. + +print_egg_info_name = """ +try: + from distutils.dist import Distribution + from distutils.command.install_egg_info import install_egg_info +except ImportError: + pass +else: + dist = Distribution({'name' : "scons", 'version' : '%s'}) + i = install_egg_info(dist) + i.finalize_options() + import os.path + print os.path.split(i.outputs[0])[1] +""" % version + +try: + fd, tfname = tempfile.mkstemp() + tfp = os.fdopen(fd, "w") + tfp.write(print_egg_info_name) + tfp.close() + egg_info_file = os.popen("python %s" % tfname).read()[:-1] + if egg_info_file: + python_scons['extra_rpm_files'].append(egg_info_file) +finally: + try: + os.unlink(tfname) + except EnvironmentError: + pass + +# +# The original packaging scheme would have have required us to push +# the Python version number into the package name (python1.5-scons, +# python2.0-scons, etc.), which would have required a definition +# like the following. Leave this here in case we ever decide to do +# this in the future, but note that this would require some modification +# to src/engine/setup.py before it would really work. +# +#python2_scons = { +# 'pkg' : 'python2-' + project, +# 'src_subdir' : 'engine', +# 'inst_subdir' : os.path.join('lib', 'python2.2', 'site-packages'), +# +# 'debian_deps' : [ +# 'debian/changelog', +# 'debian/control', +# 'debian/copyright', +# 'debian/dirs', +# 'debian/docs', +# 'debian/postinst', +# 'debian/prerm', +# 'debian/rules', +# ], +# +# 'files' : [ +# 'LICENSE.txt', +# 'README.txt', +# 'setup.cfg', +# 'setup.py', +# ], +# 'filemap' : { +# 'LICENSE.txt' : '../LICENSE.txt', +# }, +# 'buildermap' : {}, +#} +# + +scons_script = { + 'pkg' : project + '-script', + 'src_subdir' : 'script', + 'inst_subdir' : 'bin', + 'rpm_dir' : '/usr/bin', + + 'debian_deps' : [ + 'debian/changelog', + 'debian/control', + 'debian/copyright', + 'debian/dirs', + 'debian/docs', + 'debian/postinst', + 'debian/prerm', + 'debian/rules', + ], + + 'files' : [ + 'LICENSE.txt', + 'README.txt', + 'setup.cfg', + 'setup.py', + ], + + 'filemap' : { + 'LICENSE.txt' : '../LICENSE.txt', + 'scons' : 'scons.py', + 'sconsign' : 'sconsign.py', + 'scons-time' : 'scons-time.py', + }, + + 'buildermap' : {}, + + 'extra_rpm_files' : [ + 'scons-' + version, + 'sconsign-' + version, + 'scons-time-' + version, + ], + + 'explicit_deps' : { + 'scons' : Version_values, + 'sconsign' : Version_values, + }, +} + +scons = { + 'pkg' : project, + + 'debian_deps' : [ + 'debian/changelog', + 'debian/control', + 'debian/copyright', + 'debian/dirs', + 'debian/docs', + 'debian/postinst', + 'debian/prerm', + 'debian/rules', + ], + + 'files' : [ + 'CHANGES.txt', + 'LICENSE.txt', + 'README.txt', + 'RELEASE.txt', + 'scons.1', + 'sconsign.1', + 'scons-time.1', + 'script/scons.bat', + #'script/scons-post-install.py', + 'setup.cfg', + 'setup.py', + ], + + 'filemap' : { + 'scons.1' : '$BUILDDIR/doc/man/scons.1', + 'sconsign.1' : '$BUILDDIR/doc/man/sconsign.1', + 'scons-time.1' : '$BUILDDIR/doc/man/scons-time.1', + }, + + 'buildermap' : { + 'scons.1' : env.SOElim, + 'sconsign.1' : env.SOElim, + 'scons-time.1' : env.SOElim, + }, + + 'subpkgs' : [ python_scons, scons_script ], + + 'subinst_dirs' : { + 'python-' + project : python_project_subinst_dir, + project + '-script' : project_script_subinst_dir, + }, +} + +scripts = ['scons', 'sconsign', 'scons-time'] + +src_deps = [] +src_files = [] + +for p in [ scons ]: + # + # Initialize variables with the right directories for this package. + # + pkg = p['pkg'] + pkg_version = "%s-%s" % (pkg, version) + + src = 'src' + if 'src_subdir' in p: + src = os.path.join(src, p['src_subdir']) + + build = os.path.join(build_dir, pkg) + + tar_gz = os.path.join(build, 'dist', "%s.tar.gz" % pkg_version) + platform_tar_gz = os.path.join(build, + 'dist', + "%s.%s.tar.gz" % (pkg_version, platform)) + zip = os.path.join(build, 'dist', "%s.zip" % pkg_version) + platform_zip = os.path.join(build, + 'dist', + "%s.%s.zip" % (pkg_version, platform)) + if platform == "win-amd64": + win32_exe = os.path.join(build, 'dist', "%s.win-amd64.exe" % pkg_version) + else: + win32_exe = os.path.join(build, 'dist', "%s.win32.exe" % pkg_version) + + # + # Update the environment with the relevant information + # for this package. + # + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. + # + setup_py = os.path.join(build, 'setup.py') + env.Replace(PKG = pkg, + PKG_VERSION = pkg_version, + SETUP_PY = '"%s"' % setup_py) + Local(setup_py) + + # + # Read up the list of source files from our MANIFEST.in. + # This list should *not* include LICENSE.txt, MANIFEST, + # README.txt, or setup.py. Make a copy of the list for the + # destination files. + # + manifest_in = File(os.path.join(src, 'MANIFEST.in')).rstr() + src_files = bootstrap.parseManifestLines(src, open(manifest_in).readlines()) + raw_files = src_files[:] + dst_files = src_files[:] + rpm_files = [] + + MANIFEST_in_list = [] + + if 'subpkgs' in p: + # + # This package includes some sub-packages. Read up their + # MANIFEST.in files, and add them to our source and destination + # file lists, modifying them as appropriate to add the + # specified subdirs. + # + for sp in p['subpkgs']: + ssubdir = sp['src_subdir'] + isubdir = p['subinst_dirs'][sp['pkg']] + MANIFEST_in = File(os.path.join(src, ssubdir, 'MANIFEST.in')).rstr() + MANIFEST_in_list.append(MANIFEST_in) + files = bootstrap.parseManifestLines(os.path.join(src, ssubdir), open(MANIFEST_in).readlines()) + raw_files.extend(files) + src_files.extend([os.path.join(ssubdir, x) for x in files]) + for f in files: + r = os.path.join(sp['rpm_dir'], f) + rpm_files.append(r) + if f[-3:] == ".py": + rpm_files.append(r + 'c') + for f in sp.get('extra_rpm_files', []): + r = os.path.join(sp['rpm_dir'], f) + rpm_files.append(r) + files = [os.path.join(isubdir, x) for x in files] + dst_files.extend(files) + for k, f in sp['filemap'].items(): + if f: + k = os.path.join(ssubdir, k) + p['filemap'][k] = os.path.join(ssubdir, f) + for f, deps in sp['explicit_deps'].items(): + f = os.path.join(build, ssubdir, f) + env.Depends(f, deps) + + # + # Now that we have the "normal" source files, add those files + # that are standard for each distribution. Note that we don't + # add these to dst_files, because they don't get installed. + # And we still have the MANIFEST to add. + # + src_files.extend(p['files']) + + # + # Now run everything in src_file through the sed command we + # concocted to expand __FILE__, __VERSION__, etc. + # + for b in src_files: + s = p['filemap'].get(b, b) + if not s[0] == '$' and not os.path.isabs(s): + s = os.path.join(src, s) + builder = p['buildermap'].get(b, env.SCons_revision) + x = builder(os.path.join(build, b), s) + Local(x) + + # + # NOW, finally, we can create the MANIFEST, which we do + # by having Python spit out the contents of the src_files + # array we've carefully created. After we've added + # MANIFEST itself to the array, of course. + # + src_files.append("MANIFEST") + MANIFEST_in_list.append(os.path.join(src, 'MANIFEST.in')) + + def write_src_files(target, source, **kw): + global src_files + src_files.sort() + f = open(str(target[0]), 'wb') + for file in src_files: + f.write(file + "\n") + f.close() + return 0 + env.Command(os.path.join(build, 'MANIFEST'), + MANIFEST_in_list, + write_src_files) + + # + # Now go through and arrange to create whatever packages we can. + # + build_src_files = [os.path.join(build, x) for x in src_files] + Local(*build_src_files) + + distutils_formats = [] + + distutils_targets = [ win32_exe ] + + dist_distutils_targets = env.Install('$DISTDIR', distutils_targets) + Local(dist_distutils_targets) + AddPostAction(dist_distutils_targets, Chmod(dist_distutils_targets, 0644)) + + if not gzip: + print "gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg) + else: + + distutils_formats.append('gztar') + + src_deps.append(tar_gz) + + distutils_targets.extend([ tar_gz, platform_tar_gz ]) + + dist_tar_gz = env.Install('$DISTDIR', tar_gz) + dist_platform_tar_gz = env.Install('$DISTDIR', platform_tar_gz) + Local(dist_tar_gz, dist_platform_tar_gz) + AddPostAction(dist_tar_gz, Chmod(dist_tar_gz, 0644)) + AddPostAction(dist_platform_tar_gz, Chmod(dist_platform_tar_gz, 0644)) + + # + # Unpack the tar.gz archive created by the distutils into + # build/unpack-tar-gz/scons-{version}. + # + # We'd like to replace the last three lines with the following: + # + # tar zxf $SOURCES -C $UNPACK_TAR_GZ_DIR + # + # but that gives heartburn to Cygwin's tar, so work around it + # with separate zcat-tar-rm commands. + # + unpack_tar_gz_files = [os.path.join(unpack_tar_gz_dir, pkg_version, x) + for x in src_files] + env.Command(unpack_tar_gz_files, dist_tar_gz, [ + Delete(os.path.join(unpack_tar_gz_dir, pkg_version)), + "$ZCAT $SOURCES > .temp", + "tar xf .temp -C $UNPACK_TAR_GZ_DIR", + Delete(".temp"), + ]) + + # + # Run setup.py in the unpacked subdirectory to "install" everything + # into our build/test subdirectory. The runtest.py script will set + # PYTHONPATH so that the tests only look under build/test-{package}, + # and under QMTest (for the testing modules TestCmd.py, TestSCons.py, + # etc.). This makes sure that our tests pass with what + # we really packaged, not because of something hanging around in + # the development directory. + # + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. + # + dfiles = [os.path.join(test_tar_gz_dir, x) for x in dst_files] + env.Command(dfiles, unpack_tar_gz_files, [ + Delete(os.path.join(unpack_tar_gz_dir, pkg_version, 'build')), + Delete("$TEST_TAR_GZ_DIR"), + '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_TAR_GZ_DIR" --standalone-lib' % \ + os.path.join(unpack_tar_gz_dir, pkg_version, 'setup.py'), + ]) + + # + # Generate portage files for submission to Gentoo Linux. + # + gentoo = os.path.join(build, 'gentoo') + ebuild = os.path.join(gentoo, 'scons-%s.ebuild' % version) + digest = os.path.join(gentoo, 'files', 'digest-scons-%s' % version) + env.Command(ebuild, os.path.join('gentoo', 'scons.ebuild.in'), SCons_revision) + def Digestify(target, source, env): + import md5 + src = source[0].rfile() + contents = open(str(src)).read() + sig = md5.new(contents).hexdigest() + bytes = os.stat(str(src))[6] + open(str(target[0]), 'w').write("MD5 %s %s %d\n" % (sig, + src.name, + bytes)) + env.Command(digest, tar_gz, Digestify) + + if not zipit: + print "zip not found; skipping .zip package for %s." % pkg + else: + + distutils_formats.append('zip') + + src_deps.append(zip) + + distutils_targets.extend([ zip, platform_zip ]) + + dist_zip = env.Install('$DISTDIR', zip) + dist_platform_zip = env.Install('$DISTDIR', platform_zip) + Local(dist_zip, dist_platform_zip) + AddPostAction(dist_zip, Chmod(dist_zip, 0644)) + AddPostAction(dist_platform_zip, Chmod(dist_platform_zip, 0644)) + + # + # Unpack the zip archive created by the distutils into + # build/unpack-zip/scons-{version}. + # + unpack_zip_files = [os.path.join(unpack_zip_dir, pkg_version, x) + for x in src_files] + + env.Command(unpack_zip_files, dist_zip, [ + Delete(os.path.join(unpack_zip_dir, pkg_version)), + unzipit, + ]) + + # + # Run setup.py in the unpacked subdirectory to "install" everything + # into our build/test subdirectory. The runtest.py script will set + # PYTHONPATH so that the tests only look under build/test-{package}, + # and under QMTest (for the testing modules TestCmd.py, TestSCons.py, + # etc.). This makes sure that our tests pass with what + # we really packaged, not because of something hanging around in + # the development directory. + # + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. + # + dfiles = [os.path.join(test_zip_dir, x) for x in dst_files] + env.Command(dfiles, unpack_zip_files, [ + Delete(os.path.join(unpack_zip_dir, pkg_version, 'build')), + Delete("$TEST_ZIP_DIR"), + '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_ZIP_DIR" --standalone-lib' % \ + os.path.join(unpack_zip_dir, pkg_version, 'setup.py'), + ]) + + if not rpmbuild: + msg = "@echo \"Warning: Can not build 'rpm': no rpmbuild utility found\"" + AlwaysBuild(Alias('rpm', [], msg)) + else: + topdir = os.path.join(build, 'build', + 'bdist.' + platform, 'rpm') + + buildroot = os.path.join(build_dir, 'rpm-buildroot') + + BUILDdir = os.path.join(topdir, 'BUILD', pkg + '-' + version) + RPMSdir = os.path.join(topdir, 'RPMS', 'noarch') + SOURCESdir = os.path.join(topdir, 'SOURCES') + SPECSdir = os.path.join(topdir, 'SPECS') + SRPMSdir = os.path.join(topdir, 'SRPMS') + + specfile_in = os.path.join('rpm', "%s.spec.in" % pkg) + specfile = os.path.join(SPECSdir, "%s-1.spec" % pkg_version) + sourcefile = os.path.join(SOURCESdir, "%s.tar.gz" % pkg_version); + noarch_rpm = os.path.join(RPMSdir, "%s-1.noarch.rpm" % pkg_version) + src_rpm = os.path.join(SRPMSdir, "%s-1.src.rpm" % pkg_version) + + def spec_function(target, source, env): + """Generate the RPM .spec file from the template file. + + This fills in the %files portion of the .spec file with a + list generated from our MANIFEST(s), so we don't have to + maintain multiple lists. + """ + c = open(str(source[0]), 'rb').read() + c = c.replace('__VERSION' + '__', env['VERSION']) + c = c.replace('__RPM_FILES' + '__', env['RPM_FILES']) + open(str(target[0]), 'wb').write(c) + + rpm_files.sort() + rpm_files_str = "\n".join(rpm_files) + "\n" + rpm_spec_env = env.Clone(RPM_FILES = rpm_files_str) + rpm_spec_action = Action(spec_function, varlist=['RPM_FILES']) + rpm_spec_env.Command(specfile, specfile_in, rpm_spec_action) + + env.InstallAs(sourcefile, tar_gz) + Local(sourcefile) + + targets = [ noarch_rpm, src_rpm ] + cmd = "$RPMBUILD --define '_topdir $(%s$)' --buildroot %s -ba $SOURCES" % (topdir, buildroot) + if not os.path.isdir(BUILDdir): + cmd = ("$( mkdir -p %s; $)" % BUILDdir) + cmd + t = env.Command(targets, specfile, cmd) + env.Depends(t, sourcefile) + + dist_noarch_rpm = env.Install('$DISTDIR', noarch_rpm) + dist_src_rpm = env.Install('$DISTDIR', src_rpm) + Local(dist_noarch_rpm, dist_src_rpm) + AddPostAction(dist_noarch_rpm, Chmod(dist_noarch_rpm, 0644)) + AddPostAction(dist_src_rpm, Chmod(dist_src_rpm, 0644)) + + dfiles = [os.path.join(test_rpm_dir, 'usr', x) for x in dst_files] + env.Command(dfiles, + dist_noarch_rpm, + "$RPM2CPIO $SOURCES | (cd $TEST_RPM_DIR && cpio -id)") + + if dh_builddeb and fakeroot: + # Our Debian packaging builds directly into build/dist, + # so we don't need to Install() the .debs. + # The built deb is called just x.y.z, not x.y.z.final.0 so strip those off: + deb_version = '.'.join(version.split('.')[0:3]) + deb = os.path.join(build_dir, 'dist', "%s_%s_all.deb" % (pkg, deb_version)) + # print "Building deb into %s (version=%s)"%(deb, deb_version) + for d in p['debian_deps']: + b = env.SCons_revision(os.path.join(build, d), d) + env.Depends(deb, b) + Local(b) + env.Command(deb, build_src_files, [ + "cd %s && fakeroot make -f debian/rules PYTHON=$PYTHON BUILDDEB_OPTIONS=--destdir=../../build/dist binary" % build, + ]) + + old = os.path.join('lib', 'scons', '') + new = os.path.join('lib', 'python' + python_ver, 'site-packages', '') + def xxx(s, old=old, new=new): + if s[:len(old)] == old: + s = new + s[len(old):] + return os.path.join('usr', s) + dfiles = [os.path.join(test_deb_dir, xxx(x)) for x in dst_files] + env.Command(dfiles, + deb, + "dpkg --fsys-tarfile $SOURCES | (cd $TEST_DEB_DIR && tar -xf -)") + + + # + # Use the Python distutils to generate the appropriate packages. + # + commands = [ + Delete(os.path.join(build, 'build', 'lib')), + Delete(os.path.join(build, 'build', 'scripts')), + ] + + if distutils_formats: + commands.append(Delete(os.path.join(build, + 'build', + 'bdist.' + platform, + 'dumb'))) + for format in distutils_formats: + commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_dumb -f %s" % format) + + commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY sdist --formats=%s" % \ + ','.join(distutils_formats)) + + commands.append("$PYTHON $PYTHONFLAGS $SETUP_PY bdist_wininst --plat-name win32 --user-access-control auto") + + env.Command(distutils_targets, build_src_files, commands) + + # + # Now create local packages for people who want to let people + # build their SCons-buildable packages without having to + # install SCons. + # + s_l_v = '%s-local-%s' % (pkg, version) + + local = pkg + '-local' + build_dir_local = os.path.join(build_dir, local) + build_dir_local_slv = os.path.join(build_dir, local, s_l_v) + + dist_local_tar_gz = os.path.join("$DISTDIR/%s.tar.gz" % s_l_v) + dist_local_zip = os.path.join("$DISTDIR/%s.zip" % s_l_v) + AddPostAction(dist_local_tar_gz, Chmod(dist_local_tar_gz, 0644)) + AddPostAction(dist_local_zip, Chmod(dist_local_zip, 0644)) + + commands = [ + Delete(build_dir_local), + '$PYTHON $PYTHONFLAGS $SETUP_PY install "--install-script=%s" "--install-lib=%s" --no-install-man --no-compile --standalone-lib --no-version-script' % \ + (build_dir_local, build_dir_local_slv), + ] + + for script in scripts: + # add .py extension for scons-local scripts on non-windows platforms + if platform == "win32": + break + local_script = os.path.join(build_dir_local, script) + commands.append(Move(local_script + '.py', local_script)) + + rf = [x for x in raw_files if not x in scripts] + rf = [os.path.join(s_l_v, x) for x in rf] + for script in scripts: + rf.append("%s.py" % script) + local_targets = [os.path.join(build_dir_local, x) for x in rf] + + env.Command(local_targets, build_src_files, commands) + + scons_LICENSE = os.path.join(build_dir_local, 'scons-LICENSE') + l = env.SCons_revision(scons_LICENSE, 'LICENSE-local') + local_targets.append(l) + Local(l) + + scons_README = os.path.join(build_dir_local, 'scons-README') + l = env.SCons_revision(scons_README, 'README-local') + local_targets.append(l) + Local(l) + + if gzip: + if platform == "win32": + # avoid problem with tar interpreting c:/ as a remote machine + tar_cargs = '-cz --force-local -f' + else: + tar_cargs = '-czf' + env.Command(dist_local_tar_gz, + local_targets, + "cd %s && tar %s $( ${TARGET.abspath} $) *" % (build_dir_local, tar_cargs)) + + unpack_targets = [os.path.join(test_local_tar_gz_dir, x) for x in rf] + commands = [Delete(test_local_tar_gz_dir), + Mkdir(test_local_tar_gz_dir), + "cd %s && tar xzf $( ${SOURCE.abspath} $)" % test_local_tar_gz_dir] + + env.Command(unpack_targets, dist_local_tar_gz, commands) + + if zipit: + env.Command(dist_local_zip, local_targets, zipit, + CD = build_dir_local, PSV = '.') + + unpack_targets = [os.path.join(test_local_zip_dir, x) for x in rf] + commands = [Delete(test_local_zip_dir), + Mkdir(test_local_zip_dir), + unzipit] + + env.Command(unpack_targets, dist_local_zip, unzipit, + UNPACK_ZIP_DIR = test_local_zip_dir) + +# +# +# +Export('build_dir', 'env') + +SConscript('QMTest/SConscript') + +# +# +# +files = [ + 'runtest.py', +] + +def copy(target, source, env): + t = str(target[0]) + s = str(source[0]) + open(t, 'wb').write(open(s, 'rb').read()) + +for file in files: + # Guarantee that real copies of these files always exist in + # build/. If there's a symlink there, then this is an Aegis + # build and we blow them away now so that they'll get "built" later. + p = os.path.join(build_dir, file) + if os.path.islink(p): + os.unlink(p) + if not os.path.isabs(p): + p = '#' + p + sp = env.Command(p, file, copy) + Local(sp) + +# +# Documentation. +# +Export('build_dir', 'env', 'whereis', 'revaction') + +SConscript('doc/SConscript') + +# +# If we're running in a Subversion working directory, pack up a complete +# source archive from the project files and files in the change. +# + +sfiles = None +if hg_status_lines: + slines = [l for l in hg_status_lines if l[0] in 'ACM'] + sfiles = [l.split()[-1] for l in slines] +elif svn_status_lines: + slines = [l for l in svn_status_lines if l[0] in ' MA'] + sentries = [l.split()[-1] for l in slines] + sfiles = list(filter(os.path.isfile, sentries)) +else: + print "Not building in a Mercurial or Subversion tree; skipping building src package." + +if sfiles: + remove_patterns = [ + '.hgt/*', + '.svnt/*', + '*.aeignore', + '*.hgignore', + 'www/*', + ] + + for p in remove_patterns: + sfiles = [s for s in sfiles if not fnmatch.fnmatch(s, p)] + + if sfiles: + ps = "%s-src" % project + psv = "%s-%s" % (ps, version) + b_ps = os.path.join(build_dir, ps) + b_psv = os.path.join(build_dir, psv) + b_psv_stamp = b_psv + '-stamp' + + src_tar_gz = os.path.join(build_dir, 'dist', '%s.tar.gz' % psv) + src_zip = os.path.join(build_dir, 'dist', '%s.zip' % psv) + + Local(src_tar_gz, src_zip) + + for file in sfiles: + env.SCons_revision(os.path.join(b_ps, file), file) + + b_ps_files = [os.path.join(b_ps, x) for x in sfiles] + cmds = [ + Delete(b_psv), + Copy(b_psv, b_ps), + Touch("$TARGET"), + ] + + env.Command(b_psv_stamp, src_deps + b_ps_files, cmds) + + Local(*b_ps_files) + + if gzip: + + env.Command(src_tar_gz, b_psv_stamp, + "tar cz${TAR_HFLAG} -f $TARGET -C build %s" % psv) + + # + # Unpack the archive into build/unpack/scons-{version}. + # + unpack_tar_gz_files = [os.path.join(unpack_tar_gz_dir, psv, x) + for x in sfiles] + + # + # We'd like to replace the last three lines with the following: + # + # tar zxf $SOURCES -C $UNPACK_TAR_GZ_DIR + # + # but that gives heartburn to Cygwin's tar, so work around it + # with separate zcat-tar-rm commands. + env.Command(unpack_tar_gz_files, src_tar_gz, [ + Delete(os.path.join(unpack_tar_gz_dir, psv)), + "$ZCAT $SOURCES > .temp", + "tar xf .temp -C $UNPACK_TAR_GZ_DIR", + Delete(".temp"), + ]) + + # + # Run setup.py in the unpacked subdirectory to "install" everything + # into our build/test subdirectory. The runtest.py script will set + # PYTHONPATH so that the tests only look under build/test-{package}, + # and under QMTest (for the testing modules TestCmd.py, + # TestSCons.py, etc.). This makes sure that our tests pass with + # what we really packaged, not because of something hanging around + # in the development directory. + # + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. + # + dfiles = [os.path.join(test_src_tar_gz_dir, x) for x in dst_files] + scons_lib_dir = os.path.join(unpack_tar_gz_dir, psv, 'src', 'engine') + ENV = env.Dictionary('ENV').copy() + ENV['SCONS_LIB_DIR'] = scons_lib_dir + ENV['USERNAME'] = developer + env.Command(dfiles, unpack_tar_gz_files, + [ + Delete(os.path.join(unpack_tar_gz_dir, + psv, + 'build', + 'scons', + 'build')), + Delete("$TEST_SRC_TAR_GZ_DIR"), + 'cd "%s" && $PYTHON $PYTHONFLAGS "%s" "%s" VERSION="$VERSION"' % \ + (os.path.join(unpack_tar_gz_dir, psv), + os.path.join('src', 'script', 'scons.py'), + os.path.join('build', 'scons')), + '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_SRC_TAR_GZ_DIR" --standalone-lib' % \ + os.path.join(unpack_tar_gz_dir, + psv, + 'build', + 'scons', + 'setup.py'), + ], + ENV = ENV) + + if zipit: + + env.Command(src_zip, b_psv_stamp, zipit, CD = 'build', PSV = psv) + + # + # Unpack the archive into build/unpack/scons-{version}. + # + unpack_zip_files = [os.path.join(unpack_zip_dir, psv, x) + for x in sfiles] + + env.Command(unpack_zip_files, src_zip, [ + Delete(os.path.join(unpack_zip_dir, psv)), + unzipit + ]) + + # + # Run setup.py in the unpacked subdirectory to "install" everything + # into our build/test subdirectory. The runtest.py script will set + # PYTHONPATH so that the tests only look under build/test-{package}, + # and under QMTest (for the testing modules TestCmd.py, + # TestSCons.py, etc.). This makes sure that our tests pass with + # what we really packaged, not because of something hanging + # around in the development directory. + # + # We can get away with calling setup.py using a directory path + # like this because we put a preamble in it that will chdir() + # to the directory in which setup.py exists. + # + dfiles = [os.path.join(test_src_zip_dir, x) for x in dst_files] + scons_lib_dir = os.path.join(unpack_zip_dir, psv, 'src', 'engine') + ENV = env.Dictionary('ENV').copy() + ENV['SCONS_LIB_DIR'] = scons_lib_dir + ENV['USERNAME'] = developer + env.Command(dfiles, unpack_zip_files, + [ + Delete(os.path.join(unpack_zip_dir, + psv, + 'build', + 'scons', + 'build')), + Delete("$TEST_SRC_ZIP_DIR"), + 'cd "%s" && $PYTHON $PYTHONFLAGS "%s" "%s" VERSION="$VERSION"' % \ + (os.path.join(unpack_zip_dir, psv), + os.path.join('src', 'script', 'scons.py'), + os.path.join('build', 'scons')), + '$PYTHON $PYTHONFLAGS "%s" install "--prefix=$TEST_SRC_ZIP_DIR" --standalone-lib' % \ + os.path.join(unpack_zip_dir, + psv, + 'build', + 'scons', + 'setup.py'), + ], + ENV = ENV) + +for pf, help_text in packaging_flavors: + Alias(pf, [ + os.path.join(build_dir, 'test-'+pf), + os.path.join(build_dir, 'QMTest'), + os.path.join(build_dir, 'runtest.py'), + ]) + diff --git a/tests/list b/tests/list index d0628ee..76c9189 100644 --- a/tests/list +++ b/tests/list @@ -477,3 +477,11 @@ COPYING.asc application/pgp-signature xoo test-public-key.asc application/pgp-keys xoo test-secret-key.skr application/pgp-keys ooo test-secret-key.asc application/pgp-keys xoo + +# copied from https://bitbucket.org/scons/scons/raw/f0d4664d36f8a4d4da53178cf947c86c86db3cb7/SConstruct +SConstruct text/x-scons oxo +#copied from https://sourceforge.net/p/wesnoth/code/ci/master/tree/src/SConscript?format=raw +SConscript text/x-scons oxo +# copied from https://raw.githubusercontent.com/mongodb/mongo/master/SConscript.buildinfo +SConscript.buildinfo text/x-scons oxo + -- 2.1.4