Merge branch 'waf-upgrade'
This brings waf to latest and allows building with python3 Tested versions of python: 2.7.18, 3.8.7, 3.9.1
This commit is contained in:
commit
dccd4f86c7
|
@ -10,8 +10,8 @@
|
||||||
/GRTAGS
|
/GRTAGS
|
||||||
/GSYMS
|
/GSYMS
|
||||||
/GTAGS
|
/GTAGS
|
||||||
/.waf-*
|
/.waf*
|
||||||
/.lock-wafbuild
|
/.lock-waf*
|
||||||
/build
|
/build
|
||||||
*~
|
*~
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import signal, time
|
import signal, time
|
||||||
|
@ -15,21 +15,21 @@ class level1app:
|
||||||
elif signum == signal.SIGINT:
|
elif signum == signal.SIGINT:
|
||||||
self.run = False
|
self.run = False
|
||||||
else:
|
else:
|
||||||
print "Unknown signal %d received" % signum
|
print ("Unknown signal %d received" % signum)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
signal.signal(signal.SIGUSR1, self.sighandler)
|
signal.signal(signal.SIGUSR1, self.sighandler)
|
||||||
signal.signal(signal.SIGTERM, self.sighandler)
|
signal.signal(signal.SIGTERM, self.sighandler)
|
||||||
signal.signal(signal.SIGINT, self.sighandler)
|
signal.signal(signal.SIGINT, self.sighandler)
|
||||||
|
|
||||||
print "Waiting for signals..."
|
print ("Waiting for signals...")
|
||||||
|
|
||||||
while self.run:
|
while self.run:
|
||||||
if self.save:
|
if self.save:
|
||||||
print "Save"
|
print ("Save")
|
||||||
self.save = False
|
self.save = False
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
print "Exit"
|
print ("Exit")
|
||||||
|
|
||||||
level1app().run()
|
level1app().run()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/python3
|
||||||
#
|
#
|
||||||
# LADI Session Handler (ladish)
|
# LADI Session Handler (ladish)
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/python3
|
||||||
#
|
#
|
||||||
# This file shows example usage of python bindings for LASH
|
# This file shows example usage of python bindings for LASH
|
||||||
# As such code here is public domain you can use it as you wish and in
|
# As such code here is public domain you can use it as you wish and in
|
||||||
|
@ -17,22 +17,22 @@ def lash_check_events(lash_client):
|
||||||
|
|
||||||
event_type = lash.lash_event_get_type(event)
|
event_type = lash.lash_event_get_type(event)
|
||||||
if event_type == lash.LASH_Quit:
|
if event_type == lash.LASH_Quit:
|
||||||
print "LASH ordered quit."
|
print ("LASH ordered quit.")
|
||||||
return False
|
return False
|
||||||
elif event_type == lash.LASH_Save_File:
|
elif event_type == lash.LASH_Save_File:
|
||||||
print "LASH ordered to save data in directory %s" % lash.lash_event_get_string(event)
|
print ("LASH ordered to save data in directory %s" % lash.lash_event_get_string(event))
|
||||||
lash.lash_send_event(lash_client, event)
|
lash.lash_send_event(lash_client, event)
|
||||||
elif event_type == lash.LASH_Save_Data_Set:
|
elif event_type == lash.LASH_Save_Data_Set:
|
||||||
print "LASH ordered to save data"
|
print ("LASH ordered to save data")
|
||||||
lash.lash_send_event(lash_client, event)
|
lash.lash_send_event(lash_client, event)
|
||||||
elif event_type == lash.LASH_Restore_Data_Set:
|
elif event_type == lash.LASH_Restore_Data_Set:
|
||||||
print "LASH ordered to restore data"
|
print ("LASH ordered to restore data")
|
||||||
lash.lash_event_destroy(event)
|
lash.lash_event_destroy(event)
|
||||||
elif event_type == lash.LASH_Restore_File:
|
elif event_type == lash.LASH_Restore_File:
|
||||||
print "LASH ordered to restore data from directory %s" % lash.lash_event_get_string(event)
|
print ("LASH ordered to restore data from directory %s" % lash.lash_event_get_string(event))
|
||||||
lash.lash_event_destroy(event)
|
lash.lash_event_destroy(event)
|
||||||
else:
|
else:
|
||||||
print "Got unhandled LASH event, type " + str(event_type)
|
print ("Got unhandled LASH event, type " + str(event_type))
|
||||||
lash.lash_event_destroy(event)
|
lash.lash_event_destroy(event)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -43,10 +43,10 @@ def lash_check_events(lash_client):
|
||||||
# sys.argv is modified by this call
|
# sys.argv is modified by this call
|
||||||
lash_client = lash.init(sys.argv, "pylash test", lash.LASH_Config_Data_Set | lash.LASH_Terminal)
|
lash_client = lash.init(sys.argv, "pylash test", lash.LASH_Config_Data_Set | lash.LASH_Terminal)
|
||||||
if not lash_client:
|
if not lash_client:
|
||||||
print "Cannot connect to LASH server"
|
print ("Cannot connect to LASH server")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print "Successfully connected to LASH server at " + lash.lash_get_server_name(lash_client)
|
print ("Successfully connected to LASH server at " + lash.lash_get_server_name(lash_client))
|
||||||
|
|
||||||
# Send our client name to server
|
# Send our client name to server
|
||||||
lash_event = lash.lash_event_new_with_type(lash.LASH_Client_Name)
|
lash_event = lash.lash_event_new_with_type(lash.LASH_Client_Name)
|
||||||
|
|
59
wscript
59
wscript
|
@ -1,13 +1,8 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
import os
|
from __future__ import with_statement
|
||||||
import Options
|
|
||||||
import Utils
|
|
||||||
import shutil
|
|
||||||
import re
|
|
||||||
import waflib
|
|
||||||
from waflib.Scripting import Dist
|
|
||||||
|
|
||||||
parallel_debug = False
|
parallel_debug = False
|
||||||
|
|
||||||
|
@ -20,19 +15,24 @@ RELEASE = False
|
||||||
top = '.'
|
top = '.'
|
||||||
out = 'build'
|
out = 'build'
|
||||||
|
|
||||||
from Logs import pprint
|
import os, sys, re, io, optparse, shutil, tokenize
|
||||||
|
from hashlib import md5
|
||||||
|
|
||||||
|
from waflib import Errors, Utils, Options, Logs, Scripting
|
||||||
|
from waflib import Configure
|
||||||
|
from waflib import Context
|
||||||
|
|
||||||
def display_msg(conf, msg="", status = None, color = None):
|
def display_msg(conf, msg="", status = None, color = None):
|
||||||
if status:
|
if status:
|
||||||
conf.msg(msg, status, color)
|
conf.msg(msg, status, color)
|
||||||
else:
|
else:
|
||||||
pprint('NORMAL', msg)
|
Logs.pprint('NORMAL', msg)
|
||||||
|
|
||||||
def display_raw_text(conf, text, color = 'NORMAL'):
|
def display_raw_text(conf, text, color = 'NORMAL'):
|
||||||
pprint(color, text, sep = '')
|
Logs.pprint(color, text, sep = '')
|
||||||
|
|
||||||
def display_line(conf, text, color = 'NORMAL'):
|
def display_line(conf, text, color = 'NORMAL'):
|
||||||
pprint(color, text, sep = os.linesep)
|
Logs.pprint(color, text, sep = os.linesep)
|
||||||
|
|
||||||
def yesno(bool):
|
def yesno(bool):
|
||||||
if bool:
|
if bool:
|
||||||
|
@ -55,6 +55,8 @@ def options(opt):
|
||||||
opt.add_option('--distsuffix', type='string', default="", help="String to append to the distribution tarball name")
|
opt.add_option('--distsuffix', type='string', default="", help="String to append to the distribution tarball name")
|
||||||
opt.add_option('--tagdist', action='store_true', default=False, help='Create of git tag for distname')
|
opt.add_option('--tagdist', action='store_true', default=False, help='Create of git tag for distname')
|
||||||
opt.add_option('--libdir', type='string', default=None, help='Define lib dir')
|
opt.add_option('--libdir', type='string', default=None, help='Define lib dir')
|
||||||
|
|
||||||
|
|
||||||
if parallel_debug:
|
if parallel_debug:
|
||||||
opt.load('parallel_debug')
|
opt.load('parallel_debug')
|
||||||
|
|
||||||
|
@ -201,9 +203,10 @@ def configure(conf):
|
||||||
if build_gui:
|
if build_gui:
|
||||||
# We need the boost headers package (e.g. libboost-dev)
|
# We need the boost headers package (e.g. libboost-dev)
|
||||||
# shared_ptr.hpp and weak_ptr.hpp
|
# shared_ptr.hpp and weak_ptr.hpp
|
||||||
build_gui = conf.check_boost(
|
conf.check_boost(
|
||||||
mandatory = False,
|
mandatory = False,
|
||||||
errmsg="not found, see http://boost.org/")
|
errmsg="not found, see http://boost.org/")
|
||||||
|
build_gui = not not conf.env['BOOST_VERSION']
|
||||||
|
|
||||||
conf.env['BUILD_GLADISH'] = build_gui
|
conf.env['BUILD_GLADISH'] = build_gui
|
||||||
|
|
||||||
|
@ -240,10 +243,10 @@ def configure(conf):
|
||||||
#print "optimize force enable is required"
|
#print "optimize force enable is required"
|
||||||
if not check_gcc_optimizations_enabled(conf.env['CFLAGS']):
|
if not check_gcc_optimizations_enabled(conf.env['CFLAGS']):
|
||||||
if Options.options.debug:
|
if Options.options.debug:
|
||||||
print "C optimization must be forced in order to enable -Wuninitialized"
|
print ("C optimization must be forced in order to enable -Wuninitialized")
|
||||||
print "However this will not be made because debug compilation is enabled"
|
print ("However this will not be made because debug compilation is enabled")
|
||||||
else:
|
else:
|
||||||
print "C optimization forced in order to enable -Wuninitialized"
|
print ("C optimization forced in order to enable -Wuninitialized")
|
||||||
conf.env.append_unique('CFLAGS', "-O")
|
conf.env.append_unique('CFLAGS', "-O")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -273,7 +276,7 @@ def configure(conf):
|
||||||
version_msg = APPNAME + "-" + VERSION
|
version_msg = APPNAME + "-" + VERSION
|
||||||
|
|
||||||
if os.access('version.h', os.R_OK):
|
if os.access('version.h', os.R_OK):
|
||||||
data = file('version.h').read()
|
data = open('version.h').read()
|
||||||
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
|
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
|
||||||
if m != None:
|
if m != None:
|
||||||
version_msg += " exported from " + m.group(1)
|
version_msg += " exported from " + m.group(1)
|
||||||
|
@ -319,21 +322,21 @@ def git_ver(self):
|
||||||
if os.access('./version.h', os.R_OK):
|
if os.access('./version.h', os.R_OK):
|
||||||
header = os.path.join(os.getcwd(), out, "version.h")
|
header = os.path.join(os.getcwd(), out, "version.h")
|
||||||
shutil.copy('./version.h', header)
|
shutil.copy('./version.h', header)
|
||||||
data = file(header).read()
|
data = open(header).read()
|
||||||
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
|
m = re.match(r'^#define GIT_VERSION "([^"]*)"$', data)
|
||||||
if m != None:
|
if m != None:
|
||||||
self.ver = m.group(1)
|
self.ver = m.group(1)
|
||||||
pprint('BLUE', "tarball from git revision " + self.ver)
|
Logs.pprint('BLUE', "tarball from git revision " + self.ver)
|
||||||
else:
|
else:
|
||||||
self.ver = "tarball"
|
self.ver = "tarball"
|
||||||
return
|
return
|
||||||
|
|
||||||
if bld.srcnode.find_node('.git'):
|
if bld.srcnode.find_node('.git'):
|
||||||
self.ver = bld.cmd_and_log("LANG= git rev-parse HEAD", quiet=waflib.Context.BOTH).splitlines()[0]
|
self.ver = bld.cmd_and_log("LANG= git rev-parse HEAD", quiet=Context.BOTH).splitlines()[0]
|
||||||
if bld.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet=waflib.Context.BOTH).splitlines():
|
if bld.cmd_and_log("LANG= git diff-index --name-only HEAD", quiet=Context.BOTH).splitlines():
|
||||||
self.ver += "-dirty"
|
self.ver += "-dirty"
|
||||||
|
|
||||||
pprint('BLUE', "git revision " + self.ver)
|
Logs.pprint('BLUE', "git revision " + self.ver)
|
||||||
else:
|
else:
|
||||||
self.ver = "unknown"
|
self.ver = "unknown"
|
||||||
|
|
||||||
|
@ -637,10 +640,10 @@ def build(bld):
|
||||||
# GtkBuilder UI definitions (XML)
|
# GtkBuilder UI definitions (XML)
|
||||||
bld.install_files('${DATA_DIR}', 'gui/gladish.ui')
|
bld.install_files('${DATA_DIR}', 'gui/gladish.ui')
|
||||||
|
|
||||||
bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0755)
|
bld.install_files('${PREFIX}/bin', 'ladish_control', chmod=0o0755)
|
||||||
|
|
||||||
# 'Desktop' file (menu entry, icon, etc)
|
# 'Desktop' file (menu entry, icon, etc)
|
||||||
bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0644)
|
bld.install_files('${PREFIX}/share/applications/', 'gui/gladish.desktop', chmod=0o0644)
|
||||||
|
|
||||||
# Icons
|
# Icons
|
||||||
icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
|
icon_sizes = ['16x16', '22x22', '24x24', '32x32', '48x48', '256x256']
|
||||||
|
@ -661,14 +664,14 @@ def build(bld):
|
||||||
html_docs_source_dir = "build/default/html"
|
html_docs_source_dir = "build/default/html"
|
||||||
if bld.cmd == 'clean':
|
if bld.cmd == 'clean':
|
||||||
if os.access(html_docs_source_dir, os.R_OK):
|
if os.access(html_docs_source_dir, os.R_OK):
|
||||||
pprint('CYAN', "Removing doxygen generated documentation...")
|
Logs.pprint('CYAN', "Removing doxygen generated documentation...")
|
||||||
shutil.rmtree(html_docs_source_dir)
|
shutil.rmtree(html_docs_source_dir)
|
||||||
pprint('CYAN', "Removing doxygen generated documentation done.")
|
Logs.pprint('CYAN', "Removing doxygen generated documentation done.")
|
||||||
elif bld.cmd == 'build':
|
elif bld.cmd == 'build':
|
||||||
if not os.access(html_docs_source_dir, os.R_OK):
|
if not os.access(html_docs_source_dir, os.R_OK):
|
||||||
os.popen("doxygen").read()
|
os.popen("doxygen").read()
|
||||||
else:
|
else:
|
||||||
pprint('CYAN', "doxygen documentation already built.")
|
Logs.pprint('CYAN', "doxygen documentation already built.")
|
||||||
|
|
||||||
bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
|
bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
|
||||||
|
|
||||||
|
@ -701,7 +704,7 @@ def etags(ctx):
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
os.system("stat -c '%y' TAGS")
|
os.system("stat -c '%y' TAGS")
|
||||||
|
|
||||||
class ladish_dist(waflib.Scripting.Dist):
|
class ladish_dist(Scripting.Dist):
|
||||||
cmd = 'dist'
|
cmd = 'dist'
|
||||||
fun = 'dist'
|
fun = 'dist'
|
||||||
|
|
||||||
|
@ -711,7 +714,7 @@ class ladish_dist(waflib.Scripting.Dist):
|
||||||
self.base_name = Options.options.distname
|
self.base_name = Options.options.distname
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self.base_name = self.cmd_and_log("LANG= git describe --tags", quiet=waflib.Context.BOTH).splitlines()[0]
|
self.base_name = self.cmd_and_log("LANG= git describe --tags", quiet=Context.BOTH).splitlines()[0]
|
||||||
except:
|
except:
|
||||||
self.base_name = APPNAME + '-' + VERSION
|
self.base_name = APPNAME + '-' + VERSION
|
||||||
self.base_name += Options.options.distsuffix
|
self.base_name += Options.options.distsuffix
|
||||||
|
|
Loading…
Reference in New Issue