From 2eca39604249d5c01866b0487beacf1353d8ebf5 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Wed, 9 Apr 2014 20:40:30 -0400 Subject: [PATCH] Rename config -> Sconstruct I only had config so I could easily refer to the original Sconstruct. I don't need that anymore =) Signed-off-by: Anna Schumaker --- Sconstruct | 123 ++++++++++++++++++++--------------------------- config | 55 --------------------- tests/_functions | 2 +- 3 files changed, 52 insertions(+), 128 deletions(-) delete mode 100644 config diff --git a/Sconstruct b/Sconstruct index edaba2f8..39c59ec7 100644 --- a/Sconstruct +++ b/Sconstruct @@ -1,76 +1,55 @@ #!/usr/bin/python +import os -config = SConscript("config") +# Configuration variables +CONFIG_VERSION = 6.0 +CONFIG_DEBUG = True -#import os, sys -#import config -# -#FLAGS = ["-O2"] -#if config.DEBUG == True: -# FLAGS = ["-Wall", "-Werror", "-g", "-DDEBUG"] -# POSTFIX = "-debug" -# -#config.env = Environment(CCFLAGS = FLAGS) -#if ARGUMENTS.get('VERBOSE') != "1": -# config.env.Append(CXXCOMSTR = "C++ $TARGET") -# config.env.Append(LINKCOMSTR = "Linking $TARGET") -# -## Make sure these directories exist before doing anything -#if not os.path.exists("bin"): -# os.mkdir("bin") -#if not os.path.exists("lib"): -# os.mkdir("lib") -# -#config.include = SConscript("include/Sconscript") -#config.libsaria = SConscript("libsaria/Sconscript") -# -#ocarina = SConscript("ocarina/Sconscript") -#newgui = SConscript("newgui/Sconscript") -#Default(ocarina) -# -## Install bin/ and lib/ -#def install_dirs(dirs): -# res = [] -# for dir in dirs: -# target = os.path.join(config.PREFIX, dir) -# for file in os.listdir(dir): -# source = os.path.join(dir, file) -# config.env.Install(target, source) -# res += [target] -# return res -# -#dirs = install_dirs(["bin/", "lib/"]) -#config.env.Alias("install", dirs) -#config.env.Command("uninstall", None, Delete(FindInstalledFiles())) -# -## Clean up the build directory -#clean = Clean(ocarina, ["include/version.h", "bin/", "lib/"]) -# -## Create a tarball and a PKGBUILD script -#def prepare_release(target, source, env): -# import datetime -# -# ocarina="ocarina-%s" % config.version -# os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (ocarina, ocarina)) -# md5 = os.popen("md5sum %s.tar.gz | awk '{print $1}'" % ocarina).read().strip() -# -# now = datetime.datetime.now() -# year = str(now.year) -# month = str(now.month) -# if (len(month) == 1): -# month = "0" + month -# -# f = open("PKGBUILD", "w") -# for line in open("PKGBUILD.tmpl"): -# if config.BUG == 0: -# line = line.replace("pkgver=", "pkgver=%s.%s" % (config.MAJOR, config.MINOR)) -# else: -# line = line.replace("pkgver=", "pkgver=%s.%s.%s" % (config.MAJOR, config.MINOR, config.BUG)) -# line = line.replace("md5sums=", "md5sums=('%s')" % md5) -# line = line.replace("YEAR", year) -# line = line.replace("MONTH", month) -# f.write(line) -# f.close() -# -#config.env.Command("release", None, [prepare_release]) +# Set up default environment +CONFIG_CCFLAGS = [ "-O2" ] +if CONFIG_DEBUG == True: + CONFIG_CCFLAGS = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ] + +env = Environment( CCFLAGS = CONFIG_CCFLAGS ) +env.Append(CPPPATH = os.path.abspath("include")) +env.Append(CXXCOMSTR = "C++ $TARGET") +env.Append(LINKCOMSTR = "Linking $TARGET") + + +def use_package(name): + env.ParseConfig("pkg-config --cflags --libs %s" % name) + +Export("env", "use_package", "CONFIG_DEBUG", "CONFIG_VERSION") + + +include = SConscript("include/Sconscript") + +lib = SConscript("lib/Sconscript") +Export("lib") + +tests = SConscript("tests/Sconscript") + +gui = SConscript("gui/Sconscript") + +ocarina = env.Program("bin/ocarina", lib + gui) +Default(ocarina) +Clean(ocarina, "bin/") + + +def ocarina_release(target, source, env): + o_vers = "ocarina-%s" % CONFIG_VERSION + + os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (o_vers, o_vers)) + print os.popen("sha1sum %s.tar.gz" % o_vers).read() + +Command("release", None, ocarina_release) + + +env.Install("/usr/bin", "bin/ocarina") +env.Install("/usr/share", "share/ocarina/") +env.Install("/usr/share/applications", "share/applications/ocarina.desktop") + +install = Alias("install", [ "/usr/bin", "/usr/share", "/usr/share/applications" ]) +Depends(install, ocarina) +Clean(install, "/usr/share/ocarina") diff --git a/config b/config deleted file mode 100644 index 39c59ec7..00000000 --- a/config +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python -import os - -# Configuration variables -CONFIG_VERSION = 6.0 -CONFIG_DEBUG = True - - -# Set up default environment -CONFIG_CCFLAGS = [ "-O2" ] -if CONFIG_DEBUG == True: - CONFIG_CCFLAGS = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ] - -env = Environment( CCFLAGS = CONFIG_CCFLAGS ) -env.Append(CPPPATH = os.path.abspath("include")) -env.Append(CXXCOMSTR = "C++ $TARGET") -env.Append(LINKCOMSTR = "Linking $TARGET") - - -def use_package(name): - env.ParseConfig("pkg-config --cflags --libs %s" % name) - -Export("env", "use_package", "CONFIG_DEBUG", "CONFIG_VERSION") - - -include = SConscript("include/Sconscript") - -lib = SConscript("lib/Sconscript") -Export("lib") - -tests = SConscript("tests/Sconscript") - -gui = SConscript("gui/Sconscript") - -ocarina = env.Program("bin/ocarina", lib + gui) -Default(ocarina) -Clean(ocarina, "bin/") - - -def ocarina_release(target, source, env): - o_vers = "ocarina-%s" % CONFIG_VERSION - - os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (o_vers, o_vers)) - print os.popen("sha1sum %s.tar.gz" % o_vers).read() - -Command("release", None, ocarina_release) - - -env.Install("/usr/bin", "bin/ocarina") -env.Install("/usr/share", "share/ocarina/") -env.Install("/usr/share/applications", "share/applications/ocarina.desktop") - -install = Alias("install", [ "/usr/bin", "/usr/share", "/usr/share/applications" ]) -Depends(install, ocarina) -Clean(install, "/usr/share/ocarina") diff --git a/tests/_functions b/tests/_functions index 4755bf77..ac9e6d25 100644 --- a/tests/_functions +++ b/tests/_functions @@ -3,7 +3,7 @@ function read_config { - cat ../config | grep ^$1 | awk -F= '{print $2}' | tr -d ' ' + cat ../Sconstruct | grep ^$1 | awk -F= '{print $2}' | tr -d ' ' } function config_version