File: wscript_build

package info (click to toggle)
diodon 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,332 kB
  • ctags: 2,064
  • sloc: python: 17,705; makefile: 6
file content (51 lines) | stat: -rw-r--r-- 1,530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/env python
# encoding: utf-8

from waflib import Build, Utils
import os

# FIXME: there must be an easier way to install a directory recursively
# best option would be to add an install option to valadoc task itself
def signature_task(task):    
    bld = task.generator.bld 
    
    path = bld.path.find_or_declare('../_build_/doc/html')
    for x in path.ant_glob('**/*', remove=False): 
        x.sig = Utils.h_file(x.abspath())
    
doc = bld.new_task_gen (
    features = 'valadoc',
    output_dir = '../doc/html',
    package_name = bld.env['PACKAGE_NAME'],
    package_version = bld.env['VERSION'],
    packages = 'gtk+-3.0 gee-1.0 libxml-2.0 x11 gdk-x11-3.0 libpeas-gtk-1.0 libpeas-1.0 config xtst gdk-3.0',
    vapi_dirs = '../vapi',
    force = True)
    
path = bld.path.find_dir ('../libdiodon')
doc.files = path.ant_glob (incl='**/*.vala')

output_dir = bld.path.find_or_declare('../doc/html')
output_dir.mkdir()

# install all html files into the according directory
nodes = output_dir.ant_glob(incl='**/*')
for node in nodes:
    # difference between basedir and given dir
    relfile = node.path_from(output_dir)
    pos = relfile.rfind(os.sep)
    subpath = ''
    if pos > -1:
        subpath = relfile[:pos]
    # add difference of path to install dir
    install_dir = '${PREFIX}/share/doc/diodon-dev/html/' + subpath
    bld.install_files(install_dir, node)

bld.post_mode = Build.POST_LAZY
bld.add_group()

bld.new_task_gen(
  name = 'signature_task',
  always = True,
  rule = signature_task)