60 lines
1.7 KiB
Python
60 lines
1.7 KiB
Python
#!/usr/bin/python
|
|
import os
|
|
|
|
CONFIG_VERSION = "6.4.15-rc"
|
|
|
|
|
|
# Set up default environment
|
|
CONFIG_DEBUG = os.path.exists(".debug")
|
|
CONFIG_CCFLAGS = [ "-O2" ]
|
|
if CONFIG_DEBUG == True:
|
|
CONFIG_CCFLAGS = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ]
|
|
|
|
class OEnvironment(Environment):
|
|
def __init__(self, CCFLAGS = CONFIG_CCFLAGS):
|
|
Environment.__init__(self, CCFLAGS = CCFLAGS)
|
|
self.Append(CXXFLAGS = "-std=c++11");
|
|
self.Append(CPPPATH = os.path.abspath("include"))
|
|
self.Append(CXXCOMSTR = "C++ $TARGET")
|
|
self.Append(CCCOMSTR = "CC $TARGET")
|
|
self.Append(LINKCOMSTR = "Linking $TARGET")
|
|
if "DISPLAY" in os.environ.keys():
|
|
self.Append(ENV = { "DISPLAY" : os.environ["DISPLAY"] })
|
|
self.Debug = CONFIG_DEBUG
|
|
self.Version = CONFIG_VERSION
|
|
|
|
def UsePackage(self, name):
|
|
self.ParseConfig("pkg-config --cflags --libs %s" % name)
|
|
|
|
env = OEnvironment()
|
|
Export("env")
|
|
|
|
|
|
include = SConscript("include/Sconscript")
|
|
core = SConscript("core/Sconscript")
|
|
gui = SConscript("gui/Sconscript")
|
|
|
|
if os.path.isdir("tests"):
|
|
tests = SConscript("tests/Sconscript")
|
|
|
|
|
|
ocarina = env.Program("bin/ocarina", core + 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")
|