Permalink
Browse files

Update wscripts for Waf 1.6

We update the waf setup so that we can use the newest release. The
newer releases are simultaneously usable with either Python 2 or
Python 3.

NOTE: All users of the Git repository must download new Waf (See README).
  • Loading branch information...
Ulrik Sverdrup
Ulrik Sverdrup committed Nov 5, 2010
1 parent b1e4830 commit ef0d0638d76e5d967982bfd1cde0731dd2355fb9
Showing with 75 additions and 85 deletions.
  1. +1 −1 README
  2. +12 −13 auxdata/wscript
  3. +4 −3 data/wscript_build
  4. +1 −1 extras/wscript
  5. +15 −19 help/wscript
  6. +42 −48 wscript
View
2 README
@@ -11,7 +11,7 @@ Installing
This project is configured for waf; waf is shipped in the distributable
tarball but not in the repository. If you need to get waf, run::
- wget -O waf http://waf.googlecode.com/files/waf-1.5.8
+ wget -O waf http://waf.googlecode.com/files/waf-1.6.3
chmod +x waf
Installation follows the steps::
View
@@ -1,9 +1,8 @@
#! /usr/bin/env python
-import Options
-import Utils
+from waflib import Options, Utils, Logs
-def set_options(opt):
+def options(opt):
opt.add_option('--no-update-mime',
action='store_true',
default=False,
@@ -18,14 +17,14 @@ def build(bld):
# merge translations into the .desktop file
# and set it up to be installed
def install_desktop_file(desktop_subst_file):
- bld.new_task_gen(
- "intltool_in",
+ bld(
+ features="intltool_in",
podir="../po",
flags = ("-d", "-q", "-u", "-c"),
source = desktop_subst_file + ".in",
target = desktop_subst_file,
install_path = "${DATADIR}/applications",
- chmod = 0755,
+ chmod = 0o755,
)
install_desktop_file("kupfer.desktop")
@@ -34,8 +33,8 @@ def build(bld):
# install mimetype descriptions
mimetypes_file = "kupfer-mimetypes.xml"
- bld.new_task_gen(
- "intltool_in",
+ bld(
+ features="intltool_in",
podir="../po",
flags = ("-x", "-q", "-u", "-c"),
source = mimetypes_file + ".in",
@@ -54,11 +53,11 @@ def build(bld):
# Waf's "gnome" tool -- def postinstall_icons():
if icons_inst and bld.is_install:
- icon_dir = bld.get_install_path('${DATADIR}/icons/hicolor')
+ icon_dir = Utils.subst_vars('${DATADIR}/icons/hicolor', bld.env)
if not Options.options.destdir:
- Utils.pprint('YELLOW',"Updating Gtk icon cache.")
+ Logs.pprint('GREEN',"Updating Gtk icon cache.")
command='gtk-update-icon-cache -q -f -t %s' % icon_dir
- ret=Utils.exec_command(command)
+ bld.exec_command(command)
else:
- Utils.pprint('YELLOW','Icon cache not updated. After install, run this:')
- Utils.pprint('YELLOW','gtk-update-icon-cache -q -f -t %s'%icon_dir)
+ Logs.pprint('YELLOW','Icon cache not updated. After install, run this:')
+ Logs.pprint('YELLOW','gtk-update-icon-cache -q -f -t %s'%icon_dir)
View
@@ -1,7 +1,8 @@
# configuration defaults and ui files
bld.install_files("${DATADIR}/kupfer", "defaults.cfg")
-bld.install_files("${DATADIR}/kupfer", "*.ui")
+bld.install_files("${DATADIR}/kupfer", bld.path.ant_glob("*.ui"))
# install all pure data files
-bld.install_files("${DATADIR}/kupfer/art", "art/*")
-bld.install_files("${DATADIR}/kupfer/searchplugins", "searchplugins/*")
+bld.install_files("${DATADIR}/kupfer/art", bld.path.ant_glob("art/*"))
+bld.install_files("${DATADIR}/kupfer/searchplugins",
+ bld.path.ant_glob("searchplugins/*"))
View
@@ -1,7 +1,7 @@
import Options, Utils
import os
-def set_options(opt):
+def options(opt):
opt.add_option('--no-install-nautilus-extension',
action='store_true',
default=False,
View
@@ -5,8 +5,7 @@
## Mallard functionality definitions ##
import os
-import Task
-import TaskGen
+from waflib import Task, TaskGen, Utils
# FIXME: Support for figures
@@ -25,8 +24,8 @@ def init_mallard(self):
have_vars = set(var for var in DOC_VAR if DOC_VAR[var])
missing_vars = set(require_vars).difference(have_vars)
if missing_vars:
- print "Missing DOC variable declarations in %s:" % (mf_am.abspath())
- print "\n".join(missing_vars)
+ print("Missing DOC variable declarations in %s:" % (mf_am.abspath()))
+ print("\n".join(missing_vars))
self.bld.env.update(DOC_VAR)
self.default_install_path='${PREFIX}/share/gnome/help/${DOC_ID}'
@@ -35,17 +34,16 @@ def apply_mallard(self):
bld = self.bld
lst = self.to_list(bld.env["DOC_LINGUAS"])
cnode = self.path.find_dir("C")
- self.bld.rescan(cnode)
- pages = [p for p in self.bld.cache_dir_contents[cnode.id]
- if (os.path.splitext(p)[-1].lower()) == ".page"]
+ pages = cnode.ant_glob("*.page")
+ self.install_path = Utils.subst_vars(self.default_install_path, self.env)
# Check if the declared page list is consistent
declared_pages = self.to_list(bld.env["DOC_PAGES"])
- missing_pages = set(pages).difference(declared_pages)
+ missing_pages = set([str(p) for p in pages]).difference(declared_pages)
if missing_pages:
- print "Warning: Some pages not declared:"
- print "\n".join(missing_pages)
+ print("Warning: Some pages not declared:")
+ print("\n".join([str(p) for p in missing_pages]))
for lang in lst:
node = self.path.find_resource("%s/%s.po" % (lang, lang))
@@ -55,12 +53,11 @@ def apply_mallard(self):
src = self.path.find_resource('C/%s' % page)
tsk.set_inputs([node,src])
tsk.set_outputs(out)
- tsk.install_path = os.path.join(self.install_path, lang)
- if bld.is_install:
- for page in pages:
- out = "%s/%s" % (cnode.abspath(), page)
- instdir = os.path.join(self.install_path, "C")
- bld.install_files(instdir, out)
+ bld.install_files(os.path.join(self.install_path, lang),
+ tsk.outputs)
+ for page in pages:
+ instdir = os.path.join(self.install_path, "C")
+ bld.install_files(instdir, page)
Task.simple_task_type('xml2po', '${XML2PO} ${XML2POFLAGS} ${SRC} > ${TGT}',
color='BLUE')
@@ -74,7 +71,7 @@ TaskGen.after('init_mallard')(apply_mallard)
# Build Configuration
-def set_options(opt):
+def options(opt):
pass
def configure(conf):
@@ -83,7 +80,6 @@ def configure(conf):
def build(bld):
if bld.env["XML2PO"]:
- task = bld.new_task_gen(
- features="mallard",
+ task = bld(features="mallard",
variable_definitions="Makefile.am",
)
Oops, something went wrong.

0 comments on commit ef0d063

Please sign in to comment.