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 <anna@ocarinaproject.net>
This commit is contained in:
parent
887051e5c1
commit
2eca396042
123
Sconstruct
123
Sconstruct
|
@ -1,76 +1,55 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
import os
|
||||||
|
|
||||||
config = SConscript("config")
|
# Configuration variables
|
||||||
|
CONFIG_VERSION = 6.0
|
||||||
|
CONFIG_DEBUG = True
|
||||||
|
|
||||||
|
|
||||||
#import os, sys
|
# Set up default environment
|
||||||
#import config
|
CONFIG_CCFLAGS = [ "-O2" ]
|
||||||
#
|
if CONFIG_DEBUG == True:
|
||||||
#FLAGS = ["-O2"]
|
CONFIG_CCFLAGS = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ]
|
||||||
#if config.DEBUG == True:
|
|
||||||
# FLAGS = ["-Wall", "-Werror", "-g", "-DDEBUG"]
|
env = Environment( CCFLAGS = CONFIG_CCFLAGS )
|
||||||
# POSTFIX = "-debug"
|
env.Append(CPPPATH = os.path.abspath("include"))
|
||||||
#
|
env.Append(CXXCOMSTR = "C++ $TARGET")
|
||||||
#config.env = Environment(CCFLAGS = FLAGS)
|
env.Append(LINKCOMSTR = "Linking $TARGET")
|
||||||
#if ARGUMENTS.get('VERBOSE') != "1":
|
|
||||||
# config.env.Append(CXXCOMSTR = "C++ $TARGET")
|
|
||||||
# config.env.Append(LINKCOMSTR = "Linking $TARGET")
|
def use_package(name):
|
||||||
#
|
env.ParseConfig("pkg-config --cflags --libs %s" % name)
|
||||||
## Make sure these directories exist before doing anything
|
|
||||||
#if not os.path.exists("bin"):
|
Export("env", "use_package", "CONFIG_DEBUG", "CONFIG_VERSION")
|
||||||
# os.mkdir("bin")
|
|
||||||
#if not os.path.exists("lib"):
|
|
||||||
# os.mkdir("lib")
|
include = SConscript("include/Sconscript")
|
||||||
#
|
|
||||||
#config.include = SConscript("include/Sconscript")
|
lib = SConscript("lib/Sconscript")
|
||||||
#config.libsaria = SConscript("libsaria/Sconscript")
|
Export("lib")
|
||||||
#
|
|
||||||
#ocarina = SConscript("ocarina/Sconscript")
|
tests = SConscript("tests/Sconscript")
|
||||||
#newgui = SConscript("newgui/Sconscript")
|
|
||||||
#Default(ocarina)
|
gui = SConscript("gui/Sconscript")
|
||||||
#
|
|
||||||
## Install bin/ and lib/
|
ocarina = env.Program("bin/ocarina", lib + gui)
|
||||||
#def install_dirs(dirs):
|
Default(ocarina)
|
||||||
# res = []
|
Clean(ocarina, "bin/")
|
||||||
# for dir in dirs:
|
|
||||||
# target = os.path.join(config.PREFIX, dir)
|
|
||||||
# for file in os.listdir(dir):
|
def ocarina_release(target, source, env):
|
||||||
# source = os.path.join(dir, file)
|
o_vers = "ocarina-%s" % CONFIG_VERSION
|
||||||
# config.env.Install(target, source)
|
|
||||||
# res += [target]
|
os.popen("git archive --prefix=%s/ -o %s.tar.gz HEAD" % (o_vers, o_vers))
|
||||||
# return res
|
print os.popen("sha1sum %s.tar.gz" % o_vers).read()
|
||||||
#
|
|
||||||
#dirs = install_dirs(["bin/", "lib/"])
|
Command("release", None, ocarina_release)
|
||||||
#config.env.Alias("install", dirs)
|
|
||||||
#config.env.Command("uninstall", None, Delete(FindInstalledFiles()))
|
|
||||||
#
|
env.Install("/usr/bin", "bin/ocarina")
|
||||||
## Clean up the build directory
|
env.Install("/usr/share", "share/ocarina/")
|
||||||
#clean = Clean(ocarina, ["include/version.h", "bin/", "lib/"])
|
env.Install("/usr/share/applications", "share/applications/ocarina.desktop")
|
||||||
#
|
|
||||||
## Create a tarball and a PKGBUILD script
|
install = Alias("install", [ "/usr/bin", "/usr/share", "/usr/share/applications" ])
|
||||||
#def prepare_release(target, source, env):
|
Depends(install, ocarina)
|
||||||
# import datetime
|
Clean(install, "/usr/share/ocarina")
|
||||||
#
|
|
||||||
# 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])
|
|
||||||
|
|
55
config
55
config
|
@ -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")
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
function read_config
|
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
|
function config_version
|
||||||
|
|
Loading…
Reference in New Issue