xmpedit

GTK+ editor for XMP metadata embedded in images
git clone https://code.djc.id.au/git/xmpedit/
commit 60db6bd204424a7473540b47aec6ae4a7092c10a
parent e2aec90e2a5ae73a54d731c1a8625c4162e2f843
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun,  8 Aug 2010 18:25:54 +1000

switched from waf to my own simple build script, since it was too hard to make waf do build variants for valac

--HG--
rename : wscript => build

Diffstat:
Abuild | 37+++++++++++++++++++++++++++++++++++++
Dsrc/wscript_build | 7-------
Dwaf | 0
Dwscript | 18------------------
4 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/build b/build
@@ -0,0 +1,37 @@
+#!/usr/bin/env python3
+
+"""
+My own homegrown build script.
+Because waf, SCons, autotools, and CMake all made me angry.
+"""
+
+import sys
+import os
+import subprocess
+
+def invoke(command):
+    print(' '.join(command))
+    subprocess.check_call(command)
+
+def files_under(path):
+    result = []
+    for dirpath, dirnames, filenames in os.walk(path):
+        result.extend(os.path.join(dirpath, filename) for filename in filenames)
+    return result
+
+def compile_vala(sources, target, pkgs=[], defs=[]):
+    invoke(['valac', '-g', '-d', 'target', '-o', target] +
+           ['--pkg=%s' % pkg for pkg in pkgs] +
+           ['--define=%s' % define for define in defs] +
+           sources)
+
+def main():
+    pkgs = ['gtk+-2.0', 'gee-1.0', 'gexiv2', 'libxml-2.0', 'libsoup-2.4']
+    main_sources = [f for f in files_under('src') if f.endswith('.vala')]
+    compile_vala(sources=main_sources, target='xmpedit', pkgs=pkgs)
+
+    compile_vala(sources=main_sources, target='xmpedit_test', pkgs=pkgs, defs=['TEST'])
+    invoke(['gtester', '--verbose', 'target/xmpedit_test'])
+
+if __name__ == '__main__':
+    main()
diff --git a/src/wscript_build b/src/wscript_build
@@ -1,7 +0,0 @@
-bld(
-    features        = ['c', 'cprogram'],
-    source          = bld.path.ant_glob('*.vala'),
-    target          = 'xmpedit',
-    packages        = ['gtk+-2.0', 'gexiv2', 'gee-1.0'],
-    uselib          = ['GTK+-2.0', 'GEXIV2', 'GEE-1.0']
-)
diff --git a/waf b/waf
Binary files differ.
diff --git a/wscript b/wscript
@@ -1,18 +0,0 @@
-APPNAME = 'xmpedit'
-VERSION = '0.1'
-top = '.'
-out = 'target'
-
-def options(opt):
-    opt.tool_options('compiler_cc')
-    opt.tool_options('vala')
-
-def configure(conf):
-    conf.check_tool('compiler_cc vala')
-    conf.check_cfg(package='gtk+-2.0', atleast_version='2.18.0', args='--cflags --libs', mandatory=True)
-    conf.check_cfg(package='gee-1.0', args='--cflags --libs', mandatory=True)
-    conf.check_cfg(package='gexiv2', args='--cflags --libs', mandatory=True)
-    conf.env.append_unique('VALAFLAGS', ['-g'])
-
-def build(bld):
-    bld.add_subdirs('src')