2011-11-07 23:42:59 -05:00
|
|
|
#!/usr/bin/python
|
2014-04-09 20:40:30 -04:00
|
|
|
import os
|
2011-08-28 11:10:58 -04:00
|
|
|
|
2016-09-11 10:22:40 -04:00
|
|
|
CONFIG_VERSION = "6.4.19"
|
2014-04-09 20:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
# Set up default environment
|
2015-01-15 09:15:07 -05:00
|
|
|
CONFIG_DEBUG = os.path.exists(".debug")
|
2014-04-09 20:40:30 -04:00
|
|
|
CONFIG_CCFLAGS = [ "-O2" ]
|
|
|
|
if CONFIG_DEBUG == True:
|
|
|
|
CONFIG_CCFLAGS = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ]
|
|
|
|
|
2014-05-14 17:48:43 -04:00
|
|
|
class OEnvironment(Environment):
|
2014-05-20 17:22:49 -04:00
|
|
|
def __init__(self, CCFLAGS = CONFIG_CCFLAGS):
|
|
|
|
Environment.__init__(self, CCFLAGS = CCFLAGS)
|
2015-10-13 10:04:09 -04:00
|
|
|
self.Append(CXXFLAGS = "-std=c++11");
|
2014-05-14 17:48:43 -04:00
|
|
|
self.Append(CPPPATH = os.path.abspath("include"))
|
|
|
|
self.Append(CXXCOMSTR = "C++ $TARGET")
|
2015-08-19 17:15:46 -04:00
|
|
|
self.Append(CCCOMSTR = "CC $TARGET")
|
2014-05-14 17:48:43 -04:00
|
|
|
self.Append(LINKCOMSTR = "Linking $TARGET")
|
2016-04-11 15:02:24 -04:00
|
|
|
if "DISPLAY" in os.environ.keys():
|
|
|
|
self.Append(ENV = { "DISPLAY" : os.environ["DISPLAY"] })
|
2014-05-14 17:48:43 -04:00
|
|
|
self.Debug = CONFIG_DEBUG
|
|
|
|
self.Version = CONFIG_VERSION
|
2014-04-09 20:40:30 -04:00
|
|
|
|
2014-05-14 17:48:43 -04:00
|
|
|
def UsePackage(self, name):
|
|
|
|
self.ParseConfig("pkg-config --cflags --libs %s" % name)
|
2014-04-09 20:40:30 -04:00
|
|
|
|
2014-05-14 17:48:43 -04:00
|
|
|
env = OEnvironment()
|
2015-08-19 00:49:52 -04:00
|
|
|
Export("env")
|
2014-04-09 20:40:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
include = SConscript("include/Sconscript")
|
2014-06-05 10:19:22 -04:00
|
|
|
core = SConscript("core/Sconscript")
|
2014-06-14 20:05:24 -04:00
|
|
|
gui = SConscript("gui/Sconscript")
|
2014-04-09 20:40:30 -04:00
|
|
|
|
2015-01-17 09:26:01 -05:00
|
|
|
if os.path.isdir("tests"):
|
|
|
|
tests = SConscript("tests/Sconscript")
|
2014-04-09 20:40:30 -04:00
|
|
|
|
|
|
|
|
2015-01-21 08:38:00 -05:00
|
|
|
ocarina = env.Program("bin/ocarina", core + gui)
|
2014-04-09 20:40:30 -04:00
|
|
|
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")
|